@inkeep/open-knowledge 0.4.0-beta.26 → 0.4.0-beta.28

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 (354) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +5 -0
  2. package/dist/alias-JE7RI5QX-BCGl9_yw.mjs +1 -0
  3. package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
  4. package/dist/awk2-POPGKRAI-CGGIG9fD.mjs +1 -0
  5. package/dist/{banner-DdbR6AZr.mjs → banner-8cQrR88n.mjs} +2 -2
  6. package/dist/base64-4YMZCVJ5-DQZX3-n8.mjs +1 -0
  7. package/dist/basename-AA2KJYZQ-BxQSdX4k.mjs +1 -0
  8. package/dist/bash-IJWYRKFO-BitzNsGT.mjs +1 -0
  9. package/dist/build-GAD37AZK.mjs +1 -0
  10. package/dist/build-fAc55Z_L.mjs +2 -0
  11. package/dist/cat-RDUMLXKC-DT-A9snL.mjs +1 -0
  12. package/dist/chmod-SYMGL4JA-DjEw7qQb.mjs +1 -0
  13. package/dist/{chokidar-CxU7f6JW.mjs → chokidar-DnkSPA-1.mjs} +1 -1
  14. package/dist/{chunk-24IMIIXA-B6yIPkk2.mjs → chunk-24IMIIXA-_PX4ITYZ.mjs} +2 -2
  15. package/dist/{chunk-3THT3N7L-DztAF386.mjs → chunk-3THT3N7L-DrzOuTpA.mjs} +1 -1
  16. package/dist/{chunk-3ZUFRYJ4-qsYuZX7b.mjs → chunk-3ZUFRYJ4-BUqSdAvt.mjs} +1 -1
  17. package/dist/{chunk-44UOCSGV-CaFxJDHm.mjs → chunk-44UOCSGV-BbZqjKvt.mjs} +1 -1
  18. package/dist/{chunk-4GTNDTRF-PuLVuVJW.mjs → chunk-4GTNDTRF-C7Bk89yc.mjs} +2 -2
  19. package/dist/{chunk-4HHKTUW3-CQ53AiA_.mjs → chunk-4HHKTUW3-DaxBqSRO.mjs} +1 -1
  20. package/dist/{chunk-4Q4SM6WR-BlQvqCag.mjs → chunk-4Q4SM6WR-CQ3yG3KJ.mjs} +2 -2
  21. package/dist/{chunk-55VFSPNA-DLwfww5b.mjs → chunk-55VFSPNA-o6aQtPTI.mjs} +2 -2
  22. package/dist/{chunk-5QMZ5MUS-CAp625aG.mjs → chunk-5QMZ5MUS-SLhNX8t9.mjs} +2 -2
  23. package/dist/{chunk-5QVNJEHU-dbrKfPGl.mjs → chunk-5QVNJEHU-Besgjasu.mjs} +2 -2
  24. package/dist/{chunk-5V6VZH6T-DMPvCPbn.mjs → chunk-5V6VZH6T-1WdUUj8r.mjs} +2 -2
  25. package/dist/{chunk-62RKD26F-B9la0pfD.mjs → chunk-62RKD26F-BbNaH0fp.mjs} +2 -2
  26. package/dist/{chunk-64BAICW3-D92CLSK-.mjs → chunk-64BAICW3-CQTRuYnm.mjs} +2 -2
  27. package/dist/{chunk-74CEPOFO-BcZUJMO1.mjs → chunk-74CEPOFO-CLQh_oXv.mjs} +1 -1
  28. package/dist/{chunk-7L36YK2X-D7Z_Qw_C.mjs → chunk-7L36YK2X-VJvKq7OX.mjs} +1 -1
  29. package/dist/{chunk-7TSDKFEO-DUQhJkDy.mjs → chunk-7TSDKFEO-D7K8a1nI.mjs} +1 -1
  30. package/dist/{chunk-A4HU7SVR-DKLaJeys.mjs → chunk-A4HU7SVR-SqitiwTc.mjs} +1 -1
  31. package/dist/{chunk-A4JSPFCI-CEm2r8SB.mjs → chunk-A4JSPFCI-BzZWBgeR.mjs} +2 -2
  32. package/dist/{chunk-A5O5YHGN-DvJz5Cpw.mjs → chunk-A5O5YHGN-DQP-O5US.mjs} +2 -2
  33. package/dist/{chunk-A65PWWJC-DV6RO_es.mjs → chunk-A65PWWJC-C9G7KuCV.mjs} +2 -2
  34. package/dist/{chunk-A7A2DBEE-dTNL-45u.mjs → chunk-A7A2DBEE-CWXz1JTo.mjs} +1 -1
  35. package/dist/{chunk-A7ICOL4V-BvXPAaHu.mjs → chunk-A7ICOL4V-k5RTBWOL.mjs} +2 -2
  36. package/dist/{chunk-ALLTKNUZ-Cu6JFoC4.mjs → chunk-ALLTKNUZ-SyOkRvXW.mjs} +2 -2
  37. package/dist/{chunk-APT7OOP2-DmUrFuRy.mjs → chunk-APT7OOP2-CriAmyUL.mjs} +2 -2
  38. package/dist/{chunk-BBXLRYSX-K758HlCs.mjs → chunk-BBXLRYSX-dCISWeRn.mjs} +2 -2
  39. package/dist/{chunk-BRGMQKJV-BXc-9Cgj.mjs → chunk-BRGMQKJV-Dnv0H02a.mjs} +3 -3
  40. package/dist/{chunk-CR5AFCPT-DxNsgM0M.mjs → chunk-CR5AFCPT-BS9vrR_k.mjs} +2 -2
  41. package/dist/{chunk-CWQS3NFK-Co4ALolT.mjs → chunk-CWQS3NFK-BQ5SUtd7.mjs} +1 -1
  42. package/dist/{chunk-D4J545R4-DkHLjHX6.mjs → chunk-D4J545R4-T2J_By_d.mjs} +2 -2
  43. package/dist/{chunk-D6CWQ5DW-7lvT8dGP.mjs → chunk-D6CWQ5DW-0uvJGnRG.mjs} +2 -2
  44. package/dist/{chunk-D7MEQ3VN-D8jJZr4A.mjs → chunk-D7MEQ3VN-CSN8BGNX.mjs} +2 -2
  45. package/dist/{chunk-DCAAORBQ-C3s1D8OY.mjs → chunk-DCAAORBQ-BgX2K5fq.mjs} +2 -2
  46. package/dist/{chunk-DXB73IDG-DIKSLkPq.mjs → chunk-DXB73IDG-DfmyzFzL.mjs} +1 -1
  47. package/dist/{chunk-EEXR5ZDP-CETL3_Uw.mjs → chunk-EEXR5ZDP-DUXT2_T-.mjs} +1 -1
  48. package/dist/{chunk-EIZGF4BS-DOoQW9jQ.mjs → chunk-EIZGF4BS-BMblx_pb.mjs} +2 -2
  49. package/dist/{chunk-F23WWYKW-BK2tpXPf.mjs → chunk-F23WWYKW-B0xoXfw7.mjs} +2 -2
  50. package/dist/{chunk-F55TLFGB-Vy5RU2P3.mjs → chunk-F55TLFGB-CekdCv-K.mjs} +2 -2
  51. package/dist/{chunk-FEIOJCZD-C25Und0M.mjs → chunk-FEIOJCZD-Vm1q1kLH.mjs} +2 -2
  52. package/dist/{chunk-GCTKCWKD-Di-RB9Qt.mjs → chunk-GCTKCWKD-ByezaQ15.mjs} +1 -1
  53. package/dist/{chunk-GFQRA5P5-DnjwTqP3.mjs → chunk-GFQRA5P5-CkMj9l7f.mjs} +1 -1
  54. package/dist/{chunk-GOV5EKKI-CKV9jOGv.mjs → chunk-GOV5EKKI-B4qGAgcI.mjs} +2 -2
  55. package/dist/{chunk-GXVXFKBA-CUKDClxt.mjs → chunk-GXVXFKBA-CQs4HBko.mjs} +2 -2
  56. package/dist/{chunk-HDQ56CKY-MTQ75a8z.mjs → chunk-HDQ56CKY-DnAJDKCm.mjs} +2 -2
  57. package/dist/{chunk-HJQJAYMS-D-8Vc6Zb.mjs → chunk-HJQJAYMS-lEGf1x1q.mjs} +1 -1
  58. package/dist/{chunk-HJWBQKYG-XrOcsn2f.mjs → chunk-HJWBQKYG-lmVh-ZXn.mjs} +2 -2
  59. package/dist/{chunk-HWBSOZZR-BZF8XsyZ.mjs → chunk-HWBSOZZR-CdcHflPt.mjs} +2 -2
  60. package/dist/{chunk-HWKDQ44K-wgmyck2O.mjs → chunk-HWKDQ44K-cV6V5ZgY.mjs} +2 -2
  61. package/dist/{chunk-I57KEIP3-DipCOPKf.mjs → chunk-I57KEIP3-Cr5Okw7t.mjs} +2 -2
  62. package/dist/{chunk-IPJHKYVM-C3IodQq7.mjs → chunk-IPJHKYVM-orb6vjJ1.mjs} +1 -1
  63. package/dist/{chunk-J642UCRS-YiNealfn.mjs → chunk-J642UCRS-DfKEFKiV.mjs} +2 -2
  64. package/dist/{chunk-JVPRLUMK-VMFWXimu.mjs → chunk-JVPRLUMK-Bf9V_Gv7.mjs} +2 -2
  65. package/dist/{chunk-KMEYNNUA-pRogdye4.mjs → chunk-KMEYNNUA-Caoc9sHa.mjs} +2 -2
  66. package/dist/{chunk-LL3S3NLB-ByBS5IDP.mjs → chunk-LL3S3NLB-GadY6GUd.mjs} +2 -2
  67. package/dist/{chunk-LPQPILI2-FRQB9gt5.mjs → chunk-LPQPILI2-DDrAB1na.mjs} +2 -2
  68. package/dist/{chunk-LTZRCH7N-46S7WKw8.mjs → chunk-LTZRCH7N-DsWqztAp.mjs} +2 -2
  69. package/dist/{chunk-LWEGUNWT-DdGmM3wr.mjs → chunk-LWEGUNWT-DQ_TsrhS.mjs} +2 -2
  70. package/dist/{chunk-MDDMCKUK-CuRdI1Uv.mjs → chunk-MDDMCKUK-Cnfznbkf.mjs} +2 -2
  71. package/dist/{chunk-MDLLFABN-Wd1iVjXi.mjs → chunk-MDLLFABN-C_2lIHFT.mjs} +2 -2
  72. package/dist/{chunk-MHTUABJP-BWrqic3t.mjs → chunk-MHTUABJP-7AQ2Pv6q.mjs} +1 -1
  73. package/dist/{chunk-MIZPJHVH-DWdPvcYR.mjs → chunk-MIZPJHVH-BB7Is338.mjs} +2 -2
  74. package/dist/{chunk-MLXIYONF-CiCzoeGt.mjs → chunk-MLXIYONF-BI0CC1Dm.mjs} +2 -2
  75. package/dist/{chunk-MYE6AGBJ-DJo74dVC.mjs → chunk-MYE6AGBJ-DWNp4Fd-.mjs} +2 -2
  76. package/dist/{chunk-NAERJDUW-CIHrNgJB.mjs → chunk-NAERJDUW-D3VeMMYB.mjs} +2 -2
  77. package/dist/{chunk-NCNPKYJZ-BVljycUZ.mjs → chunk-NCNPKYJZ-BBZ5fJNa.mjs} +2 -2
  78. package/dist/{chunk-NUYSJFDK-BTseBdxv.mjs → chunk-NUYSJFDK-5tRwRhY2.mjs} +2 -2
  79. package/dist/{chunk-NYQYO467-BgXuDHUQ.mjs → chunk-NYQYO467-Blr3IMkQ.mjs} +2 -2
  80. package/dist/{chunk-OARHFVLG-Cr0x3Si_.mjs → chunk-OARHFVLG-Irp_vfLa.mjs} +2 -2
  81. package/dist/{chunk-OCLXQMOG-BW6rwyzS.mjs → chunk-OCLXQMOG-DKBkjIbk.mjs} +2 -2
  82. package/dist/{chunk-OCS6LSEM-D7VAOziZ.mjs → chunk-OCS6LSEM-C2EAQI0w.mjs} +2 -2
  83. package/dist/{chunk-OJDRYQWQ-ikvLWpfV.mjs → chunk-OJDRYQWQ-D4lSWh0K.mjs} +1 -1
  84. package/dist/{chunk-OL3S66CO-CQnF8cPH.mjs → chunk-OL3S66CO-BSC-nhbc.mjs} +2 -2
  85. package/dist/{chunk-PBXLG62G-CgbPJTiw.mjs → chunk-PBXLG62G-9wkRpzkO.mjs} +2 -2
  86. package/dist/{chunk-PP6PSHAB-CO4MYU__.mjs → chunk-PP6PSHAB-BkN6oaqq.mjs} +1 -1
  87. package/dist/{chunk-PYSFUGCK-DsRn64Ef.mjs → chunk-PYSFUGCK-C-zBGrN0.mjs} +2 -2
  88. package/dist/{chunk-QCDB2VPH-BUMOhlW7.mjs → chunk-QCDB2VPH-BUg_3i-W.mjs} +2 -2
  89. package/dist/{chunk-QJ7O6ZN3-F0_rcDPM.mjs → chunk-QJ7O6ZN3-h8P6Rj5g.mjs} +2 -2
  90. package/dist/{chunk-R6QSAL5T-CeW6f7-x.mjs → chunk-R6QSAL5T-CBXSpChE.mjs} +1 -1
  91. package/dist/{chunk-R6VWJ2ZL-FwG_Za20.mjs → chunk-R6VWJ2ZL-DSqbA7Rj.mjs} +1 -1
  92. package/dist/{chunk-RPNGRAAP-BmkapBPD.mjs → chunk-RPNGRAAP-BVzuWIcl.mjs} +2 -2
  93. package/dist/{chunk-SDNKECQQ-DkebEzkd.mjs → chunk-SDNKECQQ-CQaGD8tt.mjs} +2 -2
  94. package/dist/{chunk-SYMJJMQ4-DOZMaECk.mjs → chunk-SYMJJMQ4-C3GxJv_z.mjs} +2 -2
  95. package/dist/{chunk-T56QNPHK-DPXaSSfC.mjs → chunk-T56QNPHK-DLf9xkTG.mjs} +2 -2
  96. package/dist/{chunk-TLSUDHID-BovZg0r1.mjs → chunk-TLSUDHID-BHtR3boD.mjs} +2 -2
  97. package/dist/{chunk-TOMNU26N-AAglMy4J.mjs → chunk-TOMNU26N-DerX6zSM.mjs} +2 -2
  98. package/dist/{chunk-TXBZCHCQ-WeVWfqYv.mjs → chunk-TXBZCHCQ-CAbfX7on.mjs} +2 -2
  99. package/dist/{chunk-UNYNJIFU-CqGlXAg7.mjs → chunk-UNYNJIFU-Bd2svF5l.mjs} +3 -3
  100. package/dist/{chunk-V7TAPXDL-DQgGPvBY.mjs → chunk-V7TAPXDL-BUbPC-Wn.mjs} +2 -2
  101. package/dist/{chunk-VJFXDYWH-DIo0Ia0_.mjs → chunk-VJFXDYWH-B5EkAwKK.mjs} +2 -2
  102. package/dist/{chunk-VLGZJRPG-DymOu90-.mjs → chunk-VLGZJRPG-C9UlHcZa.mjs} +2 -2
  103. package/dist/{chunk-VOBGTVA6-Bfa1NTzt.mjs → chunk-VOBGTVA6-BbJdoZlr.mjs} +2 -2
  104. package/dist/{chunk-VYOJP4TV-PBsHe2md.mjs → chunk-VYOJP4TV-B4Ua-c0F.mjs} +2 -2
  105. package/dist/{chunk-WKFATFPP-KO2zkfs2.mjs → chunk-WKFATFPP-DWw-N9hi.mjs} +2 -2
  106. package/dist/{chunk-X2AJGDEF-D5w6wtaX.mjs → chunk-X2AJGDEF-BosVr67X.mjs} +1 -1
  107. package/dist/{chunk-XHM67O4N-akBjDPaR.mjs → chunk-XHM67O4N-Cd7Fiqsb.mjs} +1 -1
  108. package/dist/{chunk-XKQRETAK-RHzVmuiF.mjs → chunk-XKQRETAK-ud_FNcYV.mjs} +2 -2
  109. package/dist/{chunk-XORM457F-wr_DBBnV.mjs → chunk-XORM457F-B_0Xbzib.mjs} +2 -2
  110. package/dist/{chunk-XVDPCNWR-DxaG1FfA.mjs → chunk-XVDPCNWR-DNk_0jVb.mjs} +2 -2
  111. package/dist/{chunk-YCFVLTST-Dzwevuc3.mjs → chunk-YCFVLTST-0XsXjpJU.mjs} +2 -2
  112. package/dist/{chunk-YFG2CMIF-BoZQym0L.mjs → chunk-YFG2CMIF-BwW9XX2A.mjs} +2 -2
  113. package/dist/{chunk-YNYSPYQ5-DesxOVHh.mjs → chunk-YNYSPYQ5-Dq-BWW-f.mjs} +1 -1
  114. package/dist/{chunk-YS3AZT3J-CBc9LHIy.mjs → chunk-YS3AZT3J-CLwj1P0Z.mjs} +2 -2
  115. package/dist/{chunk-YTNYSM6T-WMIf3AF8.mjs → chunk-YTNYSM6T-TIb8x1lA.mjs} +2 -2
  116. package/dist/{chunk-Z6LRHWXI-DGTVoTuf.mjs → chunk-Z6LRHWXI-VE8VWpH9.mjs} +2 -2
  117. package/dist/{chunk-Z7JVV2SM-Cb4YKOCM.mjs → chunk-Z7JVV2SM-BAsPuUWb.mjs} +2 -2
  118. package/dist/clear-5CZ5X4YR-ph4db-bT.mjs +1 -0
  119. package/dist/cli.mjs +42 -39
  120. package/dist/colors-BCE2jNgl.mjs +1 -0
  121. package/dist/{colors-BNufdynn.mjs → colors-BtKMHmBX.mjs} +1 -1
  122. package/dist/column-WLPMMSTS-BCX6Q17n.mjs +1 -0
  123. package/dist/comm-5SLSESQG-C7AhH0K0.mjs +1 -0
  124. package/dist/constants-Bu2AuX7n.mjs +2 -0
  125. package/dist/cp-XOYR4ABJ-CQdiaiBl.mjs +1 -0
  126. package/dist/{curl-47BFPSFW-C2kRcGkX.mjs → curl-47BFPSFW-BzVtpc-O.mjs} +2 -2
  127. package/dist/cut-OPC3VAGB-oTKBumd9.mjs +1 -0
  128. package/dist/date-DD7FVA2V-BrmKZaC_.mjs +1 -0
  129. package/dist/diff-HJF2MPDN-BNIGqrz6.mjs +1 -0
  130. package/dist/dirname-LEMTZZFS-BwH_Sy4c.mjs +1 -0
  131. package/dist/{dist-DoBoUPet.mjs → dist-BY6hbGlq.mjs} +27 -27
  132. package/dist/dist-DKX8LweU.mjs +1 -0
  133. package/dist/{dist-C4qQGc8i.mjs → dist-DNYO-J2I.mjs} +804 -58
  134. package/dist/du-WO2ENHXQ-CaFJHtt9.mjs +1 -0
  135. package/dist/echo-O45JWWI2-BVUJjhWK.mjs +1 -0
  136. package/dist/env-5EPCWSXR-DH5CCl6V.mjs +1 -0
  137. package/dist/{execAsync-CulVJBMN.mjs → execAsync-Bpfn4nfY.mjs} +1 -1
  138. package/dist/{execAsync-CzW9fUYQ.mjs → execAsync-D93HRpVy.mjs} +1 -1
  139. package/dist/{execAsync-DuQoqWaW.mjs → execAsync-DMx5TUjh.mjs} +1 -1
  140. package/dist/expand-DTNXU4LQ-eK5V8PVi.mjs +1 -0
  141. package/dist/expansion-ENLSRCXJ-DJReNXZq.mjs +1 -0
  142. package/dist/expr-5T3UU5KE-DTdq14FE.mjs +1 -0
  143. package/dist/file-ZIGAJ4YS-WHJtEeVR.mjs +1 -0
  144. package/dist/find-TPUOAIUQ-Dk362bwv.mjs +1 -0
  145. package/dist/flag-coverage-QT4N2Z44-C5s46vwi.mjs +2 -0
  146. package/dist/fold-LDSORVYE-CkRa6rpW.mjs +1 -0
  147. package/dist/{getMachineId-bsd-DAmB-Ym0.mjs → getMachineId-bsd-B3nMvpKd.mjs} +2 -2
  148. package/dist/{getMachineId-bsd-FYDP9w5Q.mjs → getMachineId-bsd-CbGsKq4x.mjs} +2 -2
  149. package/dist/{getMachineId-bsd-mPrX3ckm.mjs → getMachineId-bsd-Cbosky3N.mjs} +2 -2
  150. package/dist/{getMachineId-darwin-B0Qw-MTj.mjs → getMachineId-darwin-BNex6tJ8.mjs} +2 -2
  151. package/dist/{getMachineId-darwin-C79HtyON.mjs → getMachineId-darwin-BnJVzhVS.mjs} +2 -2
  152. package/dist/{getMachineId-darwin-Co8Jnu5v.mjs → getMachineId-darwin-UUooObuL.mjs} +2 -2
  153. package/dist/{getMachineId-linux-BizmCjYq.mjs → getMachineId-linux-BCV7VFT0.mjs} +1 -1
  154. package/dist/{getMachineId-linux-BvLCCmKQ.mjs → getMachineId-linux-Bo4OhbSY.mjs} +1 -1
  155. package/dist/{getMachineId-linux-BBORs2cS.mjs → getMachineId-linux-D4ybKI-D.mjs} +1 -1
  156. package/dist/{getMachineId-unsupported-CbR45h2D.mjs → getMachineId-unsupported-4i2apDO3.mjs} +1 -1
  157. package/dist/{getMachineId-unsupported-DbGFOAw1.mjs → getMachineId-unsupported-DKWpTC9E.mjs} +1 -1
  158. package/dist/{getMachineId-unsupported-Bgp-Es9j.mjs → getMachineId-unsupported-DYYMUAWj.mjs} +1 -1
  159. package/dist/{getMachineId-win-Cy0XHq4X.mjs → getMachineId-win-CHxnm_JZ.mjs} +2 -2
  160. package/dist/{getMachineId-win-D5gDnBHa.mjs → getMachineId-win-E9RqBHbs.mjs} +2 -2
  161. package/dist/{getMachineId-win-CT_Y5i_4.mjs → getMachineId-win-W9lSyLKl.mjs} +2 -2
  162. package/dist/grep-3AIAIJVR-9FFpNxXg.mjs +1 -0
  163. package/dist/gzip-AQXSGOVS-B69jDA3r.mjs +1 -0
  164. package/dist/head-HT2B6D2J-LVz3MZgn.mjs +1 -0
  165. package/dist/help-VVWX7SA5-NiesqNE9.mjs +1 -0
  166. package/dist/history-J4QRNGRO-CJ6sdqLF.mjs +1 -0
  167. package/dist/hostname-BK6HG2DE-BTiQGLXj.mjs +1 -0
  168. package/dist/html-to-markdown-TFCECAGV-gA9lIhli.mjs +1 -0
  169. package/dist/index.mjs +1 -1
  170. package/dist/init-B_if5W2b.mjs +1 -0
  171. package/dist/{init-Djz7BdtL.mjs → init-BwWCoJSS.mjs} +5 -5
  172. package/dist/{is-object-DF0ZeuvD.mjs → is-object-C-4FJ0rP.mjs} +1 -1
  173. package/dist/join-GG2LDHE5-DP2t9Lzd.mjs +1 -0
  174. package/dist/jq-ODXZBPLY-DIh5TTSi.mjs +1 -0
  175. package/dist/{js-exec-M6UR76J5-IyD-lpzv.mjs → js-exec-M6UR76J5-2jDKLOtz.mjs} +2 -2
  176. package/dist/{lib-BOCdCkg7.mjs → lib-CxZz7HCo.mjs} +1 -1
  177. package/dist/ln-4TRFBYAT-CcfWdebC.mjs +1 -0
  178. package/dist/loader-CPJaigBl.mjs +1 -0
  179. package/dist/{loader-B64r69-j.mjs → loader-Cn4VI5Ww.mjs} +3 -3
  180. package/dist/ls-KSXFZCWH-Ck3u5K5M.mjs +1 -0
  181. package/dist/{lzma-vr8hBkhz.mjs → lzma-noRZ7I73.mjs} +1 -1
  182. package/dist/md5sum-INMIK4DX-B5BLDgGd.mjs +1 -0
  183. package/dist/mkdir-TDEMSB6C-BHFCS7vA.mjs +1 -0
  184. package/dist/mv-Z6MORUFL-CmLWSH1J.mjs +1 -0
  185. package/dist/nl-U5YJDM32-Cn7q_PFe.mjs +1 -0
  186. package/dist/od-VJEF2UR5-BMxC8c-2.mjs +1 -0
  187. package/dist/paste-7N6AFSDS-C9XyEur2.mjs +1 -0
  188. package/dist/{preview-nt7uUE2i.mjs → preview-CZm95O96.mjs} +2 -2
  189. package/dist/preview-kZnH17T7.mjs +1 -0
  190. package/dist/printf-CX64KX2P-Hzp-xme8.mjs +1 -0
  191. package/dist/public/assets/ActivityModeContent-Dlois8m1.js +2 -0
  192. package/dist/public/assets/{ConsentDialogBody-Ch5CwNgh.js → ConsentDialogBody-DmS5j5pu.js} +1 -1
  193. package/dist/public/assets/DocumentContext-B0jD_DRX.js +37 -0
  194. package/dist/public/assets/{GraphPanel-B42N4CIV.js → GraphPanel-BWlIJ3tc.js} +2 -2
  195. package/dist/public/assets/{SettingsDialog-D53RhrjD.js → SettingsDialog-Jq0VRnPP.js} +2 -2
  196. package/dist/public/assets/SourceEditor-BGZmwp3D.js +2 -0
  197. package/dist/public/assets/{config-validation-events-Bosr96x4.js → config-validation-events-Czaccnqg.js} +3 -3
  198. package/dist/public/assets/{dist-WhY-UbDY.js → dist-BYGzJeLM.js} +1 -1
  199. package/dist/public/assets/dist-BrsSsfiw.js +1 -0
  200. package/dist/public/assets/dist-CXGJFbY5.js +9 -0
  201. package/dist/public/assets/dist-Cq1LYbUj.js +1 -0
  202. package/dist/public/assets/{dist-BNZ2DXnR.js → dist-CyaBbyDQ.js} +1 -1
  203. package/dist/public/assets/dist-DsbVHLNy.js +1 -0
  204. package/dist/public/assets/{dist-B-xmnigy.js → dist-Du-s1q8P.js} +1 -1
  205. package/dist/public/assets/{doc-hash-Bg2WkAY_.js → doc-hash-CBF-HGTP.js} +82 -82
  206. package/dist/public/assets/index-MJh5lI2Y.js +1853 -0
  207. package/dist/public/assets/index-gFJyDijz.css +1 -0
  208. package/dist/public/assets/stex-CzCFWeB9.js +1 -0
  209. package/dist/public/assets/{target-navigation-intent-zW_9xoDt.js → target-navigation-intent-CFNdedu6.js} +1 -1
  210. package/dist/public/assets/{toggle-group-BMp2XgSC.js → toggle-group-DC1U2RZo.js} +1 -1
  211. package/dist/public/assets/{tooltip-CYfWgpPY.js → tooltip-BsZgyNLI.js} +1 -1
  212. package/dist/public/assets/typing-burst-detector-CvoRQQEa.js +2 -0
  213. package/dist/public/index.html +16 -13
  214. package/dist/pwd-D4OZ7N27-CxX1ETVW.mjs +1 -0
  215. package/dist/{python3-AUFTPCU6-BaJugIdp.mjs → python3-AUFTPCU6-C74hXpFG.mjs} +2 -2
  216. package/dist/readlink-MI4GCHJF-DeD4E7nz.mjs +1 -0
  217. package/dist/rev-XOSYPP45-BnymxcnA.mjs +1 -0
  218. package/dist/rg-FOQSCCX3-BiJSKli9.mjs +1 -0
  219. package/dist/rm-RTZG23RL-Djvo3nEY.mjs +1 -0
  220. package/dist/rmdir-XTQXT7RK-OI_3n90A.mjs +1 -0
  221. package/dist/sed-VFTTATXJ-Tyu5G4I6.mjs +1 -0
  222. package/dist/seq-RN5ZUASB-CG-hfPIu.mjs +1 -0
  223. package/dist/sha1sum-VJPNLNU6-CEXqRxvP.mjs +1 -0
  224. package/dist/sha256sum-PI32XWXY-Bxzw_ykX.mjs +1 -0
  225. package/dist/sleep-VZFPZFWA-WRTGZhTn.mjs +1 -0
  226. package/dist/sort-DCNRDA7U-CuSJrCSQ.mjs +1 -0
  227. package/dist/split-SITCSYCZ-DqKN3r-A.mjs +1 -0
  228. package/dist/sqlite3-56UMWEY3-C6G8A9IC.mjs +1 -0
  229. package/dist/{src-DVGh66ju.mjs → src-8by0oqe_.mjs} +2 -2
  230. package/dist/{start-D6Gr8R62.mjs → start-DKyS2HfM.mjs} +2 -2
  231. package/dist/start-zlX6WMZP.mjs +1 -0
  232. package/dist/stat-BT5A227F-D3-4IZjb.mjs +1 -0
  233. package/dist/strings-7PLOGTPD-DoJhZcXP.mjs +1 -0
  234. package/dist/tac-SJGXQ4T2-CGNEtOiG.mjs +1 -0
  235. package/dist/tail-S5ULNTJU-17nfIM0G.mjs +1 -0
  236. package/dist/tar-ANUBEFJY-C-eZUMPO.mjs +1 -0
  237. package/dist/tee-O7VXZDCO-D4C0E2s8.mjs +1 -0
  238. package/dist/time-DEUO3QV2-Wc9ZVUVu.mjs +1 -0
  239. package/dist/timeout-VRKMCG72-2MptSPRD.mjs +1 -0
  240. package/dist/touch-DX2IJOQ4-DOTz2-NU.mjs +1 -0
  241. package/dist/tr-2HXZRDSW-5aOBfN_I.mjs +1 -0
  242. package/dist/tree-LYXBS7DC-BVyeg_3R.mjs +1 -0
  243. package/dist/true-WHJNXCHG-QiTH9f1Z.mjs +1 -0
  244. package/dist/unexpand-RGTMIGZM-m3YwxdOg.mjs +1 -0
  245. package/dist/uniq-SUNANL47-CuhWyTTO.mjs +1 -0
  246. package/dist/wc-TQB3VNOX-CaEqXvYd.mjs +1 -0
  247. package/dist/which-XZHEH76L-DA_Bm_KM.mjs +1 -0
  248. package/dist/whoami-DGKU3D2X-Bdt58SNY.mjs +1 -0
  249. package/dist/xan-BXDXYEIB-CWBZ1rgf.mjs +1 -0
  250. package/dist/xan-view-ECQUO7AJ-eo_owVyX.mjs +1 -0
  251. package/dist/xargs-I6EZUCYF-VBH5v0oN.mjs +1 -0
  252. package/dist/yq-MJMAR36V-eZBfA9vJ.mjs +1 -0
  253. package/package.json +1 -1
  254. package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +0 -1
  255. package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +0 -1
  256. package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +0 -1
  257. package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +0 -1
  258. package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +0 -1
  259. package/dist/build-B6buVrsB.mjs +0 -2
  260. package/dist/cat-RDUMLXKC-CeNrSElK.mjs +0 -1
  261. package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +0 -1
  262. package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +0 -1
  263. package/dist/colors-T3xmlXQT.mjs +0 -1
  264. package/dist/column-WLPMMSTS-6o4DDsDk.mjs +0 -1
  265. package/dist/comm-5SLSESQG-C2GatHU6.mjs +0 -1
  266. package/dist/constants-CSmwRAFo.mjs +0 -2
  267. package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +0 -1
  268. package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +0 -1
  269. package/dist/date-DD7FVA2V-Dubgjr6a.mjs +0 -1
  270. package/dist/diff-HJF2MPDN-DjGBLQph.mjs +0 -1
  271. package/dist/dirname-LEMTZZFS-B477CImE.mjs +0 -1
  272. package/dist/dist-BaIGvDgD.mjs +0 -1
  273. package/dist/du-WO2ENHXQ-C4c5wweW.mjs +0 -1
  274. package/dist/echo-O45JWWI2-TudodhHR.mjs +0 -1
  275. package/dist/env-5EPCWSXR-CTcNEMpy.mjs +0 -1
  276. package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +0 -1
  277. package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +0 -1
  278. package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +0 -1
  279. package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +0 -1
  280. package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +0 -1
  281. package/dist/flag-coverage-QT4N2Z44--nNG-HLV.mjs +0 -2
  282. package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +0 -1
  283. package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +0 -1
  284. package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +0 -1
  285. package/dist/head-HT2B6D2J-BR4RHRTk.mjs +0 -1
  286. package/dist/help-VVWX7SA5-M6C6klSC.mjs +0 -1
  287. package/dist/history-J4QRNGRO-C1r7-kvT.mjs +0 -1
  288. package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +0 -1
  289. package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +0 -1
  290. package/dist/init-Cys0YykC.mjs +0 -1
  291. package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +0 -1
  292. package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +0 -1
  293. package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +0 -1
  294. package/dist/loader-DfRJHcOw.mjs +0 -1
  295. package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +0 -1
  296. package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +0 -1
  297. package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +0 -1
  298. package/dist/mrmime-C2W7cgq2.mjs +0 -2
  299. package/dist/mv-Z6MORUFL-CN471qcL.mjs +0 -1
  300. package/dist/nl-U5YJDM32-CFzXKze3.mjs +0 -1
  301. package/dist/od-VJEF2UR5-C2R4Accu.mjs +0 -1
  302. package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +0 -1
  303. package/dist/preview-Chj-AjEC.mjs +0 -1
  304. package/dist/printf-CX64KX2P-Ce--gWAq.mjs +0 -1
  305. package/dist/public/assets/ActivityModeContent-EGGl80pX.js +0 -2
  306. package/dist/public/assets/DocumentContext-Bic6EUm_.js +0 -37
  307. package/dist/public/assets/OutlinePanel-CJ2DJN7r.js +0 -2
  308. package/dist/public/assets/SourceEditor-CMwexck1.js +0 -2
  309. package/dist/public/assets/dist-BNOfnTlI.js +0 -9
  310. package/dist/public/assets/dist-Nw1RXfXU.js +0 -1
  311. package/dist/public/assets/dist-W2rlYChw.js +0 -1
  312. package/dist/public/assets/dist-Z6vgTDkw.js +0 -1
  313. package/dist/public/assets/index-10HZouza.js +0 -1853
  314. package/dist/public/assets/index-EvzmrHLW.css +0 -1
  315. package/dist/public/assets/stex-CJTvJH5f.js +0 -1
  316. package/dist/pwd-D4OZ7N27-C18XewhV.mjs +0 -1
  317. package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +0 -1
  318. package/dist/rev-XOSYPP45-2mnFFZWW.mjs +0 -1
  319. package/dist/rg-FOQSCCX3-BJahNfSe.mjs +0 -1
  320. package/dist/rm-RTZG23RL-D9-0WGRY.mjs +0 -1
  321. package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +0 -1
  322. package/dist/sed-VFTTATXJ-mYhAmixc.mjs +0 -1
  323. package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +0 -1
  324. package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +0 -1
  325. package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +0 -1
  326. package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +0 -1
  327. package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +0 -1
  328. package/dist/split-SITCSYCZ-b9hfEJw7.mjs +0 -1
  329. package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +0 -1
  330. package/dist/start-CjvYIfQD.mjs +0 -1
  331. package/dist/stat-BT5A227F-Dzp4sgau.mjs +0 -1
  332. package/dist/strings-7PLOGTPD-DT41jX9d.mjs +0 -1
  333. package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +0 -1
  334. package/dist/tail-S5ULNTJU-0-sYrYik.mjs +0 -1
  335. package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +0 -1
  336. package/dist/tee-O7VXZDCO-CwnGG0go.mjs +0 -1
  337. package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +0 -1
  338. package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +0 -1
  339. package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +0 -1
  340. package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +0 -1
  341. package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +0 -1
  342. package/dist/true-WHJNXCHG-DxCMVdqj.mjs +0 -1
  343. package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +0 -1
  344. package/dist/uniq-SUNANL47-Ceg51JdA.mjs +0 -1
  345. package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +0 -1
  346. package/dist/which-XZHEH76L-DH_U2-Cj.mjs +0 -1
  347. package/dist/whoami-DGKU3D2X-BholYNPM.mjs +0 -1
  348. package/dist/xan-BXDXYEIB-b1eAtgch.mjs +0 -1
  349. package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +0 -1
  350. package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +0 -1
  351. package/dist/yq-MJMAR36V-1r29nH4p.mjs +0 -1
  352. /package/dist/public/assets/{go-e6pdpn6U.js → go-wMvjCq97.js} +0 -0
  353. /package/dist/public/assets/{shell-BkCD5kyH.js → shell-DdhS5_h8.js} +0 -0
  354. /package/dist/public/assets/{textarea-57j4gLcZ.js → textarea-CaFqgjns.js} +0 -0
@@ -1,37 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CWYso-V4.js","./preload-helper-2ej06EnG.js","./chunk-U2HBQHQK-DenE4TdD.js","./src-DOAilbaA.js","./chunk-CFjPhJqf.js","./src-L3wpjxBL.js","./chunk-5PVQY5BW-BpceE2BZ.js","./dist-Bog19bCH.js","./chunk-ICPOFSXX-BC5Xd13f.js","./_baseFor-CVV1DSgL.js","./isObjectLike-DFnkciUU.js","./isEmpty-gGVpRSDa.js","./chunk-336JU56O-CtkQ28bg.js","./chunk-5FUZZQ4R-DF0EG1O8.js","./chunk-X2U36JSP-DSyuGkzP.js","./chunk-ZZ45TVLE-DHB0SHUz.js","./rough.esm-DDK-gphn.js","./chunk-ENJZ2VHE-CY9yto8o.js","./line-C59Ezo8Z.js","./path-C-grg3CZ.js","./array-COEOjKUv.js","./chunk-BSJP7CBP-BrRqu__W.js","./chunk-426QAEUC-jRhC4EYv.js","./chunk-XPW4576I-CLO5Bb_q.js","./pdf-CtJiipL_.js","./dist-W2rlYChw.js","./dist-B-xmnigy.js","./w3c-keyname-B5t0fahT.js","./dist-WhY-UbDY.js","./dist-Z6vgTDkw.js","./dist-BNOfnTlI.js","./dist-Nw1RXfXU.js","./dist-BNZ2DXnR.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{$n as o,$t as s,A as c,An as l,At as u,Bn as d,Bt as f,C as p,Cn as m,Cr as h,Dn as g,Dr as _,Dt as v,En as y,Er as b,Et as x,F as S,Fn as C,Fr as w,Ft as T,Gn as E,H as D,Ht as O,I as k,In as A,Ir as j,It as M,J as N,Jn as P,K as F,L as I,Lt as L,Mr as R,Mt as z,N as B,Nn as V,Nr as H,O as U,On as ee,Or as te,Ot as ne,P as re,Pr as ie,Pt as ae,Qt as oe,Rr as se,Rt as ce,S as le,Sn as ue,Sr as de,T as fe,Tn as pe,Tr as me,Tt as he,Un as ge,Wn as _e,X as ve,Y as ye,Z as be,Zt as xe,_n as Se,_r as Ce,_t as we,a as Te,an as Ee,ar as De,b as Oe,br as ke,bt as Ae,c as je,cr as Me,d as Ne,dn as Pe,dr as Fe,dt as Ie,en as Le,er as Re,f as ze,fr as Be,gt as Ve,h as He,hn as Ue,hr as We,i as Ge,ir as Ke,it as qe,jt as Je,k as Ye,l as Xe,ln as Ze,lr as Qe,lt as $e,m as et,mr as tt,mt as nt,n as rt,nr as it,nt as at,on as ot,pn as st,pr as ct,q as lt,qn as ut,r as dt,rr as ft,s as pt,sn as mt,tr as ht,u as gt,un as _t,ut as vt,vn as yt,vr as bt,vt as xt,w as St,wn as Ct,wr as wt,wt as Tt,x as Et,xr as Dt,xt as Ot,yn as kt,yr as At,z as jt,zn as Mt,zt as Nt}from"./doc-hash-Bg2WkAY_.js";import{C as W,S as Pt,_ as Ft,a as It,c as Lt,d as Rt,f as zt,h as Bt,l as Vt,m as Ht,o as Ut,r as Wt,s as Gt,t as Kt,u as qt,v as Jt,w as Yt,x as Xt}from"./button-C1nwPVFQ.js";import{n as Zt,t as Qt}from"./dist-Bej94Urx.js";import{a as $t,c as en,d as tn,i as nn,l as rn,m as an,n as on,o as sn,p as cn,r as ln,s as un,u as dn}from"./dist-OTL8-1C2.js";import{n as fn,t as pn}from"./propagation-api-3kmMXRwS.js";import{t as mn}from"./dist-Cg-Qaqw_.js";import{t as hn}from"./input-BOmkuBId.js";import{B as gn,Bt as _n,D as vn,Et as yn,G as bn,H as xn,I as Sn,K as Cn,L as G,M as wn,N as Tn,Nt as En,P as Dn,Pt as On,Tt as kn,U as An,V as jn,W as Mn,Y as Nn,Z as Pn,_ as Fn,a as In,b as Ln,f as Rn,h as zn,i as Bn,j as Vn,jt as Hn,k as Un,kt as Wn,l as Gn,lt as Kn,o as qn,p as Jn,q as Yn,r as Xn,s as Zn,t as Qn,u as $n,w as er,wt as tr,y as nr,z as rr}from"./dist-B-xmnigy.js";import{a as ir,c as ar,s as or,t as sr}from"./dist-Nw1RXfXU.js";import{i as cr,n as lr,r as ur,t as dr}from"./dist-WhY-UbDY.js";var K=i();(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var fr=W(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),pr=W(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),mr=W(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),hr=W(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),gr=W(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),_r=W(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),vr=W(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),yr=W(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),br=W(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),xr=W(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Sr=W(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Cr=W(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),wr=W(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Tr=W(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Er=W(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Dr=W(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),Or=W(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),kr=W(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Ar=W(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),jr=W(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Mr=W(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Nr=W(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Pr=W(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Fr=W(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Ir=W(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Lr=W(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Rr=W(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),zr=W(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Br=W(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Vr=W(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Hr=W(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ur=W(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),Wr=W(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Gr=W(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),Kr=W(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),qr=W(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Jr=W(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Yr=W(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Xr=W(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),Zr=W(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),Qr=W(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),$r=W(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),ei=W(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),ti=W(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),ni=W(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),ri=W(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ii=W(`unlink-2`,[[`path`,{d:`M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2`,key:`1re2ne`}]]),ai=W(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),oi=W(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),si=W(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ci=W(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),li=W(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),ui=W(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),q=e(r(),1),di=`Collapsible`,[fi,pi]=Ht(di),[mi,hi]=fi(di),gi=q.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=qt({prop:r,defaultProp:i??!1,onChange:o,caller:di});return(0,K.jsx)(mi,{scope:n,disabled:a,contentId:Lt(),open:c,onOpenToggle:q.useCallback(()=>l(e=>!e),[l]),children:(0,K.jsx)(Bt.div,{"data-state":Si(c),"data-disabled":a?``:void 0,...s,ref:t})})});gi.displayName=di;var _i=`CollapsibleTrigger`,vi=q.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=hi(_i,n);return(0,K.jsx)(Bt.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Si(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:zt(e.onClick,i.onOpenToggle)})});vi.displayName=_i;var yi=`CollapsibleContent`,bi=q.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=hi(yi,e.__scopeCollapsible);return(0,K.jsx)(Vt,{present:n||i.open,children:({present:e})=>(0,K.jsx)(xi,{...r,ref:t,present:e})})});bi.displayName=yi;var xi=q.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=hi(yi,n),[s,c]=q.useState(r),l=q.useRef(null),u=Xt(t,l),d=q.useRef(0),f=d.current,p=q.useRef(0),m=p.current,h=o.open||s,g=q.useRef(h),_=q.useRef(void 0);return q.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Rt(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,K.jsx)(Bt.div,{"data-state":Si(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function Si(e){return e?`open`:`closed`}var Ci=gi,wi=vi,Ti=bi,Ei=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Di=t(((e,t)=>{t.exports=Ei()})),Oi=e(Yt(),1);function ki(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ai=`Popover`,[ji,Mi]=Ht(Ai,[fe]),Ni=fe(),[Pi,Fi]=ji(Ai),Ii=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Ni(t),c=q.useRef(null),[l,u]=q.useState(!1),[d,f]=qt({prop:r,defaultProp:i??!1,onChange:a,caller:Ai});return(0,K.jsx)(St,{...s,children:(0,K.jsx)(Pi,{scope:t,contentId:Lt(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:q.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:q.useCallback(()=>u(!0),[]),onCustomAnchorRemove:q.useCallback(()=>u(!1),[]),modal:o,children:n})})};Ii.displayName=Ai;var Li=`PopoverAnchor`,Ri=q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Fi(Li,n),a=Ni(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return q.useEffect(()=>(o(),()=>s()),[o,s]),(0,K.jsx)(Et,{...a,...r,ref:t})});Ri.displayName=Li;var zi=`PopoverTrigger`,Bi=q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Fi(zi,n),a=Ni(n),o=Xt(t,i.triggerRef),s=(0,K.jsx)(Bt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ta(i.open),...r,ref:o,onClick:zt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,K.jsx)(Et,{asChild:!0,...a,children:s})});Bi.displayName=zi;var Vi=`PopoverPortal`,[Hi,Ui]=ji(Vi,{forceMount:void 0}),Wi=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Fi(Vi,t);return(0,K.jsx)(Hi,{scope:t,forceMount:n,children:(0,K.jsx)(Vt,{present:n||a.open,children:(0,K.jsx)(It,{asChild:!0,container:i,children:r})})})};Wi.displayName=Vi;var Gi=`PopoverContent`,Ki=q.forwardRef((e,t)=>{let n=Ui(Gi,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Fi(Gi,e.__scopePopover);return(0,K.jsx)(Vt,{present:r||a.open,children:a.modal?(0,K.jsx)(Ji,{...i,ref:t}):(0,K.jsx)(Yi,{...i,ref:t})})});Ki.displayName=Gi;var qi=Jt(`PopoverContent.RemoveScroll`),Ji=q.forwardRef((e,t)=>{let n=Fi(Gi,e.__scopePopover),r=q.useRef(null),i=Xt(t,r),a=q.useRef(!1);return q.useEffect(()=>{let e=r.current;if(e)return en(e)},[]),(0,K.jsx)(rn,{as:qi,allowPinchZoom:!0,children:(0,K.jsx)(Xi,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:zt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:zt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yi=q.forwardRef((e,t)=>{let n=Fi(Gi,e.__scopePopover),r=q.useRef(!1),i=q.useRef(!1);return(0,K.jsx)(Xi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Xi=q.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Fi(Gi,n),m=Ni(n);return dn(),(0,K.jsx)(tn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(Ut,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,K.jsx)(p,{"data-state":ta(f.open),role:`dialog`,id:f.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Zi=`PopoverClose`,Qi=q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Fi(Zi,n);return(0,K.jsx)(Bt.button,{type:`button`,...r,ref:t,onClick:zt(e.onClick,()=>i.onOpenChange(!1))})});Qi.displayName=Zi;var $i=`PopoverArrow`,ea=q.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Ni(n);return(0,K.jsx)(le,{...i,...r,ref:t})});ea.displayName=$i;function ta(e){return e?`open`:`closed`}var na=Ii,ra=Ri,ia=Bi,aa=Wi,oa=Ki,sa=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ca=[` `,`Enter`],la=`Select`,[ua,da,fa]=I(la),[pa,ma]=Ht(la,[fa,fe]),ha=fe(),[ga,_a]=pa(la),[va,ya]=pa(la),ba=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=ha(t),[g,_]=q.useState(null),[v,y]=q.useState(null),[b,x]=q.useState(!1),S=k(l),[C,w]=qt({prop:r,defaultProp:i??!1,onChange:a,caller:la}),[T,E]=qt({prop:o,defaultProp:s,onChange:c,caller:la}),D=q.useRef(null),O=g?m||!!g.closest(`form`):!0,[A,j]=q.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,K.jsx)(St,{...h,children:(0,K.jsxs)(ga,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:Lt(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,K.jsx)(ua.Provider,{scope:t,children:(0,K.jsx)(va,{scope:e.__scopeSelect,onNativeOptionAdd:q.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:q.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,K.jsxs)(go,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,K.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};ba.displayName=la;var xa=`SelectTrigger`,Sa=q.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ha(n),o=_a(xa,n),s=o.disabled||r,c=Xt(t,o.onTriggerChange),l=da(n),u=q.useRef(`touch`),[d,f,p]=vo(e=>{let t=l().filter(e=>!e.disabled),n=yo(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,K.jsx)(Et,{asChild:!0,...a,children:(0,K.jsx)(Bt.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":_o(o.value)?``:void 0,...i,ref:c,onClick:zt(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:zt(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:zt(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&sa.includes(e.key)&&(m(),e.preventDefault())})})})});Sa.displayName=xa;var Ca=`SelectValue`,wa=q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=_a(Ca,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Xt(t,c.onValueNodeChange);return Rt(()=>{l(u)},[l,u]),(0,K.jsx)(Bt.span,{...s,ref:d,style:{pointerEvents:`none`},children:_o(c.value)?(0,K.jsx)(K.Fragment,{children:o}):a})});wa.displayName=Ca;var Ta=`SelectIcon`,Ea=q.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,K.jsx)(Bt.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Ea.displayName=Ta;var Da=`SelectPortal`,Oa=e=>(0,K.jsx)(It,{asChild:!0,...e});Oa.displayName=Da;var ka=`SelectContent`,Aa=q.forwardRef((e,t)=>{let n=_a(ka,e.__scopeSelect),[r,i]=q.useState();if(Rt(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Oi.createPortal((0,K.jsx)(Ma,{scope:e.__scopeSelect,children:(0,K.jsx)(ua.Slot,{scope:e.__scopeSelect,children:(0,K.jsx)(`div`,{children:e.children})})}),t):null}return(0,K.jsx)(Ia,{...e,ref:t})});Aa.displayName=ka;var ja=10,[Ma,Na]=pa(ka),Pa=`SelectContentImpl`,Fa=Jt(`SelectContent.RemoveScroll`),Ia=q.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=_a(ka,n),[y,b]=q.useState(null),[x,S]=q.useState(null),C=Xt(t,e=>b(e)),[w,T]=q.useState(null),[E,D]=q.useState(null),O=da(n),[k,A]=q.useState(!1),j=q.useRef(!1);q.useEffect(()=>{if(y)return en(y)},[y]),dn();let M=q.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=q.useCallback(()=>M([w,y]),[M,w,y]);q.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;q.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),q.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,L]=vo(e=>{let t=O().filter(e=>!e.disabled),n=yo(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),R=q.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),z=q.useCallback(()=>y?.focus(),[y]),B=q.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),V=r===`popper`?Ba:Ra,H=V===Ba?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,K.jsx)(Ma,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:R,selectedItem:w,onItemLeave:z,itemTextRefCallback:B,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,K.jsx)(rn,{as:Fa,allowPinchZoom:!0,children:(0,K.jsx)(tn,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:zt(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,K.jsx)(Ut,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,K.jsx)(V,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...H,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:zt(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});Ia.displayName=Pa;var La=`SelectItemAlignedPosition`,Ra=q.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=_a(ka,n),o=Na(ka,n),[s,c]=q.useState(null),[l,u]=q.useState(null),d=Xt(t,e=>u(e)),f=da(n),p=q.useRef(!1),m=q.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=q.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ja,d=ki(a,[ja,Math.max(ja,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-ja,d=ki(a,[ja,Math.max(ja,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-ja*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-ja,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${ja}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Rt(()=>y(),[y]);let[b,x]=q.useState();return Rt(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,K.jsx)(Va,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:q.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,K.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,K.jsx)(Bt.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ra.displayName=La;var za=`SelectPopperPosition`,Ba=q.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=ja,...a}=e,o=ha(n);return(0,K.jsx)(p,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Ba.displayName=za;var[Va,Ha]=pa(ka,{}),Ua=`SelectViewport`,Wa=q.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Na(Ua,n),o=Ha(Ua,n),s=Xt(t,a.onViewportChange),c=q.useRef(0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,K.jsx)(ua.Slot,{scope:n,children:(0,K.jsx)(Bt.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:zt(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-ja*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Wa.displayName=Ua;var Ga=`SelectGroup`,[Ka,qa]=pa(Ga),Ja=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Lt();return(0,K.jsx)(Ka,{scope:n,id:i,children:(0,K.jsx)(Bt.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ja.displayName=Ga;var Ya=`SelectLabel`,Xa=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=qa(Ya,n);return(0,K.jsx)(Bt.div,{id:i.id,...r,ref:t})});Xa.displayName=Ya;var Za=`SelectItem`,[Qa,$a]=pa(Za),eo=q.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=_a(Za,n),c=Na(Za,n),l=s.value===r,[u,d]=q.useState(a??``),[f,p]=q.useState(!1),m=Xt(t,e=>c.itemRefCallback?.(e,r,i)),h=Lt(),g=q.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,K.jsx)(Qa,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:q.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,K.jsx)(ua.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,K.jsx)(Bt.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:zt(o.onFocus,()=>p(!0)),onBlur:zt(o.onBlur,()=>p(!1)),onClick:zt(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:zt(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:zt(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:zt(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:zt(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:zt(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(ca.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});eo.displayName=Za;var to=`SelectItemText`,no=q.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=_a(to,n),s=Na(to,n),c=$a(to,n),l=ya(to,n),[u,d]=q.useState(null),f=Xt(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=q.useMemo(()=>(0,K.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Rt(()=>(h(m),()=>g(m)),[h,g,m]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Bt.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Oi.createPortal(a.children,o.valueNode):null]})});no.displayName=to;var ro=`SelectItemIndicator`,io=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return $a(ro,n).isSelected?(0,K.jsx)(Bt.span,{"aria-hidden":!0,...r,ref:t}):null});io.displayName=ro;var ao=`SelectScrollUpButton`,oo=q.forwardRef((e,t)=>{let n=Na(ao,e.__scopeSelect),r=Ha(ao,e.__scopeSelect),[i,a]=q.useState(!1),o=Xt(t,r.onScrollButtonChange);return Rt(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,K.jsx)(lo,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});oo.displayName=ao;var so=`SelectScrollDownButton`,co=q.forwardRef((e,t)=>{let n=Na(so,e.__scopeSelect),r=Ha(so,e.__scopeSelect),[i,a]=q.useState(!1),o=Xt(t,r.onScrollButtonChange);return Rt(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,K.jsx)(lo,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});co.displayName=so;var lo=q.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Na(`SelectScrollButton`,n),o=q.useRef(null),s=da(n),c=q.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return q.useEffect(()=>()=>c(),[c]),Rt(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,K.jsx)(Bt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:zt(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:zt(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:zt(i.onPointerLeave,()=>{c()})})}),uo=`SelectSeparator`,fo=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,K.jsx)(Bt.div,{"aria-hidden":!0,...r,ref:t})});fo.displayName=uo;var po=`SelectArrow`,mo=q.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ha(n),a=_a(po,n),o=Na(po,n);return a.open&&o.position===`popper`?(0,K.jsx)(le,{...i,...r,ref:t}):null});mo.displayName=po;var ho=`SelectBubbleInput`,go=q.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=q.useRef(null),a=Xt(r,i),o=Qt(t);return q.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,K.jsx)(Bt.select,{...n,style:{...jt,...n.style},ref:a,defaultValue:t})});go.displayName=ho;function _o(e){return e===``||e===void 0}function vo(e){let t=Gt(e),n=q.useRef(``),r=q.useRef(0),i=q.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=q.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return q.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function yo(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=bo(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function bo(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xo=ba,So=Sa,Co=wa,wo=Ea,To=Oa,Eo=Aa,Do=Wa,Oo=eo,ko=no,Ao=io,jo=oo,Mo=co,No=`Switch`,[Po,Fo]=Ht(No),[Io,Lo]=Po(No),Ro=q.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=q.useState(null),m=Xt(t,e=>p(e)),h=q.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=qt({prop:i,defaultProp:a??!1,onChange:l,caller:No});return(0,K.jsxs)(Io,{scope:n,checked:_,disabled:s,children:[(0,K.jsx)(Bt.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":Uo(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:zt(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,K.jsx)(Ho,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});Ro.displayName=No;var zo=`SwitchThumb`,Bo=q.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Lo(zo,n);return(0,K.jsx)(Bt.span,{"data-state":Uo(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Bo.displayName=zo;var Vo=`SwitchBubbleInput`,Ho=q.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=q.useRef(null),s=Xt(o,a),c=Qt(n),l=mn(t);return q.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,K.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Ho.displayName=Vo;function Uo(e){return e?`checked`:`unchecked`}var Wo=Ro,Go=Bo,Ko=Di(),J=a(),qo=Pt(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3! font-mono uppercase`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,warning:`bg-yellow-500/10 text-yellow-600 [a]:hover:bg-yellow-500/20`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`,dashed:`border-dashed border-border text-muted-foreground rounded-sm`,primary:`border border-primary/50 text-primary bg-primary/5 rounded-sm p-0.5 px-1.5 font-mono`,gray:`border border-border text-muted-foreground bg-muted rounded-sm p-0.5 px-1.5 font-mono`}},defaultVariants:{variant:`default`}});function Jo(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?Ft:`span`,c;t[5]!==n||t[6]!==o?(c=Wt(qo({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,K.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}function Yo(e){let t=e.split(`/`);return t.length<2?`ok`:`${t[0]}/${t[1]}`}function Xo(e){if(!e)return;let t=Object.entries(e);if(t.length!==0)return t.map(([e,t])=>{if(t==null)return[e,String(t)];if(typeof t==`string`)return[e,t];if(typeof t==`number`||typeof t==`boolean`)return[e,String(t)];try{return[e,JSON.stringify(t)]}catch{return[e,`[unserializable]`]}})}function Y(e,t,n){if(typeof performance>`u`||!performance.measure)return;let r=Yo(e),i=Xo(t),a={devtools:{dataType:`track-entry`,track:r,...i?{properties:i}:{},...n?.tooltipText?{tooltipText:n.tooltipText}:{}}},o=performance.now(),s=n?.startTime??o,c=n?.duration??Math.max(0,o-s);try{performance.measure(e,{start:s,duration:c,detail:a})}catch{}({...t?{properties:t}:{}})}function Zo(e){let t=(0,J.c)(3),{name:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsx)(q.Profiler,{id:n,onRender:Qo,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}var Qo=(e,t,n,r,i,a)=>{Y(`ok/render/${e}`,{phase:t,actualDuration:Math.round(n*1e3)/1e3,baseDuration:Math.round(r*1e3)/1e3},{startTime:i,duration:Math.max(0,a-i)})},{getOwnPropertyNames:$o,getOwnPropertySymbols:es}=Object,{hasOwnProperty:ts}=Object.prototype;function ns(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function rs(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function is(e){return e?.[Symbol.toStringTag]}function as(e){return $o(e).concat(es(e))}var os=Object.hasOwn||((e,t)=>ts.call(e,t));function ss(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var cs=`__v`,ls=`__o`,us=`_owner`,{getOwnPropertyDescriptor:ds,keys:fs}=Object;function ps(e,t){return e.byteLength===t.byteLength&&Es(new Uint8Array(e),new Uint8Array(t))}function ms(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function hs(e,t){return e.byteLength===t.byteLength&&Es(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function gs(e,t){return ss(e.getTime(),t.getTime())}function _s(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function vs(e,t){return e===t}function ys(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var bs=ss;function xs(e,t,n){let r=fs(e),i=r.length;if(fs(t).length!==i)return!1;for(;i-- >0;)if(!Os(e,t,n,r[i]))return!1;return!0}function Ss(e,t,n){let r=as(e),i=r.length;if(as(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!Os(e,t,n,a)||(o=ds(e,a),s=ds(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Cs(e,t){return ss(e.valueOf(),t.valueOf())}function ws(e,t){return e.source===t.source&&e.flags===t.flags}function Ts(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Es(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Ds(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Os(e,t,n,r){return(r===us||r===ls||r===cs)&&(e.$$typeof||t.$$typeof)?!0:os(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var ks=`[object ArrayBuffer]`,As=`[object Arguments]`,js=`[object Boolean]`,Ms=`[object DataView]`,Ns=`[object Date]`,Ps=`[object Error]`,Fs=`[object Map]`,Is=`[object Number]`,Ls=`[object Object]`,Rs=`[object RegExp]`,zs=`[object Set]`,Bs=`[object String]`,Vs={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Hs=`[object URL]`,Us=Object.prototype.toString;function Ws({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Us.call(h);if(b===Ns)return r(h,g,_);if(b===Rs)return u(h,g,_);if(b===Fs)return o(h,g,_);if(b===zs)return d(h,g,_);if(b===Ls)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Hs)return p(h,g,_);if(b===Ps)return i(h,g,_);if(b===As)return c(h,g,_);if(Vs[b])return f(h,g,_);if(b===ks)return e(h,g,_);if(b===Ms)return n(h,g,_);if(b===js||b===Is||b===Bs)return l(h,g,_);if(m){let e=m[b];if(!e){let t=is(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Gs({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ps,areArraysEqual:n?Ss:ms,areDataViewsEqual:hs,areDatesEqual:gs,areErrorsEqual:_s,areFunctionsEqual:vs,areMapsEqual:n?ns(ys,Ss):ys,areNumbersEqual:bs,areObjectsEqual:n?Ss:xs,arePrimitiveWrappersEqual:Cs,areRegExpsEqual:ws,areSetsEqual:n?ns(Ts,Ss):Ts,areTypedArraysEqual:n?ns(Es,Ss):Es,areUrlsEqual:Ds,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=rs(r.areArraysEqual),t=rs(r.areMapsEqual),n=rs(r.areObjectsEqual),i=rs(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Ks(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function qs({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Js=Ys();Ys({strict:!0}),Ys({circular:!0}),Ys({circular:!0,strict:!0}),Ys({createInternalComparator:()=>ss}),Ys({strict:!0,createInternalComparator:()=>ss}),Ys({circular:!0,createInternalComparator:()=>ss}),Ys({circular:!0,createInternalComparator:()=>ss,strict:!0});function Ys(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Ws(Gs(e));return qs({circular:t,comparator:a,createState:r,equals:n?n(a):Ks(a),strict:i})}var Xs=t((e=>{var t=r(),n=Di();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Zs=t(((e,t)=>{t.exports=Xs()}))(),Qs=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},$s=({contentComponent:e})=>{let t=(0,Ko.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,K.jsx)(K.Fragment,{children:Object.values(t)})};function ec(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Oi.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var tc=class extends q.Component{constructor(e){super(e),this.editorContentRef=q.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=ec(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:Qs(t,this.editorContentRef),...n}),e?.contentComponent&&(0,K.jsx)($s,{contentComponent:e.contentComponent})]})}},nc=(0,q.forwardRef)((e,t)=>{let n=q.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return q.createElement(tc,{key:n,innerRef:t,...e})}),rc=q.memo(nc),ic=typeof window<`u`?q.useLayoutEffect:q.useEffect,ac=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function oc(e){let[t]=(0,q.useState)(()=>new ac(e.editor)),n=(0,Zs.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Js);return ic(()=>t.watch(e.editor),[e.editor,t]),(0,q.useDebugValue)(n),n}typeof window>`u`||typeof window<`u`&&window.next;var sc=(0,q.createContext)({editor:null});sc.Consumer;var cc=()=>(0,q.useContext)(sc),lc=(0,q.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),uc=()=>(0,q.useContext)(lc);function dc({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=uc();return(0,K.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var fc=q.forwardRef((e,t)=>{let{onDragStart:n}=uc();return(0,K.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function pc(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function mc(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function hc(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function gc(e){if(pc(e)||mc(e))return!0;if(hc(e)){let t=e.type;if(t)return pc(t)||mc(t)}return!1}function _c(){try{if(q.version)return parseInt(q.version.split(`.`)[0],10)>=19}catch{}return!1}var vc=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,Oi.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=_c(),a=gc(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,K.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};q.createContext({markViewContentRef:()=>{}});var yc=class extends ht{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,q.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,q.memo)(e=>(0,K.jsx)(lc.Provider,{value:t,children:(0,q.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new vc(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},ct(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(it(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=Ke(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function bc(e,t){return n=>n.editor.contentComponent?new yc(e,n,t):{}}var xc=(0,q.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});xc.displayName=`TiptapContext`;var Sc=()=>(0,q.useContext)(xc);function Cc({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,q.useMemo)(()=>({editor:r}),[r]),a=(0,q.useMemo)(()=>({editor:r}),[r]);return(0,K.jsx)(sc.Provider,{value:a,children:(0,K.jsx)(xc.Provider,{value:i,children:n})})}Cc.displayName=`Tiptap`;function wc({...e}){let{editor:t}=Sc();return(0,K.jsx)(rc,{editor:t,...e})}wc.displayName=`Tiptap.Content`,Object.assign(Cc,{Content:wc});var Tc=()=>new Map,Ec=e=>{let t=Tc();return e.forEach((e,n)=>{t.set(n,e)}),t},Dc=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},Oc=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},kc=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},Ac=()=>new Set,jc=e=>e[e.length-1],Mc=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},Nc=Array.from,Pc=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Fc=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},Ic=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},Lc=Array.isArray,Rc=class{constructor(){this._observers=Tc()}on(e,t){return Dc(this._observers,e,Ac).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Nc((this._observers.get(e)||Tc()).values()).forEach(e=>e(...t))}destroy(){this._observers=Tc()}},zc=class{constructor(){this._observers=Tc()}on(e,t){Dc(this._observers,e,Ac).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Nc((this._observers.get(e)||Tc()).values()).forEach(e=>e(...t))}destroy(){this._observers=Tc()}},Bc=Math.floor,Vc=Math.abs,Hc=(e,t)=>e<t?e:t,Uc=(e,t)=>e>t?e:t;Number.isNaN;var Wc=e=>e===0?1/e<0:e<0,Gc=1<<17,Kc=1<<18,qc=1<<19,Jc=1<<20,Yc=1<<21,Xc=1<<22,Zc=1<<23,Qc=1<<24,$c=1<<25,el=1<<26,tl=1<<27,nl=1<<28,rl=1<<29;Gc-1,Kc-1,qc-1,Jc-1,Yc-1,Xc-1,Zc-1,Qc-1,$c-1,el-1,tl-1,nl-1,rl-1;var il=2**53-1,al=-(2**53-1),ol=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&Bc(e)===e);Number.isNaN,Number.parseInt;var sl=String.fromCharCode;String.fromCodePoint,sl(65535);var cl=e=>e.toLowerCase(),ll=/^\s*/g,ul=e=>e.replace(ll,``),dl=/([A-Z])/g,fl=(e,t)=>ul(e.replace(dl,e=>`${t}${cl(e)}`)),pl=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},ml=typeof TextEncoder<`u`?new TextEncoder:null,hl=ml?e=>ml.encode(e):pl,gl=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});gl&&gl.decode(new Uint8Array).length===1&&(gl=null);var _l=(e,t)=>Ic(t,()=>e).join(``),vl=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},yl=()=>new vl,bl=e=>{let t=yl();return e(t),Sl(t)},xl=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},Sl=e=>{let t=new Uint8Array(xl(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Cl=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Uc(n,t)*2),e.cpos=0)},wl=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Tl=wl,El=(e,t)=>{for(;t>127;)wl(e,128|127&t),t=Bc(t/128);wl(e,127&t)},Dl=(e,t)=>{let n=Wc(t);for(n&&(t=-t),wl(e,(t>63?128:0)|(n?64:0)|63&t),t=Bc(t/64);t>0;)wl(e,(t>127?128:0)|127&t),t=Bc(t/128)},Ol=new Uint8Array(3e4),kl=Ol.length/3,Al=ml&&ml.encodeInto?(e,t)=>{if(t.length<kl){let n=ml.encodeInto(t,Ol).written||0;El(e,n);for(let t=0;t<n;t++)wl(e,Ol[t])}else Ml(e,hl(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;El(e,r);for(let t=0;t<r;t++)wl(e,n.codePointAt(t))},jl=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Hc(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Uc(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Ml=(e,t)=>{El(e,t.byteLength),jl(e,t)},Nl=(e,t)=>{Cl(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Pl=(e,t)=>Nl(e,4).setFloat32(0,t,!1),Fl=(e,t)=>Nl(e,8).setFloat64(0,t,!1),Il=(e,t)=>Nl(e,8).setBigInt64(0,t,!1),Ll=new DataView(new ArrayBuffer(4)),Rl=e=>(Ll.setFloat32(0,e),Ll.getFloat32(0)===e),zl=(e,t)=>{switch(typeof t){case`string`:wl(e,119),Al(e,t);break;case`number`:ol(t)&&Vc(t)<=2147483647?(wl(e,125),Dl(e,t)):Rl(t)?(wl(e,124),Pl(e,t)):(wl(e,123),Fl(e,t));break;case`bigint`:wl(e,122),Il(e,t);break;case`object`:if(t===null)wl(e,126);else if(Lc(t)){wl(e,117),El(e,t.length);for(let n=0;n<t.length;n++)zl(e,t[n])}else if(t instanceof Uint8Array)wl(e,116),Ml(e,t);else{wl(e,118);let n=Object.keys(t);El(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];Al(e,i),zl(e,t[i])}}break;case`boolean`:wl(e,t?120:121);break;default:wl(e,127)}},Bl=class extends vl{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&El(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},Vl=e=>{e.count>0&&(Dl(e.encoder,e.count===1?e.s:-e.s),e.count>1&&El(e.encoder,e.count-2))},Hl=class{constructor(){this.encoder=new vl,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Vl(this),this.count=1,this.s=e)}toUint8Array(){return Vl(this),Sl(this.encoder)}},Ul=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);Dl(e.encoder,t),e.count>1&&El(e.encoder,e.count-2)}},Wl=class{constructor(){this.encoder=new vl,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ul(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ul(this),Sl(this.encoder)}},Gl=class{constructor(){this.sarr=[],this.s=``,this.lensE=new Hl}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new vl;return this.sarr.push(this.s),this.s=``,Al(e,this.sarr.join(``)),jl(e,this.lensE.toUint8Array()),Sl(e)}},Kl=e=>Error(e),ql=()=>{throw Kl(`Method unimplemented`)},Jl=()=>{throw Kl(`Unexpected case`)},Yl=Kl(`Unexpected end of array`),Xl=Kl(`Integer out of Range`),Zl=class{constructor(e){this.arr=e,this.pos=0}},Ql=e=>new Zl(e),$l=e=>e.pos!==e.arr.length,eu=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},tu=e=>eu(e,X(e)),nu=e=>e.arr[e.pos++],X=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>il)throw Xl}throw Yl},ru=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>il)throw Xl}throw Yl},iu=gl?e=>gl.decode(tu(e)):e=>{let t=X(e);if(t===0)return``;{let n=String.fromCodePoint(nu(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(nu(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},au=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},ou=[e=>void 0,e=>null,ru,e=>au(e,4).getFloat32(0,!1),e=>au(e,8).getFloat64(0,!1),e=>au(e,8).getBigInt64(0,!1),e=>!1,e=>!0,iu,e=>{let t=X(e),n={};for(let r=0;r<t;r++){let t=iu(e);n[t]=su(e)}return n},e=>{let t=X(e),n=[];for(let r=0;r<t;r++)n.push(su(e));return n},tu],su=e=>ou[127-nu(e)](e),cu=class extends Zl{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),$l(this)?this.count=X(this)+1:this.count=-1),this.count--,this.s}},lu=class extends Zl{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=ru(this);let e=Wc(this.s);this.count=1,e&&(this.s=-this.s,this.count=X(this)+2)}return this.count--,this.s}},uu=class extends Zl{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=ru(this),t=e&1;this.diff=Bc(e/2),this.count=1,t&&(this.count=X(this)+2)}return this.s+=this.diff,this.count--,this.s}},du=class{constructor(e){this.decoder=new lu(e),this.str=iu(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var fu=crypto.getRandomValues.bind(crypto),pu=Math.random,mu=()=>fu(new Uint32Array(1))[0],hu=e=>e[Bc(pu()*e.length)],gu=`10000000-1000-4000-8000-100000000000`,_u=()=>gu.replace(/[018]/g,e=>(e^mu()&15>>e/4).toString(16)),vu=Date.now,yu=e=>new Promise(e);Promise.all.bind(Promise);var bu=e=>e===void 0?null:e,xu=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{typeof localStorage<`u`&&localStorage&&(xu=localStorage)}catch{}var Su=xu,Cu=Symbol(`Equality`),wu=(e,t)=>e===t||!!e?.[Cu]?.(t)||!1,Tu=e=>typeof e==`object`,Eu=Object.assign,Du=Object.keys,Ou=(e,t)=>{for(let n in e)t(e[n],n)},ku=e=>Du(e).length,Au=e=>{for(let t in e)return!1;return!0},ju=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},Mu=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Nu=(e,t)=>e===t||ku(e)===ku(t)&&ju(e,(e,n)=>(e!==void 0||Mu(t,n))&&wu(t[n],e)),Pu=Object.freeze,Fu=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&Fu(e[t])}return Pu(e)},Iu=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&Iu(e,t,n+1)}},Lu=e=>e,Ru=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Cu]!=null)return e[Cu](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!Ru(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(ku(e)!==ku(t))return!1;for(let n in e)if(!Mu(e,n)||!Ru(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ru(e[n],t[n]))return!1;break;default:return!1}return!0},zu=(e,t)=>t.includes(e),Bu=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,Vu=typeof window<`u`&&typeof document<`u`&&!Bu;typeof navigator<`u`&&/Mac/.test(navigator.platform);var Hu,Uu=[],Wu=()=>{if(Hu===void 0)if(Bu){Hu=Tc();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&Hu.set(t,``),t=r):t===null?Uu.push(r):(Hu.set(t,r),t=null)}t!==null&&Hu.set(t,``)}else typeof location==`object`?(Hu=Tc(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);Hu.set(`--${fl(t,`-`)}`,n),Hu.set(`-${fl(t,`-`)}`,n)}})):Hu=Tc();return Hu},Gu=e=>Wu().has(e),Ku=e=>bu(Bu?{}[e.toUpperCase().replaceAll(`-`,`_`)]:Su.getItem(e)),qu=e=>Gu(`--`+e)||Ku(e)!==null,Ju=qu(`production`),Yu=Bu&&zu({}.FORCE_COLOR,[`true`,`1`,`2`])||!Gu(`--no-colors`)&&!qu(`no-color`)&&(!Bu||process.stdout.isTTY)&&(!Bu||Gu(`--color`)||Ku(`COLORTERM`)!==null||(Ku(`TERM`)||``).includes(`color`)),Xu=e=>new Uint8Array(e),Zu=Vu?e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=sl(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),Qu=e=>{let t=Xu(e.byteLength);return t.set(e),t},$u=e=>bl(t=>zl(t,e)),ed=class{constructor(e,t){this.left=e,this.right=t}},td=(e,t)=>new ed(e,t),nd=(e,t)=>e.forEach(e=>t(e.left,e.right)),rd=e=>e.next()>=.5,id=(e,t,n)=>Bc(e.next()*(n+1-t)+t),ad=(e,t,n)=>Bc(e.next()*(n+1-t)+t),od=(e,t,n)=>ad(e,t,n),sd=e=>sl(od(e,97,122)),cd=(e,t=0,n=20)=>{let r=od(e,t,n),i=``;for(let t=0;t<r;t++)i+=sd(e);return i},ld=(e,t)=>t[od(e,0,t.length-1)],ud=Symbol(`0schema`),dd=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(_l(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
3
- `)}},fd=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Cu]?wu(e,t):Lc(e)?Pc(e,e=>Fc(t,t=>fd(e,t))):Tu(e)?ju(e,(e,n)=>fd(e,t[n])):!1,pd=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),fd(t,n)}equals(e){return this.constructor===e.constructor&&Ru(this.shape,e.shape)}[ud](){return!0}[Cu](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){ql()}get nullable(){return Kd(this,cf)}get optional(){return new wd(this)}cast(e){return ff(e,this),e}expect(e){return ff(e,this),e}},md=class extends pd{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},hd=(e,t=null)=>new md(e,t);hd(md);var gd=class extends pd{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},_d=e=>new gd(e);hd(gd);var vd=class extends pd{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},yd=(...e)=>new vd(e),bd=hd(vd),xd=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),Sd=e=>{if(nf.check(e))return[xd(e)];if(bd.check(e))return e.shape.map(e=>e+``);if(tf.check(e))return[`[+-]?\\d+.?\\d*`];if(rf.check(e))return[`.*`];if(qd.check(e))return e.shape.map(Sd).flat(1);Jl()};hd(class extends pd{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(Sd).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var Cd=Symbol(`optional`),wd=class extends pd{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[Cd](){return!0}},Td=hd(wd),Ed=class extends pd{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new Ed,hd(Ed);var Dd=class e extends pd{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):ju(this.shape,(n,r)=>{let i=this._isPartial&&!Mu(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},Od=e=>new Dd(e),kd=hd(Dd),Ad=_d(e=>e!=null&&(e.constructor===Object||e.constructor==null)),jd=class extends pd{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&ju(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},Md=(e,t)=>new jd(e,t),Nd=hd(jd),Pd=class extends pd{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&ju(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},Fd=(...e)=>new Pd(e);hd(Pd);var Id=class extends pd{constructor(e){super(),this.shape=e.length===1?e[0]:new Gd(e)}check(e,t){let n=Lc(e)&&Pc(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},Ld=(...e)=>new Id(e),Rd=hd(Id),zd=_d(e=>Lc(e)),Bd=class extends pd{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},Vd=(e,t=null)=>new Bd(e,t);hd(Bd);var Hd=Vd(pd),Ud=hd(class extends pd{constructor(e){super(),this.len=e.length-1,this.args=Fd(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),Wd=_d(e=>typeof e==`function`);hd(class extends pd{constructor(e){super(),this.shape=e}check(e,t){let n=Pc(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var Gd=class extends pd{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=Fc(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},Kd=(...e)=>e.findIndex(e=>qd.check(e))>=0?Kd(...e.map(e=>df(e)).map(e=>qd.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new Gd(e),qd=hd(Gd),Jd=()=>!0,Yd=_d(Jd),Xd=hd(gd,e=>e.shape===Jd),Zd=_d(e=>typeof e==`bigint`),Qd=_d(e=>e===Zd),$d=_d(e=>typeof e==`symbol`);_d(e=>e===$d);var ef=_d(e=>typeof e==`number`),tf=_d(e=>e===ef),nf=_d(e=>typeof e==`string`),rf=_d(e=>e===nf),af=_d(e=>typeof e==`boolean`),of=_d(e=>e===af),sf=yd(void 0);hd(vd,e=>e.shape.length===1&&e.shape[0]===void 0),yd(void 0);var cf=yd(null),lf=hd(vd,e=>e.shape.length===1&&e.shape[0]===null);hd(Uint8Array),hd(md,e=>e.shape===Uint8Array);var uf=Kd(ef,nf,cf,sf,Zd,af,$d);(()=>{let e=Ld(Yd),t=Md(nf,Yd),n=Kd(ef,nf,cf,af,e,t);return e.shape=n,t.shape.values=n,n})();var df=e=>{if(Hd.check(e))return e;if(Ad.check(e)){let t={};for(let n in e)t[n]=df(e[n]);return Od(t)}else if(zd.check(e))return Kd(...e.map(df));else if(uf.check(e))return yd(e);else if(Wd.check(e))return hd(e);Jl()},ff=Ju?()=>{}:(e,t)=>{let n=new dd;if(!t.check(e,n))throw Kl(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},pf=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:df(e),h:t}),this}else(e){return this.if(Yd,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw Kl(`Unhandled pattern`)}}},mf=(e=>new pf(e))(Yd).if(tf,(e,t)=>id(t,al,il)).if(rf,(e,t)=>cd(t)).if(of,(e,t)=>rd(t)).if(Qd,(e,t)=>BigInt(id(t,al,il))).if(qd,(e,t)=>hf(t,ld(t,e.shape))).if(kd,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(Td.check(i)){if(rd(t))continue;i=i.shape}n[r]=mf(i,t)}return n}).if(Rd,(e,t)=>{let n=[],r=ad(t,0,42);for(let i=0;i<r;i++)n.push(hf(t,e.shape));return n}).if(bd,(e,t)=>ld(t,e.shape)).if(lf,(e,t)=>null).if(Ud,(e,t)=>{let n=hf(t,e.res);return()=>n}).if(Xd,(e,t)=>hf(t,ld(t,[ef,nf,cf,sf,Zd,af,Ld(ef),Md(Kd(`a`,`b`,`c`),ef)]))).if(Nd,(e,t)=>{let n={},r=id(t,0,3);for(let i=0;i<r;i++){let r=hf(t,e.shape.keys);n[r]=hf(t,e.shape.values)}return n}).done(),hf=(e,t)=>mf(df(t),e),gf=typeof document<`u`?document:{},_f=e=>gf.createElement(e),vf=()=>gf.createDocumentFragment();_d(e=>e.nodeType===Af);var yf=e=>gf.createTextNode(e);typeof DOMParser<`u`&&new DOMParser;var bf=(e,t)=>(nd(t,(t,n)=>{n===!1?e.removeAttribute(t):n===!0?e.setAttribute(t,``):e.setAttribute(t,n)}),e),xf=e=>{let t=vf();for(let n=0;n<e.length;n++)Ef(t,e[n]);return t},Sf=(e,t)=>(Ef(e,xf(t)),e),Cf=(e,t=[],n=[])=>Sf(bf(_f(e),t),n);_d(e=>e.nodeType===Df);var wf=yf;_d(e=>e.nodeType===Of);var Tf=e=>Oc(e,(e,t)=>`${t}:${e};`).join(``),Ef=(e,t)=>e.appendChild(t),Df=gf.ELEMENT_NODE,Of=gf.TEXT_NODE;gf.CDATA_SECTION_NODE,gf.COMMENT_NODE;var kf=gf.DOCUMENT_NODE;gf.DOCUMENT_TYPE_NODE;var Af=gf.DOCUMENT_FRAGMENT_NODE;_d(e=>e.nodeType===kf);var jf=(e=>class{constructor(e){this._=e}destroy(){e(this._)}})(clearTimeout),Mf=(e,t)=>new jf(setTimeout(t,e)),Nf=Symbol,Pf=Nf(),Ff=Nf(),If=Nf(),Lf=Nf(),Rf=Nf(),zf=Nf(),Bf=Nf(),Vf=Nf(),Hf=Nf(),Uf=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};vu();var Wf={[Pf]:td(`font-weight`,`bold`),[Ff]:td(`font-weight`,`normal`),[If]:td(`color`,`blue`),[Rf]:td(`color`,`green`),[Lf]:td(`color`,`grey`),[zf]:td(`color`,`red`),[Bf]:td(`color`,`purple`),[Vf]:td(`color`,`orange`),[Hf]:td(`color`,`black`)},Gf=Yu?e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=Tc(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=Wf[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=Tf(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i}:Uf,Kf=(...e)=>{console.log(...Gf(e)),Jf.forEach(t=>t.print(e))},qf=(...e)=>{console.warn(...Gf(e)),e.unshift(Vf),Jf.forEach(t=>t.print(e))},Jf=Ac(),Yf=e=>({[Symbol.iterator](){return this},next:e}),Xf=(e,t)=>Yf(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Zf=(e,t)=>Yf(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),Qf=class{constructor(e,t){this.clock=e,this.len=t}},$f=class{constructor(){this.clients=new Map}},ep=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])vm(e,i,o.clock,o.len,n)}}),tp=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=Bc((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},np=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&tp(n,t.clock)!==null},rp=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new Qf(r.clock,Uc(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},ip=e=>{let t=new $f;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)Mc(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return rp(t),t},ap=(e,t,n,r)=>{Dc(e.clients,t,()=>[]).push(new Qf(n,r))},op=()=>new $f,sp=e=>{let t=op();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new Qf(i,a))}}r.length>0&&t.clients.set(n,r)}),t},cp=(e,t)=>{El(e.restEncoder,t.clients.size),Nc(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),El(e.restEncoder,t);let r=n.length;El(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},lp=e=>{let t=new $f,n=X(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=X(e.restDecoder),r=X(e.restDecoder);if(r>0){let i=Dc(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new Qf(e.readDsClock(),e.readDsLen()))}}return t},up=(e,t,n)=>{let r=new $f,i=X(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=X(e.restDecoder),a=X(e.restDecoder),o=n.clients.get(i)||[],s=um(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&ap(r,i,s,a-s);let e=fm(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,Fg(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,Fg(t,c,a-c.id.clock)),c.delete(t))}else ap(r,i,n,a-n)}}if(r.clients.size>0){let e=new bp;return El(e.restEncoder,0),cp(e,r),e.toUint8Array()}return null},dp=mu,fp=class e extends Rc{constructor({guid:e=_u(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=dp(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new cm,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=yu(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>yu(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&Em(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Nc(this.subdocs).map(e=>e.guid))}transact(e,t=null){return Em(this,e,t)}get(e,t=nh){let n=Dc(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==nh&&r!==t)if(r===nh){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,Ch)}getText(e=``){return this.get(e,Wh)}getMap(e=``){return this.get(e,Eh)}getXmlElement(e=``){return this.get(e,Yh)}getXmlFragment(e=``){return this.get(e,qh)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,Nc(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Em(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},pp=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return X(this.restDecoder)}readDsLen(){return X(this.restDecoder)}},mp=class extends pp{readLeftID(){return Z(X(this.restDecoder),X(this.restDecoder))}readRightID(){return Z(X(this.restDecoder),X(this.restDecoder))}readClient(){return X(this.restDecoder)}readInfo(){return nu(this.restDecoder)}readString(){return iu(this.restDecoder)}readParentInfo(){return X(this.restDecoder)===1}readTypeRef(){return X(this.restDecoder)}readLen(){return X(this.restDecoder)}readAny(){return su(this.restDecoder)}readBuf(){return Qu(tu(this.restDecoder))}readJSON(){return JSON.parse(iu(this.restDecoder))}readKey(){return iu(this.restDecoder)}},hp=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=X(this.restDecoder),this.dsCurrVal}readDsLen(){let e=X(this.restDecoder)+1;return this.dsCurrVal+=e,e}},gp=class extends hp{constructor(e){super(e),this.keys=[],X(e),this.keyClockDecoder=new uu(tu(e)),this.clientDecoder=new lu(tu(e)),this.leftClockDecoder=new uu(tu(e)),this.rightClockDecoder=new uu(tu(e)),this.infoDecoder=new cu(tu(e),nu),this.stringDecoder=new du(tu(e)),this.parentInfoDecoder=new cu(tu(e),nu),this.typeRefDecoder=new lu(tu(e)),this.lenDecoder=new lu(tu(e))}readLeftID(){return new Up(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Up(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return su(this.restDecoder)}readBuf(){return tu(this.restDecoder)}readJSON(){return su(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},_p=class{constructor(){this.restEncoder=yl()}toUint8Array(){return Sl(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){El(this.restEncoder,e)}writeDsLen(e){El(this.restEncoder,e)}},vp=class extends _p{writeLeftID(e){El(this.restEncoder,e.client),El(this.restEncoder,e.clock)}writeRightID(e){El(this.restEncoder,e.client),El(this.restEncoder,e.clock)}writeClient(e){El(this.restEncoder,e)}writeInfo(e){Tl(this.restEncoder,e)}writeString(e){Al(this.restEncoder,e)}writeParentInfo(e){El(this.restEncoder,+!!e)}writeTypeRef(e){El(this.restEncoder,e)}writeLen(e){El(this.restEncoder,e)}writeAny(e){zl(this.restEncoder,e)}writeBuf(e){Ml(this.restEncoder,e)}writeJSON(e){Al(this.restEncoder,JSON.stringify(e))}writeKey(e){Al(this.restEncoder,e)}},yp=class{constructor(){this.restEncoder=yl(),this.dsCurrVal=0}toUint8Array(){return Sl(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,El(this.restEncoder,t)}writeDsLen(e){e===0&&Jl(),El(this.restEncoder,e-1),this.dsCurrVal+=e}},bp=class extends yp{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Wl,this.clientEncoder=new Hl,this.leftClockEncoder=new Wl,this.rightClockEncoder=new Wl,this.infoEncoder=new Bl(Tl),this.stringEncoder=new Gl,this.parentInfoEncoder=new Bl(Tl),this.typeRefEncoder=new Hl,this.lenEncoder=new Hl}toUint8Array(){let e=yl();return El(e,0),Ml(e,this.keyClockEncoder.toUint8Array()),Ml(e,this.clientEncoder.toUint8Array()),Ml(e,this.leftClockEncoder.toUint8Array()),Ml(e,this.rightClockEncoder.toUint8Array()),Ml(e,Sl(this.infoEncoder)),Ml(e,this.stringEncoder.toUint8Array()),Ml(e,Sl(this.parentInfoEncoder)),Ml(e,this.typeRefEncoder.toUint8Array()),Ml(e,this.lenEncoder.toUint8Array()),jl(e,Sl(this.restEncoder)),Sl(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){zl(this.restEncoder,e)}writeBuf(e){Ml(this.restEncoder,e)}writeJSON(e){zl(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},xp=(e,t,n,r)=>{r=Uc(r,t[0].id.clock);let i=fm(t,r);El(e.restEncoder,t.length-i),e.writeClient(n),El(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},Sp=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{um(t,n)>e&&r.set(n,e)}),lm(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),El(e.restEncoder,r.size),Nc(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{xp(e,t.clients.get(n),n,r)})},Cp=(e,t)=>{let n=Tc(),r=X(e.restDecoder);for(let i=0;i<r;i++){let r=X(e.restDecoder),i=Array(r),a=e.readClient(),o=X(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new ig(Z(a,o),t),o+=t;break}case 10:{let t=X(e.restDecoder);i[n]=new Hg(Z(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new Rg(Z(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,zg(e,r));i[n]=c,o+=c.length}}}}return n},wp=(e,t,n)=>{let r=[],i=Nc(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new cm,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==Hg){let i=Dc(d,u.id.client,()=>um(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,um(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new bp;return Sp(e,s,new Map),El(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},Tp=(e,t)=>Sp(e,t.doc.store,t.beforeState),Ep=(e,t,n,r=new gp(e))=>Em(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=wp(e,i,Cp(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<um(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=Im([o.update,a.update])}}else i.pendingStructs=a;let s=up(r,e,i);if(i.pendingDs){let t=new gp(Ql(i.pendingDs));X(t.restDecoder);let n=up(t,e,i);s&&n?i.pendingDs=Im([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,Dp(e.doc,t)}},n,!1),Dp=(e,t,n,r=gp)=>{let i=Ql(t);Ep(i,e,n,new r(i))},Op=(e,t,n)=>Dp(e,t,n,mp),kp=(e,t,n=new Map)=>{Sp(e,t.store,n),cp(e,sp(t.store))},Ap=(e,t=new Uint8Array([0]),n=new bp)=>{kp(n,e,Np(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Lm(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===vp)return Pm(r.map((e,t)=>t===0?e:Hm(e)));if(n.constructor===bp)return Im(r)}return r[0]},jp=(e,t)=>Ap(e,t,new vp),Mp=e=>{let t=new Map,n=X(e.restDecoder);for(let r=0;r<n;r++){let n=X(e.restDecoder),r=X(e.restDecoder);t.set(n,r)}return t},Np=e=>Mp(new pp(Ql(e))),Pp=(e,t)=>(El(e.restEncoder,t.size),Nc(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{El(e.restEncoder,t),El(e.restEncoder,n)}),e),Fp=(e,t)=>Pp(e,lm(t.store)),Ip=(e,t=new yp)=>(e instanceof Map?Pp(t,e):Fp(t,e),t.toUint8Array()),Lp=e=>Ip(e,new _p),Rp=class{constructor(){this.l=[]}},zp=()=>new Rp,Bp=(e,t)=>e.l.push(t),Vp=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},Hp=(e,t,n)=>Iu(e.l,[t,n]),Up=class{constructor(e,t){this.client=e,this.clock=t}},Wp=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,Z=(e,t)=>new Up(e,t),Gp=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw Jl()},Kp=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},qp=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},Jp=e=>{let t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},Yp=e=>new qp(e.type==null?null:Z(e.type.client,e.type.clock),e.tname??null,e.item==null?null:Z(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),Xp=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},Zp=(e,t,n=0)=>new Xp(e,t,n),Qp=(e,t,n)=>{let r=null,i=null;return e._item===null?i=Gp(e):r=Z(e._item.id.client,e._item.id.clock),new qp(r,i,t,n)},$p=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return Qp(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return Qp(e,Z(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return Qp(e,r.lastId,n);r=r.right}return Qp(e,null,n)},em=(e,t)=>{let n=pm(e,t);return{item:n,diff:t.clock-n.id.clock}},tm=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(um(r,i.client)<=i.clock)return null;let e=n?Ng(r,i):em(r,i),t=e.item;if(!(t instanceof Rg))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(um(r,a.client)<=a.clock)return null;let{item:e}=n?Ng(r,a):{item:pm(r,a)};if(e instanceof Rg&&e.content instanceof jg)c=e.content.type;else return null}else throw Jl();l=s>=0?c._length:0}return Zp(c,l,e.assoc)},nm=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&Wp(e.item,t.item)&&Wp(e.type,t.type)&&e.assoc===t.assoc,rm=class{constructor(e,t){this.ds=e,this.sv=t}},im=(e,t)=>new rm(e,t);im(op(),new Map);var am=e=>im(sp(e.store),lm(e.store)),om=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!np(t.ds,e.id),sm=(e,t)=>{let n=Dc(e.meta,sm,Ac),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<um(r,n)&&hm(e,Z(n,t))}),ep(e,t.ds,e=>{}),n.add(t))},cm=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},lm=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},um=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},dm=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Jl()}n.push(t)},fm=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=Bc(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=Bc((n+r)/2)}throw Jl()},pm=(e,t)=>{let n=e.clients.get(t.client);return n[fm(n,t.clock)]},mm=(e,t,n)=>{let r=fm(t,n),i=t[r];return i.id.clock<n&&i instanceof Rg?(t.splice(r+1,0,Fg(e,i,n-i.id.clock)),r+1):r},hm=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[mm(e,n,t.clock)]},gm=(e,t,n)=>{let r=t.clients.get(n.client),i=fm(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==ig&&r.splice(i+1,0,Fg(e,a,n.clock-a.id.clock+1)),a},_m=(e,t,n)=>{let r=e.clients.get(t.id.client);r[fm(r,t.id.clock)]=n},vm=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=mm(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&mm(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},ym=class{constructor(e,t,n){this.doc=e,this.deleteSet=new $f,this.beforeState=lm(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},bm=(e,t)=>t.deleteSet.clients.size===0&&!kc(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(rp(t.deleteSet),Tp(e,t),cp(e,t.deleteSet),!0),xm=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Dc(e.changed,t,Ac).add(n)},Sm=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Rg&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},Cm=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=fm(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof Rg&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},wm=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=Hc(r.length-1,1+fm(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+Sm(r,e)}})},Tm=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{rp(a),n.afterState=lm(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{Hp(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&Vh(n)})}),Iu(e,[])}finally{r.gc&&Cm(a,i,r.gcFilter),wm(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=Uc(fm(e,r),1);for(let t=e.length-1;t>=n;)t-=1+Sm(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=fm(r,n);a+1<r.length&&Sm(r,a+1)>1||a>0&&Sm(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(Kf(Vf,Pf,`[yjs] `,Ff,zf,`Changed the client-id because another client seems to be using it.`),r.clientID=dp()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new vp;bm(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new bp;bm(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):Tm(e,t+1)}}},Em=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new ym(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&Tm(i,0)}}return o},Dm=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},Om=(e,t,n)=>{ep(e,n.deletions,n=>{n instanceof Rg&&t.scope.some(t=>t===e.doc||Kp(t,n))&&Pg(n,!1)})},km=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;Em(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;ep(n,o.insertions,e=>{if(e instanceof Rg){if(e.redone!==null){let{item:t,diff:i}=Ng(r,e.id);i>0&&(t=hm(n,Z(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||Kp(t,e))&&c.push(e)}}),ep(n,o.deletions,e=>{e instanceof Rg&&a.some(t=>t===n.doc||Kp(t,e))&&!np(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=Lg(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},Am=class extends Rc{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=Lc(e)?e[0].doc:e instanceof fp?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new $f;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&ap(i,n,r,a)});let a=vu(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=ip([t.deletions,e.deleteSet]),t.insertions=ip([t.insertions,i])}else r.push(new Dm(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),ep(e,e.deleteSet,t=>{t instanceof Rg&&this.scope.some(n=>n===e.doc||Kp(n,t))&&Pg(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=Lc(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof nh?e.doc!==this.doc:e!==this.doc)&&qf(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>Om(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>Om(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=km(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=km(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}};function*jm(e){let t=X(e.restDecoder);for(let n=0;n<t;n++){let t=X(e.restDecoder),n=e.readClient(),r=X(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=X(e.restDecoder);yield new Hg(Z(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new Rg(Z(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,zg(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new ig(Z(n,r),t),r+=t}}}}var Mm=class{constructor(e,t){this.gen=jm(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Hg);return this.curr}},Nm=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},Pm=e=>Im(e,mp,vp),Fm=(e,t)=>{if(e.constructor===ig){let{client:n,clock:r}=e.id;return new ig(Z(n,r+t),e.length-t)}else if(e.constructor===Hg){let{client:n,clock:r}=e.id;return new Hg(Z(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new Rg(Z(r,i+t),null,Z(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Im=(e,t=gp,n=bp)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(Ql(e))),i=r.map(e=>new Mm(e,!0)),a=null,o=new n,s=new Nm(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Hg?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)zm(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===Hg)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{zm(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new Hg(Z(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===Hg?a.struct.length-=t:n=Fm(n,t)),a.struct.mergeWith(n)||(zm(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==Hg;n=e.next())zm(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(zm(s,a.struct,a.offset),a=null),Bm(s),cp(o,ip(r.map(e=>lp(e)))),o.toUint8Array()},Lm=(e,t,n=gp,r=bp)=>{let i=Np(t),a=new r,o=new Nm(a),s=new n(Ql(e)),c=new Mm(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===Hg){c.next();continue}if(e.id.clock+e.length>n)for(zm(o,e,Uc(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)zm(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return Bm(o),cp(a,lp(s)),a.toUint8Array()},Rm=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Sl(e.encoder.restEncoder)}),e.encoder.restEncoder=yl(),e.written=0)},zm=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Rm(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),El(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Bm=e=>{Rm(e);let t=e.encoder.restEncoder;El(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];El(t,r.written),jl(t,r.restEncoder)}},Vm=(e,t,n,r)=>{let i=new n(Ql(e)),a=new Mm(i,!1),o=new r,s=new Nm(o);for(let e=a.curr;e!==null;e=a.next())zm(s,t(e),0);return Bm(s),cp(o,lp(i)),o.toUint8Array()},Hm=e=>Vm(e,Lu,gp,vp),Um=`You must not compute changes after the event-handler fired.`,Wm=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=Gm(this.currentTarget,this.target)}deletes(e){return np(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Kl(Um);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=jc(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=jc(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=jc(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Kl(Um);let t=this.target,n=Ac(),r=Ac(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},Gm=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},Km=()=>{qf(`Invalid access: Add Yjs type to a document before reading data.`)},qm=80,Jm=0,Ym=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Jm++}},Xm=e=>{e.timestamp=Jm++},Zm=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Jm++},Qm=(e,t,n)=>{if(e.length>=qm){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return Zm(r,t,n),r}else{let r=new Ym(t,n);return e.push(r),r}},$m=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>Vc(t-e.index)<Vc(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,Xm(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Vc(n.index-i)<r.parent.length/qm?(Zm(n,r,i),n):Qm(e._searchMarker,r,i)},eh=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=Uc(t,i.index+n))}},th=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;Dc(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;Hp(r._eH,n,t)},nh=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=zp(),this._dEH=zp(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw ql()}clone(){throw ql()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Bp(this._eH,e)}observeDeep(e){Bp(this._dEH,e)}unobserve(e){Vp(this._eH,e)}unobserveDeep(e){Vp(this._dEH,e)}toJSON(){}},rh=(e,t,n)=>{e.doc??Km(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},ih=e=>{e.doc??Km();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},ah=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&om(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},oh=(e,t)=>{let n=0,r=e._start;for(e.doc??Km();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},sh=(e,t)=>{let n=[];return oh(e,(r,i)=>{n.push(t(r,i,e))}),n},ch=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},lh=(e,t)=>{e.doc??Km();let n=$m(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},uh=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new Rg(Z(o,um(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new yg(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new Rg(Z(o,um(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new ag(new Uint8Array(n))),i.integrate(e,0);break;case fp:i=new Rg(Z(o,um(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new ug(n)),i.integrate(e,0);break;default:if(n instanceof nh)i=new Rg(Z(o,um(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new jg(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},dh=()=>Kl(`Length exceeded!`),fh=(e,t,n,r)=>{if(n>t._length)throw dh();if(n===0)return t._searchMarker&&eh(t._searchMarker,n,r.length),uh(e,t,null,r);let i=n,a=$m(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&hm(e,Z(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&eh(t._searchMarker,i,r.length),uh(e,t,o,r)},ph=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return uh(e,t,r,n)},mh=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=$m(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&hm(e,Z(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&hm(e,Z(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw dh();t._searchMarker&&eh(t._searchMarker,i,-a+r)},hh=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},gh=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new yg([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new yg([r]);break;case Uint8Array:s=new ag(r);break;case fp:s=new ug(r);break;default:if(r instanceof nh)s=new jg(r);else throw Error(`Unexpected content type`)}new Rg(Z(o,um(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},_h=(e,t)=>{e.doc??Km();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},vh=e=>{let t={};return e.doc??Km(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},yh=(e,t)=>{e.doc??Km();let n=e._map.get(t);return n!==void 0&&!n.deleted},bh=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&om(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},xh=e=>(e.doc??Km(),Xf(e._map.entries(),e=>!e[1].deleted)),Sh=class extends Wm{},Ch=class e extends nh{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof nh?e.clone():e)),t}get length(){return this.doc??Km(),this._length}_callObserver(e,t){super._callObserver(e,t),th(this,e,new Sh(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):Em(this.doc,n=>{fh(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):Em(this.doc,t=>{ph(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):Em(this.doc,n=>{mh(n,this,e,t)})}get(e){return lh(this,e)}toArray(){return ih(this)}slice(e=0,t=this.length){return rh(this,e,t)}toJSON(){return this.map(e=>e instanceof nh?e.toJSON():e)}map(e){return sh(this,e)}forEach(e){oh(this,e)}[Symbol.iterator](){return ch(this)}_write(e){e.writeTypeRef(wg)}},wh=e=>new Ch,Th=class extends Wm{constructor(e,t,n){super(e,t),this.keysChanged=n}},Eh=class e extends nh{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof nh?e.clone():e)}),t}_callObserver(e,t){th(this,e,new Th(this,e,t))}toJSON(){this.doc??Km();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof nh?r.toJSON():r}}),e}get size(){return[...xh(this)].length}keys(){return Zf(xh(this),e=>e[0])}values(){return Zf(xh(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Zf(xh(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Km(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):Em(this.doc,t=>{hh(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):Em(this.doc,n=>{gh(n,this,e,t)}),t}get(e){return _h(this,e)}has(e){return yh(this,e)}clear(){this.doc===null?this._prelimContent.clear():Em(this.doc,e=>{this.forEach(function(t,n,r){hh(e,r,n)})})}_write(e){e.writeTypeRef(Tg)}},Dh=e=>new Eh,Oh=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&Nu(e,t),kh=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&Jl(),this.right.content.constructor){case mg:this.right.deleted||Nh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},Ah=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case mg:t.right.deleted||Nh(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&hm(e,Z(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},jh=(e,t,n,r)=>{let i=new Map,a=r?$m(t,n):null;return a?Ah(e,new kh(a.p.left,a.p,a.index,i),n-a.index):Ah(e,new kh(null,t._start,0,i),n)},Mh=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===mg&&Oh(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new Rg(Z(a,um(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new mg(o,r));l.integrate(e,0),n.right=l,n.forward()})},Nh=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},Ph=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===mg&&Oh(t[e.right.content.key]??null,e.right.content.value));)e.forward()},Fh=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!Oh(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new Rg(Z(a,um(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new mg(s,c)),n.right.integrate(e,0),n.forward()}}return o},Ih=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;Ph(n,i);let s=Fh(e,t,n,i),c=r.constructor===String?new xg(r):r instanceof nh?new jg(r):new fg(r),{left:l,right:u,index:d}=n;t._searchMarker&&eh(t._searchMarker,n.index,c.getLength()),u=new Rg(Z(o,um(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),Mh(e,t,n,s)},Lh=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;Ph(n,i);let s=Fh(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===mg));){if(!n.right.deleted)switch(n.right.content.constructor){case mg:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(Oh(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&hm(e,Z(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
4
- `;n.right=new Rg(Z(o,um(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new xg(i)),n.right.integrate(e,0),n.forward()}Mh(e,t,n,s)},Rh=(e,t,n,r,i)=>{let a=t,o=Tc();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===mg){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case mg:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&Nh(i,n);break}}}t=t.right}return s},zh=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===mg){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},Bh=e=>{let t=0;return Em(e.doc,n=>{let r=e._start,i=e._start,a=Tc(),o=Ec(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case mg:Nh(o,i.content);break;default:t+=Rh(n,r,i,a,o),a=Ec(o),r=i;break}i=i.right}}),t},Vh=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&vm(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===mg&&e.constructor!==ig&&t.add(e.parent)})}Em(n,n=>{ep(e,e.deleteSet,e=>{if(e instanceof ig||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===mg?t.add(r):zh(n,e)});for(let e of t)Bh(e)})},Hh=(e,t,n)=>{let r=n,i=Ec(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case jg:case fg:case xg:n<t.right.length&&hm(e,Z(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&Rh(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&eh(o._searchMarker,t.index,-r+n),t},Uh=class extends Wm{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];Em(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},Au(o)||(e.attributes=Eu({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case jg:case fg:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case xg:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case mg:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(Oh(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),Oh(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;Oh(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(Oh(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),Nh(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},Wh=class e extends nh{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Km(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new Uh(this,e,t);th(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Km();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===xg&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):Em(this.doc,n=>{let r=new kh(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
5
- `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&Ih(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&Hh(n,r,a.delete):Lh(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??Km();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(om(s,e)||t!==void 0&&om(s,t))switch(s.content.constructor){case xg:{let r=i.get(`ychange`);e!==void 0&&!om(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!om(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case jg:case fg:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case mg:om(s,e)&&(c(),Nh(i,s.content));break}s=s.right}c()};return e||t?Em(a,n=>{e&&sm(n,e),t&&sm(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):Em(r,r=>{let i=jh(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),Ih(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):Em(r,r=>{let i=jh(r,this,e,!n);Ih(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):Em(n,n=>{Hh(n,jh(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):Em(r,r=>{let i=jh(r,this,e,!1);i.right!==null&&Lh(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):Em(this.doc,t=>{hh(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):Em(this.doc,n=>{gh(n,this,e,t)})}getAttribute(e){return _h(this,e)}getAttributes(){return vh(this)}_write(e){e.writeTypeRef(Eg)}},Gh=e=>new Wh,Kh=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Km()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Yh||t.constructor===qh)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},qh=class e extends nh{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof nh?e.clone():e)),t}get length(){return this.doc??Km(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Kh(this,e)}querySelector(e){e=e.toUpperCase();let t=new Kh(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),Nc(new Kh(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){th(this,e,new Zh(this,t,e))}toString(){return sh(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),oh(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):Em(this.doc,n=>{fh(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)Em(this.doc,n=>{let r=e&&e instanceof nh?e._item:e;uh(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw Kl(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):Em(this.doc,n=>{mh(n,this,e,t)})}toArray(){return ih(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return lh(this,e)}slice(e=0,t=this.length){return rh(this,e,t)}forEach(e){oh(this,e)}_write(e){e.writeTypeRef(Og)}},Jh=e=>new qh,Yh=class e extends qh{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return Ou(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof nh?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):Em(this.doc,t=>{hh(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):Em(this.doc,n=>{gh(n,this,e,t)})}getAttribute(e){return _h(this,e)}hasAttribute(e){return yh(this,e)}getAttributes(e){return e?bh(this,e):vh(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return oh(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Dg),e.writeKey(this.nodeName)}},Xh=e=>new Yh(e.readKey()),Zh=class extends Wm{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},Qh=class e extends Eh{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(kg),e.writeKey(this.hookName)}},$h=e=>new Qh(e.readKey()),eg=class e extends Wh{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Ag)}},tg=e=>new eg,ng=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw ql()}mergeWith(e){return!1}write(e,t,n){throw ql()}integrate(e,t){throw ql()}},rg=0,ig=class extends ng{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),dm(e.doc.store,this)}write(e,t){e.writeInfo(rg),e.writeLen(this.length-t)}getMissing(e,t){return null}},ag=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw ql()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},og=e=>new ag(e.readBuf()),sg=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){ap(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},cg=e=>new sg(e.readLen()),lg=(e,t)=>new fp({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),ug=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(lg(this.doc.guid,this.opts))}splice(e){throw ql()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},dg=e=>new ug(lg(e.readString(),e.readAny())),fg=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw ql()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},pg=e=>new fg(e.readJSON()),mg=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw ql()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},hg=e=>new mg(e.readKey(),e.readJSON()),gg=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},_g=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new gg(n)},vg=Ku(`node_env`)===`development`,yg=class e{constructor(e){this.arr=e,vg&&Fu(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},bg=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new yg(n)},xg=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},Sg=e=>new xg(e.readString()),Cg=[wh,Dh,Gh,Xh,Jh,$h,tg],wg=0,Tg=1,Eg=2,Dg=3,Og=4,kg=5,Ag=6,jg=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw ql()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},Mg=e=>new jg(Cg[e.readTypeRef()](e)),Ng=(e,t)=>{let n=t,r=0,i;do r>0&&(n=Z(n.client,n.clock+r)),i=pm(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof Rg);return{item:i,diff:r}},Pg=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},Fg=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new Rg(Z(r,i+n),t,Z(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=Z(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},Ig=(e,t)=>Fc(e,e=>np(e.deletions,t)),Lg=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return hm(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||Lg(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=hm(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:hm(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:hm(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||np(r,d.right.id)||Ig(a.undoStack,d.right.id)||Ig(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=hm(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=Z(c,um(s,c)),h=new Rg(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,Pg(h,!0),h.integrate(e,0),h},Rg=class e extends ng{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=um(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=um(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Up&&this.id.client!==this.parent.client&&this.parent.clock>=um(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=gm(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=hm(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===ig||this.right&&this.right.constructor===ig)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Up){let e=pm(n,this.parent);e.constructor===ig?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=gm(e,e.doc.store,Z(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),Wp(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(Wp(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(pm(e.doc.store,n.origin)))r.has(pm(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),dm(e.doc.store,this),this.content.integrate(e,this),xm(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new ig(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Z(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Wp(e.origin,this.lastId)&&this.right===e&&Wp(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),ap(e.deleteSet,this.id.client,this.id.clock,this.length),xm(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Jl();this.content.gc(e),t?_m(e,this,new ig(this.id,this.length)):this.content=new sg(this.length)}write(e,t){let n=t>0?Z(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=Gp(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===Up?(e.writeParentInfo(!1),e.writeLeftID(t)):Jl();i!==null&&e.writeString(i)}this.content.write(e,t)}},zg=(e,t)=>Bg[t&31](e),Bg=[()=>{Jl()},cg,_g,og,Sg,pg,hg,Mg,bg,dg,()=>{Jl()}],Vg=10,Hg=class extends ng{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){Jl()}write(e,t){e.writeInfo(Vg),El(e.restEncoder,this.length-t)}getMissing(e,t){return null}},Ug=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},Wg=`__ $YJS$ __`;Ug[Wg]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),Ug[Wg]=!0;var Gg=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},Kg=/[\uD800-\uDBFF]/,qg=/[\uDC00-\uDFFF]/,Jg=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&Kg.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&qg.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Yg=(e,t)=>e>>>t|e<<32-t,Xg=e=>Yg(e,2)^Yg(e,13)^Yg(e,22),Zg=e=>Yg(e,6)^Yg(e,11)^Yg(e,25),Qg=e=>Yg(e,7)^Yg(e,18)^e>>>3,$g=e=>Yg(e,17)^Yg(e,19)^e>>>10,e_=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t_=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n_=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(t_),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=$g(t[e-2])+t[e-7]+Qg(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+Zg(o)+(o&s^~o&c)+e_[e]+t[e]>>>0,d=Xg(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/rl,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},r_=e=>new n_().digest(e),i_=new ke(`y-sync`),a_=new ke(`y-undo`),o_=new ke(`yjs-cursor`),s_=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},c_=e=>Zu(s_(r_($u(e)))),l_=()=>({mapping:new Map,isOMark:new Map}),u_=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!np(t.ds,e.id),d_=[{light:`#ecd44433`,dark:`#ecd444`}],f_=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Ac();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,hu(t))}return e.get(n)},p_=(e,{colors:t=d_,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new __(e,a),c=new At({props:{editable:e=>{let t=i_.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:i_,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(i_);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&Mf(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=a_.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},i_)})}},destroy:()=>{s.destroy()}})});return c},m_=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new Ce(e.doc));else if(t.type===`node`){let r=K_(n.doc,n.type,t.anchor,n.mapping);e.setSelection(h_(e,r))}else{let r=K_(n.doc,n.type,t.anchor,n.mapping),i=K_(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(h.between(e.doc.resolve(r),e.doc.resolve(i)))}},h_=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?bt.create(e.doc,t):h.near(n)},g_=(e,t)=>({type:t.selection.jsonID,anchor:W_(t.selection.anchor,e.type,e.mapping),head:W_(t.selection.head,e.type,e.mapping)}),__=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=Gg(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=g_(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Vu&&this._domSelectionInView===null&&(Mf(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=gf.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=im(op(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(i_,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>y_(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new te(b.from(e),0,0));t.setMeta(i_,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>y_(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new te(b.from(t),0,0));if(e){let t=Hc(Uc(e.anchor,0),n.doc.content.size),r=Hc(Uc(e.head,0),n.doc.content.size);n.setSelection(h.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(i_,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=am(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Jl(),r=new fp({gc:!1}),Dp(r,t),t=am(r),Dp(r,e),e=am(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[fm(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{ep(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:f_(n.colorMapping,n.colors,r)}},s=ah(i,new rm(t.ds,e.sv)).map(n=>!n._item.deleted||u_(n._item,e)||u_(n._item,t)?y_(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new te(b.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(i_,{isChangeOrigin:!0}))},i_)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=i_.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);ep(t,t.deleteSet,e=>{if(e.constructor===Rg){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>v_(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new te(b.from(n),0,0));m_(r,this.beforeTransactionSelection,this),r=r.setMeta(i_,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Am}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{L_(this.doc,this.type,e,this),this.beforeTransactionSelection=g_(this,this.prosemirrorView.state)},i_)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},v_=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof Yh)return y_(e,t,n,r,i,a);throw ql()}return o},y_=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof Yh){let s=v_(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Wh&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=b_(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):ah(e,new rm(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(u_(e._item,r)?u_(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},b_=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,F_(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},x_=(e,t)=>{let n=new eg,r=e.map(e=>({insert:e.text,attributes:I_(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},S_=(e,t)=>{let n=new Yh(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,E_(e).map(e=>C_(e,t))),t.mapping.set(n,e),n},C_=(e,t)=>e instanceof Array?x_(e,t):S_(e,t),w_=e=>typeof e==`object`&&!!e,T_=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||w_(o)&&w_(s)&&T_(o,s)}return r},E_=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},D_=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&Du(e.attributes||{}).length===t[n].marks.length&&ju(e.attributes,(e,r)=>{let i=P_(r),a=t[n].marks;return a.find(e=>e.type.name===i)?T_(e,a.find(e=>e.type.name===i)?.attrs):!1}))},O_=(e,t)=>{if(e instanceof Yh&&!(t instanceof Array)&&R_(e,t)){let n=E_(t);return e._length===n.length&&T_(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>O_(e,n[t]))}return e instanceof eg&&t instanceof Array&&D_(e,t)},k_=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),A_=(e,t,n)=>{let r=e.toArray(),i=E_(t),a=i.length,o=r.length,s=Hc(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(k_(n.mapping.get(e),t))u=!0;else if(!O_(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(k_(n.mapping.get(e),t))u=!0;else if(!O_(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},j_=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof xg?t+=n.content.str:n.content instanceof mg&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},M_=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=j_(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,I_(e.marks,n))})),{insert:o,remove:s,index:c}=Jg(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},N_=/(.*)(--[a-zA-Z0-9+/=]{8})$/,P_=e=>N_.exec(e)?.[1]??e,F_=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(P_(r),e[r]));return n},I_=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=Dc(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${c_(e.toJSON())}`:e.type.name]=e.attrs}}),n},L_=(e,t,n,r)=>{if(t instanceof Yh&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof Yh){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=E_(n),a=i.length,o=t.toArray(),s=o.length,c=Hc(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!k_(r.mapping.get(e),t))if(O_(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!k_(r.mapping.get(e),t))if(O_(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof eg&&c instanceof Array)D_(n,c)||M_(n,c,r),l+=1;else{let i=n instanceof Yh&&R_(n,c),a=d instanceof Yh&&R_(d,f);if(i&&a){let e=A_(n,c,r),t=A_(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(L_(e,n,c,r),l+=1):a?(L_(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[C_(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof eg?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(C_(i[t],r));t.insert(l,e)}},i_)},R_=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,z_=null,B_=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=i_.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},V_=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=z_;z_=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new B_(t,r,e))})}),new e(n)}},H_=(e=V_.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||Mf(0,()=>H_(e,!0));return}throw r}n=!1,e.dequeueFirst()}},U_=(e,t,n)=>{z_||(z_=new Map,Mf(0,H_)),Dc(z_,e,Tc).set(t,n)},W_=(e,t,n)=>{if(e===0)return $p(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof eg){if(r._length>=e)return $p(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new qp(r._item===null?null:r._item.id,r._item===null?Gp(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new qp(r._item===null?null:r._item.id,r._item===null?Gp(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Jl();if(e===0&&r.constructor!==eg&&r!==t)return G_(r._item.parent,r._item)}return $p(t,t._length,-1)},G_=(e,t)=>{let n=null,r=null;return e._item===null?r=Gp(e):n=Z(e._item.id.client,e._item.id.clock),new qp(n,r,t.id)},K_=(e,t,n,r)=>{let i=tm(n,e);if(i===null||i.type!==t&&!Kp(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===eg)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof eg?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof eg?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},q_=(e,t)=>{let n=l_(),r=e.toArray().map(e=>y_(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,b.fromArray(r)),meta:n,mapping:n.mapping}},J_=(e,t,n)=>e!==t,Y_=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},X_=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Z_=/^#[0-9a-fA-F]{6}$/,Q_=(e,t,n,r,i)=>{let a=i_.getState(e);if(a==null||a.doc==null||a.binding==null)return We.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?We.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:Z_.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=K_(o,a.type,Yp(t.cursor.anchor),a.binding.mapping),u=K_(o,a.type,Yp(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Uc(e.doc.content.size-1,0);l=Hc(l,t),u=Hc(u,t),s.push(tt.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Hc(l,u),o=Uc(l,u);s.push(tt.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),We.create(e.doc,s))},$_=(e,{awarenessStateFilter:t=J_,cursorBuilder:n=Y_,selectionBuilder:r=X_,getSelection:i=e=>e.selection}={},a=`cursor`)=>new At({key:o_,state:{init(i,a){return Q_(a,e,t,n,r)},apply(i,a,o,s){let c=i_.getState(s),l=i.getMeta(o_);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Q_(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>o_.getState(e)},view:t=>{let n=()=>{t.docView&&U_(t,o_,{awarenessUpdated:!0})},r=()=>{let n=i_.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=W_(o.anchor,n.type,n.binding.mapping),c=W_(o.head,n.type,n.binding.mapping);(r.cursor==null||!nm(Yp(r.cursor.anchor),s)||!nm(Yp(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&K_(n.doc,n.type,Yp(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),ev=e=>{let t=a_.getState(e).undoManager;if(t!=null)return t.undo(),!0},tv=e=>{let t=a_.getState(e).undoManager;if(t!=null)return t.redo(),!0},nv=new Set([`paragraph`]),rv=(e,t)=>!(e instanceof Rg)||!(e.content instanceof jg)||!(e.content.type instanceof Wh||e.content.type instanceof Yh&&t.has(e.content.type.nodeName))||e.content.type._length===0,iv=({protectedNodes:e=nv,trackedOrigins:t=[],undoManager:n=null}={})=>new At({key:a_,state:{init:(r,i)=>{let a=i_.getState(i),o=n||new Am(a.type,{trackedOrigins:new Set([i_].concat(t)),deleteFilter:t=>rv(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=i_.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:g_(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=i_.getState(e.state),n=a_.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,a_.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}});function av(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=ft(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function ov(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
6
- `);return/\s/.test(n)}):!1}var sv=new ke(`suggestion`);function cv({pluginKey:e=sv,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:h=av,shouldShow:g,shouldResetDismissed:_}){let v,y=p?.(),b=r&&!i,x=()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=t.view.coordsAtPos(e);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}},S=(n,r)=>r?()=>{let r=e.getState(t.state)?.decorationId;return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect()||null}:x,C=({match:e,dismissedRange:n,state:r,transaction:i})=>_?.({editor:t,state:r,range:n,match:e,transaction:i,allowSpaces:b})?!1:b?e.range.from===n.from:e.range.from===n.from&&!ov(i);function w(n,r){var i;try{let r=e.getState(n.state),a=r?.decorationId?n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`):null,o={editor:t,range:r?.range||{from:0,to:0},query:r?.query||null,text:r?.text||null,items:[],command:e=>d({editor:t,range:r?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:S(n,a)};(i=y?.onExit)==null||i.call(y,o)}catch{}let a=n.state.tr.setMeta(r,{exit:!0});n.dispatch(a)}let T=new At({key:e,view(){return{update:async(e,n)=>{var r,i,a,o,s;let c=this.key?.getState(n),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,p=!c.active&&l.active,m=c.active&&!l.active,h=!p&&!m&&c.query!==l.query,g=p||u&&h,_=h||u,b=m||u&&h;if(!g&&!_&&!b)return;let x=b&&!g?c:l,C=e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);v={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:e=>d({editor:t,range:x.range,props:e}),decorationNode:C,clientRect:S(e,C)},g&&((r=y?.onBeforeStart)==null||r.call(y,v)),_&&((i=y?.onBeforeUpdate)==null||i.call(y,v)),(_||g)&&(v.items=await f({editor:t,query:x.query})),b&&((a=y?.onExit)==null||a.call(y,v)),_&&((o=y?.onUpdate)==null||o.call(y,v)),g&&((s=y?.onStart)==null||s.call(y,v))},destroy:()=>{var e;v&&((e=y?.onExit)==null||e.call(y,v))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(s,c,l,u){let{isEditable:d}=t,{composing:f}=t.view,{selection:p}=s,{empty:_,from:v}=p,y={...c},b=s.getMeta(e);if(b&&b.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=c.active?{...c.range}:c.dismissedRange,y;if(y.composing=f,s.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:s.mapping.map(y.dismissedRange.from),to:s.mapping.map(y.dismissedRange.to)}),d&&(_||t.view.composing)){(v<c.range.from||v>c.range.to)&&!f&&!c.composing&&(y.active=!1);let e=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:p.$from}),l=`id_${Math.floor(Math.random()*4294967295)}`;e&&m({editor:t,state:u,range:e.range,isActive:c.active})&&(!g||g({editor:t,range:e.range,query:e.query,text:e.text,transaction:s}))?(y.dismissedRange!==null&&!C({match:e,dismissedRange:y.dismissedRange,state:u,transaction:s})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=c.decorationId?c.decorationId:l,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1):(e||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(t,n){var r;let{active:i,range:a}=T.getState(t.state);if(!i)return!1;if(n.key===`Escape`||n.key===`Esc`){let i=T.getState(t.state);return(r=y?.onKeyDown)==null||r.call(y,{view:t,event:n,range:i.range}),w(t,e),!0}return(y?.onKeyDown)?.call(y,{view:t,event:n,range:a})||!1},decorations(e){let{active:t,range:n,decorationId:r,query:i}=T.getState(e);if(!t)return null;let a=!i?.length,o=[c];return a&&o.push(u),We.create(e.doc,[tt.inline(n.from,n.to,{nodeName:s,class:o.join(` `),"data-decoration-id":r,"data-decoration-content":l})])}}});return T}var lv=cv;function uv(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function dv(e){if(e.kind===`create`)return`Create new tag #${e.value}`;let t=e.count===1?`1 use`:`${e.count} uses`;return`Tag #${e.value}, ${t}`}function fv(e){let t=(0,J.c)(32),{items:n,query:r,selectedIndex:i,onSelect:a,onHover:o,loading:s,error:c}=e,l=s===void 0?!1:s,u=c===void 0?null:c,d=(0,q.useRef)(null),f=(0,q.useId)(),p=i>=0&&i<n.length?`${f}-option-${i}`:void 0,m,h;t[0]===i?(m=t[1],h=t[2]):(m=()=>{let e=d.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},h=[i],t[0]=i,t[1]=m,t[2]=h),(0,q.useEffect)(m,h);let g=pv;if(l){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`div`,{ref:d,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:{maxHeight:`var(--suggestion-menu-max-height, 40vh)`},onMouseDown:g,children:`Loading tags…`}),t[3]=e):e=t[3],e}if(n.length===0){let e;t[4]===r?e=t[5]:(e=r.trim(),t[4]=r,t[5]=e);let n=e,i=u??(n?`No tags match "${n}". Continue typing to create one.`:`No tags yet. Continue typing to create one.`),a;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[6]=a):a=t[6];let o;return t[7]===i?o=t[8]:(o=(0,K.jsx)(`div`,{ref:d,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:a,onMouseDown:g,children:i}),t[7]=i,t[8]=o),o}let _=i>=0&&i<n.length?n[i]:null,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=v):v=t[9];let y;t[10]===_?y=t[11]:(y=_?dv(_):``,t[10]=_,t[11]=y);let b;t[12]===y?b=t[13]:(b=(0,K.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:y}),t[12]=y,t[13]=b);let x;t[14]===u?x=t[15]:(x=u&&(0,K.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:u}),t[14]=u,t[15]=x);let S;if(t[16]!==n||t[17]!==f||t[18]!==o||t[19]!==a||t[20]!==i){let e;t[22]!==f||t[23]!==o||t[24]!==a||t[25]!==i?(e=(e,t)=>{let n=t===i,r=uv(e),s=e.kind===`create`;return(0,K.jsxs)(`button`,{id:`${f}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":s?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},onPointerMove:o?()=>o(t):void 0,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,K.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),s?(0,K.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:`New`}):(0,K.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[22]=f,t[23]=o,t[24]=a,t[25]=i,t[26]=e):e=t[26],S=n.map(e),t[16]=n,t[17]=f,t[18]=o,t[19]=a,t[20]=i,t[21]=S}else S=t[21];let C;return t[27]!==p||t[28]!==b||t[29]!==x||t[30]!==S?(C=(0,K.jsxs)(`div`,{ref:d,role:`listbox`,"aria-label":`Tag suggestions`,"aria-activedescendant":p,tabIndex:-1,onMouseDown:g,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:v,children:[b,x,S]}),t[27]=p,t[28]=b,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function pv(e){return e.preventDefault()}function mv(e,t){let n=document.createElement(`div`);n.style.position=`fixed`,n.style.zIndex=`50`,n.style.visibility=`hidden`,document.body.appendChild(n);let r={getBoundingClientRect:()=>e()?.clientRect?.()??new DOMRect,get contextElement(){return e()?.editor.view.dom}},i=!1,a=!1,o=()=>{n.isConnected&&(n.style.removeProperty(`--suggestion-menu-max-height`),Ye(r,n,{placement:`bottom-start`,middleware:[B(4),c(),re({padding:8}),S({apply({availableHeight:e}){n.isConnected&&n.style.setProperty(`--suggestion-menu-max-height`,`${Math.min(e,window.innerHeight*.4)}px`)}})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`,i&&!a&&(n.style.removeProperty(`visibility`),a=!0))}).catch(e=>{n.isConnected&&console.warn(`[${t}] computePosition failed`,e)}))};return{popup:n,doPosition:o,startAutoUpdate:()=>U(r,n,o),reveal:()=>{a||(i=!0,o())}}}function hv(e){e.stopAutoUpdate?.(),e.stopAutoUpdate=null,e.popup?.remove(),e.popup=null}var gv=new ke(`tagSuggestion`),_v=8,vv=/^[a-zA-Z][\w/-]*$/;async function yv(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function bv(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function xv(e,t){let n=bv(e,t).slice(0,_v).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&vv.test(r)&&!e.some(e=>e.name===r)&&n.unshift({kind:`create`,value:r}),n}function Sv(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function Cv(e){let t=[],n=!1,r=null,i=null;return lv({editor:e,pluginKey:gv,char:`#`,allowedPrefixes:null,findSuggestionMatch:Sv,items:async({query:e})=>{if(!n){r||=yv();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return xv(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!vv.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=mv(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new vc(fv,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&vv.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){hv(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}async function wv(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:Oe(n)??t}}function Tv(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}H({event:R(`ok-branch-switched-clear-failed`),branch:ie(),docName:ie(),reason:ie()});async function Ev(e,t){let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}function Dv(e){let t=!1;return()=>{t?e():t=!0}}function Ov(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function kv(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=ae.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&Ev(e,i.data.currentBranch),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Ov(n)}catch{}e.observeDiskAckBatch(t)}}async function Av(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0}}}function jv(e){return zv(e,ye)}function Mv(e){return zv(e,be)}function Nv(e){return zv(e,F)}function Pv(e){return zv(e,N)}function Fv(e){return zv(e,lt)}function Iv(e){let t=zv(e,ve);if(!t)return null;try{return{docName:t.docName,sv:Lv(t.sv)}}catch{return null}}function Lv(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Rv(e,t){let n=Mv(e);if(n){t.onServerInfo?.(n);return}let r=Nv(e);if(r){t.onBranchSwitched?.(r);return}let i=Iv(e);if(i){t.onDiskAck?.(i);return}let a=jv(e);if(a){t.onDerivedView?.(a);return}let o=Pv(e);if(o){t.onConfigValidationRejected?.(o);return}let s=Fv(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function zv(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function Bv(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function Vv(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function Hv(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var Uv=2e3,Wv=15e3;function Gv(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??Uv,r=e.maxDelayMs??Wv,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function Kv(){let e=(0,J.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,q.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,q.useRef)(i),[o,s]=(0,q.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=Vv(typeof window<`u`?window:void 0);if(t){r(Hv(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(Hv(t))});return()=>{n()}}let n=Gv({fetchConfig:Av,fallbackUrl:Bv,now:Date.now,setTimeout:Xv,clearTimeout:Yv,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let l;e[3]===o?l=e[4]:(l=[o],e[3]=o,e[4]=l),(0,q.useEffect)(c,l);let u;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a.current.token=a.current.token+1,r(Jv),s(qv)},e[5]=u):u=e[5];let d=u,f;return e[6]===n?f=e[7]:(f={...n,retry:d},e[6]=n,e[7]=f),f}function qv(e){return e+1}function Jv(e){return{...e,terminal:!1,lastError:null}}function Yv(e){return globalThis.clearTimeout(e)}function Xv(e,t){return globalThis.setTimeout(e,t)}function Zv(e,t){return t}var Qv=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}},$v=3e4,ey=class extends Error{docName;elapsedMs;constructor(e,t){super(`Mount timed out for "${e}" after ${t}ms`),this.name=`MountTimeoutError`,this.docName=e,this.elapsedMs=t}};function ty(e){e.timeoutHandle!==null&&(clearTimeout(e.timeoutHandle),e.timeoutHandle=null)}var ny=new Map;function ry(e){let{docName:t,construct:n,sizeStats:r}=e,i=ny.get(t);if(i)return i.promise;let a=new AbortController,o=Date.now(),s=()=>{},c=()=>{},l=new Promise((e,t)=>{s=e,c=t}),u={promise:l,rejectFn:c,controller:a,createdAt:o,settled:!1,resolved:!1,preMountEditor:null,timeoutHandle:null};return u.timeoutHandle=setTimeout(()=>{if(u.settled)return;u.settled=!0;let e=Date.now()-u.createdAt;u.controller.abort(),u.preMountEditor&&=(oy(t,u.preMountEditor,`timeout`),null),ny.delete(t),Y(`ok/mount/reject`,{docName:t,reason:`timeout`,elapsedMs:e}),c(new ey(t,e))},$v),ny.set(t,u),Y(`ok/mount/create`,{docName:t}),sy({docName:t,construct:n,sizeStats:r,entry:u,resolveFn:s,rejectFn:c}).catch(e=>{if(u.preMountEditor&&=(oy(t,u.preMountEditor,`backstop`),null),u.settled){Y(`ok/mount/post-settle-throw`,{docName:t,message:e instanceof Error?e.message:String(e)});return}u.settled=!0,ty(u);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,reason:`unhandled-body-throw`}),c(n)}),l}function iy(e){return ny.get(e)?.resolved===!0}function ay(e){let t=ny.get(e);if(!t)return;let n=t.settled;t.settled=!0,ty(t),t.controller.abort(),ny.delete(e),Y(`ok/mount/invalidate`,{docName:e}),n||t.rejectFn(new Qv(e))}function oy(e,t,n){let r=cy(t);try{t.destroy()}catch(t){Y(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function sy(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(Iy(t)!==void 0){let e=by({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,ty(i),Y(`ok/mount/cache-hit`,{docName:t}),a(e);return}let c=null;try{c=n()}catch(e){i.settled=!0,ty(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,reason:`construct-failed`}),o(n);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){oy(t,c.editor,`aborted`),i.preMountEditor=null,i.settled=!0,ty(i);let e=new Qv(t);Y(`ok/mount/reject`,{docName:t,reason:`aborted`}),o(e);return}try{c.editor.mount(s)}catch(e){oy(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,ty(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,reason:`mount-failed`}),o(n);return}let l;try{l=by({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){oy(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,ty(i);let n=e instanceof Error?e:Error(String(e));Y(`ok/mount/reject`,{docName:t,reason:`v2-register-failed`}),o(n);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,ty(i),Y(`ok/mount/resolve`,{docName:t,elapsedMs:Date.now()-i.createdAt}),a(l)}function cy(e){try{let t=e.state;return a_.getState(t)?.undoManager??null}catch(e){return Y(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var ly=Zv(`MAX_CACHE`,10),uy=Zv(`VIEW_COUNT_CACHE_THRESHOLD`,50),dy=Zv(`BYTES_CACHE_THRESHOLD`,8e6);function fy(e){return!(e.viewCount>0&&e.viewCount>=uy||e.bytes>dy)}var py=new Map,my=new Map,hy=[],gy=[],_y=new Set,vy=null;function yy(){if(vy)return vy;if(typeof document>`u`||typeof document.createElement!=`function`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,vy=e,e}function by(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!fy(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=py.get(t);if(a){if(Y(`ok/cache/reparent-start`,{docName:t,kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Oy(a,n),a.activeMountKey=t,Ay(hy,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.editor.commands.focus()}catch{}return Y(`ok/cache/reparent-end`,{docName:t,kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Y(`ok/cache/hit`,{docName:t,kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;py.size>=ly;){let e=jy(hy,t);if(!e)break;Sy(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return py.set(t,s),Ay(hy,t),Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function xy(e){let t=e.activeMountKey;if(e.__uncached){t&&ay(t);let n=cy(e.editor);try{e.editor.destroy()}catch(e){Y(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=Ey(e.editor);if(n){e.hadFocus=Dy(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom);let r=yy();r&&r.appendChild(n.dom)}e.activeMountKey=null}function Sy(e){ay(e);let t=py.get(e);if(!t)return!1;let n=cy(t.editor);try{t.editor.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}py.delete(e);let r=hy.indexOf(e);return r!==-1&&hy.splice(r,1),Y(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function Cy(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!fy(i)){let e=r(n);return Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,__uncached:!0}}let a=my.get(t);if(a){if(Y(`ok/cache/reparent-start`,{docName:t,kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),ky(a,n),a.activeMountKey=t,Ay(gy,t),n.scrollTop=a.scrollTop,a.hadFocus)try{a.view.focus()}catch{}return Y(`ok/cache/reparent-end`,{docName:t,kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Y(`ok/cache/hit`,{docName:t,kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;my.size>=ly;){let e=jy(gy,t);if(!e)break;Ty(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t};return my.set(t,s),Ay(gy,t),Y(`ok/cache/miss`,{docName:t,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&Y(`ok/cold/editor-mount-stats`,{docName:t,viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function wy(e){if(e.__uncached){try{e.view.destroy()}catch(t){Y(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=Dy(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t);let r=yy();r&&r.appendChild(t),e.activeMountKey=null}function Ty(e){let t=my.get(e);if(!t)return!1;try{t.view.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){Y(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}my.delete(e);let n=gy.indexOf(e);return n!==-1&&gy.splice(n,1),Y(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function Ey(e){return e.editorView??null}function Dy(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function Oy(e,t){let n=Ey(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function ky(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function Ay(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function jy(e,t){for(let n of e)if(n!==t&&!_y.has(n))return n;Y(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:_y.size});for(let n of e)if(n!==t)return n;return null}function My(e){let t=_y,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=Py(e);if(t)try{t.disconnect(),Y(`ok/cache/disconnect`,{docName:e})}catch(t){Y(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=Py(e);if(!n)continue;let r=t=>{Y(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>Y(`ok/cache/connect`,{docName:e}),e=>r(e)):Y(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}_y=n}var Ny=null;function Py(e){let t=py.get(e);if(t)return t.provider;let n=my.get(e);if(n)return n.provider;if(Ny){let t=Ny.entries.get(e);if(t)return t.provider}return null}function Fy(e){Ny=e;let t=e.onEvict(e=>{Sy(e),Ty(e)});return()=>{t(),Ny===e&&(Ny=null)}}function Iy(e){return py.get(e)}var Ly=`ok-editor-tabs-v1:`,Ry=`\0folder:`;function zy(e){return typeof e!=`string`||e.length===0?!1:e.startsWith(Ry)?e.length>8:!0}function By(e){return e}function Vy(e){return`${Ry}${e}`}function Hy(e){switch(e.kind){case`doc`:case`folder-index`:return By(e.docName);case`folder`:return Vy(e.folderPath);case`missing`:return By(e.target);case`asset`:return null}}function Uy(e){return e.startsWith(Ry)?{kind:`folder`,folderPath:e.slice(8)}:{kind:`doc`,docName:e}}function Wy(e){let t=Uy(e);return t.kind===`doc`?t.docName:null}function Gy(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(zy(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function Ky(e,t,n){let r=Gy(e,n);if(!zy(t)||r.includes(t))return r;let i=[...r,t];return i.length>n?i.slice(i.length-n):i}function qy(e,t){return e.filter(e=>e!==t)}function Jy(e,{pages:t,folderPaths:n,keepMissingDocName:r=null}){return Gy(e,2**53-1).filter(e=>{let i=Uy(e);return i.kind===`folder`?n.has(i.folderPath):t.has(i.docName)||i.docName===r})}function Yy(e,t,n,r=[]){if(t.length===0&&r.length===0)return Gy(e,n);let i=new Map(t.map(e=>[e.fromDocName,e.toDocName])),a=[],o=new Set;for(let t of e){let e=Uy(t),s=e.kind===`doc`?i.get(e.docName)??t:Vy(Xy(e.folderPath,r));if(!o.has(s)&&(o.add(s),a.push(s),a.length>=n))break}return a}function Xy(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function Zy(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function Qy(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function $y(e,t){if(typeof e!=`object`||!e)return{openTabs:[],activeDocName:null,activeTabId:null,updatedAt:null};let n=e,r=Gy(n.openTabs,t),i=typeof n.activeTabId==`string`&&r.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&r.includes(n.activeDocName)?n.activeDocName:null,a=i?Uy(i):null;return{openTabs:r,activeDocName:a?.kind===`doc`?a.docName:null,activeTabId:i,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function eb(e,t,n=()=>new Date){let r=Gy(e,2**53-1),i=t&&r.includes(t)?t:null,a=i?Uy(i):null;return{openTabs:r,activeDocName:a?.kind===`doc`?a.docName:null,activeTabId:i,updatedAt:n().toISOString()}}function tb(e){return`${Ly}${e}`}function nb(e,t,n){if(!e)return{openTabs:[],activeDocName:null,activeTabId:null,updatedAt:null};try{let r=e.getItem(t);return r?$y(JSON.parse(r),n):{openTabs:[],activeDocName:null,activeTabId:null,updatedAt:null}}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),{openTabs:[],activeDocName:null,activeTabId:null,updatedAt:null}}}function rb(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}var ib=Math.floor,ab=(e,t)=>e<t?e:t,ob=(e,t)=>e>t?e:t;Number.isNaN;var sb=128,cb=1<<17,lb=1<<18,ub=1<<19,db=1<<20,fb=1<<21,pb=1<<22,mb=1<<23,hb=1<<24,gb=1<<25,_b=1<<26,vb=1<<27,yb=1<<28,bb=1<<29,xb=1<<30,Sb=127;cb-1,lb-1,ub-1,db-1,fb-1,pb-1,mb-1,hb-1,gb-1,_b-1,vb-1,yb-1,bb-1,xb-1;var Cb=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var wb=String.fromCharCode;String.fromCodePoint,wb(65535);var Tb=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Eb=typeof TextEncoder<`u`?new TextEncoder:null,Db=Eb?e=>Eb.encode(e):Tb,Ob=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Ob&&Ob.decode(new Uint8Array).length===1&&(Ob=null);var kb=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Ab=(e,t)=>{for(;t>Sb;)kb(e,sb|Sb&t),t=ib(t/128);kb(e,Sb&t)},jb=new Uint8Array(3e4),Mb=jb.length/3,Nb=Eb&&Eb.encodeInto?(e,t)=>{if(t.length<Mb){let n=Eb.encodeInto(t,jb).written||0;Ab(e,n);for(let t=0;t<n;t++)kb(e,jb[t])}else Fb(e,Db(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Ab(e,r);for(let t=0;t<r;t++)kb(e,n.codePointAt(t))},Pb=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=ab(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(ob(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Fb=(e,t)=>{Ab(e,t.byteLength),Pb(e,t)},Ib=e=>Error(e),Lb=Ib(`Unexpected end of array`),Rb=Ib(`Integer out of Range`),zb=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Bb=e=>zb(e,Hb(e)),Vb=e=>e.arr[e.pos++],Hb=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&Sb)*n,n*=128,r<sb)return t;if(t>Cb)throw Rb}throw Lb},Ub=Ob?e=>Ob.decode(Bb(e)):e=>{let t=Hb(e);if(t===0)return``;{let n=String.fromCodePoint(Vb(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Vb(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Wb=function(e){return e[e.Token=0]=`Token`,e[e.PermissionDenied=1]=`PermissionDenied`,e[e.Authenticated=2]=`Authenticated`,e}({}),Gb=(e,t)=>{Ab(e,Wb.Token),Nb(e,t)},Kb=(e,t,n,r)=>{switch(Hb(e)){case Wb.Token:t();break;case Wb.PermissionDenied:n(Ub(e));break;case Wb.Authenticated:r(Ub(e));break;default:}},qb=e=>Array.from(e.entries()).map(([e,t])=>({clientId:e,...t})),Jb=`\0`;function Yb(e,t){return e+Jb+t}function Xb(e){let t=e.indexOf(Jb);return t===-1?{documentName:e,sessionId:null}:{documentName:e.substring(0,t),sessionId:e.substring(t+1)}}var Zb=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Open=1]=`Open`,e[e.Closing=2]=`Closing`,e[e.Closed=3]=`Closed`,e}({});function Qb(e){return e||={},{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function $b(e){return new Promise(t=>setTimeout(t,e))}function ex(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=t.factor**(e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);n=Math.floor(Math.random()*(Math.floor(n)-e+1))+e}return Math.round(n)}async function tx(e,t){let n=Qb(t);for(let e of[`delay`,`initialDelay`,`minDelay`,`maxDelay`,`maxAttempts`,`timeout`]){let t=n[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw Error(`Value for factor must be a number greater than or equal to 0`);if(n.delay<n.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);let r={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){r.aborted=!0}},i=n.calculateDelay||ex;async function a(){if(n.beforeAttempt&&n.beforeAttempt(r,n),r.aborted){let e=Error(`Attempt aborted`);throw e.code=`ATTEMPT_ABORTED`,e}let t=async e=>{if(n.handleError&&await n.handleError(e,r,n),r.aborted||r.attemptsRemaining===0)throw e;r.attemptNum++;let t=i(r,n);return t&&await $b(t),a()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((i,a)=>{let o=setTimeout(()=>{if(n.handleTimeout)try{i(n.handleTimeout(r,n))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);e.code=`ATTEMPT_TIMEOUT`,a(e)}},n.timeout);e(r,n).then(e=>{clearTimeout(o),i(e)}).catch(e=>{clearTimeout(o),t(e).then(i).catch(a)})}):e(r,n).catch(t)}let o=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(o&&await $b(o),r.attemptNum<1&&n.initialJitter){let e=i(r,n);e&&await $b(e)}return a()}var nx=Math.floor,rx=(e,t)=>e<t?e:t,ix=(e,t)=>e>t?e:t;Number.isNaN;var ax=64,ox=128,sx=1<<17,cx=1<<18,lx=1<<19,ux=1<<20,dx=1<<21,fx=1<<22,px=1<<23,mx=1<<24,hx=1<<25,gx=1<<26,_x=1<<27,vx=1<<28,yx=1<<29,bx=1<<30,xx=63,Sx=127;sx-1,cx-1,lx-1,ux-1,dx-1,fx-1,px-1,mx-1,hx-1,gx-1,_x-1,vx-1,yx-1,bx-1;var Cx=2**53-1;Number.isInteger,Number.isNaN,Number.parseInt;var wx=()=>new Set,Tx=Array.from;Array.isArray;var Ex=String.fromCharCode;String.fromCodePoint,Ex(65535);var Dx=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Ox=typeof TextEncoder<`u`?new TextEncoder:null,kx=Ox?e=>Ox.encode(e):Dx,Ax=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});Ax&&Ax.decode(new Uint8Array).length===1&&(Ax=null);var jx=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Mx=()=>new jx,Nx=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},Px=e=>{let t=new Uint8Array(Nx(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Fx=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Ix=(e,t)=>{for(;t>Sx;)Fx(e,ox|Sx&t),t=nx(t/128);Fx(e,Sx&t)},Lx=new Uint8Array(3e4),Rx=Lx.length/3,zx=Ox&&Ox.encodeInto?(e,t)=>{if(t.length<Rx){let n=Ox.encodeInto(t,Lx).written||0;Ix(e,n);for(let t=0;t<n;t++)Fx(e,Lx[t])}else Vx(e,kx(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Ix(e,r);for(let t=0;t<r;t++)Fx(e,n.codePointAt(t))},Bx=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=rx(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(ix(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Vx=(e,t)=>{Ix(e,t.byteLength),Bx(e,t)},Hx=e=>Error(e),Ux=Hx(`Unexpected end of array`),Wx=Hx(`Integer out of Range`),Gx=class{constructor(e){this.arr=e,this.pos=0}},Kx=e=>new Gx(e),qx=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},Jx=e=>qx(e,Xx(e)),Yx=e=>e.arr[e.pos++],Xx=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&Sx)*n,n*=128,r<ox)return t;if(t>Cx)throw Wx}throw Ux},Zx=e=>{let t=e.arr[e.pos++],n=t&xx,r=64,i=(t&ax)>0?-1:1;if((t&ox)===0)return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&Sx)*r,r*=128,t<ox)return i*n;if(n>Cx)throw Wx}throw Ux},Qx=Ax?e=>Ax.decode(Jx(e)):e=>{let t=Xx(e);if(t===0)return``;{let n=String.fromCodePoint(Yx(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Yx(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},$x=e=>{let t=e.pos,n=Qx(e);return e.pos=t,n},eS=Date.now,tS=()=>new Map,nS=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},rS=class{constructor(){this._observers=tS()}on(e,t){nS(this._observers,e,wx).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Tx((this._observers.get(e)||tS()).values()).forEach(e=>e(...t))}destroy(){this._observers=tS()}},iS=Symbol(`Equality`),aS=Object.keys,oS=e=>aS(e).length,sS=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),cS=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[iS]!=null)return e[iS](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!cS(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(oS(e)!==oS(t))return!1;for(let n in e)if(!sS(e,n)||!cS(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!cS(e[n],t[n]))return!1;break;default:return!1}return!0},lS=3e4,uS=class extends rS{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=eS();this.getLocalState()!==null&&lS/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&lS<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&dS(this,t,`timeout`)},nx(lS/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:eS()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),cS(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},dS=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:eS()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},fS=(e,t,n=e.states)=>{let r=t.length,i=Mx();Ix(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;Ix(i,r),Ix(i,s),zx(i,JSON.stringify(o))}return Px(i)},pS=(e,t,n)=>{let r=Kx(t),i=eS(),a=[],o=[],s=[],c=[],l=Xx(r);for(let t=0;t<l;t++){let t=Xx(r),n=Xx(r),l=JSON.parse(Qx(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(cS(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},mS=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}},hS=class{constructor(e){this.data=e,this.encoder=Mx(),this.decoder=Kx(new Uint8Array(this.data))}peekVarString(){return $x(this.decoder)}readVarUint(){return Xx(this.decoder)}readVarString(){return Qx(this.decoder)}readVarUint8Array(){return Jx(this.decoder)}writeVarUint(e){return Ix(this.encoder,e)}writeVarString(e){return zx(this.encoder,e)}writeVarUint8Array(e){return Vx(this.encoder,e)}length(){return Nx(this.encoder)}},gS=function(e){return e[e.Sync=0]=`Sync`,e[e.Awareness=1]=`Awareness`,e[e.Auth=2]=`Auth`,e[e.QueryAwareness=3]=`QueryAwareness`,e[e.Stateless=5]=`Stateless`,e[e.CLOSE=7]=`CLOSE`,e[e.SyncStatus=8]=`SyncStatus`,e[e.Ping=9]=`Ping`,e[e.Pong=10]=`Pong`,e}({}),_S=function(e){return e.Connecting=`connecting`,e.Connected=`connected`,e.Disconnected=`disconnected`,e}({}),vS=class{constructor(){this.encoder=Mx()}get(e){return e.encoder}toUint8Array(){return Px(this.encoder)}},yS=class extends vS{constructor(...e){super(...e),this.type=gS.CLOSE,this.description=`Ask the server to close the connection`}get(e){return zx(this.encoder,e.documentName),Ix(this.encoder,this.type),this.encoder}},bS=class e extends mS{static{this.DEDUPLICATABLE_TYPES=new Set([gS.Awareness,gS.QueryAwareness])}constructor(e){super(),this.messageQueue=[],this.configuration={url:``,autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=_S.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on(`open`,this.configuration.onOpen),this.on(`open`,this.onOpen.bind(this)),this.on(`connect`,this.configuration.onConnect),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`status`,this.configuration.onStatus),this.on(`disconnect`,this.configuration.onDisconnect),this.on(`close`,this.configuration.onClose),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`close`,this.onClose.bind(this)),this.on(`message`,this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=_S.Connected,this.emit(`status`,{status:_S.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){let t=e.effectiveName,n=this.configuration.providerMap.get(t);if(n&&n!==e&&n.isAuthenticated)throw Error(`Cannot attach two providers with the same effective name "${t}". Use sessionAwareness: true to multiplex providers with the same document name.`);this.configuration.providerMap.set(t,e),this.status===_S.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===_S.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){let t=e.effectiveName;this.configuration.providerMap.has(t)&&(e.send(yS,{documentName:t}),this.configuration.providerMap.delete(t))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===_S.Connected)return;this.cancelWebsocketRetry&&=(this.cancelWebsocketRetry(),void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;let{retryPromise:e,cancelFunc:t}=(()=>{let e=!1;return{retryPromise:tx(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:t=>{(!this.shouldConnect||e)&&t.abort()}}).catch(e=>{if(e&&e.code!==`ATTEMPT_ABORTED`)throw e}),cancelFunc:()=>{e=!0}}})();return this.cancelWebsocketRetry=t,e}attachWebSocketListeners(e,t){let{identifier:n}=e,r=e=>this.emit(`message`,e),i=e=>this.emit(`close`,{event:e}),a=e=>this.emit(`open`,e),o=e=>{t(e)};this.webSocketHandlers[n]={message:r,close:i,open:a,error:o};let s=this.webSocketHandlers[e.identifier];Object.keys(s).forEach(t=>{e.addEventListener(t,s[t])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(n=>{this.webSocket?.removeEventListener(n,t[n]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let n=new this.configuration.WebSocketPolyfill(this.url);n.binaryType=`arraybuffer`,n.identifier=this.identifier,this.attachWebSocketListeners(n,t),this.webSocket=n,this.status=_S.Connecting,this.emit(`status`,{status:_S.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){this.resolveConnectionAttempt(),this.lastMessageReceived=eS();let t=new Uint8Array(e.data);if(t.length===1&&t[0]===gS.Ping){this.sendPong();return}let n=new hS(t).peekVarString();this.configuration.providerMap.get(n)?.onMessage(e)}sendPong(){let e=Mx();Ix(e,gS.Pong),this.send(Px(e))}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=_S.Connected,this.emit(`status`,{status:_S.Connected}),this.emit(`connect`),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){this.connectionAttempt?.reject(),this.connectionAttempt=null}checkConnection(){this.status===_S.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=eS()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:`forced`}}),this.closeTries=0):(this.webSocket?.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]===`/`;)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}parseQueuedMessage(e){try{let t=Kx(e);return{documentName:Qx(t),messageType:Xx(t)}}catch{return null}}addToQueue(t){if(t instanceof Uint8Array){let n=this.parseQueuedMessage(t);n&&e.DEDUPLICATABLE_TYPES.has(n.messageType)&&(this.messageQueue=this.messageQueue.filter(e=>{if(!(e instanceof Uint8Array))return!0;let t=this.parseQueuedMessage(e);return t?!(t.documentName===n.documentName&&t.messageType===n.messageType):!0}))}this.messageQueue.push(t)}send(e){this.webSocket?.readyState===Zb.Open?this.webSocket.send(e):this.addToQueue(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=_S.Disconnected,this.emit(`status`,{status:_S.Disconnected}),this.emit(`disconnect`,{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit(`destroy`),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}},xS=0,SS=1,CS=2,wS=(e,t)=>{Ix(e,xS),Vx(e,Lp(t))},TS=(e,t,n)=>{Ix(e,SS),Vx(e,jp(t,n))},ES=(e,t,n)=>TS(t,n,Jx(e)),DS=(e,t,n,r)=>{try{Op(t,Jx(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},OS=(e,t)=>{Ix(e,CS),Vx(e,t)},kS=DS,AS=(e,t,n,r,i)=>{let a=Xx(e);switch(a){case xS:ES(e,t,n);break;case SS:DS(e,n,r,i);break;case CS:kS(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},jS=class{constructor(e){this.message=e}apply(e,t){let{message:n}=this,r=n.readVarUint(),i=n.length();switch(r){case gS.Sync:this.applySyncMessage(e,t);break;case gS.Awareness:this.applyAwarenessMessage(e);break;case gS.Auth:this.applyAuthMessage(e);break;case gS.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case gS.Stateless:e.receiveStateless(Qx(n.decoder));break;case gS.SyncStatus:this.applySyncStatusMessage(e,Zx(n.decoder)===1);break;case gS.CLOSE:let i={code:1e3,reason:Qx(n.decoder)};e.onClose(),e.configuration.onClose({event:i}),e.forwardClose({event:i});break;default:console.error(`Can’t apply message of unknown type: ${r}`)}n.length()>i+1&&e.send(vS,{encoder:n.encoder})}applySyncMessage(e,t){let{message:n}=this;n.writeVarUint(gS.Sync);let r=AS(n.decoder,n.encoder,e.document,e);t&&r===SS&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;pS(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){let{message:t}=this;Kb(t.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;let{message:t}=this;t.writeVarUint(gS.Awareness),t.writeVarUint8Array(fS(e.awareness,Array.from(e.awareness.getStates().keys())))}},MS=class{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return Px(this.encoder)}send(e){e?.send(this.create())}},NS=`4.0.0-rc.1`,PS=class extends vS{constructor(...e){super(...e),this.type=gS.Auth,this.description=`Authentication`}get(e){if(e.token===void 0)throw Error("The authentication message requires `token` as an argument.");return zx(this.encoder,e.documentName),Ix(this.encoder,this.type),Gb(this.encoder,e.token),zx(this.encoder,NS),this.encoder}},FS=class extends vS{constructor(...e){super(...e),this.type=gS.Awareness,this.description=`Awareness states update`}get(e){if(e.awareness===void 0)throw Error(`The awareness message requires awareness as an argument`);if(e.clients===void 0)throw Error(`The awareness message requires clients as an argument`);zx(this.encoder,e.documentName),Ix(this.encoder,this.type);let t;return t=e.states===void 0?fS(e.awareness,e.clients):fS(e.awareness,e.clients,e.states),Vx(this.encoder,t),this.encoder}},IS=class extends vS{constructor(...e){super(...e),this.type=gS.Stateless,this.description=`A stateless message`}get(e){return zx(this.encoder,e.documentName),Ix(this.encoder,this.type),zx(this.encoder,e.payload??``),this.encoder}},LS=class extends vS{constructor(...e){super(...e),this.type=gS.Sync,this.description=`First sync step`}get(e){if(e.document===void 0)throw Error(`The sync step one message requires document as an argument`);return zx(this.encoder,e.documentName),Ix(this.encoder,this.type),wS(this.encoder,e.document),this.encoder}},RS=class extends vS{constructor(...e){super(...e),this.type=gS.Sync,this.description=`A document update`}get(e){return zx(this.encoder,e.documentName),Ix(this.encoder,this.type),OS(this.encoder,e.update),this.encoder}},zS=class extends Error{constructor(...e){super(...e),this.code=1001}},BS=class extends mS{get effectiveName(){return this.configuration.sessionAwareness?Yb(this.configuration.name,this.sessionId):this.configuration.name}constructor(e){super(),this.configuration={name:``,document:void 0,awareness:void 0,token:null,sessionAwareness:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.sessionId=Math.random().toString(36).slice(2),this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit(`connect`),this.forwardStatus=e=>this.emit(`status`,e),this.forwardClose=e=>this.emit(`close`,e),this.forwardDisconnect=e=>this.emit(`disconnect`,e),this.forwardDestroy=()=>this.emit(`destroy`),this.setConfiguration(e),this.configuration.document=e.document?e.document:new fp,this.configuration.awareness=e.awareness===void 0?new uS(this.document):e.awareness,this.on(`open`,this.configuration.onOpen),this.on(`message`,this.configuration.onMessage),this.on(`outgoingMessage`,this.configuration.onOutgoingMessage),this.on(`synced`,this.configuration.onSynced),this.on(`destroy`,this.configuration.onDestroy),this.on(`awarenessUpdate`,this.configuration.onAwarenessUpdate),this.on(`awarenessChange`,this.configuration.onAwarenessChange),this.on(`stateless`,this.configuration.onStateless),this.on(`unsyncedChanges`,this.configuration.onUnsyncedChanges),this.on(`authenticated`,this.configuration.onAuthenticated),this.on(`authenticationFailed`,this.configuration.onAuthenticationFailed),this.awareness?.on(`update`,()=>{this.emit(`awarenessUpdate`,{states:qb(this.awareness.getStates())})}),this.awareness?.on(`change`,()=>{this.emit(`awarenessChange`,{states:qb(this.awareness.getStates())})}),this.document.on(`update`,this.boundDocumentUpdateHandler),this.awareness?.on(`update`,this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval==`number`&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new bS(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&--this.unsyncedChanges,this.unsyncedChanges===0&&(this.synced=!0),this.emit(`unsyncedChanges`,{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(LS,{document:this.document,documentName:this.effectiveName})}pageHide(){this.awareness&&dS(this.awareness,[this.document.clientID],`page hide`)}registerEventListeners(){typeof window>`u`||!(`addEventListener`in window)||window.addEventListener(`pagehide`,this.boundPageHide)}sendStateless(e){this.send(IS,{documentName:this.effectiveName,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(e){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${e}`);return}this.send(PS,{token:e??``,documentName:this.effectiveName})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(RS,{update:e,documentName:this.effectiveName}))}awarenessUpdateHandler({added:e,updated:t,removed:n},r){let i=e.concat(t).concat(n);this.send(FS,{awareness:this.awareness,clients:i,documentName:this.effectiveName})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit(`synced`,{state:e}))}receiveStateless(e){this.emit(`stateless`,{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn(`HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn(`HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.`)}async onOpen(e){this.isAuthenticated=!1,this.emit(`open`,{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token==`function`?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(LS,{document:this.document,documentName:this.effectiveName}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(FS,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.effectiveName})}send(e,t){if(!this._isAttached)return;let n=new MS(e,t);this.emit(`outgoingMessage`,{message:n.message}),n.send(this.configuration.websocketProvider)}onMessage(e){let t=new hS(e.data),{documentName:n}=Xb(t.readVarString());t.writeVarString(this.effectiveName),this.emit(`message`,{event:e,message:new hS(e.data)}),new jS(t).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&dS(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit(`destroy`),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(dS(this.awareness,[this.document.clientID],`provider destroy`),this.awareness.off(`update`,this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off(`update`,this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>`u`||!(`removeEventListener`in window))&&window.removeEventListener(`pagehide`,this.boundPageHide)}detach(){this.configuration.websocketProvider.off(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.off(`connect`,this.forwardConnect),this.configuration.websocketProvider.off(`status`,this.forwardStatus),this.configuration.websocketProvider.off(`status`,this.configuration.onStatus),this.configuration.websocketProvider.off(`open`,this.boundOnOpen),this.configuration.websocketProvider.off(`close`,this.boundOnClose),this.configuration.websocketProvider.off(`close`,this.configuration.onClose),this.configuration.websocketProvider.off(`close`,this.forwardClose),this.configuration.websocketProvider.off(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.off(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.off(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.off(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||=(this.configuration.websocketProvider.on(`connect`,this.configuration.onConnect),this.configuration.websocketProvider.on(`connect`,this.forwardConnect),this.configuration.websocketProvider.on(`status`,this.configuration.onStatus),this.configuration.websocketProvider.on(`status`,this.forwardStatus),this.configuration.websocketProvider.on(`open`,this.boundOnOpen),this.configuration.websocketProvider.on(`close`,this.boundOnClose),this.configuration.websocketProvider.on(`close`,this.configuration.onClose),this.configuration.websocketProvider.on(`close`,this.forwardClose),this.configuration.websocketProvider.on(`disconnect`,this.configuration.onDisconnect),this.configuration.websocketProvider.on(`disconnect`,this.forwardDisconnect),this.configuration.websocketProvider.on(`destroy`,this.configuration.onDestroy),this.configuration.websocketProvider.on(`destroy`,this.forwardDestroy),this.configuration.websocketProvider.attach(this),!0)}permissionDeniedHandler(e){this.emit(`authenticationFailed`,{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit(`authenticated`,{scope:e})}setAwarenessField(e,t){if(!this.awareness)throw new zS(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}},VS=e=>yu((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),HS=(e,t)=>yu((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(Kl(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),US=e=>VS(indexedDB.deleteDatabase(e)),WS=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),GS=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>nC(r,e))},KS=(e,t)=>VS(e.count(t)),qS=(e,t)=>VS(e.get(t)),JS=(e,t)=>VS(e.delete(t)),YS=(e,t,n)=>VS(e.put(t,n)),XS=(e,t)=>VS(e.add(t)),ZS=(e,t,n)=>VS(e.getAll(t,n)),QS=(e,t,n)=>{let r=null;return tC(e,t,e=>(r=e,!1),n).then(()=>r)},$S=(e,t=null)=>QS(e,t,`prev`),eC=(e,t)=>yu((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),tC=(e,t,n,r=`next`)=>eC(e.openKeyCursor(t,r),e=>n(e.key)),nC=(e,t)=>e.objectStore(t),rC=(e,t)=>IDBKeyRange.upperBound(e,t),iC=(e,t)=>IDBKeyRange.lowerBound(e,t),aC=`custom`,oC=`updates`,sC=(e,t=()=>{},n=()=>{})=>{let[r]=GS(e.db,[oC]);return ZS(r,iC(e._dbref,!1)).then(i=>{e._destroyed||(t(r),Em(e.doc,()=>{i.forEach(t=>Op(e.doc,t))},e,!1),n(r))}).then(()=>$S(r).then(t=>{e._dbref=t+1})).then(()=>KS(r).then(t=>{e._dbsize=t})).then(()=>r)},cC=(e,t=!0)=>sC(e).then(n=>{(t||e._dbsize>=500)&&XS(n,jp(e.doc)).then(()=>JS(n,rC(e._dbref,!0))).then(()=>KS(n).then(t=>{e._dbsize=t}))}),lC=class extends zc{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=HS(e,e=>WS(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=yu(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,sC(this,async e=>{await KS(e)>0&&XS(e,jp(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=GS(this.db,[oC]);XS(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{cC(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{US(this.name)})}get(e){return this._db.then(t=>{let[n]=GS(t,[aC],`readonly`);return qS(n,e)})}set(e,t){return this._db.then(n=>{let[r]=GS(n,[aC]);return YS(r,t,e)})}del(e){return this._db.then(t=>{let[n]=GS(t,[aC]);return JS(n,e)})}};function uC(){return!0}var dC=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=uC()?0:performance.now();this._idb=new lC(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!uC()){let e=performance.now();Y(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=uC()?0:performance.now();try{await this._idb.destroy()}finally{if(!uC()){let t=performance.now();Y(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async clearData(){let e=uC()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e})),n(Error(`idb-clear-blocked: ${e}`))}})}finally{if(!uC()){let t=performance.now();Y(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function fC(e){return new dC(e)}function pC(e){return Lp(e)}function mC(e,t){return t===null?jp(e):jp(e,t)}function hC(e,t){if(e===null)return t;if(t===null)return e;let n=Np(e),r=Np(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return Lp(i)}function gC(e){let t={};if(pn.inject(fn.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var _C=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new At({key:e||new ke(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),vC=o.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[_C({key:new ke(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),yC=o.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof bt){let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=h.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof h?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof bt))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=bt.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch{return!1}},ArrowDown:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof bt))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=bt.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch{return!1}},Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof h)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(h.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),bC=new WeakMap;function xC(e,t){if(t===null){bC.delete(e);return}bC.set(e,t)}function SC(e){return bC.get(e)??null}function CC(e){return`pagesBySlug`in e}function wC(e){return CC(e)?e.pages:e}function TC(e,t){return CC(e)?e.assetPaths??new Set:t??new Set}function EC(e,t){let n=ut(e);if(n){if(CC(t))return t.pagesBySlug.get(n);for(let e of t)if(ut(e)===n)return e}}function DC(e){let t=e.trim();if(!t)return null;let n=ut(t);return n?{target:n,alias:n===t?null:t,anchor:null}:null}function OC(e){let t=e.trim();if(!t)return[];let n=ut(t);return n.length>0&&n!==t?[n]:[]}function kC(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function AC(e,t){let n=kC(e);if(!n)return null;if(t.has(n))return n;let r=n.toLowerCase();for(let e of t)if(e.toLowerCase()===r)return e;if(n.includes(`/`))return null;let i=[...t].filter(e=>{let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()===r});return i.length===0?null:i.sort((e,t)=>e.localeCompare(t))[0]??null}function jC(e,t,n){let r=e.trim();if(!r)return!1;if(AC(r,TC(t,n)))return!0;let i=wC(t);return i.has(r)||OC(r).some(e=>i.has(e))?!0:EC(r,t)!==void 0}var MC=class extends Error{status;instance;constructor(e,t={}){super(e,t.cause===void 0?void 0:{cause:t.cause}),this.name=`HttpResponseParseError`,this.status=t.status,this.instance=t.instance}},NC=new ke(`imageUpload`);function PC(e){let t=document.createElement(`div`);return t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-label`,e?.name?`Uploading ${e.name}…`:`Uploading file…`),t}var FC=new At({key:NC,state:{init(){return{decorations:We.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(NC);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=tt.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return NC.getState(e)?.decorations??We.empty}}});function IC(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function LC(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function RC(e){return e.split(`/`).filter(e=>e!==``)}function zC(e,t){let n=IC(e),r=IC(t),i=LC(e);if(n===r)return i;let a=RC(r),o=RC(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function BC(e){return SC(e)}function VC(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t,alt:``}:{src:t,controls:!0}}}}function HC(e){let t=_t(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:Ve.has(t)?{kind:`jsx-img`,ext:t}:L.has(t)?{kind:`jsx-video`,ext:t}:D.has(t)?{kind:`jsx-audio`,ext:t}:$e.has(t)?{kind:`jsx-file`,ext:t}:ce.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function UC(e,t,n){let r=BC(t),i=r?`${r}.md`:``;if(!i){cn.error(`Cannot upload: no document is open`);return}let a=crypto.randomUUID(),o=PC(e);t.view.dispatch(t.state.tr.setMeta(NC,{type:`add`,id:a,pos:n,widget:o}));let s=new FormData;s.append(`file`,e),s.append(`parentDocName`,i);let c;try{c=await fetch(`/api/upload`,{method:`POST`,body:s})}catch(e){console.error(`[uploadAndInsert] Network error:`,e),WC(t,a);return}let l;try{l=await c.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),WC(t,a);return}if(!c.ok){let e=v.safeParse(l);if(!e.success){let n=new MC(`Upload response did not match ProblemDetails.`,{cause:e.error,status:c.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),WC(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),WC(t,a,e.data.title);return}let u=M.safeParse(l);if(!u.success){let e=new MC(`Upload success response did not match UploadAssetSuccess.`,{cause:u.error,status:c.status});console.error(`[uploadAndInsert] Response missing src:`,e),WC(t,a);return}let d=u.data,f=d.src,p=d.deduped===!0,m=IC(i),h=typeof d.path==`string`&&d.path.length>0?d.path:m?`${m}/${f}`:f;p&&cn.info(`Already at ${h} — reusing.`);let g=HC(e.name),{state:_}=t,y=NC.getState(_)?.uploads.get(a)??n,b=_.tr.setMeta(NC,{type:`remove`,id:a}),x=zC(h,i),S=`/${h}`;if(g.kind===`jsx-file`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),WC(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:S,target:f,alias:null,anchor:null,size:st(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(NC,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(bt.create(e.doc,n)),!0}).run();return}if(g.kind===`jsx-img`||g.kind===`jsx-video`||g.kind===`jsx-audio`){if(!_.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),WC(t,a);return}let e=VC(g.kind,S);t.chain().command(({tr:e})=>(e.setMeta(NC,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(bt.create(e.doc,n)),!0}).run();return}if(g.kind===`wikiembed`){let e=_.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),WC(t,a);return}b.insert(y,e.create({target:f,alias:null,anchor:null,resolvedSrc:S}))}else if(g.kind===`wiki-link`){let n=_.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),WC(t,a);return}let r=DC(e.name.replace(/\.(md|mdx)$/i,``));r?b.insert(y,n.create(r)):b.insert(y,_.schema.text(e.name))}else{let t=_.schema.marks.link;if(t){let n=_.schema.text(e.name,[t.create({href:x})]);b.insert(y,n)}else b.insert(y,_.schema.text(e.name))}t.view.dispatch(b)}function WC(e,t,n){e.view.dispatch(e.state.tr.setMeta(NC,{type:`remove`,id:t})),cn.error(n??`Upload failed`)}var GC={ChevronRight:vr,Image:Ir,MessageSquareWarning:Ur,Sigma:Xr,SquarePlay:Zr,Volume2:oi,Workflow:si};function KC(e){return e&&Object.hasOwn(GC,e)?GC[e]:hr}var qC={ChevronRight:vr};function JC(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(qC,t)?qC[t]:null}function YC(e){let t=(0,J.c)(24),n;t[0]===e.icon?n=t[1]:(n=JC(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(vr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,K.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,K.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,K.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,K.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,K.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,K.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,K.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}function XC(e){return e!==!1}function ZC(e){let t=(0,J.c)(10),n=e.src,r=e.title,i;t[0]===e.controls?i=t[1]:(i=XC(e.controls),t[0]=e.controls,t[1]=i);let a;return t[2]!==e.autoplay||t[3]!==e.loop||t[4]!==e.muted||t[5]!==e.preload||t[6]!==e.src||t[7]!==e.title||t[8]!==i?(a=(0,K.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[2]=e.autoplay,t[3]=e.loop,t[4]=e.muted,t[5]=e.preload,t[6]=e.src,t[7]=e.title,t[8]=i,t[9]=a):a=t[9],a}var QC={note:Lr,tip:Rr,important:Ur,warning:w,caution:Gr,abstract:Cr,info:mr,todo:Br,success:j,question:xr,failure:Sr,danger:ci,bug:gr,example:Ar,quote:Jr},$C={Info:Lr,Lightbulb:Rr,MessageSquareWarning:Ur,AlertTriangle:w,AlertOctagon:Gr,ClipboardList:Cr,BookOpen:mr,ListTodo:Br,CircleCheck:j,CircleHelp:xr,CircleX:Sr,Zap:ci,Bug:gr,FlaskConical:Ar,Quote:Jr};function ew(e,t){if(!e||!e.startsWith(`lucide:`))return QC[t];let n=e.slice(7);return Object.hasOwn($C,n)?$C[n]:QC[t]}var tw=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function nw(e){return typeof e==`string`&&tw.has(e)?e:`note`}function rw(e){let t=(0,J.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=nw(e.type),n=ew(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,a;t[4]===e.color?a=t[5]:(a=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=a);let o=a,s;t[6]!==i||t[7]!==e.title?(s=e.title||i?(0,K.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,K.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,K.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=s):s=t[8];let c=s;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===c?i=t[10]:(i=c??(0,K.jsx)(`span`,{className:`callout-title`,children:`Details`}),t[9]=c,t[10]=i);let a;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(_r,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=a):a=t[11];let s;t[12]===i?s=t[13]:(s=(0,K.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,a]}),t[12]=i,t[13]=s);let l;t[14]===e.children?l=t[15]:(l=(0,K.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=l);let u;return t[16]!==n||t[17]!==o||t[18]!==s||t[19]!==l||t[20]!==r?(u=(0,K.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:o,children:[s,l]}),t[16]=n,t[17]=o,t[18]=s,t[19]=l,t[20]=r,t[21]=u):u=t[21],u}let l;t[22]===e.children?l=t[23]:(l=(0,K.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=l);let u;return t[24]!==c||t[25]!==o||t[26]!==l||t[27]!==r?(u=(0,K.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:o,children:[c,l]}),t[24]=c,t[25]=o,t[26]=l,t[27]=r,t[28]=u):u=t[28],u}function iw(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function aw(e){let t=(0,J.c)(16),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||iw(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=t=>{t.stopPropagation(),t.preventDefault(),e.src&&window.open(e.src,`_blank`,`noopener,noreferrer`)},t[3]=e.src,t[4]=a);let o=a,s=e.src||void 0,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(Or,{className:`ok-file-icon`,"aria-hidden":`true`}),t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=(0,K.jsx)(`span`,{className:`ok-file-name`,children:r}),t[6]=r,t[7]=l);let u;t[8]===i?u=t[9]:(u=i?(0,K.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[8]=i,t[9]=u);let d;return t[10]!==o||t[11]!==e.title||t[12]!==s||t[13]!==l||t[14]!==u?(d=(0,K.jsxs)(`a`,{href:s,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:ow,onClick:o,children:[c,l,u]}),t[10]=o,t[11]=e.title,t[12]=s,t[13]=l,t[14]=u,t[15]=d):d=t[15],d}function ow(e){return e.stopPropagation()}function sw(){return q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},q.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function cw(){return q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},q.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function lw(e){return typeof Element>`u`?!1:e instanceof Element}var uw=(e,t)=>lw(t)&&t.tagName.toUpperCase()===e,dw=e=>uw(`DIV`,e)||uw(`SPAN`,e),fw=e=>uw(`IMG`,e),pw=e=>e.complete&&e.naturalHeight!==0,mw=e=>uw(`SVG`,e),hw=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),gw=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=hw({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},_w=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?gw({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):hw({height:e,offset:r,width:t}),vw=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,yw=e=>{if(e!==null){if(fw(e))return e.currentSrc===``?void 0:e.currentSrc;if(dw(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return vw.exec(t)?.[1]}}},bw=e=>{if(e!==null)return fw(e)?e.alt:e.getAttribute(`aria-label`)??void 0},xw=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=_w({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},Sw=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},Cw=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=Sw({position:p,relativeNum:r-l*f}),g=Sw({position:m,relativeNum:e-c*f}),_=_w({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=Sw({position:a,relativeNum:r-l}),f=Sw({position:u,relativeNum:e-c}),p=_w({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=_w({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},ww=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=Sw({position:p,relativeNum:a-l*f}),g=Sw({position:m,relativeNum:n-c*f}),_=_w({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=Sw({position:t,relativeNum:a-l}),f=Sw({position:u,relativeNum:n-c}),p=_w({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=Sw({position:u,relativeNum:a}),p=Sw({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=Sw({position:_,relativeNum:a-l*g}),b=Sw({position:v,relativeNum:n-c*g}),x=_w({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},Tw=/\.svg$/i,Ew=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&Tw.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&dw(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=xw({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?Cw({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?ww({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},Dw=e=>{if(e==null)return{};if(mw(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},Ow=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},kw=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Aw={overflow:``,width:``};function jw(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function Mw(e){e.preventDefault()}function Nw(e){return q.createElement(Pw,{...e})}var Pw=class extends q.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=q.createRef(),this.refDialog=q.createRef(),this.refModalContent=q.createRef(),this.refModalImg=q.createRef(),this.refWrap=q.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Aw,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(kw),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:Dw(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:Dw(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=yw(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(fw(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:Dw(this.imgEl)})};t.decode().then(r).catch(()=>{if(pw(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||mw(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=Aw},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(pw(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(mw(e)){let r=e.cloneNode(!0);Ow(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=dw(a),j=fw(a),M=mw(a),N=bw(a),P=yw(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,R=h?.src!==void 0&&h.src!==``,z=this.hasImage(),B=N!==void 0&&N!==``?`${s}: ${N}`:s,V=T===`LOADING`||T===`LOADED`,H=z?`found`:`not-found`,U=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ee={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=z&&a!==null?Ew({hasZoomImg:R,imgSrc:P,isSvg:M,isZoomed:f&&V,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let te=null;if(z){let t=j||A?q.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?q.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=q.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},q.createElement(u,null));te=m==null?q.createElement(q.Fragment,null,t,n):q.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return q.createElement(p,{"aria-owns":z?O:void 0,"data-rmiz":``,ref:x},q.createElement(p,{"data-rmiz-content":H,ref:_,style:ee},c),z&&q.createElement(p,{"data-rmiz-ghost":``,style:D},q.createElement(`button`,{"aria-label":B,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},q.createElement(d,null))),z&&Oi.createPortal(q.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:Mw,ref:v,role:`dialog`},q.createElement(`div`,{"data-rmiz-modal-overlay":U}),q.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},te)),jw()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Pw.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:sw,IconZoom:cw,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Fw({onZoomChange:e,...t}){let[n,r]=q.useState(!1),i=q.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return q.createElement(Nw,{...t,isZoomed:n,onZoomChange:i})}function Iw(e){return e??`lazy`}function Lw(e){let t=(0,J.c)(15),n=e.src,r=e.alt??``,i=e.width,a=e.height,o=e.title,s;t[0]===e.loading?s=t[1]:(s=Iw(e.loading),t[0]=e.loading,t[1]=s);let c;return t[2]!==e.crossorigin||t[3]!==e.decoding||t[4]!==e.fetchpriority||t[5]!==e.height||t[6]!==e.referrerpolicy||t[7]!==e.sizes||t[8]!==e.src||t[9]!==e.srcset||t[10]!==e.title||t[11]!==e.width||t[12]!==r||t[13]!==s?(c=(0,K.jsx)(`img`,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[2]=e.crossorigin,t[3]=e.decoding,t[4]=e.fetchpriority,t[5]=e.height,t[6]=e.referrerpolicy,t[7]=e.sizes,t[8]=e.src,t[9]=e.srcset,t[10]=e.title,t[11]=e.width,t[12]=r,t[13]=s,t[14]=c):c=t[14],c}function Rw(e){let t=(0,J.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,K.jsx)(Fw,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,K.jsx)(Lw,{...e})}),t[1]=e,t[2]=r),r}var zw=(0,q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,K.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function Bw(e){let t=(0,J.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,K.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function Vw(e){let t=(0,J.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,K.jsx)(Bw,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,K.jsx)(q.Suspense,{fallback:(0,K.jsx)(Bw,{formula:n,id:e.id}),children:(0,K.jsx)(zw,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}var Hw=null;function Uw(){return Hw||=n(()=>import(`./mermaid.core-CWYso-V4.js`).then(e=>{let t=e.default;return t.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`default`,suppressErrorRendering:!0}),t}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url).catch(e=>{throw Hw=null,e}),Hw}function Ww(e){let t=(0,J.c)(26),n=e.chart??``,r=(0,q.useId)(),i;if(t[0]!==r){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],i=r.replace(e,`_`),t[0]=r,t[1]=i}else i=t[1];let a=`mermaid-${i}`,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={status:`idle`,svg:``,error:``},t[3]=o):o=t[3];let[s,c]=(0,q.useState)(o),l,u;if(t[4]!==n||t[5]!==a?(l=()=>{if(!n.trim()){c({status:`idle`,svg:``,error:``});return}let e=!1;return c(Gw),Uw().then(async t=>{try{let r=await t.render(a,n);e||c({status:`ready`,svg:r.svg,error:``})}catch(t){let n=t;e||c({status:`error`,svg:``,error:n instanceof Error?n.message:String(n)})}}).catch(t=>{e||c({status:`error`,svg:``,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},u=[n,a],t[4]=n,t[5]=a,t[6]=l,t[7]=u):(l=t[6],u=t[7]),(0,q.useEffect)(l,u),!n.trim()){let n;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,K.jsx)(`span`,{className:`mermaid-empty`,children:` `}),t[8]=n):n=t[8];let r;return t[9]===e.id?r=t[10]:(r=(0,K.jsx)(`div`,{className:`mermaid mermaid-placeholder`,"data-component-type":`mermaid`,id:e.id,children:n}),t[9]=e.id,t[10]=r),r}if(s.status===`error`){let r;t[11]===n?r=t[12]:(r=(0,K.jsx)(`pre`,{className:`mermaid-error-source`,children:n}),t[11]=n,t[12]=r);let i;t[13]===s.error?i=t[14]:(i=(0,K.jsx)(`p`,{className:`mermaid-error-message`,children:s.error}),t[13]=s.error,t[14]=i);let a;return t[15]!==e.id||t[16]!==s.error||t[17]!==r||t[18]!==i?(a=(0,K.jsxs)(`div`,{className:`mermaid mermaid-error`,"data-component-type":`mermaid`,title:s.error,id:e.id,children:[r,i]}),t[15]=e.id,t[16]=s.error,t[17]=r,t[18]=i,t[19]=a):a=t[19],a}let d=`mermaid mermaid-${s.status}`,f;t[20]===s.svg?f=t[21]:(f={__html:s.svg},t[20]=s.svg,t[21]=f);let p;return t[22]!==e.id||t[23]!==d||t[24]!==f?(p=(0,K.jsx)(`div`,{className:d,"data-component-type":`mermaid`,id:e.id,dangerouslySetInnerHTML:f}),t[22]=e.id,t[23]=d,t[24]=f,t[25]=p):p=t[25],p}function Gw(e){return{...e,status:`rendering`}}var Kw=24,qw=24,Jw=12,Yw=.1;function Xw(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(Yw,(n-Kw)/t.naturalWidth);case`fit-height`:return Math.max(Yw,(r-qw)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(Yw,((n-Kw)/2-Jw)/t.naturalWidth)}}var Zw=600,Qw=.5,$w=3,eT=.25,tT=null;function nT(){return tT||(tT=(async()=>{let e=await n(()=>import(`./pdf-CtJiipL_.js`),__vite__mapDeps([24,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-BZq-wJdz.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),tT.catch(()=>{tT=null})),tT}function rT(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function iT(e){let t=(0,J.c)(84),n,r;if(t[0]!==e.anchor){let{height:i,viewerFragment:a}=d(e.anchor);n=i??Zw,r=uT(a),t[0]=e.anchor,t[1]=n,t[2]=r}else n=t[1],r=t[2];let i=r,a=(0,q.useRef)(null),o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],t[3]=o):o=t[3];let s=(0,q.useRef)(o),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,q.useRef)(c),u=(0,q.useRef)(null),f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[5]=f):f=t[5];let[p,m]=(0,q.useState)(f),[h,g]=(0,q.useState)(!0),[_,v]=(0,q.useState)(null),[y,b]=(0,q.useState)(i??1),[x,S]=(0,q.useState)(String(i??1)),[C,w]=(0,q.useState)(1),[T,E]=(0,q.useState)(`fit-width`),[D,O]=(0,q.useState)(!1),[k,A]=(0,q.useState)(!1),[j,M]=(0,q.useState)(0),[N,P]=(0,q.useState)(0),F=p.length,I,L;t[6]===e.src?(I=t[7],L=t[8]):(I=()=>{if(!e.src){g(!1);return}let t=!1,n=null;return g(!0),v(null),(async()=>{try{let r=await(await nT()).getDocument({url:e.src,isEvalSupported:!1}).promise;if(t){await r.destroy();return}n=r,u.current=r;let i=[];for(let e=1;e<=r.numPages;e++){if(t)return;let n=(await r.getPage(e)).getViewport({scale:1});i.push({pageNumber:e,naturalWidth:n.width,naturalHeight:n.height})}if(t)return;m(i)}catch(e){let n=e;if(t)return;v(n instanceof Error?n.message:`Failed to load PDF`),g(!1)}})(),()=>{t=!0,n&&=(n.destroy(),null),u.current=null}},L=[e.src],t[6]=e.src,t[7]=I,t[8]=L),(0,q.useEffect)(I,L);let R,z;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{let e=a.current;if(!e)return;let t=()=>{M(e.clientWidth),P(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},z=[],t[9]=R,t[10]=z):(R=t[9],z=t[10]),(0,q.useEffect)(R,z);let B,V;t[11]!==N||t[12]!==j||t[13]!==T||t[14]!==p||t[15]!==C?(B=()=>{let e=u.current;if(!e||p.length===0||j===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of p){if(t)return;let a=s.current[i.pageNumber-1];if(!a)continue;let o=Xw(T,i,j,N)*C,c=await e.getPage(i.pageNumber);if(t)return;let l=c.getViewport({scale:o});a.width=Math.floor(l.width*r),a.height=Math.floor(l.height*r),a.style.width=`${l.width}px`,a.style.height=`${l.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=c.render({canvas:a,canvasContext:u,viewport:l}),await n.promise,n=null)}t||g(!1)}catch(e){let n=e;if(t||rT(n))return;console.warn(`[Pdf] page render failed:`,n),v(n instanceof Error?n.message:`Failed to render PDF`),g(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},V=[p,T,C,j,N],t[11]=N,t[12]=j,t[13]=T,t[14]=p,t[15]=C,t[16]=B,t[17]=V):(B=t[16],V=t[17]),(0,q.useEffect)(B,V);let H,U;t[18]!==p||t[19]!==D?(H=()=>{if(!D)return;let e=u.current;if(!e||p.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of p){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;rT(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},U=[D,p],t[18]=p,t[19]=D,t[20]=H,t[21]=U):(H=t[20],U=t[21]),(0,q.useEffect)(H,U);let ee,te;t[22]!==h||t[23]!==i?(ee=()=>{if(h||!i)return;let e=a.current,t=s.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},te=[h,i],t[22]=h,t[23]=i,t[24]=ee,t[25]=te):(ee=t[24],te=t[25]),(0,q.useEffect)(ee,te);let ne,re;t[26]===p?(ne=t[27],re=t[28]):(ne=()=>{let e=a.current;if(!e||p.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of p){let i=s.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}b(r),S(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},re=[p],t[26]=p,t[27]=ne,t[28]=re),(0,q.useEffect)(ne,re);let ie,ae;t[29]===k?(ie=t[30],ae=t[31]):(ie=()=>{if(!k)return;let e=e=>{let t=e.target,n=a.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){A(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&A(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},ae=[k],t[29]=k,t[30]=ie,t[31]=ae),(0,q.useEffect)(ie,ae);let oe;t[32]===F?oe=t[33]:(oe=e=>{let t=Math.max(1,Math.min(F||1,e));b(t),S(String(t));let n=a.current,r=s.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[32]=F,t[33]=oe);let se=oe,ce;t[34]!==y||t[35]!==se||t[36]!==x?(ce=()=>{let e=Number.parseInt(x,10);if(Number.isNaN(e)){S(String(y));return}se(e)},t[34]=y,t[35]=se,t[36]=x,t[37]=ce):ce=t[37];let le=ce,ue;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>w(cT),t[38]=ue):ue=t[38];let de=ue,fe;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>w(sT),t[39]=fe):fe=t[39];let pe=fe,me;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{E(e),A(!1),w(1)},t[40]=me):me=t[40];let he=me,ge=`${n}px`,_e;t[41]===ge?_e=t[42]:(_e={height:ge},t[41]=ge,t[42]=_e);let ve;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>O(oT),t[43]=ve):ve=t[43];let ye=D?`Hide thumbnails`:`Show thumbnails`,be;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,K.jsx)(Kr,{size:14,"aria-hidden":`true`}),t[44]=be):be=t[44];let xe;t[45]!==D||t[46]!==ye?(xe=(0,K.jsx)(`button`,{type:`button`,onClick:ve,"aria-label":ye,"aria-pressed":D,className:`ok-pdf-btn`,title:`Toggle thumbnails`,children:be}),t[45]=D,t[46]=ye,t[47]=xe):xe=t[47];let Se=e.title??`PDF`,Ce;t[48]===Se?Ce=t[49]:(Ce=(0,K.jsx)(`span`,{className:`ok-pdf-title`,children:Se}),t[48]=Se,t[49]=Ce);let we;t[50]!==k||t[51]!==T||t[52]!==x||t[53]!==le||t[54]!==F||t[55]!==C?(we=F>0&&(0,K.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,K.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),le()},children:(0,K.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:x,onChange:e=>S(e.target.value.replace(/[^0-9]/g,``)),onBlur:le,"aria-label":`Page number`})}),(0,K.jsxs)(`span`,{className:`ok-pdf-page-of`,children:[`of `,F]}),(0,K.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,K.jsx)(`button`,{type:`button`,onClick:pe,disabled:C<=Qw,"aria-label":`Zoom out`,className:`ok-pdf-btn`,title:`Zoom out`,children:(0,K.jsx)(ui,{size:14,"aria-hidden":`true`})}),(0,K.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(C*100),`%`]}),(0,K.jsx)(`button`,{type:`button`,onClick:de,disabled:C>=$w,"aria-label":`Zoom in`,className:`ok-pdf-btn`,title:`Zoom in`,children:(0,K.jsx)(li,{size:14,"aria-hidden":`true`})}),(0,K.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,K.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>A(aT),"aria-label":`Layout options`,"aria-haspopup":`menu`,"aria-expanded":k,className:`ok-pdf-btn`,title:`Layout`,children:(0,K.jsx)(_r,{size:14,"aria-hidden":`true`})}),k&&(0,K.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,K.jsx)(lT,{label:`Fit width`,active:T===`fit-width`,onSelect:()=>he(`fit-width`)}),(0,K.jsx)(lT,{label:`Fit height`,active:T===`fit-height`,onSelect:()=>he(`fit-height`)}),(0,K.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,K.jsx)(lT,{label:`Single page`,active:T===`single`,onSelect:()=>he(`single`)}),(0,K.jsx)(lT,{label:`Two-page (odd)`,active:T===`two-odd`,onSelect:()=>he(`two-odd`)}),(0,K.jsx)(lT,{label:`Two-page (even)`,active:T===`two-even`,onSelect:()=>he(`two-even`)})]})]})]}),t[50]=k,t[51]=T,t[52]=x,t[53]=le,t[54]=F,t[55]=C,t[56]=we):we=t[56];let Te;t[57]!==xe||t[58]!==Ce||t[59]!==we?(Te=(0,K.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[xe,Ce,we]}),t[57]=xe,t[58]=Ce,t[59]=we,t[60]=Te):Te=t[60];let Ee;t[61]!==y||t[62]!==se||t[63]!==p||t[64]!==D?(Ee=D&&(0,K.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":`Page thumbnails`,children:p.map((e,t)=>(0,K.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":y===e.pageNumber||void 0,onClick:()=>se(e.pageNumber),"aria-label":`Jump to page ${e.pageNumber}`,children:[(0,K.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,K.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:e.pageNumber})]},e.pageNumber))}),t[61]=y,t[62]=se,t[63]=p,t[64]=D,t[65]=Ee):Ee=t[65];let De;t[66]===h?De=t[67]:(De=h&&(0,K.jsx)(`div`,{className:`ok-pdf-loading`,children:`Loading PDF…`}),t[66]=h,t[67]=De);let Oe;t[68]===_?Oe=t[69]:(Oe=_&&(0,K.jsxs)(`div`,{className:`ok-pdf-error`,children:[`Failed to load PDF: `,_]}),t[68]=_,t[69]=Oe);let ke;t[70]===F?ke=t[71]:(ke=Array.from({length:F},(e,t)=>{let n=t+1;return(0,K.jsx)(`canvas`,{ref:e=>{s.current[t]=e},className:`ok-pdf-page`,"aria-label":`Page ${n}`},n)}),t[70]=F,t[71]=ke);let Ae;t[72]!==T||t[73]!==De||t[74]!==Oe||t[75]!==ke?(Ae=(0,K.jsxs)(`div`,{className:`ok-pdf-pages`,ref:a,"data-layout":T,children:[De,Oe,ke]}),t[72]=T,t[73]=De,t[74]=Oe,t[75]=ke,t[76]=Ae):Ae=t[76];let je;t[77]!==Ee||t[78]!==Ae?(je=(0,K.jsxs)(`div`,{className:`ok-pdf-body`,children:[Ee,Ae]}),t[77]=Ee,t[78]=Ae,t[79]=je):je=t[79];let Me;return t[80]!==_e||t[81]!==Te||t[82]!==je?(Me=(0,K.jsxs)(`div`,{className:`ok-pdf`,style:_e,children:[Te,je]}),t[80]=_e,t[81]=Te,t[82]=je,t[83]=Me):Me=t[83],Me}function aT(e){return!e}function oT(e){return!e}function sT(e){return Math.max(Qw,+(e-eT).toFixed(2))}function cT(e){return Math.min($w,+(e+eT).toFixed(2))}function lT(e){let t=(0,J.c)(8),n=e.active||void 0,r=e.active?`✓`:``,i;t[0]===r?i=t[1]:(i=(0,K.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==e.active||t[3]!==e.label||t[4]!==e.onSelect||t[5]!==n||t[6]!==i?(a=(0,K.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[2]=e.active,t[3]=e.label,t[4]=e.onSelect,t[5]=n,t[6]=i,t[7]=a):a=t[7],a}function uT(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function dT(e){return e!==!1}function fT(e){let t=(0,J.c)(14),n=e.src,r=e.title,i;t[0]===e.controls?i=t[1]:(i=dT(e.controls),t[0]=e.controls,t[1]=i);let a;return t[2]!==e.autoplay||t[3]!==e.height||t[4]!==e.loop||t[5]!==e.muted||t[6]!==e.playsinline||t[7]!==e.poster||t[8]!==e.preload||t[9]!==e.src||t[10]!==e.title||t[11]!==e.width||t[12]!==i?(a=(0,K.jsx)(`video`,{className:`ok-video`,src:n,title:r,controls:i,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:e.poster,preload:e.preload,width:e.width,height:e.height}),t[2]=e.autoplay,t[3]=e.height,t[4]=e.loop,t[5]=e.muted,t[6]=e.playsinline,t[7]=e.poster,t[8]=e.preload,t[9]=e.src,t[10]=e.title,t[11]=e.width,t[12]=i,t[13]=a):a=t[13],a}function pT(e){let t=(0,J.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,K.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var mT={Callout:rw,img:Rw,video:fT,audio:ZC,Pdf:iT,File:aw,Accordion:YC,Math:Vw,Mermaid:Ww,"*":pT};function hT(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var gT=Ee(),_T=new Map;function vT(e){if(e.surface===`compat`){let t=mT[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:hT(e.props)}}let t=mT[e.name];return t?{Component:t,reactNodePropNames:hT(e.props)}:null}for(let[e,t]of gT.entries()){let n=vT(t);n&&_T.set(e,n)}function yT(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function bT(e){let t=gT.getOrWildcard(e),n=_T.get(t.name)??_T.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return yT(t,n)}function xT(){let e=[];for(let[t,n]of gT.entries()){if(t===`*`)continue;let r=_T.get(t);r&&e.push(yT(n,r))}return e}var ST=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,CT=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,wT={Callout:{description:`Highlight tips, warnings, and notes.`,props:{type:`note`,title:`Heads up`},children:`Callouts draw attention to key information.`},Accordion:{description:`Collapsible section with a clickable summary.`,props:{title:`Click to expand`,defaultOpen:!0},children:`Hidden content goes here.`},img:{description:`Embed an image with optional alt text.`,props:{src:ST,alt:`Sample image`}},video:{description:`Embed a video with native player controls.`,props:{controls:!0,poster:CT}},audio:{description:`Embed an audio file with native player controls.`,props:{controls:!0}},Math:{description:`Block math equation rendered with KaTeX from a LaTeX source string.`,props:{formula:`c = \\pm\\sqrt{a^2 + b^2}`}}};function TT(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function ET(e){let t=bT(e),n=TT(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var DT=new Set;function OT(e){DT.add(e)}function kT(e){if(typeof e==`number`)return DT.delete(e);let t=DT.values().next();return t.done?!1:(DT.delete(t.value),!0)}function AT(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(OT(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren&&e.commands.setTextSelection(t+2)}function jT(e){return t=>{let n=new WeakSet;t.state.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&n.add(t)}),t.chain().focus().insertContent(ET(e.name)).run();let r=-1;t.state.doc.descendants((t,i)=>{if(r>=0)return!1;t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&!n.has(t)&&(r=i)}),!(r<0)&&AT(t,r,e)}}var MT=new Set([`File`]);function NT(){return[{name:`component-File`,label:`File`,icon:Or,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",command:FT}]}function PT(){return[...xT().filter(e=>e.surface===`canonical`&&!MT.has(e.name)).map(e=>{let t=wT[e.name],n=e.Component,r=t?{description:t.description,render:()=>(0,K.jsx)(n,{...t.props,children:t.children})}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:KC(e.icon),category:e.category??`content`,command:jT(e),aliases:e.searchTerms,description:e.description,preview:r}}),...NT()]}function FT(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;UC(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function IT(){return[{name:`component-Tag`,label:`Tag`,icon:Mr,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",command:e=>{e.chain().insertTag(``).run()}}]}var LT=[{name:`heading1`,label:`Heading 1`,icon:Nr,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:1}).run(),aliases:[`h1`],preview:{description:`Big section heading.`,render:()=>(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Heading 1`})}},{name:`heading2`,label:`Heading 2`,icon:Pr,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:2}).run(),aliases:[`h2`],preview:{description:`Medium section heading.`,render:()=>(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Heading 2`})}},{name:`heading3`,label:`Heading 3`,icon:Fr,category:`basic`,command:e=>e.chain().focus().toggleHeading({level:3}).run(),aliases:[`h3`],preview:{description:`Small section heading.`,render:()=>(0,K.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:`Heading 3`})}},{name:`bulletList`,label:`Bullet List`,icon:Vr,category:`basic`,command:e=>e.chain().focus().toggleBulletList().run(),aliases:[`ul`,`unordered`],preview:{description:`Unordered list of items.`,render:()=>(0,K.jsxs)(`ul`,{className:`list-disc pl-5 text-sm leading-7`,children:[(0,K.jsx)(`li`,{children:`First item`}),(0,K.jsx)(`li`,{children:`Second item`})]})}},{name:`orderedList`,label:`Ordered List`,icon:zr,category:`basic`,command:e=>e.chain().focus().toggleOrderedList().run(),aliases:[`ol`,`numbered`],preview:{description:`Numbered list of items.`,render:()=>(0,K.jsxs)(`ol`,{className:`list-decimal pl-5 text-sm leading-7`,children:[(0,K.jsx)(`li`,{children:`First item`}),(0,K.jsx)(`li`,{children:`Second item`})]})}},{name:`taskList`,label:`Task List`,icon:Br,category:`basic`,command:e=>e.chain().focus().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`],preview:{description:`Checklist with checkboxes.`,render:()=>(0,K.jsxs)(`ul`,{className:`space-y-1.5 text-sm`,children:[(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:!0,readOnly:!0,className:`size-3.5`}),(0,K.jsx)(`span`,{className:`text-muted-foreground line-through`,children:`Done`})]}),(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,readOnly:!0,className:`size-3.5`}),(0,K.jsx)(`span`,{children:`To do`})]})]})}},{name:`blockquote`,label:`Quote`,icon:Jr,category:`basic`,command:e=>e.chain().focus().toggleBlockquote().run(),aliases:[`quote`],preview:{description:`Indented blockquote for citations.`,render:()=>(0,K.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/40 pl-3 text-sm italic text-muted-foreground`,children:`A pull quote stands out from the surrounding text.`})}},{name:`codeBlock`,label:`Code Block`,icon:wr,category:`basic`,command:e=>e.chain().focus().toggleCodeBlock().run(),aliases:[`code`,`fence`],preview:{description:`Fenced code block with monospace text.`,render:()=>(0,K.jsx)(`pre`,{className:`rounded-md bg-muted px-2.5 py-2 font-mono text-xs leading-5`,children:(0,K.jsx)(`code`,{children:`const greeting = "Hello";
7
- console.log(greeting);`})})}},{name:`table`,label:`Table`,icon:$r,category:`insert`,command:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),aliases:[`grid`],preview:{description:`Grid of rows and columns with a header row.`,render:()=>(0,K.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:`Name`}),(0,K.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:`Role`})]})}),(0,K.jsxs)(`tbody`,{children:[(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Ada`}),(0,K.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Engineer`})]}),(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Grace`}),(0,K.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Admiral`})]})]})]})}},{name:`separator`,label:`Separator`,icon:Wr,category:`insert`,command:e=>e.chain().focus().setHorizontalRule().run(),aliases:[`hr`,`divider`,`rule`],preview:{description:`Horizontal rule that divides sections.`,render:()=>(0,K.jsxs)(`div`,{className:`w-full`,children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:`Above`}),(0,K.jsx)(`hr`,{className:`border-border`}),(0,K.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Below`})]})}},{name:`footnote`,label:`Footnote`,icon:Qr,category:`insert`,command:e=>{let t=0;e.state.doc.descendants(e=>{if(e.type.name===`footnoteDefinition`){let n=String(e.attrs.identifier??``),r=Number.parseInt(n,10);!Number.isNaN(r)&&r>t&&(t=r)}return!0});let n=String(t+1),r=e.state.doc.content.size;e.chain().focus().insertFootnoteReference(n).insertContentAt(r+1,{type:`footnoteDefinition`,attrs:{identifier:n,label:n},content:[{type:`paragraph`}]}).run()},aliases:[`fn`,`ref`,`[^`],preview:{description:`Insert a footnote reference + matching definition stub.`,render:()=>(0,K.jsxs)(`p`,{className:`text-sm leading-6`,children:[`A line with a footnote`,(0,K.jsx)(`sup`,{className:`footnote-ref`,children:(0,K.jsx)(`a`,{className:`footnote-ref-link`,href:`#fn-1`,children:`[1]`})}),` `,`and a definition shown below.`]})}},{name:`inlineMath`,label:`Inline Math`,icon:Xr,category:`insert`,command:e=>{let t=e.state.selection.from;e.chain().focus().insertMathInline(``).run(),OT(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})},aliases:[`math`,`latex`,`equation`,`formula`,`katex`,`inlinemath`]}];function RT(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)||e.aliases?.some(e=>e.toLowerCase().includes(n)))}function zT(e){let{$from:t}=e.selection;return t.depth===0?null:{from:t.before(1),to:t.after(1)}}function BT(e,t){let n=zT(e);if(!n)return!1;let{from:r,to:i}=n;if(r===0)return!1;let a=e.doc.resolve(r-1);if(a.depth===0)return!1;let o=a.before(1),s=e.doc.slice(r,i).content,c=e.doc.slice(o,r).content;if(!t)return!0;let l=e.tr;l.replaceWith(o,i,s.append(c));let u=o+1,d=o+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(h.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}function VT(e,t){let n=zT(e);if(!n)return!1;let{from:r,to:i}=n;if(i>=e.doc.content.size)return!1;let a=e.doc.resolve(i+1);if(a.depth===0)return!1;let o=a.after(1),s=e.doc.slice(r,i).content,c=e.doc.slice(i,o).content;if(!t)return!0;let l=e.tr;l.replaceWith(r,o,c.append(s));let u=r+c.size+1,d=r+c.size+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(h.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}var HT=o.create({name:`blockMover`,addKeyboardShortcuts(){return{"Mod-Shift-ArrowUp":({editor:e})=>BT(e.state,e.view.dispatch),"Mod-Shift-ArrowDown":({editor:e})=>VT(e.state,e.view.dispatch)}}}),UT=new ke(`bridgeId`);function WT(e){let t=i_.getState(e);return t?.binding?.mapping?t.binding.mapping:null}function GT(e){let t=WT(e);if(!t)return null;let n=new Map;for(let[e,r]of t)r&&`nodeName`in e&&typeof e.getAttribute==`function`&&n.set(r,e);return n}function KT(e,t){return e?e.get(t)??null:null}var qT=o.create({name:`bridgeIdPlugin`,priority:1e3,addProseMirrorPlugins(){return[new At({key:UT,state:{init(e,t){let n={yElementToId:new WeakMap,posToId:new Map,counter:0},r=GT(t);return t.doc.descendants((e,t)=>{if(e.type.name!==`jsxComponent`)return;let i=KT(r,e);if(i){let e=`b${++n.counter}`;n.yElementToId.set(i,e),n.posToId.set(t,e)}else{let e=`b${++n.counter}`;n.posToId.set(t,e)}}),n},apply(e,t,n,r){if(!e.docChanged){let n=new Map;for(let[i,a]of t.posToId){let t=e.mapping.map(i);r.doc.nodeAt(t)?.type.name===`jsxComponent`&&n.set(t,a)}return{...t,posToId:n}}let i=new Map,{counter:a}=t,{yElementToId:o}=t,s=GT(r);return r.doc.descendants((n,r)=>{if(n.type.name!==`jsxComponent`)return;let c=KT(s,n);if(c){let e=o.get(c);if(e)i.set(r,e);else{let e=`b${++a}`;o.set(c,e),i.set(r,e)}}else{let n=!1;for(let[a,o]of t.posToId)if(e.mapping.map(a)===r){i.set(r,o),n=!0;break}if(!n){let e=`b${++a}`;i.set(r,e)}}}),{yElementToId:o,posToId:i,counter:a}}}})]}}),JT=new ke(`chunkWrapperDecoration`),YT=`ok-chunk-wrapper`,XT=!1;function ZT(){return globalThis.CSS===void 0||typeof globalThis.CSS.supports!=`function`?!0:globalThis.CSS.supports(`content-visibility`,`auto`)}var QT=ZT();function $T(){return QT?new At({key:JT,props:{decorations(e){let t=[];return e.doc.forEach((e,n)=>{e.isInline||t.push(tt.node(n,n+e.nodeSize,{class:YT}))}),t.length===0?null:(XT||(XT=!0,Y(`ok/render/cv-auto-skip`,{chunkCount:t.length},{startTime:performance.now(),duration:0})),We.create(e.doc,t))}}}):new At({key:JT})}function eE(e){return!!e.getMeta(i_)}function tE(e,t){let n=i_.getState(e);return K_(n.doc,n.type,t,n.binding.mapping)||0}function nE(e,t){let n=i_.getState(e);return W_(t,n.type,n.binding.mapping)}var rE=class e extends Re{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function iE(e,t){return new rE(e,nE(t,e))}function aE(e,t,n){let r=e instanceof rE?e.yRelativePosition:null;if(eE(t)&&r)return{position:new rE(tE(n,r),r),mapResult:null};let i=Me(e,t),a=i.position.position;return{position:new rE(a,r??nE(n,a)),mapResult:i.mapResult}}var oE=o.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>aE(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>iE(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),a_.getState(t).undoManager.undoStack.length===0?!1:n?ev(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),a_.getState(t).undoManager.redoStack.length===0?!1:n?tv(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=iv(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=a_.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[p_(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new At({key:new ke(`filterInvalidContent`),filterTransaction:t=>{if(!eE(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function sE(e){if(!e.length)return We.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(tt.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),We.create(n,t)}function cE(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function lE(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new _(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=cE(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new de(a.resolve(l),a.resolve(u));i.push(p)}),i}var uE=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new dE(e.resolve(this.anchor),e.resolve(this.head))}},dE=class e extends Dt{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=lE(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new uE(this.anchor,this.head)}};dE.prototype.visible=!1;function fE(e){return e instanceof dE}o.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!fE(a)){let e=dE.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!fE(a)){let e=dE.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=dE.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;fE(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new At({key:new ke(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=dE.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=fE(r);if(e=!1,!t)return i?(e=!0,sE(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=lE(a,o,this.options.depth);return s.length?(e=!0,sE(s)):null}}})]}});function pE(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function mE(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=pE(e)}),t}var hE=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],gE={edges:[`left`,`top`],threshold:12,strength:500};function _E(e){return e===void 0||e===`left`?{...gE}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...gE,...e}}function vE(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function yE(e,t,n,r){return!t||n.edges.length===0?0:vE(e,t,n)?n.strength*r:0}var bE=1e3;function xE(e,t,n,r){let i=bE,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=yE(r,o,n,e.depth),i<=0?-1:i}function SE(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function CE(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...hE),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!SE(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=xE({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=SE(a,l,n.allowedContainers)),p){let r=xE({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function wE(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function TE(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function EE(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!TE(s)||!TE(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var DE=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=EE(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=CE(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=wE(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function OE(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function kE(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function AE(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=DE({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return lE(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function jE(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=AE(e,t,n,r),l=lE(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,OE(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=bt.create(i.state.doc,m)):(v=dE.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=mE(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,document.body.append(p),e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=e.clientX-y.left;e.dataTransfer.setDragImage(p,Math.max(0,Math.min(b,y.width)),0);let x=!1,S=()=>{x||(x=!0,kE(p),document.removeEventListener(`drop`,S),document.removeEventListener(`dragend`,S))},C=v instanceof bt?v:void 0;i.dragging={slice:_,move:!0,node:C},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,S),document.addEventListener(`dragend`,S)}var ME=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},NE=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},PE=(e,t)=>{let n=i_.getState(e);return n?W_(t,n.type,n.binding.mapping):null},FE=(e,t)=>{let n=i_.getState(e);return n?K_(n.doc,n.type,t,n.binding.mapping)||0:-1},IE=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},LE=new ke(`dragHandle`),RE=({pluginKey:e=LE,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){Ye(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),jE(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function b(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function x(){if(Qe()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new At({key:typeof e==`string`?new ke(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(eE(e)){let e=FE(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=PE(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,b),document.addEventListener(`drop`,x),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=IE(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=NE(n.state.doc,s),l=ME(n.state.doc,s);d=c,f=l,p=PE(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null),t&&kE(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=DE({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=IE(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=NE(n.state.doc,t),l=ME(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=PE(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function zE(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:_E(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:_E(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:_E(e.edgeDetection)}}var BE={placement:`left-start`,strategy:`absolute`};o.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=zE(this.options.nested);return[RE({computePositionConfig:{...BE,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var VE=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),HE=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),UE=new Set([`aria-label`,`aria-description`,`title`]),WE=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,GE=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,KE=/\bexpression\s*\(/i,qE=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,JE=`data-clipboard-omit`;function YE(e){let t=e.trim();return t===``||Je.test(t)?!0:V(t)}function XE(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!YE(t.split(/\s+/)[0]??``))return!1}return!0}function ZE(e,t){let n=!1,r=e.replace(WE,e=>YE(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function QE(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function $E(e){return e.length>1e4||GE.test(e)||KE.test(e)?``:e}function eD(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=tD(i[0],1),o=tD(i[1],1),s=tD(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=tD(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function tD(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function nD(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function rD(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function iD(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function aD(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function oD(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=nD(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=nD(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=rD(a,o,s);return[aD(iD(c)),aD(iD(l)),aD(iD(u))]}function sD(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(qE,(e,t,n)=>{let r=eD(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=oD(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var cD=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function lD(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(V(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if(cD.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return VE.IPv4.isValid(o)?VE.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:VE.IPv6.isValid(o)?VE.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}function uD(e){if(!e)return`plaintext`;if(e.types.includes(`vscode-editor-data`))return`vscode`;if(e.types.includes(`text/x-gfm`))return`gfm`;let t=e.getData(`text/html`);return t?/data-pm-slice/i.test(t)?`pm-origin`:/docs-internal-guid-/i.test(t)?`gdocs`:/xmlns:o="urn:schemas-microsoft-com:office/i.test(t)||/<meta[^>]*Generator[^>]*Microsoft Word/i.test(t)?`word`:/class="gmail_|class='gmail_/i.test(t)?`gmail`:/notionvc:/i.test(t)?`notion`:/Cocoa HTML Writer/i.test(t)?`apple`:/c-message_kit__|c-message__|c-compose/i.test(t)?`slack`:/google-sheets-html-origin/i.test(t)?`gsheets`:/data-hovercard-type=/i.test(t)?`github`:`generic`:`plaintext`}var dD=250,fD=100;function pD(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?dD:fD)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function mD(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function hD(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function gD(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function _D(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function vD(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function yD(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function bD(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function xD(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var SD=new Set;function CD(e){SD.has(e.lucideClass)||(SD.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function wD(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function TD(e){if(e instanceof nt)return`HtmlPayloadTooLargeError`;if(e instanceof at)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var ED=/^```/m,DD=/^#{1,6} /m,OD=/^[-*+] /m,kD=/^\d+[.)] /m,AD=/\[[^\]\n]+\]\([^)\n]+\)/,jD=/^\|.*\|$/m,MD=/^\|?\s*(:?-+:?)(\s*\|\s*:?-+:?)+\s*\|?$/m,ND=/\$\$[\s\S]+?\$\$/,PD=/^> /m,FD=/`[^`\n]+`/,ID=/\*\*[^*\n]+\*\*/,LD=/__[^_\n]+__/,RD=/~~[^~\n]+~~/,zD=/<[A-Z]\w*[\s/>]/,BD=/<[a-z]+\s+\w+="[^"]*"/,VD=/<[a-z]+>[^<\n]*<\/[a-z]+>/,HD=/^.+\n[=-]+$/m,UD=/(^|\s)\*[^*\s\n][^*\n]*[^*\s\n]\*(\s|$)/m,WD=/(^|\s)_[^_\s\n][^_\n]*[^_\s\n]_(\s|$)/m,GD=/^~~~/m,KD=/\\[\\`*_{}[\]<>()#+\-.!|]/,qD=256*1024,JD=32*1024;function YD(e){return e.length<=qD?e:`${e.slice(0,JD)}\n${e.slice(-JD)}`}function XD(e){if(!e)return!1;let t=YD(e),n=0;ED.test(t)&&n++,DD.test(t)&&n++,OD.test(t)&&n++,kD.test(t)&&n++,AD.test(t)&&n++,jD.test(t)&&MD.test(t)&&n++,ND.test(t)&&n++,PD.test(t)&&n++,FD.test(t)&&n++,(ID.test(t)||LD.test(t)||RD.test(t))&&n++,zD.test(t)&&n++,BD.test(t)&&n++,VD.test(t)&&n++,HD.test(t)&&n++,UD.test(t)&&n++,WD.test(t)&&n++,GD.test(t)&&n++,KD.test(t)&&n++;let r=t.split(`
8
- `).length,i=Math.min(3,Math.floor(r/5));return n>=Math.max(1,i)}var ZD=3e3,QD=new Map;function $D(e,t=`Pasted as plain text — some formatting could not be converted.`){let n=Date.now();return n-(QD.get(e)??0)<ZD?!1:(QD.set(e,n),cn.error(t),!0)}var eO=!1,tO=!1;function nO(e){eO=e.shiftKey}function rO(e){(e.key===`Shift`||!e.shiftKey)&&(eO=!1)}function iO(){eO=!1}function aO(){tO||typeof window>`u`||(window.addEventListener(`keydown`,nO,!0),window.addEventListener(`keyup`,rO,!0),window.addEventListener(`blur`,iO,!0),tO=!0)}function oO(){aO()}function sO(){return aO(),eO}function cO(e){return sO()?!0:e.shiftKey===!0}function lO(e){return(t,n)=>dO(t,n,`paste`,e)}function uO(e){return(t,n)=>n.dataTransfer?.files&&n.dataTransfer.files.length>0?!1:dO(t,n,`drop`,e)}function dO(e,t,n,r){let i=n===`paste`?t.clipboardData:t.dataTransfer;if(!i||i.types.length===0)return!1;let a=performance.now(),o=uD(i),s=i.getData(`text/plain`),c=i.getData(`text/html`);if(fO(t,n))return s&&mO(e,s),mD({view:`wysiwyg`,branch:`shift`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`shift`,source:o}),!0;if(pO(e))return s&&mO(e,s),mD({view:`wysiwyg`,branch:`codeblock`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`codeblock`,source:o}),!0;let l=i.getData(`vscode-editor-data`);if(l&&s&&gO(e,l,s,o))return mD({view:`wysiwyg`,branch:`A`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`A`,source:o}),!0;let u=i.getData(`text/x-gfm`);return u&&_O(e,u,r,`B`,o)||s&&c&&XD(s)&&_O(e,s,r,`B`,o)?(mD({view:`wysiwyg`,branch:`B`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`B`,source:o}),!0):c&&/data-pm-slice/i.test(c)?(mD({view:`wysiwyg`,branch:`C`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`C`,source:o}),!1):c&&vO(e,c,r,o)?(mD({view:`wysiwyg`,branch:`D`,source:o}),pD(a,{op:n,view:`wysiwyg`,branch:`D`,source:o,htmlBytes:c.length}),!0):s?XD(s)&&_O(e,s,r,`E`,`markdown-text`)?(mD({view:`wysiwyg`,branch:`E`,source:`markdown-text`}),pD(a,{op:n,view:`wysiwyg`,branch:`E`,source:`markdown-text`}),!0):(mO(e,s),mD({view:`wysiwyg`,branch:`E`,source:`plaintext`}),pD(a,{op:n,view:`wysiwyg`,branch:`E`,source:`plaintext`}),!0):!1}function fO(e,t){return t===`paste`?cO(e):e.shiftKey===!0}function pO(e){let{$from:t}=e.state.selection;for(let e=t.depth;e>=0;e--)if(t.node(e).type.name===`codeBlock`)return!0;return!1}function mO(e,t){let{schema:n,tr:r}=e.state;t&&e.dispatch(r.replaceSelectionWith(n.text(t)).scrollIntoView())}var hO=/^[A-Za-z0-9_+-]+$/;function gO(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=hO.test(i)?i:``,o=e.state.schema.nodes.codeBlock;if(!o)return!1;let s=o.create({language:a},n?e.state.schema.text(n):null);return e.dispatch(e.state.tr.replaceSelectionWith(s).scrollIntoView()),!0}catch(e){return hD({view:`wysiwyg`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:TD(e)}),!1}}function _O(e,t,n,r,i){let a;try{a=n.mdManager.parse(t)}catch(e){return hD({view:`wysiwyg`,stage:`mdManagerParse`,source:i,branch:r,reason:e?.message??`unknown`,errorClass:TD(e)}),!1}return yO(e,a,i,r)}function vO(e,t,n,r){let i;try{i=kt(t)}catch(e){return hD({view:`wysiwyg`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:TD(e),htmlBytes:t.length}),$D(`wysiwyg`),!1}let a;try{a=A(i)}catch(e){return hD({view:`wysiwyg`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:TD(e),htmlBytes:t.length}),$D(`wysiwyg`),!1}let o;try{o=n.mdManager.parse(a)}catch(e){return hD({view:`wysiwyg`,stage:`mdManagerParse`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:TD(e),htmlBytes:t.length}),$D(`wysiwyg`),!1}return yO(e,o,r,`D`,t.length)}function yO(e,t,n,r,i){try{let n=e.state.schema.nodeFromJSON(t);return e.dispatch(e.state.tr.replaceSelection(n.slice(0,n.content.size)).scrollIntoView()),!0}catch(e){return hD({view:`wysiwyg`,stage:`applyJsonSlice`,source:n,branch:r,reason:e?.message??`unknown`,errorClass:TD(e),...i==null?{}:{htmlBytes:i}}),!1}}function bO(e){if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Math`:return{source:`$$\n${typeof n.formula==`string`?n.formula:``}\n$$`};case`Mermaid`:return{source:`\`\`\`mermaid\n${typeof n.chart==`string`?n.chart:``}\n\`\`\``};default:return null}}function xO(e,t){let n=bO(e);if(!n)return null;let r=t.createElement(`pre`);r.className=`mdx-component`;let i=t.createElement(`code`);return i.textContent=n.source,r.appendChild(i),r}var SO={note:{color:`#0969da`,bg:`#dbeafe`},tip:{color:`#1f883d`,bg:`#dcfce7`},important:{color:`#8250df`,bg:`#f3e8ff`},warning:{color:`#9a6700`,bg:`#fef3c7`},caution:{color:`#cf222e`,bg:`#fee2e2`}};function CO(e){return Object.hasOwn(SO,e)?SO[e]:SO.note}function wO(e){let t=typeof e.type==`string`?e.type:`note`,n=CO(t),r=document.createElement(`aside`);if(r.setAttribute(`class`,`callout callout-${t}`),r.setAttribute(`data-callout-type`,t),r.setAttribute(`style`,`border-left: 3px solid ${n.color}; background-color: ${n.bg}; padding: 0.5rem 0.75rem; border-radius: 0.25rem;`),typeof e.title==`string`&&e.title){let t=document.createElement(`strong`);t.textContent=e.title,r.appendChild(t)}return r}function TO(e){let t=document.createElement(`details`);e.defaultOpen===!0&&t.setAttribute(`open`,``),t.setAttribute(`class`,`accordion`);let n=document.createElement(`summary`);return n.textContent=typeof e.title==`string`?e.title:`Accordion`,t.appendChild(n),t}function EO(e){let t=lD(e);return t.portable?null:t.reason}function DO(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t}function OO(e,t,n){if(e===``)return null;let r;try{r=EO(e)}catch(e){let n=TD(e);return xD({view:`wysiwyg`,tag:t,phase:`classifier-throw`,...n===void 0?{}:{errorClass:n}}),null}return r===null?null:(bD({view:`wysiwyg`,tag:t,class:`mdx-component`,reason:r}),DO(n))}function kO(e){let t=typeof e.alt==`string`?e.alt:``,n=typeof e.src==`string`?e.src:``,r=OO(n,`img`,`![${t}](${n})`);if(r!==null)return r;let i=document.createElement(`img`);return n&&YE(n)&&i.setAttribute(`src`,n),typeof e.alt==`string`&&i.setAttribute(`alt`,e.alt),i}function AO(e,t){let n=document.createElement(e);return n.setAttribute(`src`,t),n.outerHTML}function jO(e){let t=typeof e.src==`string`?e.src:``,n=OO(t,`video`,AO(`video`,t));if(n!==null)return n;let r=document.createElement(`video`);return t&&YE(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function MO(e){let t=typeof e.src==`string`?e.src:``,n=OO(t,`audio`,AO(`audio`,t));if(n!==null)return n;let r=document.createElement(`audio`);return t&&YE(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function NO(e){if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Callout`:case`GFMCallout`:return wO(n);case`Accordion`:case`HtmlDetailsAccordion`:return TO(n);case`img`:case`CommonMarkImage`:return kO(n);case`video`:return jO(n);case`audio`:return MO(n);case`Math`:case`Mermaid`:return xO(e,document);default:return null}}var PO=`color.background-color.background-image.border.border-top.border-right.border-bottom.border-left.border-color.border-width.border-style.border-radius.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.text-decoration.text-align.line-height.list-style.list-style-type.list-style-position.vertical-align.white-space`.split(`.`),FO=new Set([`jsx-component-wrapper`,`selectedCell`,`is-empty`,`ProseMirror-selectednode`,`ProseMirror-trailingBreak`]),IO=new Set([`data-selected`,`data-has-child-selected`,`data-dragging`,`contenteditable`,`data-pm-slice`]),LO={getComputedStyle:e=>window.getComputedStyle(e)};function RO(e,t=PO){let n=``;for(let r of t){let t=e.getPropertyValue(r);t&&(t===`initial`||t===`normal`||(n+=`${r}: ${sD(t)}; `))}return n.trim()}function zO(e,t=FO){return e.split(/\s+/).filter(e=>e.length>0&&!t.has(e)).join(` `)||null}function BO(e,t,n){let r=!1;return e.nodesBetween(t,n,(i,a,o)=>(o===e&&(t>a||n<a+i.nodeSize)&&(r=!0),!1)),r}function VO(e,t,n=LO){let r=document.createDocumentFragment(),{from:i,to:a}=t.state.selection;return i===a||BO(t.state.doc,i,a)||t.state.doc.nodesBetween(i,a,(e,i,a)=>{if(a!==t.state.doc)return!1;let o=t.nodeDOM(i);if(o==null){_D({descriptor:e.type.name,view:`wysiwyg`});let t=NO(e);return t&&r.appendChild(t),!1}if(!(o instanceof Element)||o.getAttribute(`data-clipboard-omit`)===`true`)return!1;let s=xO(e,document);return s===null?(r.appendChild(HO(o,n)),!1):(r.appendChild(s),vD({view:`wysiwyg`,descriptor:e.attrs.componentName??e.type.name}),!1)}),r}function HO(e,t){let n=e.cloneNode(!0);return JO(e,n,t),YO(n),UO(n),sk(e,n,t),qO(n),n}function UO(e){let t=Array.from(e.querySelectorAll(`[data-component-type="math-inline"]`));for(let n of t){if(!n.parentNode)continue;let t=n.getAttribute(`data-formula`)??``,r=e.ownerDocument.createElement(`span`);r.className=`mdx-inline`,r.textContent=`$$${t}$$`,n.replaceWith(r),vD({view:`wysiwyg`,descriptor:`mathInline`})}let n=Array.from(e.querySelectorAll(`a[data-wiki-embed]`));for(let t of n){if(!t.parentNode)continue;let n=t.getAttribute(`data-target`)??``;if(!n)continue;let r=t.getAttribute(`data-alias`)||null,i=t.getAttribute(`data-anchor`)||null,a=e.ownerDocument.createElement(`span`);a.className=`mdx-inline`,a.textContent=WO(n,i,r),t.replaceWith(a),vD({view:`wysiwyg`,descriptor:`wikiLinkEmbed`})}}function WO(e,t,n){let r=e;return t&&(r+=`#${t}`),n&&(r+=`|${n}`),`![[${r}]]`}var GO={"lucide-chevron-right":`›`,"lucide-chevron-down":`⌄`,"lucide-info":`ℹ`,"lucide-lightbulb":`💡`,"lucide-message-square-warning":`❗`,"lucide-alert-triangle":`⚠`,"lucide-alert-octagon":`⛔`},KO=/(?:^|\s)(lucide-[a-z0-9-]+)(?:\s|$)/;function qO(e){let t=e.querySelectorAll(`svg`);for(let e of Array.from(t)){let t=(e.getAttribute(`class`)??``).match(KO);if(!t)continue;let n=t[1],r=GO[n];if(!r){CD({lucideClass:n,view:`wysiwyg`});continue}let i=e.ownerDocument.createElement(`span`);i.setAttribute(`aria-hidden`,`true`),i.textContent=r,e.replaceWith(i)}}function JO(e,t,n){let r=RO(n.getComputedStyle(e));if(r){let e=t.getAttribute(`style`);t.setAttribute(`style`,e?`${e}; ${r}`:r)}let i=t.getAttribute(`class`);if(i!==null){let e=zO(i);e?t.setAttribute(`class`,e):t.removeAttribute(`class`)}for(let e of Array.from(t.attributes)){if(IO.has(e.name)){t.removeAttribute(e.name);continue}if(QE(e.name)){t.removeAttribute(e.name),yD({attr:`on*`,reason:`event-handler`,view:`wysiwyg`});continue}if(e.name===`style`){let n=$E(e.value);n===``?(t.removeAttribute(`style`),yD({attr:`style`,reason:`unsafe-url-or-expression`,view:`wysiwyg`})):n!==e.value&&t.setAttribute(`style`,n);continue}if(HE.has(e.name)){(e.name===`srcset`?XE(e.value):YE(e.value))||(t.removeAttribute(e.name),yD({attr:e.name,reason:e.name===`srcset`?`srcset-candidate`:`scheme`,view:`wysiwyg`}));continue}if(UE.has(e.name)){let n=ZE(e.value,{reportNoChange:!0});n!==null&&(t.setAttribute(e.name,n),yD({attr:e.name,reason:`embedded-url`,view:`wysiwyg`}))}}let a=Array.from(e.children),o=Array.from(t.children),s=Math.min(a.length,o.length);for(let e=0;e<s;e++){let t=a[e],r=o[e];if(t.getAttribute(`data-clipboard-omit`)===`true`){r.remove();continue}JO(t,r,n)}}function YO(e){let t=e.querySelectorAll(`span[data-wiki-link]`);for(let e of Array.from(t)){let t=e.getAttribute(`data-target`)??``;if(!t)continue;let n=Mt(e.getAttribute(`data-anchor`)),r=Mt(e.getAttribute(`data-alias`)),i=P(t,n),a=e.ownerDocument.createElement(`a`);a.setAttribute(`class`,`wiki-link`),a.setAttribute(`href`,i),a.setAttribute(`data-target`,t),a.setAttribute(`data-anchor`,n??``),a.setAttribute(`data-alias`,r??``),a.textContent=e.textContent??``,e.replaceWith(a)}}var XO=new Set([`img`,`video`,`audio`,`source`,`a`]);function ZO(e){return XO.has(e)}function QO(e){return e.closest(`p`)===null?`mdx-component`:`mdx-inline`}function $O(e,t,n){if(t===`mdx-component`){let t=e.createElement(`pre`);t.className=`mdx-component`;let r=e.createElement(`code`);return r.textContent=n,t.appendChild(r),t}let r=e.createElement(`span`);return r.className=`mdx-inline`,r.textContent=n,r}function ek(e){let t=lD(e);return t.portable?null:t.reason}function tk(e){for(let t of e.split(`,`)){let e=t.trim();if(e===``)continue;let n=ek(e.split(/\s+/)[0]??``);if(n!==null)return n}return null}function nk(e,t){switch(t){case`img`:case`source`:{let t=e.getAttribute(`src`);if(t!==null){let e=ek(t);if(e!==null)return e}let n=e.getAttribute(`srcset`);if(n!==null){let e=tk(n);if(e!==null)return e}return null}case`video`:case`audio`:{let t=e.getAttribute(`src`);return t===null?null:ek(t)}case`a`:{let t=e.getAttribute(`href`);return t===null?null:ek(t)}default:return null}}function rk(e){let t=e.querySelectorAll(`source, img`);for(let e of Array.from(t)){let t=e.tagName.toLowerCase();if(!ZO(t))continue;let n=nk(e,t);if(n!==null)return n}return null}function ik(e,t,n,r){let i;try{i=nk(n,r)}catch(e){let t=TD(e);return xD({view:`wysiwyg`,tag:r,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return i===null?!1:ok(e,t,n,r,i)}function ak(e,t,n){let r;try{r=rk(n)}catch(e){let t=TD(e);return xD({view:`wysiwyg`,tag:`picture`,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return r===null?!1:ok(e,t,n,`picture`,r)}function ok(e,t,n,r,i){let a=e.serializeElementMarkdown?e.serializeElementMarkdown(t):{kind:`no-correspondence`};switch(a.kind){case`no-correspondence`:return xD({view:`wysiwyg`,tag:r,phase:`serializer-null`}),!1;case`failed`:{let e=a.errorClass;return xD({view:`wysiwyg`,tag:r,phase:`serializer-throw`,...e===void 0?{}:{errorClass:e}}),!1}case`ok`:{let e=QO(n),t=$O(n.ownerDocument,e,a.markdown);return n.replaceWith(t),bD({view:`wysiwyg`,tag:r,class:e,reason:i}),!0}default:return!1}}function sk(e,t,n){if(!n.serializeElementMarkdown)return;let r=t.tagName.toLowerCase();if(r===`picture`&&ak(n,e,t)||ZO(r)&&ik(n,e,t,r))return;let i=Array.from(e.children),a=Array.from(t.children),o=[];for(let e of i)e.getAttribute(`data-clipboard-omit`)!==`true`&&o.push(e);let s=Math.min(o.length,a.length);for(let e=0;e<s;e++)sk(o[e],a[e],n)}function ck(e){return(t,n)=>{try{return dk(t,n.state.schema,e.mdManager)}catch(e){return gD({view:`wysiwyg`,kind:`text`,reason:e?.message??`unknown`}),t.content.textBetween(0,t.content.size,`
9
-
10
- `)}}}var lk=class extends me{mdManager;view=null;constructor(e){super({},{}),this.mdManager=e}setView(e){this.view=e}serializeFragment(e,t,n){let r=this.view;if(r&&r.state.selection.from!==r.state.selection.to)try{let e=VO(r.state.selection.content(),r,pk(r,this.mdManager));if(e.childNodes.length>0){if(n){for(let t of Array.from(e.childNodes))n.appendChild(t);return n}return e}}catch(e){gD({view:`wysiwyg`,kind:`html`,reason:`walker:${e?.message??`unknown`}`})}try{let t=e.firstChild?.type.schema;if(!t)return n??document.createDocumentFragment();let r=gk(mk(e,t,this.mdManager));if(n){for(let e of Array.from(r.childNodes))n.appendChild(e);return n}return r}catch(e){return gD({view:`wysiwyg`,kind:`html`,reason:`markdown:${e?.message??`unknown`}`}),n??document.createDocumentFragment()}}};function uk(e){let t=new lk(e.mdManager);return{serializer:t,setView:e=>t.setView(e)}}function dk(e,t,n){return n.serialize(hk(e,t))}function fk(e){let t=null,n=e;for(;n&&!n.classList.contains(`ProseMirror`);)(n.classList.contains(`react-renderer`)||n.hasAttribute(`data-node-view-wrapper`)||n.hasAttribute(`data-jsx-component`))&&(t=n),n=n.parentElement;return t}function pk(e,t){return{getComputedStyle:e=>window.getComputedStyle(e),serializeElementMarkdown:n=>{let r=fk(n),i;try{let t=r?.parentElement;if(t&&r){let n=Array.from(t.children).indexOf(r);i=e.posAtDOM(t,n,-1)}else i=e.posAtDOM(n,0)}catch(e){return{kind:`failed`,errorClass:TD(e)}}if(i<0)return{kind:`no-correspondence`};let a=e.state.doc.nodeAt(i);if(!a)return{kind:`no-correspondence`};let o=e.state.doc.slice(i,i+a.nodeSize);try{return{kind:`ok`,markdown:dk(o,e.state.schema,t)}}catch(e){return{kind:`failed`,errorClass:TD(e)}}}}}function mk(e,t,n){return C(dk(new te(e,0,0),t,n))}function hk(e,t){let n=e.content;if(n.firstChild?.isInline){let e=t.nodes.paragraph;if(e){let t=e.createAndFill(null,n);t&&(n=b.from(t))}}let r=t.topNodeType.createAndFill(null,n);if(!r){let e=t.topNodeType.createAndFill();if(!e)throw Error(`[clipboard] schema cannot fill topNodeType`);return e.toJSON()}return r.toJSON()}function gk(e){let t=new DOMParser().parseFromString(e,`text/html`),n=document.createDocumentFragment();for(let e of Array.from(t.body.childNodes))n.appendChild(e);return n}function _k(e){return oO(),Nn.domEventHandlers({copy:(e,t)=>yk(e,t,`copy`),cut:(e,t)=>yk(e,t,`cut`),paste:(t,n)=>bk(t,n,e)})}function vk(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t.outerHTML}function yk(e,t,n){let{from:r,to:i}=t.state.selection.main;if(r===i)return e.preventDefault(),!0;let a=e.clipboardData;if(!a)return!1;let o=performance.now();try{let s=t.state.sliceDoc(r,i);a.setData(`text/plain`,s);try{a.setData(`text/html`,vk(s))}catch(e){gD({view:`source`,kind:`html`,reason:e?.message??`unknown`})}return e.preventDefault(),n===`cut`&&t.dispatch({changes:{from:r,to:i,insert:``}}),pD(o,{op:n,view:`source`,branch:`serialize`,source:`local`}),!0}catch(e){return gD({view:`source`,kind:`text`,reason:e?.message??`unknown`}),!1}}function bk(e,t,n){let r=e.clipboardData;if(!r||r.types.length===0)return!1;let i=performance.now(),a=uD(r),o=r.getData(`text/plain`),s=r.getData(`text/html`);if(cO(e))return mD({view:`source`,branch:`shift`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`shift`,source:a}),!1;let c=r.getData(`vscode-editor-data`);return c&&o&&Sk(t,c,o,a)?(e.preventDefault(),mD({view:`source`,branch:`A`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`A`,source:a}),!0):o&&s&&XD(o)?(mD({view:`source`,branch:`B`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`B`,source:a}),!1):s&&/data-pm-slice/i.test(s)?(mD({view:`source`,branch:`C`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`C`,source:a}),!1):s&&Ck(t,s,n,a)?(e.preventDefault(),mD({view:`source`,branch:`D`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`D`,source:a,htmlBytes:s.length}),!0):(mD({view:`source`,branch:`E`,source:a}),pD(i,{op:`paste`,view:`source`,branch:`E`,source:a}),!1)}var xk=/^[A-Za-z0-9_+-]+$/;function Sk(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=`\`\`\`${xk.test(i)?i:``}\n${n}\n\`\`\`\n`,{from:o,to:s}=e.state.selection.main;return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length}}),!0}catch(e){return hD({view:`source`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:TD(e)}),!1}}function Ck(e,t,n,r){let i;try{i=kt(t)}catch(e){return hD({view:`source`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:TD(e),htmlBytes:t.length}),!1}let a;try{a=A(i)}catch(e){return hD({view:`source`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:TD(e),htmlBytes:t.length}),!1}let{from:o,to:s}=e.state.selection.main;if(!(a.length>500*1024))return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length}}),!0;let c=o===s?``:e.state.sliceDoc(o,s);o!==s&&e.dispatch({changes:{from:o,to:s,insert:``}});let l=o,u=$p(n.ytext,l);return oe(n.ydoc,n.ytext,l,a,{resolveOffset:e=>{let t=tm(u,n.ydoc);return t==null?e:t.index+(e-l)}}).catch(i=>{wk({view:e,source:r,html:t,restoreText:c,anchorIndex:l,anchorRelPos:u,ydoc:n.ydoc,err:i})}),!0}function wk(e){let{view:t,source:n,html:r,restoreText:i,anchorIndex:a,anchorRelPos:o,ydoc:s,err:c}=e,l=`no-restore-needed`;if(c instanceof at&&c.bytesWritten>0){let e=o&&s?tm(o,s)?.index??a:a,n=Math.min(e+c.bytesWritten,t.state.doc.length);try{t.dispatch({changes:{from:e,to:n,insert:i}}),l=i.length>0?`restored`:`no-restore-needed`}catch(e){console.warn(`[clipboard] partial-chunk rollback dispatch failed`,e),l=i.length>0?`restore-failed`:`no-restore-needed`}}else if(i.length>0)try{t.dispatch({changes:{from:a,to:a,insert:i}}),l=`restored`}catch(e){console.warn(`[clipboard] selection-restore dispatch failed`,e),l=`restore-failed`}let u=l===`restored`?` Your selection has been restored.`:l===`restore-failed`?` Your selection could not be restored.`:``;if(c instanceof at){wD({view:`source`,chunksCompleted:c.chunksCompleted,totalChunks:c.totalChunks,bytesWritten:c.bytesWritten,bytesRemaining:c.bytesRemaining,reason:c.message}),cn.error(`Paste was incomplete — ${c.chunksCompleted} of ${c.totalChunks} chunks landed.${u}`);return}hD({view:`source`,stage:`chunkedYTextInsert`,source:n,branch:`D`,reason:c?.message??`unknown`,errorClass:TD(c),htmlBytes:r.length}),cn.error(`Paste failed.${u}`)}var Tk=20,Ek=44,Dk=28;function Ok(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.setAttribute(JE,`true`),e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`div`);return n.className=`ok-drag-grip`,n.setAttribute(`aria-hidden`,`true`),n.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t}}function kk(e,t,n){let{state:r,view:i}=e;if(n.type.name===`jsxComponent`){let i=n.attrs.componentName??``;if(i){let a=bT(i);if(a.emptyChildName){let i=t+1+n.content.size;if(i>r.doc.content.size)return;let o=a.emptyChildName;e.chain().focus().insertContentAt(i,ET(o)).run(),AT(e,i,bT(o));return}}}let a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=h.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var Ak=o.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i}=Ok();return i.addEventListener(`click`,()=>{t&&n>=0&&kk(e,n,t)}),[RE({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[B(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=Ek?e.reference.height:Dk)-Tk)/2}))]},nestedOptions:zE(!1)}).plugin]}}),jk=/^#fn(?:ref)?-/,Mk=o.create({name:`footnoteAnchorScroll`,addProseMirrorPlugins(){return[new At({props:{handleDOMEvents:{click(e,t){let n=t.target;if(!(n instanceof Element))return!1;let r=n.closest(`a[href^="#fn"]`);if(!(r instanceof HTMLAnchorElement))return!1;let i=r.getAttribute(`href`)??``;if(!jk.test(i))return!1;let a=i.slice(1);t.preventDefault();let o=e.dom.ownerDocument.getElementById(a);return o&&o.scrollIntoView({behavior:`smooth`,block:`start`}),!0}}}})]}}),Nk=o.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new At({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=Ue(e.textContent,n);if(!i)return;t.push(tt.node(r,r+e.nodeSize,{id:i}))}}),We.create(e.doc,t)}}})]}}),Pk=new class{byExt=new Map;viewerUnregisterFns=new WeakMap;register(e){let t=this.viewerUnregisterFns.get(e);if(t)return t;for(let t of e.exts){let n=t.toLowerCase(),r=this.byExt.get(n);r&&r!==e&&console.warn(JSON.stringify({event:`asset-viewer-collision`,ext:n,priorExts:r.exts,newExts:e.exts})),this.byExt.set(n,e)}let n=!1,r=()=>{if(!n){n=!0;for(let t of e.exts){let n=t.toLowerCase();this.byExt.get(n)===e&&this.byExt.delete(n)}this.viewerUnregisterFns.delete(e)}};return this.viewerUnregisterFns.set(e,r),r}lookup(e){let t=this.byExt.get(e.toLowerCase());return t?{ok:!0,viewer:t}:{ok:!1}}clearForTests(){this.byExt.clear(),this.viewerUnregisterFns=new WeakMap}get size(){return this.byExt.size}};function Fk(e){globalThis.window?.open(e,`_blank`,`noopener,noreferrer`)}async function Ik(e,t={}){let n=t.registry??Pk,r=`desktopBridge`in t?t.desktopBridge:globalThis.window?.okDesktop,i=t.openUrl??Fk;if(!e.forceOsDelegation){let t=n.lookup(e.ext);if(t.ok){t.viewer.render(e);return}}if(r){let t=await r.shell.openAsset(e.projectRelPath);t.ok||console.warn(`[asset-dispatch] openAsset refused:`,t.reason,{projectRelPath:e.projectRelPath,ext:e.ext});return}i(e.url)}var Lk=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function Rk(e){try{let t=new URL(e);return Lk.has(t.protocol)}catch{return!1}}function zk(e=window.location.hash){let t=e.match(/^#\/([^?#]+)/);return t?decodeURIComponent(t[1]):``}function Bk(e,t=window.location.hash){return s(e,zk(t))}function Vk({docName:e,anchor:t}){return t?`#/${e}?anchor=${encodeURIComponent(t)}`:`#/${e}`}function Hk(e){e.startsWith(`#`)||Rk(e)?window.open(e,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,e)}function Uk(e){window.location.assign(Vk(e))}function Wk(e){Hk(Vk(e))}function Gk(e){return e.metaKey||e.ctrlKey}function Kk(e,t=window.location.hash){let n=zk(t);if(!n)return;let r=document.getElementById(e);r&&r.scrollIntoView({behavior:`smooth`,block:`start`}),window.location.assign(Ge(n,e))}function qk(e,t=window.location.hash){if(e.kind===`doc`){Uk(e);return}if(e.kind===`anchor`){Kk(e.anchor,t);return}Hk(e.url)}function Jk(e,t,n=window.location.hash){return xe(zk(n),e,t)}function Yk(e,t){let n=e;for(;n&&typeof n.hasAttribute==`function`;){if(n.hasAttribute(`data-wiki-embed`)){let e=n.getAttribute(`data-target`)??``;if(!e)return null;let r=ge(e,t);return r?{kind:n.tagName===`IMG`?`image`:`asset`,relPath:r,title:r.split(`/`).pop()??e}:null}if(n.hasAttribute(`data-wiki-link`)){let e=n.getAttribute(`data-target`)??``;return e?{kind:`wiki-link`,relPath:`${e}.md`,title:e}:null}if(n.tagName===`A`&&n.hasAttribute(`href`)){let e=s(n.getAttribute(`href`)??``,t);if(e?.kind===`asset`){let n=ge(e.url,t);return n?{kind:`asset`,relPath:n,title:n.split(`/`).pop()??e.url}:null}}if(n.tagName===`IMG`){let e=n.getAttribute(`src`)??``;if(e){let n=s(e,t);if(n?.kind===`asset`){let e=ge(n.url,t);return e?{kind:`image`,relPath:e,title:e.split(`/`).pop()??n.url}:null}}}n=n.parentElement}return null}var Xk=new ke(`asset-context-menu`);function Zk(e){return new At({key:Xk,view(t){let n=e.showAssetMenu??(e=>{let t=globalThis.window?.okDesktop;return t?t.shell.showAssetMenu({relPath:e.relPath,title:e.title,kind:e.kind}):Promise.resolve()}),r=t=>{if(!(t.target instanceof Element))return;let r=Yk(t.target,e.sourceDocName);r&&(t.preventDefault(),n(r))};return t.dom.addEventListener(`contextmenu`,r),{destroy(){t.dom.removeEventListener(`contextmenu`,r)}}}})}var Qk=e=>{let t=(0,J.c)(17),{kind:n,ariaLabel:r,onDeactivate:i,children:a,triggerReference:o,layout:s,className:l,"data-slot":u}=e,d=s===void 0?`standard`:s,f=(0,q.useRef)(null),p,m;t[0]===o?(p=t[1],m=t[2]):(p=()=>{let e=f.current;if(e)return U(o,e,()=>{Ye(o,e,{placement:`bottom-start`,strategy:`fixed`,middleware:[B(8),c(),re({padding:8})]}).then(t=>{let{x:n,y:r}=t;e.isConnected&&(e.style.left=`${n}px`,e.style.top=`${r}px`)}).catch($k)})},m=[o],t[0]=o,t[1]=p,t[2]=m),(0,q.useLayoutEffect)(p,m);let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={position:`fixed`,left:`-9999px`,top:`-9999px`},t[3]=h):h=t[3];let g=d===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,_;t[4]!==l||t[5]!==g?(_=Wt(`ok-interaction-prop-panel pointer-events-auto z-40 rounded-md border border-border bg-popover p-3 shadow-lg`,g,l),t[4]=l,t[5]=g,t[6]=_):_=t[6];let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,K.jsx)(an,{className:`size-3.5`,"aria-hidden":`true`}),t[7]=v):v=t[7];let y;t[8]===i?y=t[9]:(y=(0,K.jsx)(Kt,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:i,className:`absolute right-1 top-1 size-7`,children:v}),t[8]=i,t[9]=y);let b;return t[10]!==r||t[11]!==a||t[12]!==u||t[13]!==n||t[14]!==_||t[15]!==y?(b=(0,K.jsxs)(`div`,{ref:f,role:`dialog`,"aria-label":r,"data-ok-prop-panel":n,"data-slot":u,style:h,className:_,children:[a,y]}),t[10]=r,t[11]=a,t[12]=u,t[13]=n,t[14]=_,t[15]=y,t[16]=b):b=t[16],b};function $k(){}function eA(e,t){let n=[e,...t.fallbackTargets??[]],r=new Set,i=null;for(let e of n){if(r.has(e))continue;r.add(e);let n=Xe(e,{pages:t.pages,folderPaths:t.folderPaths,pagesBySlug:t.pagesBySlug});if(n.kind!==`asset`){if(n.kind===`missing`){i??=n;continue}return{kind:`navigate`,displayState:n.kind===`folder`?`folder`:`resolved`,resolvedTarget:n,hashDocName:n.target}}}let a=i??Xe(e,{pages:t.pages,folderPaths:t.folderPaths,pagesBySlug:t.pagesBySlug});if(a.kind!==`missing`&&a.kind!==`asset`)return{kind:`navigate`,displayState:a.kind===`folder`?`folder`:`resolved`,resolvedTarget:a,hashDocName:a.target};let o=a.kind===`asset`?{kind:`missing`,target:e}:a,s=t.createDialogSeed??gt(o.target);return{kind:`create`,displayState:`missing`,resolvedTarget:o,initialDir:s.initialDir,suggestedName:s.suggestedName}}function tA(e){if(e.kind!==`navigate`||e.displayState!==`folder`)return null;let t=e.resolvedTarget;return`folderPath`in t?{initialDir:t.folderPath,suggestedName:`index.md`}:null}function nA(e){let t=e.trim();return/\.(md|mdx)$/i.test(t)?t:`${t}.md`}function rA(e){let t=e.initialDir.trim().replace(/^\/+|\/+$/g,``),n=nA(e.suggestedName);return t?`${t}/${n}`:n}async function iA(e){let t=await wv(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create page`);if(!t.ok)throw Error(t.title);let n=e.replace(/\.(mdx|md)$/i,``);return{docName:Tv(qe,t.body,`create-page`,{docName:n}).docName}}async function aA(e){return iA(rA(e))}async function oA(e,t){let{docName:n}=await aA(e);return t.addPage(n),ze([`files`,`backlinks`,`graph`]),t.onCreated?.(n),{docName:n}}var sA=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function cA(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}var lA=e=>{let t=(0,J.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),t[0]=n,t[1]=r);let[i,a]=(0,q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,q.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,K.jsxs)(K.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function uA(e){return e.editorView?.dom??null}function dA(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function fA(e){let{editor:t}=e,n=new sA,r=uA(t),i=!1,a=null,o=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;a=t&&dA(t,e)?t:null}return}if(typeof document>`u`)return;let i=a;if(a=null,i&&document.contains(i)&&typeof i.focus==`function`){try{i.focus({preventScroll:!0})}catch{}return}let o=r??uA(t);if(o&&typeof o.focus==`function`)try{o.focus({preventScroll:!0})}catch{}}),s=e=>{let t=e;if(t.button===2)return;if(t.metaKey||t.ctrlKey||t.button===1){t.button===1&&t.preventDefault?.();return}let r=cA(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1})||n.setActiveNode(r)},c=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1||!(t.metaKey||t.ctrlKey||t.button===1))return;let r=cA(e.target,n);if(r===null)return;let i=n.getRegistration(r);i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!0})&&t.preventDefault?.()},l=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(n.setActiveNode(null),t.preventDefault?.());return}if(t.key!==`Enter`&&t.key!==` `&&t.key!==`Spacebar`)return;let r=cA(e.target,n);if(r===null)return;let i=n.getRegistration(r);t.preventDefault?.(),!(i?.handlePrimary&&i.handlePrimary({nodeId:r,type:i.type,newTab:!1}))&&n.setActiveNode(r)},u=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||n.setActiveNode(null))},d=()=>{i||(r=uA(t),r&&(r.addEventListener(`pointerdown`,s,!0),r.addEventListener(`click`,c,!0),r.addEventListener(`auxclick`,c,!0),r.addEventListener(`keydown`,l,!0),typeof document<`u`&&document.addEventListener(`pointerdown`,u,!0),i=!0))},f=()=>{i&&=(r?.removeEventListener(`pointerdown`,s,!0),r?.removeEventListener(`click`,c,!0),r?.removeEventListener(`auxclick`,c,!0),r?.removeEventListener(`keydown`,l,!0),typeof document<`u`&&document.removeEventListener(`pointerdown`,u,!0),!1)};return d(),{register(e){n.register(e),i||d()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){f(),o(),n.clear()},store:n}}var pA=e=>{let t=(0,J.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,K.jsx)(lA,{store:n})}),t[0]=n,t[1]=r),r},mA=new WeakMap;function hA(e){let t=mA.get(e);if(t)return t;let n=fA({editor:e});return mA.set(e,n),e.on(`destroy`,()=>{n.destroy(),mA.delete(e)}),n}var gA=new ke(`markIdentity`);function _A(){return{byId:new Map,counter:0}}function vA(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&yA(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function yA(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&!(typeof n==`object`&&n&&typeof i==`object`&&i&&yA(n,i)))return!1}return!0}function bA(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function xA(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new At({key:gA,state:{init(e,t){return vA(t.doc,_A(),a,n)},apply(e,t,r,i){return e.docChanged?vA(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=gA.getState(t.state);n&&(e=bA(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}function SA(e,t){return gA.getState(e)?.byId.get(t)??null}function CA(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function wA(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=CA({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return xA({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function TA(e){let t=hA(e.editor);return wA({...e,layer:t})}function EA(e){return e.kind===`asset`?e.target:e.kind===`anchor`?`${e.docName}#${e.slug}`:e.docName}function DA(e){return e.kind===`anchor`?`Heading H${e.level}: ${e.text}`:e.kind===`asset`?`Asset: ${e.title}`:e.kind===`create`?e.actionLabel:e.title}function OA(e){let t=(0,J.c)(41),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,mode:c,pageTarget:l,anchorQuery:u}=e,d=o===void 0?!1:o,f=s===void 0?null:s,p=c===void 0?`page`:c,m=l===void 0?``:l,h=u===void 0?``:u,g=(0,q.useRef)(null),_=(0,q.useId)(),v=i>=0&&i<n.length?`${_}-option-${i}`:void 0,y,b;t[0]===i?(y=t[1],b=t[2]):(y=()=>{let e=g.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},b=[i],t[0]=i,t[1]=y,t[2]=b),(0,q.useEffect)(y,b);let x=kA;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n=p===`anchor`?`Loading headings for ${m}…`:`Loading pages…`,r;return t[4]===n?r=t[5]:(r=(0,K.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:x,children:n}),t[4]=n,t[5]=r),r}if(n.length===0){let e;t[6]!==h||t[7]!==f||t[8]!==p||t[9]!==m||t[10]!==r?(e=f??(p===`anchor`?h.trim()?`No headings match "${h.trim()}"`:`No headings in ${m}`:r.trim()?`No pages found for "${r.trim()}"`:`No pages found`),t[6]=h,t[7]=f,t[8]=p,t[9]=m,t[10]=r,t[11]=e):e=t[11];let n=e,i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[12]=i):i=t[12];let a;return t[13]===n?a=t[14]:(a=(0,K.jsx)(`div`,{ref:g,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:x,children:n}),t[13]=n,t[14]=a),a}let S=i>=0&&i<n.length?n[i]:null,C=p===`anchor`?`Heading suggestions`:`Wiki link suggestions`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[15]=w):w=t[15];let T;t[16]===S?T=t[17]:(T=S?DA(S):``,t[16]=S,t[17]=T);let E;t[18]===T?E=t[19]:(E=(0,K.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:T}),t[18]=T,t[19]=E);let D;t[20]===f?D=t[21]:(D=f&&(0,K.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[20]=f,t[21]=D);let O;t[22]!==p||t[23]!==m?(O=p===`anchor`&&(0,K.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m}),t[22]=p,t[23]=m,t[24]=O):O=t[24];let k;if(t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==i){let e;t[30]!==_||t[31]!==a||t[32]!==i?(e=(e,t)=>{let n=t===i,r=EA(e);return e.kind===`anchor`?(0,K.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,style:{paddingLeft:`${(e.level-1)*10+8}px`},onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,K.jsxs)(`span`,{className:`w-6 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,K.jsx)(`span`,{className:`truncate font-medium`,children:e.text})]},r):(0,K.jsxs)(`button`,{id:`${_}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full flex-col rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:e.kind===`create`?e.actionLabel:e.title}),e.kind===`page`&&e.title!==e.docName&&(0,K.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.docName}),e.kind===`asset`&&(0,K.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.path}),e.kind===`create`&&(0,K.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.docName,`.md`]})]},r)},t[30]=_,t[31]=a,t[32]=i,t[33]=e):e=t[33],k=n.map(e),t[25]=n,t[26]=_,t[27]=a,t[28]=i,t[29]=k}else k=t[29];let A;return t[34]!==v||t[35]!==E||t[36]!==D||t[37]!==O||t[38]!==k||t[39]!==C?(A=(0,K.jsxs)(`div`,{ref:g,role:`listbox`,"aria-label":C,"aria-activedescendant":v,tabIndex:-1,onMouseDown:x,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:w,children:[E,D,O,k]}),t[34]=v,t[35]=E,t[36]=D,t[37]=O,t[38]=k,t[39]=C,t[40]=A):A=t[40],A}function kA(e){return e.preventDefault()}var AA=new ke(`wikiLinkSuggestion`),jA=8,MA=null,NA=null;function PA(e){let t=e.indexOf(`#`);return t>0?{mode:`anchor`,pageTarget:e.slice(0,t),anchorQuery:e.slice(t+1)}:{mode:`page`,pageTarget:``,anchorQuery:``}}function FA(e,t){if(!t)return e.slice(0,jA);let n=IA(e);return _e(n.corpus,t,{intent:`autocomplete`,limit:jA}).map(e=>n.byPath.get(e.document.path)).filter(e=>!!e)}function IA(e){let t=e.map(e=>`${e.kind??`page`}\u0000${e.docName}\u0000${e.title}`).join(``);return MA?.fingerprint===t||(MA={fingerprint:t,byPath:new Map(e.map(e=>[e.docName,e])),corpus:ot(e.map(e=>mt({kind:`page`,path:e.docName,title:e.title})))}),MA}function LA(e){let t=e.map(e=>`${e.slug}\u0000${e.level}\u0000${e.text}`).join(``);return NA?.fingerprint===t||(NA={fingerprint:t,byPath:new Map(e.map(e=>[e.slug,e])),corpus:ot(e.map(e=>mt({kind:`page`,path:e.slug,title:e.text})))}),NA}function RA(e,t){if(!t)return e.slice(0,jA);let n=LA(e);return _e(n.corpus,t,{intent:`autocomplete`,limit:jA}).map(e=>n.byPath.get(e.document.path)).filter(e=>!!e)}function zA(e,t){let n=FA(e,t);if(n.length>0)return n.map(e=>e.kind===`asset`?{kind:`asset`,target:e.docName,path:e.docName.replace(/^\//,``),title:e.title}:{kind:`page`,docName:e.docName,title:e.title});let r=DC(t);return r?[{kind:`create`,docName:r.target,title:t.trim(),actionLabel:`Insert unresolved link "${t.trim()}"`}]:[]}function BA(e,t,n){return RA(t,n).map(t=>({kind:`anchor`,docName:e,level:t.level,text:t.text,slug:t.slug}))}function VA(e){let{mode:t,pageTarget:n,anchorQuery:r}=PA(e);return t===`anchor`&&n?{target:n,alias:null,anchor:r.trim()||null}:DC(e)}function HA(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``),r=n.match(/\[\[([^\]]*)$/);if(!r)return null;let i=r[1];return{range:{from:t.start()+n.lastIndexOf(`[[`),to:t.pos},query:i,text:r[0]}}async function UA(){let e=await fetch(`/api/pages`),t;try{t=await e.json()}catch(t){throw new MC(`Pages response was not JSON`,{cause:t,status:e.status})}if(!e.ok){let n=v.safeParse(t);throw Error(n.success?n.data.title:`/api/pages responded with ${e.status}`)}let n=he.safeParse(t);if(!n.success)return console.warn(`[wiki-link-suggestion] /api/pages response schema drift:`,n.error),[];let r=n.data.pages.map(e=>({kind:`page`,docName:e.docName,title:e.title})),i;try{let e=await fetch(`/api/documents`);if(!e.ok)return console.warn(`[wiki-link-suggestion] /api/documents responded with`,e.status),r;if(i=await e.json(),!Array.isArray(i.documents))return r}catch(e){return console.warn(`[wiki-link-suggestion] Failed to fetch referenced assets:`,e),r}let a=i.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>{let t=e.path.split(`/`).pop()??e.path;return{kind:`asset`,docName:`/${e.path}`,title:t}});return[...r,...a]}async function WA(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new MC(`Page headings response was not JSON`,{cause:e,status:t.status})}if(!t.ok){let e=v.safeParse(n);throw Error(e.success?e.data.title:`/api/page-headings responded with ${t.status}`)}let r=Tt.safeParse(n);return r.success?r.data.headings??[]:(console.warn(`[wiki-link-suggestion] /api/page-headings response schema drift:`,r.error),[])}function GA(e){let t=[],n=!1,r=null,i=new Map,a=null,o=null,s=null;return lv({editor:e,pluginKey:AA,char:`[[`,allowedPrefixes:null,findSuggestionMatch:HA,items:async({query:e})=>{let{mode:c,pageTarget:l,anchorQuery:u}=PA(e);if(c===`anchor`){if(!i.has(l)&&a!==l){a=l;try{let e=await WA(l);i.set(l,e),s=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch headings:`,e),i.set(l,[]),s=`Failed to load headings for ${l}. Press Escape and type [[ again to retry.`}finally{a=null}}return BA(l,i.get(l)??[],u)}if(!n){r||=UA();try{t=await r,o=null}catch(e){console.error(`[wiki-link-suggestion] Failed to fetch pages:`,e),o=`Failed to load pages. Press Escape and type [[ again to retry, or continue typing to insert an unresolved link.`,t=[]}finally{n=!0,r=null}}return zA(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=null;if(n.kind===`page`?r={target:n.docName,alias:null,anchor:null}:n.kind===`asset`?r={target:n.target,alias:n.title,anchor:null}:n.kind===`anchor`?r={target:n.docName,alias:null,anchor:n.slug}:n.kind===`create`&&(r=DC(n.title)),!r)return;e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:r}).run()}catch(e){console.error(`[wiki-link-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,c=null,l=0,u={popup:null,stopAutoUpdate:null},d=null,f=null,p=e=>{c?.command(e)};function m(e,t,r){let{mode:a,pageTarget:c,anchorQuery:u}=PA(e.query??``),d=t===null?a===`anchor`?!i.has(c):!n:t;return{items:e.items,query:e.query??``,selectedIndex:l,onSelect:r,loading:d,error:a===`page`?o:s,mode:a,pageTarget:c,anchorQuery:u}}let h=t=>{!e||!c||e.updateProps(m(c,t,p))},g=()=>{if(!c)return;let{editor:e,range:t}=c,n=VA(c.query??``);if(n)try{e.chain().focus().deleteRange(t).insertContent({type:`wikiLink`,attrs:n}).run()}catch(e){console.error(`[wiki-link-suggestion] fallback insert error:`,e)}};return{onBeforeStart(t){c=t,l=0;let n=mv(()=>c,`wiki-link-suggestion`);u.popup=n.popup,d=n.doPosition,f=n.reveal,e=new vc(OA,{props:m(t,!0,p),editor:t.editor}),n.popup.appendChild(e.element),u.stopAutoUpdate=n.startAutoUpdate()},onBeforeUpdate(e){let t=c?PA(c.query??``).mode:null,n=PA(e.query??``).mode;c=e,t!==n&&(l=0,h(!0))},onStart(e){c=e,l=0,h(null),f?.()},onUpdate(e){c=e,l=Math.min(l,Math.max(0,e.items.length-1)),h(null),d?.()},onKeyDown({event:e}){if(!c)return!1;let t=c.items;if(e.key===`ArrowDown`)return t.length===0?!1:(l=(l+1)%t.length,h(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(l=(l-1+t.length)%t.length,h(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[l];return e?c.command(e):g(),!0}return e.key,!1},onExit(){hv(u),d=null,f=null,e?.destroy(),e=null,c=null,l=0,t=[],i=new Map,o=null,s=null,n=!1,r=null,a=null}}}})}function KA(e,t){let n=(0,J.c)(4),[r,i]=(0,q.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),WA(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,q.useEffect)(a,o),r}function qA(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:n.startsWith(`/`)||l(n)?`external`:`doc`:t}function JA(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function YA(e){let t=(0,J.c)(64),{open:n,href:r,pages:i,onOpenChange:a,onSave:o}=e,[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(`doc`),p=(0,q.useId)(),m=(0,q.useId)(),h=(0,q.useId)(),g,_;t[0]!==r||t[1]!==n?(g=()=>{if(!n)return;let e=Bk(r);if(f(JA(e)),e?.kind===`doc`){c(e.docName),u(e.anchor??``);return}if(e?.kind===`anchor`){c(`#${e.anchor}`),u(``);return}c(e?.kind===`external`?e.url:r),u(``)},_=[r,n],t[0]=r,t[1]=n,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,q.useEffect)(g,_);let v,y,b;t[4]!==d||t[5]!==s||t[6]!==i?(v=Ne(s),y=d===`doc`,b=y&&jC(v,i),t[4]=d,t[5]=s,t[6]=i,t[7]=v,t[8]=y,t[9]=b):(v=t[7],y=t[8],b=t[9]);let x=KA(v,b&&n),S=!!x?.length,C;t[10]!==v||t[11]!==y||t[12]!==l||t[13]!==s||t[14]!==a||t[15]!==o?(C=function(){let e=s.trim();e&&(o(y?Jk(v,l.trim()||null):e),a(!1))},t[10]=v,t[11]=y,t[12]=l,t[13]=s,t[14]=a,t[15]=o,t[16]=C):C=t[16];let w=C,T;t[17]===w?T=t[18]:(T=function(e){e.key===`Enter`&&(e.preventDefault(),w())},t[17]=w,t[18]=T);let E=T,D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,K.jsx)(nn,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[19]=D):D=t[19];let O,k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(un,{className:`mb-1 text-base font-semibold`,children:`Edit markdown link`}),k=(0,K.jsx)(ln,{className:`mb-4 text-sm text-muted-foreground`,children:`Update the destination and optional section anchor.`}),t[20]=O,t[21]=k):(O=t[20],k=t[21]);let A=y?`Page`:`Link target`,j;t[22]!==A||t[23]!==p?(j=(0,K.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:p,children:A}),t[22]=A,t[23]=p,t[24]=j):j=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{let t=e.target.value;c(t),f(e=>qA(t,e))},t[25]=M):M=t[25];let N;t[26]!==s||t[27]!==E||t[28]!==p?(N=(0,K.jsx)(hn,{id:p,value:s,onChange:M,placeholder:`guides/install or https://example.com`,autoFocus:!0,onKeyDown:E}),t[26]=s,t[27]=E,t[28]=p,t[29]=N):N=t[29];let P;t[30]===y?P=t[31]:(P=y?(0,K.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:`This changes the destination page. The visible link text stays editable inline in the document.`}):null,t[30]=y,t[31]=P);let F;t[32]!==j||t[33]!==N||t[34]!==P?(F=(0,K.jsxs)(`div`,{children:[j,N,P]}),t[32]=j,t[33]=N,t[34]=P,t[35]=F):F=t[35];let I;t[36]!==m||t[37]!==y||t[38]!==l||t[39]!==E||t[40]!==h||t[41]!==x||t[42]!==S?(I=y?(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:m,children:[`Section`,` `,(0,K.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`})]}),(0,K.jsx)(hn,{id:m,value:l,onChange:e=>u(e.target.value),placeholder:`heading-slug`,"aria-controls":S?h:void 0,"aria-expanded":S?!0:void 0,"aria-haspopup":S?`listbox`:void 0,onKeyDown:E}),S?(0,K.jsx)(`div`,{role:`listbox`,id:h,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:x.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":l===e.slug,className:Wt(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,l===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>u(l===e.slug?``:e.slug),children:[(0,K.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,K.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[36]=m,t[37]=y,t[38]=l,t[39]=E,t[40]=h,t[41]=x,t[42]=S,t[43]=I):I=t[43];let L;t[44]!==F||t[45]!==I?(L=(0,K.jsxs)(`div`,{className:`mb-4 space-y-6`,children:[F,I]}),t[44]=F,t[45]=I,t[46]=L):L=t[46];let R;t[47]===a?R=t[48]:(R=(0,K.jsx)(Kt,{variant:`outline`,onClick:()=>a(!1),children:`Cancel`}),t[47]=a,t[48]=R);let z;t[49]===s?z=t[50]:(z=s.trim(),t[49]=s,t[50]=z);let B=!z,V;t[51]!==w||t[52]!==B?(V=(0,K.jsx)(Kt,{onClick:w,disabled:B,children:`Save`}),t[51]=w,t[52]=B,t[53]=V):V=t[53];let H;t[54]!==R||t[55]!==V?(H=(0,K.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[R,V]}),t[54]=R,t[55]=V,t[56]=H):H=t[56];let U;t[57]!==L||t[58]!==H?(U=(0,K.jsxs)($t,{children:[D,(0,K.jsxs)(on,{"data-slot":`dialog-content`,"data-ok-layer-spawned":``,className:`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[O,k,L,H]})]}),t[57]=L,t[58]=H,t[59]=U):U=t[59];let ee;return t[60]!==a||t[61]!==n||t[62]!==U?(ee=(0,K.jsx)(sn,{open:n,onOpenChange:a,children:U}),t[60]=a,t[61]=n,t[62]=U,t[63]=ee):ee=t[63],ee}function XA(e){let t=(0,J.c)(77),{editor:n,nodeId:r,sourceDocName:i,onClose:a}=e,o=SA(n.state,r),c=o?.attrs?.href??``,[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(null),{addPage:p,folderPaths:m,pages:h,loading:g}=pt();if(!o||!c)return null;let _=s(c,i),v=_?.kind===`doc`?`${_.docName}${_.anchor?`#${_.anchor}`:``}`:_?.kind===`anchor`?`#${_.anchor}`:_?.kind===`external`?_.url:c,y;t[0]!==n||t[1]!==r?(y=function(e){let t=SA(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run()},t[0]=n,t[1]=r,t[2]=y):y=t[2];let b=y,x;t[3]!==n||t[4]!==r||t[5]!==a?(x=function(){let e=SA(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),a())},t[3]=n,t[4]=r,t[5]=a,t[6]=x):x=t[6];let S=x,C=function(e){if(_){if(_.kind===`asset`){let t=ge(_.url,i);if(!t)return;Ik({url:_.url,projectRelPath:t,ext:_.ext,title:t.split(`/`).pop()??_.url,forceOsDelegation:e.newTab??!1});return}if(_.kind===`external`){qk(_);return}if(_.kind===`anchor`||_.kind===`doc`){let t=_.kind===`doc`?_.docName:i,n=_.anchor??null;e.newTab?Wk({docName:t,anchor:n}):window.location.assign(Vk({docName:t,anchor:n}))}}},w=function(e){let t=SA(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:Jk(e,_?.kind===`doc`?_.anchor??null:null)}).run()},T,E=!1,D=!1,O=null,k=null;if(g){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(Hr,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[7]=e):e=t[7],T={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(_?.kind===`asset`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[8]=e):e=t[8],T={icon:e,text:`Asset reference`,className:`text-foreground`}}else if(_?.kind===`external`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(Tr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[9]=e):e=t[9],T={icon:e,text:`External link`,className:`text-foreground`}}else if(_?.kind===`anchor`){let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[10]=e):e=t[10],T={icon:e,text:`Anchor in this page`,className:`text-foreground`}}else if(_?.kind===`doc`){let e=eA(_.docName,{pages:h,folderPaths:m});if(O=tA(e),D=e.kind===`navigate`&&e.displayState===`folder`,E=e.kind===`create`,k=e.kind===`create`?{initialDir:e.initialDir,suggestedName:e.suggestedName}:null,D){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(jr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[11]=e):e=t[11],T={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(E){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(br,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[12]=e):e=t[12],T={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else{let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[13]=e):e=t[13],T={icon:e,text:`Page link`,className:`text-foreground`}}}else{let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(br,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[14]=e):e=t[14],T={icon:e,text:`Unrecognized link`,className:`text-muted-foreground`}}let A;t[15]!==n.state||t[16]!==n.view||t[17]!==r?(A=()=>{let e=SA(n.state,r);if(!e)return new DOMRect;try{return Be(n.view,e.from,e.to)}catch{return new DOMRect}},t[15]=n.state,t[16]=n.view,t[17]=r,t[18]=A):A=t[18];let j;t[19]!==n.view.dom||t[20]!==A?(j={getBoundingClientRect:A,contextElement:n.view.dom},t[19]=n.view.dom,t[20]=A,t[21]=j):j=t[21];let M=j,N;t[22]!==O||t[23]!==k?(N=function(e){return e===`folder-index`?O:k},t[22]=O,t[23]=k,t[24]=N):N=t[24];let P=N,F;t[25]!==p||t[26]!==P||t[27]!==d||t[28]!==a||t[29]!==w?(F=async function(e){let t=P(e);if(!(!t||d)){f(e);try{await oA(t,{addPage:p,onCreated(t){e===`missing`&&w(t),window.location.hash=`#/${t}`,a()}}),f(null)}catch(e){let t=e;cn.error(t instanceof Error?t.message:`Failed to create page`),f(null)}}},t[25]=p,t[26]=P,t[27]=d,t[28]=a,t[29]=w,t[30]=F):F=t[30];let I=F,L=Wt(`text-sm font-medium`,T.className),R;t[31]!==T.text||t[32]!==L?(R=(0,K.jsx)(`div`,{className:L,children:T.text}),t[31]=T.text,t[32]=L,t[33]=R):R=t[33];let z;t[34]===v?z=t[35]:(z=(0,K.jsx)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,title:v,children:v}),t[34]=v,t[35]=z);let B;t[36]!==z||t[37]!==R?(B=(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[R,z]}),t[36]=z,t[37]=R,t[38]=B):B=t[38];let V;t[39]!==C||t[40]!==E||t[41]!==a||t[42]!==_?.kind?(V=E?null:(0,K.jsx)(Kt,{size:`sm`,variant:`default`,onClick:()=>{C({}),a()},children:_?.kind===`external`?`Open in new tab`:`Open`}),t[39]=C,t[40]=E,t[41]=a,t[42]=_?.kind,t[43]=V):V=t[43];let H;t[44]!==d||t[45]!==I||t[46]!==E?(H=E?(0,K.jsx)(Kt,{size:`sm`,variant:`default`,disabled:d!==null,onClick:()=>void I(`missing`),children:d===`missing`?`Creating…`:`Create page`}):null,t[44]=d,t[45]=I,t[46]=E,t[47]=H):H=t[47];let U;t[48]!==d||t[49]!==O||t[50]!==I||t[51]!==D?(U=D&&O?(0,K.jsxs)(Kt,{size:`sm`,variant:`outline`,disabled:d!==null,onClick:()=>void I(`folder-index`),children:[(0,K.jsx)(Dr,{className:`size-3.5`,"aria-hidden":`true`}),d===`folder-index`?`Creating…`:`Create index`]}):null,t[48]=d,t[49]=O,t[50]=I,t[51]=D,t[52]=U):U=t[52];let ee;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,K.jsx)(`div`,{className:`flex-1`}),t[53]=ee):ee=t[53];let te;t[54]===u?te=t[55]:(te=()=>u(!0),t[54]=u,t[55]=te);let ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,K.jsx)(qr,{className:`size-3.5`,"aria-hidden":`true`}),t[56]=ne):ne=t[56];let re;t[57]===te?re=t[58]:(re=(0,K.jsxs)(Kt,{size:`sm`,variant:`outline`,onClick:te,children:[ne,`Edit`]}),t[57]=te,t[58]=re);let ie;t[59]===E?ie=t[60]:(ie=E?(0,K.jsx)(ii,{className:`size-3.5`,"aria-hidden":`true`}):(0,K.jsx)(ri,{className:`size-3.5`,"aria-hidden":`true`}),t[59]=E,t[60]=ie);let ae=E?`Unlink`:`Remove`,oe;t[61]!==S||t[62]!==ie||t[63]!==ae?(oe=(0,K.jsxs)(Kt,{size:`sm`,variant:`destructive`,onClick:S,children:[ie,ae]}),t[61]=S,t[62]=ie,t[63]=ae,t[64]=oe):oe=t[64];let se;t[65]!==V||t[66]!==H||t[67]!==U||t[68]!==re||t[69]!==oe?(se=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,H,U,ee,re,oe]}),t[65]=V,t[66]=H,t[67]=U,t[68]=re,t[69]=oe,t[70]=se):se=t[70];let ce;return t[71]!==l||t[72]!==b||t[73]!==c||t[74]!==h||t[75]!==u?(ce=(0,K.jsx)(YA,{open:l,href:c,pages:h,onOpenChange:u,onSave:b}),t[71]=l,t[72]=b,t[73]=c,t[74]=h,t[75]=u,t[76]=ce):ce=t[76],(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(Qk,{kind:`internal-link`,ariaLabel:`Link options`,onDeactivate:a,triggerReference:M,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-start gap-2 pr-8`,children:[(0,K.jsx)(`div`,{className:Wt(`mt-0.5 flex shrink-0`,T.className),children:T.icon}),B]}),se]}),ce]})}function ZA(e,t,n){let r=s(e,t);if(!r)return`unresolved`;if(r.kind===`external`)return`external`;if(r.kind===`anchor`)return`anchor`;if(r.kind===`asset`)return`asset`;if(n===null)return`loading`;let i=eA(r.docName,{pages:n.pages,folderPaths:n.folderPaths});return i.kind===`create`?`unresolved`:i.displayState}function QA(e,t,n){let r=e.attrs?.href;return typeof r!=`string`||r.length===0||e.attrs?.sourceForm===`wikiembed`?null:{"data-resolution-state":ZA(r,n,t)}}function $A(e){return(t,n)=>QA(t,n,e)}new ke(`markIdentityDecoration`);var ej=`data-mark-id`,tj=new ke(`linkResolutionDecoration`);function nj(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i),o={[ej]:e.id};t!==null&&Object.assign(o,t),a.push(tt.inline(e.from,e.to,o))}return a.length===0?null:We.create(e,a)}function rj(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new At({key:tj,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(tj);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=gA.getState(e);if(!r)return null;let i=et();return nj(e.doc,r.byId,t,n,i)}},view(e){Y(`ok/render/decoration-merge`,{markTypes:Array.from(t).join(`,`)},{startTime:performance.now(),duration:0});let n=He(()=>{e.dispatch(e.state.tr.setMeta(tj,{refresh:!0}))});return{destroy(){n()}}}})}var ij=xt.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,Fe(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``;return[TA({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:t,nodeId:n,deactivate:r})=>(0,q.createElement)(XA,{editor:t,nodeId:n,sourceDocName:e,onClose:r}),handlePrimary:({editor:t,nodeId:n,newTab:r})=>{let i=SA(t.state,n),a=i?.attrs?.href;if(typeof a!=`string`||!a)return!1;let o=i?.attrs?.sourceForm,c=s(a,e),l=Pe(a);if(c?.kind===`asset`||o===`wikiembed`&&l!==null){let t=c?.kind===`asset`?c.url:a,n=c?.kind===`asset`?c.ext:l??``,i=ge(t,e);return i?(Ik({url:t,projectRelPath:i,ext:n,title:i.split(`/`).pop()??t,forceOsDelegation:r}),!0):!1}if(!r||!c)return!1;switch(c.kind){case`doc`:return Wk({docName:c.docName,anchor:c.anchor}),!0;case`anchor`:return Wk({docName:e,anchor:c.anchor}),!0;case`external`:return Rk(c.url)?(Hk(c.url),!0):!1;default:return O(c)}}}),rj({markTypes:[`link`],computeAttrs:$A(e)}),Zk({sourceDocName:e})]}}),aj=(0,q.createContext)(null),oj={didCatch:!1,error:null},sj=class extends q.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=oj}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(oj))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&cj(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(oj))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,q.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,q.createElement)(aj.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function cj(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function lj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(na,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function uj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(ia,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function dj(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=Wt(`z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,K.jsx)(aa,{children:(0,K.jsx)(oa,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function fj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(ra,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}function pj(e){let t=(0,J.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({label:i,Icon:n,onClick:a,selected:s,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=s?`true`:void 0,l;t[7]===a?l=t[8]:(l=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=l);let u;t[9]===r?u=t[10]:(u=Wt(`flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-border bg-transparent px-3 py-2 text-center text-sm text-muted-foreground transition-colors hover:bg-muted/50 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,r),t[9]=r,t[10]=u);let d;t[11]===n?d=t[12]:(d=(0,K.jsx)(n,{size:16,"aria-hidden":`true`}),t[11]=n,t[12]=d);let f;t[13]===i?f=t[14]:(f=(0,K.jsx)(`span`,{children:i}),t[13]=i,t[14]=f);let p;return t[15]!==a||t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,K.jsxs)(`div`,{...o,role:`button`,tabIndex:-1,contentEditable:!1,"data-descriptor-placeholder":``,"data-selected":c,onClick:a,onMouseDown:mj,onKeyDown:l,className:u,children:[d,f]}),t[15]=a,t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function mj(e){e.preventDefault(),e.stopPropagation()}function hj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(Ci,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function gj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(wi,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function _j(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(Ti,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function vj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(xo,{"data-slot":`select`,...n}),t[2]=n,t[3]=r),r}function yj(e){let t=(0,J.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(Co,{"data-slot":`select-value`,...n}),t[2]=n,t[3]=r),r}function bj(e){let t=(0,J.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=Wt(`flex w-full items-center justify-between gap-2 rounded-lg border border-input bg-background text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=default]:px-2.5 data-[size=sm]:px-2 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(wo,{asChild:!0,children:(0,K.jsx)(_r,{className:`size-4 opacity-50`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,K.jsxs)(So,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function xj(e){let t=(0,J.c)(20),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,position:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`popper`:a,s=o===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,c;t[5]!==r||t[6]!==s?(c=Wt(`relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-md outline-hidden 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`,s,r),t[5]=r,t[6]=s,t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(Cj,{}),t[8]=l):l=t[8];let u=o===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`,d;t[9]===u?d=t[10]:(d=Wt(`p-1`,u),t[9]=u,t[10]=d);let f;t[11]!==n||t[12]!==d?(f=(0,K.jsx)(Do,{className:d,children:n}),t[11]=n,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(wj,{}),t[14]=p):p=t[14];let m;return t[15]!==o||t[16]!==i||t[17]!==c||t[18]!==f?(m=(0,K.jsx)(To,{children:(0,K.jsxs)(Eo,{"data-slot":`select-content`,"data-ok-layer-spawned":``,position:o,className:c,...i,children:[l,f,p]})}),t[15]=o,t[16]=i,t[17]=c,t[18]=f,t[19]=m):m=t[19],m}function Sj(e){let t=(0,J.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Wt(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,K.jsx)(Ao,{children:(0,K.jsx)(Zt,{className:`size-4`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,K.jsx)(ko,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,K.jsxs)(Oo,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Cj(e){let t=(0,J.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Wt(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(yr,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,K.jsx)(jo,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function wj(e){let t=(0,J.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Wt(`flex cursor-default items-center justify-center py-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(_r,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,K.jsx)(Mo,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function Tj(e){let t=(0,J.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=Wt(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(Go,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`}),t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==o?(c=(0,K.jsx)(Wo,{"data-slot":`switch`,"data-size":a,className:o,...r,children:s}),t[7]=r,t[8]=a,t[9]=o,t[10]=c):c=t[10],c}function Ej(){if(typeof window>`u`)return null;let e=window.location.hash.match(/^#\/([^?#]+)/);return e?decodeURIComponent(e[1]):null}var Dj=`/api/upload`;async function Oj(e,t,n={}){let r=n.fetch??globalThis.fetch,i=n.docName===void 0?Ej():n.docName;if(!i)throw Error(`No document is open`);let a=new FormData;a.append(`file`,e),a.append(`parentDocName`,i);let o;try{o=await r(Dj,{method:`POST`,body:a})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Upload failed: ${t}`)}let s;try{s=await o.json()}catch(e){throw new MC(`Upload response is not JSON.`,{cause:e,status:o.status})}if(!o.ok){let e=v.safeParse(s);throw e.success?Error(e.data.title):new MC(`Upload error response did not match ProblemDetails.`,{cause:e.error,status:o.status})}let c=M.safeParse(s);if(!c.success)throw new MC(`Upload success response did not match UploadAssetSuccess.`,{cause:c.error,status:o.status});let l=c.data.path??c.data.src;return{url:l.startsWith(`/`)?l:`/${l}`}}var kj=new Intl.PluralRules(`en-US`);function Aj(e,t,n){return n<=0?`${e} (empty)`:`${e} with ${n} ${kj.select(n)===`one`?`item`:`items`}`}var jj=`Document`;function Mj(e){for(let t of e)if(t.type===`string`&&t.hidden!==!0&&t.advanced!==!0&&t.autoFocus===!0)return t.name;return null}function Nj(e){if(!e)return e;let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1)}function Pj(e){return`ok.propPanel.advanced.${e}`}function Fj(e){try{return typeof localStorage>`u`?!1:localStorage.getItem(Pj(e))===`true`}catch{return!1}}function Ij(e,t){try{if(typeof localStorage>`u`)return;localStorage.setItem(Pj(e),t?`true`:`false`)}catch{}}function Lj(e,t){let n=0;for(let r of e){let e=t[r.name],i=`defaultValue`in r?r.defaultValue:void 0;e!==void 0&&e!==i&&(n+=1)}return n}async function Rj(e,t,n){try{let{url:r}=await Oj(e,t);n(r)}catch(e){let t=e instanceof Error?e.message:String(e);cn.error(`Upload failed: ${t}`)}}function zj(e){let t=(0,J.c)(11),{descriptor:n,values:r,onChange:i}=e,a=n.props.filter(Hj),o=a.filter(Vj),s=a.filter(Bj),c=Lj(s,r),l;t[0]===n.props?l=t[1]:(l=Mj(n.props),t[0]=n.props,t[1]=l);let u=l,d;t[2]===n.name?d=t[3]:(d=()=>Fj(n.name),t[2]=n.name,t[3]=d);let[f,p]=(0,q.useState)(d);if(a.length===0)return null;let m;t[4]!==u||t[5]!==i||t[6]!==r?(m=e=>(0,K.jsx)(Wj,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===u},e.name),t[4]=u,t[5]=i,t[6]=r,t[7]=m):m=t[7];let h=o.map(m),g=s.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,K.jsxs)(hj,{open:f,onOpenChange:e=>{p(e),Ij(n.name,e)},children:[(0,K.jsxs)(gj,{"data-prop-panel-advanced-trigger":``,className:`group flex w-full items-center justify-between rounded px-1 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground uppercase font-mono`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(_r,{className:`size-3 transition-transform group-data-[state=closed]:-rotate-90`}),`Advanced`]}),c>0&&(0,K.jsx)(Jo,{variant:`secondary`,"data-prop-panel-advanced-count":``,children:c})]}),(0,K.jsx)(_j,{className:`flex flex-col gap-4 pt-2`,children:s.map(e=>(0,K.jsx)(Wj,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),isAutoFocused:e.name===u},e.name))})]})]}),_;return t[8]!==h||t[9]!==g?(_=(0,K.jsxs)(`div`,{"data-prop-panel":``,className:`flex flex-col gap-4 py-2 text-sm`,children:[h,g]}),t[8]=h,t[9]=g,t[10]=_):_=t[10],_}function Bj(e){return`advanced`in e&&e.advanced}function Vj(e){return!(`advanced`in e&&e.advanced)}function Hj(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}function Uj(e){throw Error(`PropPanel: unhandled PropDef type ${JSON.stringify(e)}`)}function Wj(e){let t=(0,J.c)(74),{propDef:n,value:r,onChange:i,isAutoFocused:a}=e;switch(n.type){case`reactnode`:return null;case`string`:{let e=`prop-${n.name}`,o=n.accept,s=o!==void 0&&o.length>0,c=!n.required&&n.defaultValue===void 0,l;t[0]===n.name?l=t[1]:(l=Nj(n.name),t[0]=n.name,t[1]=l);let u;t[2]!==e||t[3]!==l?(u=(0,K.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:l}),t[2]=e,t[3]=l,t[4]=u):u=t[4];let d=r??``,f;t[5]!==i||t[6]!==c?(f=e=>{let t=e.target.value;if(t===``&&c){i(void 0);return}i(t)},t[5]=i,t[6]=c,t[7]=f):f=t[7];let p=a?``:void 0,m;t[8]!==a||t[9]!==e||t[10]!==d||t[11]!==f||t[12]!==p?(m=(0,K.jsx)(hn,{id:e,type:`text`,value:d,onChange:f,autoFocus:a,"data-prop-autofocus":p,className:`h-7 text-sm`}),t[8]=a,t[9]=e,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==o||t[15]!==i||t[16]!==s?(h=s&&(0,K.jsx)(Kj,{accept:o,onUploaded:e=>i(e)}),t[14]=o,t[15]=i,t[16]=s,t[17]=h):h=t[17];let g;t[18]!==m||t[19]!==h?(g=(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==u||t[22]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[u,g]}),t[21]=u,t[22]=g,t[23]=_):_=t[23],_}case`boolean`:{let e=`prop-${n.name}`,a;t[24]===n.name?a=t[25]:(a=Nj(n.name),t[24]=n.name,t[25]=a);let o=a,s;t[26]!==e||t[27]!==o?(s=(0,K.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[26]=e,t[27]=o,t[28]=s):s=t[28];let c=!!r,l;t[29]===i?l=t[30]:(l=e=>i(e),t[29]=i,t[30]=l);let u;t[31]!==e||t[32]!==c||t[33]!==l?(u=(0,K.jsx)(Tj,{id:e,checked:c,onCheckedChange:l}),t[31]=e,t[32]=c,t[33]=l,t[34]=u):u=t[34];let d;return t[35]!==s||t[36]!==u?(d=(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[s,u]}),t[35]=s,t[36]=u,t[37]=d):d=t[37],d}case`enum`:{let e=`prop-${n.name}`,a=r??n.enumValues[0]??``,o;t[38]===n.name?o=t[39]:(o=Nj(n.name),t[38]=n.name,t[39]=o);let s;t[40]!==e||t[41]!==o?(s=(0,K.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[40]=e,t[41]=o,t[42]=s):s=t[42];let c;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(yj,{}),t[43]=c):c=t[43];let l;t[44]===e?l=t[45]:(l=(0,K.jsx)(bj,{id:e,size:`sm`,children:c}),t[44]=e,t[45]=l);let u;t[46]===n.enumValues?u=t[47]:(u=n.enumValues.map(Gj),t[46]=n.enumValues,t[47]=u);let d;t[48]===u?d=t[49]:(d=(0,K.jsx)(xj,{className:`z-70`,children:u}),t[48]=u,t[49]=d);let f;t[50]!==a||t[51]!==i||t[52]!==l||t[53]!==d?(f=(0,K.jsxs)(vj,{value:a,onValueChange:i,children:[l,d]}),t[50]=a,t[51]=i,t[52]=l,t[53]=d,t[54]=f):f=t[54];let p;return t[55]!==s||t[56]!==f?(p=(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,f]}),t[55]=s,t[56]=f,t[57]=p):p=t[57],p}case`number`:{let e=`prop-${n.name}`,a;t[58]===n.name?a=t[59]:(a=Nj(n.name),t[58]=n.name,t[59]=a);let o;t[60]!==e||t[61]!==a?(o=(0,K.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[60]=e,t[61]=a,t[62]=o):o=t[62];let s=r==null?``:String(r),c;t[63]===i?c=t[64]:(c=e=>{let t=e.target.value;if(t===``){i(void 0);return}if(t===`-`)return;let n=Number(t);Number.isNaN(n)||i(n)},t[63]=i,t[64]=c);let l;t[65]!==e||t[66]!==s||t[67]!==c?(l=(0,K.jsx)(hn,{id:e,type:`number`,inputMode:`numeric`,value:s,onChange:c,className:`h-7 text-sm`}),t[65]=e,t[66]=s,t[67]=c,t[68]=l):l=t[68];let u;return t[69]!==o||t[70]!==l?(u=(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,l]}),t[69]=o,t[70]=l,t[71]=u):u=t[71],u}default:{let e;return t[72]===n?e=t[73]:(e=Uj(n),t[72]=n,t[73]=e),e}}}function Gj(e){return(0,K.jsx)(Sj,{value:e,children:e},e)}function Kj(e){let t=(0,J.c)(17),{accept:n,onUploaded:r}=e,[i,a]=(0,q.useState)(!1),o=(0,q.useRef)(null),s;t[0]===n?s=t[1]:(s=n.join(`,`),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=async e=>{let t=e.target.files?.[0];if(t){a(!0);try{await Rj(t,n,r)}catch{}a(!1),o.current&&(o.current.value=``)}},t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,K.jsx)(`input`,{ref:o,type:`file`,accept:s,className:`hidden`,"data-prop-upload-input":``,onChange:c}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>o.current?.click(),t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=i?(0,K.jsx)(Hr,{className:`size-3.5 animate-spin`}):(0,K.jsx)(ai,{className:`size-3.5`}),t[9]=i,t[10]=d);let f;t[11]!==d||t[12]!==i?(f=(0,K.jsx)(Kt,{type:`button`,variant:`outline`,size:`sm`,disabled:i,"aria-label":`Upload file`,"data-prop-upload-trigger":``,className:`h-7 px-2`,onClick:u,children:d}),t[11]=d,t[12]=i,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,K.jsxs)(K.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var qj=`selectionStatePlugin/origin`,Jj=`selectionStatePlugin/refresh`,Yj=new ke(`selectionState`),Xj={selectedBlockId:null,ancestorChain:[],selectionOrigin:`programmatic`,isDragging:!1};function Zj(e){return Yj.getState(e.state)??Xj}function Qj(e,t){let n=[],{$from:r}=t;for(let t=1;t<=r.depth;t++){let i=r.node(t);if(i.type.name!==`jsxComponent`)continue;let a=r.before(t);n.push($j(e,i,a))}if(t instanceof bt){let r=t.node;r.type.name===`jsxComponent`&&n.push($j(e,r,t.from))}return n}function $j(e,t,n){let r=t.attrs.componentName??`unknown`;return{bridgeId:eM(e,n),componentName:r,pos:n}}function eM(e,t){return UT.getState(e)?.posToId.get(t)??`pos-${t}`}function tM(e,t,n={}){let r=Qj(e,e.selection),i={selectedBlockId:r[r.length-1]?.bridgeId??null,ancestorChain:r,selectionOrigin:n.origin??t.selectionOrigin,isDragging:n.isDragging??t.isDragging};return nM(t,i)?t:i}function nM(e,t){if(e===t)return!0;if(e.selectedBlockId!==t.selectedBlockId||e.selectionOrigin!==t.selectionOrigin||e.isDragging!==t.isDragging||e.ancestorChain.length!==t.ancestorChain.length)return!1;for(let n=0;n<e.ancestorChain.length;n++){let r=e.ancestorChain[n],i=t.ancestorChain[n];if(r.bridgeId!==i.bridgeId||r.componentName!==i.componentName||r.pos!==i.pos)return!1}return!0}var rM=new WeakMap;function iM(e,t,n,r){let i=r?.isDragging??t.isDragging,a=!!e.getMeta(Jj),o=e.selectionSet&&!a,s=e.getMeta(qj),c=o?r?.pendingOrigin??null:null,l=s??c??t.selectionOrigin;return o&&r&&(r.pendingOrigin=null),tM(n,t,{origin:l,isDragging:i})}var aM=o.create({name:`selectionStatePlugin`,addProseMirrorPlugins(){let e=this.editor,t=new At({key:Yj,state:{init(e,t){return tM(t,Xj)},apply(e,n,r,i){return iM(e,n,i,rM.get(t))}},props:{handleDOMEvents:{mousedown:()=>{let e=rM.get(t);return e&&(e.pendingOrigin=`pointer`),!1},pointerdown:()=>{let e=rM.get(t);return e&&(e.pendingOrigin=`pointer`),!1}},handleKeyDown:(e,n)=>{if(oM(n.key)){let e=rM.get(t);e&&(e.pendingOrigin=`keyboard`)}return!1}},view(n){rM.set(t,{pendingOrigin:null,isDragging:!1});let r=()=>{let n=rM.get(t);n&&(n.isDragging=!0,sM(e))},i=()=>{let n=rM.get(t);n&&(n.isDragging=!1,sM(e))};return n.dom.addEventListener(`dragstart`,r,!0),n.dom.addEventListener(`dragend`,i,!0),n.dom.addEventListener(`drop`,i,!0),{destroy:()=>{n.dom.removeEventListener(`dragstart`,r,!0),n.dom.removeEventListener(`dragend`,i,!0),n.dom.removeEventListener(`drop`,i,!0),rM.delete(t)}}}});return[t]}});function oM(e){return e===`ArrowUp`||e===`ArrowDown`||e===`ArrowLeft`||e===`ArrowRight`||e===`Tab`||e===`Escape`||e===`Enter`||e===`Home`||e===`End`||e===`PageUp`||e===`PageDown`}function sM(e){queueMicrotask(()=>{if(!e.isDestroyed)try{let t=e.state.tr.setMeta(Jj,!0);e.view.dispatch(t)}catch{}})}function cM(e){let t=(0,J.c)(5),n;t[0]===e?n=t[1]:(n=()=>e?Zj(e):null,t[0]=e,t[1]=n);let[r,i]=(0,q.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(!e){i(null);return}i(Zj(e));let t=()=>{i(Zj(e))};return e.on(`transaction`,t),e.on(`selectionUpdate`,t),()=>{e.off(`transaction`,t),e.off(`selectionUpdate`,t)}},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,q.useEffect)(a,o),r}function lM(){}function uM(e){let{xmlFragment:t,ytext:n}=e,r=(e,t)=>{},i=(e,t)=>{};return t.observeDeep(r),n.observe(i),()=>{t.unobserveDeep(r),n.unobserve(i)}}function dM(e,t){if(e.hasChildren)return!1;let n=Mj(e.props);return n===null?!1:t[n]===``}function fM(e){let t=e.placeholder?.label,n=`Add ${(e.displayName??e.name).toLowerCase()}`;return{label:t??n,Icon:KC(e.placeholder?.icon??e.icon)}}var pM=null;function mM(){return pM||=new Ae({extensions:E}),pM}function hM(e){if(!e.attrs.sourceDirty&&e.attrs.sourceRaw)return e.attrs.sourceRaw;let t=mM(),n=e.type.schema.node(`doc`,null,[e]);return t.serialize(n.toJSON()).trim()}var gM=new Set(u.map(e=>`${e}:`)),_M=6e4,vM=10,yM=new Map;function bM(e,t){let n=t.toLowerCase();pe(n);let r=Date.now(),i=yM.get(n);if(!i||r-i.windowStart>=_M)yM.set(n,{windowStart:r,count:1});else if(i.count+=1,i.count>vM)return;typeof console<`u`&&typeof console.warn==`function`&&console.warn(JSON.stringify({event:`jsx-prop-dropped`,reason:e,prop:t}))}var xM=new Set([`href`,`src`,`action`,`formaction`,`poster`,`cite`,`data`,`manifest`,`background`,`ping`,`xlinkhref`,`xlinkactuate`,`xlinkrole`,`xlinkarcrole`,`xlinkshow`,`url`,`link`]),SM=new Set([`dangerouslysetinnerhtml`,`ref`,`key`,`defaultvalue`,`defaultchecked`,`__proto__`,`constructor`,`prototype`]),CM=1e4;function wM(e){let t=e.toLowerCase();return!!(SM.has(t)||t.length>=3&&t.startsWith(`on`))}function TM(e){return xM.has(e.toLowerCase())}function EM(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`//`)||V(t))return e;let n=t.indexOf(`:`),r=t.slice(0,n+1).toLowerCase();return gM.has(r)?e:`#`}function DM(e){if(e.length>CM)return``;let t=e.toLowerCase();return/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/.test(t)||/\bexpression\s*\(/.test(t)?``:e}function OM(e){if(e==null)return e;if(Array.isArray(e)){let t=!1,n=Array(e.length);for(let r=0;r<e.length;r++){let i=OM(e[r]);n[r]=i,i!==e[r]&&(t=!0)}return t?n:e}if(typeof e!=`object`)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=e,r=!1,i={};for(let[e,t]of Object.entries(n)){if(wM(e)){bM(`dangerous-prop-name-nested`,e),r=!0;continue}if(TM(e)&&typeof t==`string`){let n=EM(t);n!==t&&(r=!0),i[e]=n}else{let n=OM(t);n!==t&&(r=!0),i[e]=n}}return r?i:e}function kM(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){if(wM(r)){bM(`dangerous-prop-name`,r),t=!0;continue}if(TM(r)){let e=EM(i);e!==i&&(t=!0),n[r]=e;continue}if(r===`style`){if(typeof i==`string`){let e=DM(i);e!==i&&(t=!0),n[r]=e}else t=!0;continue}let e=OM(i);e!==i&&(t=!0),n[r]=e}return t?n:e}function AM(e){let t=(0,J.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`div`,{className:`jsx-component-error-fallback`,children:n}),t[0]=n,t[1]=r),r}function jM(e){let t=(0,J.c)(13),{children:n,resetKey:r,onError:i,descriptorName:a,rawComponentName:o}=e,s;t[0]===r?s=t[1]:(s=[r],t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==i||t[4]!==o?(c=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:a,rawComponentName:String(o??``).slice(0,200),error:String(n),stack:t.componentStack})),y(a),i(n)},t[2]=a,t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=e=>(0,K.jsx)(AM,{...e,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==n||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,K.jsx)(sj,{resetKeys:s,onError:c,fallbackRender:l,children:n}),t[8]=n,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function MM(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(MM).join(`,`)}]`;let t=Object.entries(e);return t.sort(([e],[t])=>e<t?-1:+(e>t)),`{${t.map(([e,t])=>`${JSON.stringify(e)}:${MM(t)}`).join(`,`)}}`}function NM(e,t){let n=e.props??{},r={};for(let[e,i]of Object.entries(n))t.has(e)||(r[e]=i);return kM(r)}var PM=3;function FM(e){let t=(0,J.c)(161),{node:n,editor:r,getPos:i,selected:a}=e,o=bT(n.attrs.componentName),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1),d=(0,q.useRef)(!1),f=typeof i==`function`?i():void 0,p=!1,_=0,v=1;try{if(f!==void 0){let e=r.state.doc.resolve(f);e.depth>0&&e.parent.type.name===`jsxComponent`&&(p=!0,_=e.index(e.depth),v=e.parent.childCount)}}catch(e){let t=e;if(!(t instanceof RangeError))throw t}let y=p&&_>0,b=p&&_<v-1,x=cM(r),S=typeof f==`number`?eM(r.state,f):null,C=S!==null&&x?.selectedBlockId===S,w=S!==null&&!C&&(x?.ancestorChain.some(e=>e.bridgeId===S)??!1),T=C&&x?x.selectionOrigin:void 0,E=C&&(x?.isDragging??!1),D=o.props.some(zM),O=n.attrs.props??{},k=D&&o.props.some(e=>e.type!==`string`||!e.required||`hidden`in e&&e.hidden?!1:O[e.name]===``),A=dM(o,O),j=A?fM(o):null,M=!o.hasChildren||!!o.isSelfClosing;(0,q.useEffect)(()=>{a&&!d.current&&D&&kT(f)&&u(!0),d.current=a},[a,D,f]);let N=NM(n.attrs,o.reactNodePropNames),P=o.surface===`compat`?o.translateProps(N):N,F=`${o.name}::${MM(N)}`,I;t[0]!==i||t[1]!==n.content.size?(I=()=>(typeof i==`function`?i()??0:0)+1+n.content.size,t[0]=i,t[1]=n.content.size,t[2]=I):I=t[2];let L=I,R=o.name===`*`||s!==null,z=(0,q.useRef)(!1),B=(0,q.useRef)(0),[V,H]=(0,q.useState)(!1),U;t[3]!==o.displayName||t[4]!==o.name||t[5]!==r||t[6]!==i||t[7]!==R||t[8]!==n||t[9]!==s?.message||t[10]!==V?(U=()=>{if(!R||z.current||V)return;let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=hM(n),a=o.name===`*`?`Unregistered component: ${n.attrs.componentName}`:`Render error in <${o.displayName??o.name}>: ${s?.message??`unknown`}`,c=n.type.schema.nodes.rawMdxFallback.create({reason:a},n.type.schema.text(t)),l=!1,u,d=()=>{if(!l)try{r.view.dispatch(r.state.tr.replaceWith(e,e+n.nodeSize,c)),z.current=!0,m(o.name===`*`?`wildcard`:o.name)}catch(e){let t=e,r=o.name===`*`?`wildcard`:o.name;if(console.warn(JSON.stringify({event:`jsx-component-auto-convert-failed`,component:r,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500),retry:B.current})),ue(r),B.current+=1,B.current<PM){let e=50*(2**B.current-1);u=setTimeout(()=>{l||d()},e)}else l||H(!0)}},f=requestAnimationFrame(d);return()=>{l=!0,cancelAnimationFrame(f),u!==void 0&&clearTimeout(u)}},t[3]=o.displayName,t[4]=o.name,t[5]=r,t[6]=i,t[7]=R,t[8]=n,t[9]=s?.message,t[10]=V,t[11]=U):U=t[11];let te;if(t[12]!==o||t[13]!==r||t[14]!==i||t[15]!==R||t[16]!==n||t[17]!==s||t[18]!==V?(te=[R,n,r,i,o,s,V],t[12]=o,t[13]=r,t[14]=i,t[15]=R,t[16]=n,t[17]=s,t[18]=V,t[19]=te):te=t[19],(0,q.useEffect)(U,te),V){let e=o.name===`*`?`<${n.attrs.componentName}> isn't a known component. Copy the source to use it elsewhere, or delete the block.`:`<${o.displayName??o.name}> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block.`,a;t[20]!==o.name||t[21]!==n?(a=()=>{try{let e=hM(n);typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e)}catch(e){let t=e;g(o.name),console.warn(JSON.stringify({event:`jsx-component-stuck-copy-failed`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500)}))}},t[20]=o.name,t[21]=n,t[22]=a):a=t[22];let s=a,c;t[23]!==o.name||t[24]!==r||t[25]!==i||t[26]!==n.attrs.componentName?(c=()=>{let e=typeof i==`function`?i():void 0;if(typeof e==`number`)try{r.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;ee(o.name),console.warn(JSON.stringify({event:`jsx-component-stuck-delete-failed`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},t[23]=o.name,t[24]=r,t[25]=i,t[26]=n.attrs.componentName,t[27]=c):c=t[27];let l=c,u;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(u={[JE]:`true`},t[28]=u):u=t[28];let d;t[29]===e?d=t[30]:(d=(0,K.jsx)(`span`,{className:`flex-1`,children:e}),t[29]=e,t[30]=d);let f;t[31]===s?f=t[32]:(f=(0,K.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:s,children:`Copy source`}),t[31]=s,t[32]=f);let p;t[33]===l?p=t[34]:(p=(0,K.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:l,children:`Delete`}),t[33]=l,t[34]=p);let m;t[35]!==p||t[36]!==d||t[37]!==f?(m=(0,K.jsxs)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-2 border border-destructive/40 rounded bg-destructive/5 flex items-center gap-2`,contentEditable:!1,...u,children:[d,f,p]}),t[35]=p,t[36]=d,t[37]=f,t[38]=m):m=t[38];let h;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsx)(dc,{className:`component-children`}),t[39]=h):h=t[39];let _;return t[40]===m?_=t[41]:(_=(0,K.jsxs)(fc,{className:`jsx-component-wrapper my-2`,children:[m,h]}),t[40]=m,t[41]=_),_}if(R){let e=o.name===`*`?`Unknown component: ${n.attrs.componentName} — source editable below`:`${o.displayName??o.name} — render error, source editable below`,r;t[42]===e?r=t[43]:(r=(0,K.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-1`,contentEditable:!1,children:e}),t[42]=e,t[43]=r);let i;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(dc,{className:`component-children`}),t[44]=i):i=t[44];let a;return t[45]===r?a=t[46]:(a=(0,K.jsxs)(fc,{className:`jsx-component-wrapper my-2`,children:[r,i]}),t[45]=r,t[46]=a),a}let ne=o.Component,re;t[47]!==r||t[48]!==M||t[49]!==f||t[50]!==A?(re=e=>{if(A||!M)return;let t=e.target;if(!e.currentTarget.contains(t)||t.closest(`.jsx-component-chrome`)||t.closest(`.jsx-add-child-pill, .jsx-empty-child-placeholder`)||t.closest(`a[href]`)||typeof f!=`number`)return;let n=r.state.doc.nodeAt(f);if(!n)return;let i=f+n.nodeSize,a=r.state.selection.from;a<f||a>=i||r.chain().focus().setNodeSelection(f).run()},t[47]=r,t[48]=M,t[49]=f,t[50]=A,t[51]=re):re=t[51];let ie=re,ae;t[52]!==r||t[53]!==i||t[54]!==u?(ae=()=>{let e=typeof i==`function`?i():void 0;typeof e==`number`&&(r.chain().focus().setNodeSelection(e).run(),u(!0))},t[52]=r,t[53]=i,t[54]=u,t[55]=ae):ae=t[55];let oe=ae,se=o.displayName??o.name,ce=!!o.emptyChildName,le;t[56]!==se||t[57]!==o.emptyChildName||t[58]!==ce||t[59]!==n.childCount?(le=ce?Aj(se,o.emptyChildName,n.childCount):void 0,t[56]=se,t[57]=o.emptyChildName,t[58]=ce,t[59]=n.childCount,t[60]=le):le=t[60];let de=le,fe;t[61]!==D||t[62]!==a||t[63]!==u?(fe=e=>{if(e.key!==`Enter`&&e.key!==` `||!a||!D)return;let t=e.target;t.closest(`.jsx-component-chrome`)||t.closest(`input, textarea, select, button`)||(e.preventDefault(),u(!0))},t[61]=D,t[62]=a,t[63]=u,t[64]=fe):fe=t[64];let pe=fe,me;t[65]!==r||t[66]!==i||t[67]!==M||t[68]!==u?(me=e=>{u(e),!e&&M&&requestAnimationFrame(()=>{let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=r.state.doc.nodeAt(e);if(!t)return;let n=e+t.nodeSize,a=r.state.selection.from;if(a<e||a>=n)return;let o=r.state.doc.resolve(Math.min(n,r.state.doc.content.size)),s=h.near(o,1);r.view.dispatch(r.state.tr.setSelection(s).scrollIntoView())})},t[65]=r,t[66]=i,t[67]=M,t[68]=u,t[69]=me):me=t[69];let he=me,ge;t[70]===o.name?ge=t[71]:(ge=o.name.toLowerCase(),t[70]=o.name,t[71]=ge);let _e;bb0:{let e=O.align;if(e===`left`||e===`right`||e===`center`){_e=e;break bb0}if(o.name===`img`||o.name===`CommonMarkImage`){_e=`center`;break bb0}_e=void 0}let ve=C?`true`:void 0,ye=w?`true`:void 0,be=E?`true`:void 0,xe=k?`true`:void 0,Se=ce?`group`:void 0,Ce=C?0:-1,we;t[72]===p?we=t[73]:(we=p?{draggable:`false`,onDragStart:RM}:{"data-drag-handle":``,draggable:`true`},t[72]=p,t[73]=we);let Te;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Te={[JE]:`true`},t[74]=Te):Te=t[74];let Ee;t[75]!==O.align||t[76]!==o.name||t[77]!==r||t[78]!==f?(Ee=(o.name===`img`||o.name===`CommonMarkImage`)&&[{value:`left`,label:`Align left`,Icon:ni},{value:`center`,label:`Align center`,Icon:ei},{value:`right`,label:`Align right`,Icon:ti}].map(e=>{let{value:t,label:n,Icon:i}=e,a=typeof O.align==`string`?O.align:`center`,o=(a===`left`||a===`right`||a===`center`?a:`center`)===t;return(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":n,"aria-pressed":o,"data-active":o?`true`:void 0,onClick:()=>{if(typeof f!=`number`)return;let e=r.state.doc.nodeAt(f);if(!e||e.type.name!==`jsxComponent`)return;let n=String(e.attrs.componentName??``);if(n!==`img`&&n!==`CommonMarkImage`||e.attrs.kind!==`element`)return;let i=n===`CommonMarkImage`,a={...e.attrs.props??{},align:t},o=i?{...e.attrs,componentName:`img`,props:a,sourceDirty:!0}:{...e.attrs,props:a,sourceDirty:!0};r.view.dispatch(r.state.tr.setNodeMarkup(f,null,o))},children:(0,K.jsx)(i,{size:12,"aria-hidden":`true`})},t)}),t[75]=O.align,t[76]=o.name,t[77]=r,t[78]=f,t[79]=Ee):Ee=t[79];let De;t[80]!==y||t[81]!==o.name||t[82]!==r||t[83]!==n.attrs.componentName||t[84]!==n.nodeSize||t[85]!==f?(De=y&&(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`Move up`,onClick:()=>{try{if(typeof f!=`number`)return;let e=r.state.doc.resolve(f),t=e.index(e.depth);if(t===0)return;let i=f-e.node(e.depth).child(t-1).nodeSize,a=f+n.nodeSize,o=r.state.tr,s=r.state.doc.slice(f,f+n.nodeSize),c=r.state.doc.slice(i,f);o.replaceWith(i,a,s.content.append(c.content)),r.view.dispatch(o.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;Ct(`up`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`up`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,K.jsx)(pr,{size:12,"aria-hidden":`true`})}),t[80]=y,t[81]=o.name,t[82]=r,t[83]=n.attrs.componentName,t[84]=n.nodeSize,t[85]=f,t[86]=De):De=t[86];let Oe;t[87]!==b||t[88]!==o.name||t[89]!==r||t[90]!==n.attrs.componentName||t[91]!==n.nodeSize||t[92]!==f?(Oe=b&&(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`Move down`,onClick:()=>{try{if(typeof f!=`number`)return;let e=r.state.doc.resolve(f),t=e.index(e.depth),i=e.node(e.depth);if(t>=i.childCount-1)return;let a=i.child(t+1),o=f,s=f+n.nodeSize+a.nodeSize,c=r.state.tr,l=r.state.doc.slice(f,f+n.nodeSize),u=r.state.doc.slice(f+n.nodeSize,s);c.replaceWith(o,s,u.content.append(l.content)),r.view.dispatch(c.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;Ct(`down`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`down`,component:o.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,K.jsx)(fr,{size:12,"aria-hidden":`true`})}),t[87]=b,t[88]=o.name,t[89]=r,t[90]=n.attrs.componentName,t[91]=n.nodeSize,t[92]=f,t[93]=Oe):Oe=t[93];let ke=`Delete ${o.displayName??o.name}`,Ae;t[94]!==r||t[95]!==f?(Ae=()=>{typeof f==`number`&&r.chain().focus().setNodeSelection(f).deleteSelection().run()},t[94]=r,t[95]=f,t[96]=Ae):Ae=t[96];let je;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,K.jsx)(ri,{size:12,"aria-hidden":`true`}),t[97]=je):je=t[97];let Me;t[98]!==ke||t[99]!==Ae?(Me=(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":ke,onClick:Ae,children:je}),t[98]=ke,t[99]=Ae,t[100]=Me):Me=t[100];let Ne;t[101]!==o.displayName||t[102]!==o.name||t[103]!==D?(Ne=D&&(0,K.jsx)(uj,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":`${o.displayName??o.name} properties`,children:(0,K.jsx)(Yr,{size:12,"aria-hidden":`true`})})}),t[101]=o.displayName,t[102]=o.name,t[103]=D,t[104]=Ne):Ne=t[104];let Pe;t[105]!==Ee||t[106]!==De||t[107]!==Oe||t[108]!==Me||t[109]!==Ne?(Pe=(0,K.jsxs)(`div`,{className:`jsx-component-chrome`,contentEditable:!1,onMouseDown:LM,...Te,children:[Ee,De,Oe,Me,Ne]}),t[105]=Ee,t[106]=De,t[107]=Oe,t[108]=Me,t[109]=Ne,t[110]=Pe):Pe=t[110];let Fe;t[111]!==ne||t[112]!==o.hasChildren||t[113]!==o.isSelfClosing||t[114]!==o.name||t[115]!==C||t[116]!==n.attrs.componentName||t[117]!==n.childCount||t[118]!==oe||t[119]!==P||t[120]!==F||t[121]!==j||t[122]!==c||t[123]!==A?(Fe=A&&j?(0,K.jsx)(fj,{asChild:!0,children:(0,K.jsx)(pj,{label:j.label,Icon:j.Icon,onClick:oe,selected:C})}):(0,K.jsx)(jM,{resetKey:F,onError:c,descriptorName:o.name===`*`?`wildcard`:o.name,rawComponentName:n.attrs.componentName??``,children:(0,K.jsx)(ne,{...P,children:(0,K.jsx)(dc,{className:`component-children ${!o.hasChildren&&n.childCount===0?`min-h-0 m-0 p-0`:``}`,...!o.hasChildren||o.isSelfClosing?{contentEditable:!1}:{}})})}),t[111]=ne,t[112]=o.hasChildren,t[113]=o.isSelfClosing,t[114]=o.name,t[115]=C,t[116]=n.attrs.componentName,t[117]=n.childCount,t[118]=oe,t[119]=P,t[120]=F,t[121]=j,t[122]=c,t[123]=A,t[124]=Fe):Fe=t[124];let Ie;t[125]!==o.emptyChildName||t[126]!==r||t[127]!==L||t[128]!==n.childCount?(Ie=o.emptyChildName&&(0,K.jsx)(`button`,{type:`button`,contentEditable:!1,className:n.childCount===0?`jsx-empty-child-placeholder`:`jsx-add-child-pill`,onMouseDown:IM,onClick:()=>{let e=o.emptyChildName,t=ET(e),n=L();r.chain().focus().insertContentAt(n,t).run(),AT(r,n,bT(e))},"data-clipboard-omit":`true`,children:(0,K.jsxs)(`span`,{children:[`+ Add `,o.emptyChildName]})}),t[125]=o.emptyChildName,t[126]=r,t[127]=L,t[128]=n.childCount,t[129]=Ie):Ie=t[129];let Le;t[130]!==o.name||t[131]!==de||t[132]!==ie||t[133]!==pe||t[134]!==T||t[135]!==ge||t[136]!==_e||t[137]!==ve||t[138]!==ye||t[139]!==be||t[140]!==xe||t[141]!==Se||t[142]!==Ce||t[143]!==we||t[144]!==Pe||t[145]!==Fe||t[146]!==Ie?(Le=(0,K.jsxs)(fc,{className:`jsx-component-wrapper my-2`,"data-jsx-component":``,"data-component-type":ge,"data-align":_e,"data-selected":ve,"data-has-child-selected":ye,"data-selection-origin":T,"data-dragging":be,"data-needs-config":xe,role:Se,"aria-label":de,tabIndex:Ce,...we,"data-component-name":o.name,onClick:ie,onKeyDown:pe,children:[Pe,Fe,Ie]}),t[130]=o.name,t[131]=de,t[132]=ie,t[133]=pe,t[134]=T,t[135]=ge,t[136]=_e,t[137]=ve,t[138]=ye,t[139]=be,t[140]=xe,t[141]=Se,t[142]=Ce,t[143]=we,t[144]=Pe,t[145]=Fe,t[146]=Ie,t[147]=Le):Le=t[147];let Re;t[148]!==o||t[149]!==r||t[150]!==i||t[151]!==D||t[152]!==M||t[153]!==N||t[154]!==A?(Re=D&&(0,K.jsxs)(dj,{side:A?`bottom`:`right`,align:A?`center`:`start`,sideOffset:A?-4:8,className:`w-64 p-3 z-[60] overflow-y-auto subtle-scrollbar max-h-[calc(100vh-2rem)] overscroll-contain`,onCloseAutoFocus:M?e=>{e.preventDefault(),r.view.focus()}:void 0,children:[(0,K.jsxs)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:[o.displayName??o.name,` Properties`]}),(0,K.jsx)(zj,{descriptor:o,values:N,onChange:(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let a=r.state.doc.nodeAt(n);if(!a||a.attrs.kind!==`element`)return;let o={...a.attrs.props??{}},s=Array.isArray(a.attrs.attributes)?a.attrs.attributes:[],c=s;t===void 0?(delete o[e],c=s.filter(t=>!(typeof t==`object`&&t&&t.type===`mdxJsxAttribute`&&t.name===e))):o[e]=t,r.view.dispatch(r.state.tr.setNodeMarkup(n,null,{...a.attrs,attributes:c,props:o,sourceDirty:!0}))}})]}),t[148]=o,t[149]=r,t[150]=i,t[151]=D,t[152]=M,t[153]=N,t[154]=A,t[155]=Re):Re=t[155];let ze;return t[156]!==he||t[157]!==l||t[158]!==Le||t[159]!==Re?(ze=(0,K.jsxs)(lj,{open:l,onOpenChange:he,children:[Le,Re]}),t[156]=he,t[157]=l,t[158]=Le,t[159]=Re,t[160]=ze):ze=t[160],ze}function IM(e){return e.stopPropagation()}function LM(e){return e.stopPropagation()}function RM(e){return e.preventDefault()}function zM(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}var BM=we.extend({addNodeView(){return bc(FM)}}),VM={name:`InlineMath`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,category:`content`,description:`Inline math`,props:[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX inline math source`}]},HM=(0,q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-DX-tM4Fr.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,J.c)(4),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!1,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;return n[2]===i?a=n[3]:(a=(0,K.jsx)(`span`,{className:`math math-inline`,dangerouslySetInnerHTML:{__html:i}}),n[2]=i,n[3]=a),a}return{default:t}});function UM(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(`span`,{className:`math math-inline math-placeholder math-placeholder-empty inline-flex items-center gap-1 rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs italic text-muted-foreground hover:bg-muted/60 cursor-pointer`,"data-component-type":`math-inline`,children:`f(x)`}),e[0]=t):t=e[0],t}function WM(e){let t=(0,J.c)(2),n;return t[0]===e.formula?n=t[1]:(n=(0,K.jsx)(`span`,{className:`math math-inline math-placeholder`,"data-component-type":`math-inline`,children:e.formula}),t[0]=e.formula,t[1]=n),n}function GM(e){let t=(0,J.c)(38),{node:n,selected:r,getPos:i,editor:a}=e,o=typeof n.attrs.formula==`string`?n.attrs.formula:``,s=typeof n.attrs.id==`string`?n.attrs.id:void 0,[c,l]=(0,q.useState)(!1),u=(0,q.useRef)(!1),d;t[0]!==a.state||t[1]!==i||t[2]!==r?(d=()=>{let e=r&&a.state.selection instanceof bt;e&&!u.current?(kT(typeof i==`function`?i()??0:0),l(!0)):!e&&u.current&&l(!1),u.current=e},t[0]=a.state,t[1]=i,t[2]=r,t[3]=d):d=t[3];let f;t[4]!==a||t[5]!==i||t[6]!==r?(f=[r,i,a],t[4]=a,t[5]=i,t[6]=r,t[7]=f):f=t[7],(0,q.useEffect)(d,f);let p=r?`math-inline-selected`:void 0,m;t[8]===s?m=t[9]:(m=s?{id:s}:{},t[8]=s,t[9]=m);let h;t[10]===o?h=t[11]:(h=o?(0,K.jsx)(sj,{resetKeys:[o],onError:qM,fallbackRender:()=>(0,K.jsx)(`span`,{className:`math math-inline math-error`,children:o}),children:(0,K.jsx)(q.Suspense,{fallback:(0,K.jsx)(WM,{formula:o}),children:(0,K.jsx)(HM,{formula:o})})}):(0,K.jsx)(UM,{}),t[10]=o,t[11]=h);let g;t[12]!==o||t[13]!==m||t[14]!==h?(g=(0,K.jsx)(uj,{asChild:!0,children:(0,K.jsx)(`span`,{className:`math-inline-trigger`,"data-component-type":`math-inline`,"data-formula":o,...m,children:h})}),t[12]=o,t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]===a.view?_=t[17]:(_=e=>{e.preventDefault(),a.view.focus()},t[16]=a.view,t[17]=_);let v;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,K.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground px-3 pt-2`,children:`Inline Math Properties`}),t[18]=v):v=t[18];let y;t[19]===o?y=t[20]:(y={formula:o},t[19]=o,t[20]=y);let b;t[21]!==a.state||t[22]!==a.view||t[23]!==i?(b=(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let r=a.state.doc.nodeAt(n);if(!r||r.type.name!==`mathInline`)return;let o=a.state.tr.setNodeMarkup(n,null,{...r.attrs,[e]:t??``});o.setSelection(bt.create(o.doc,n)),a.view.dispatch(o)},t[21]=a.state,t[22]=a.view,t[23]=i,t[24]=b):b=t[24];let x;t[25]!==b||t[26]!==y?(x=(0,K.jsx)(zj,{descriptor:VM,values:y,onChange:b}),t[25]=b,t[26]=y,t[27]=x):x=t[27];let S;t[28]!==x||t[29]!==_?(S=(0,K.jsxs)(dj,{className:`z-[60] w-72 p-0`,side:`bottom`,align:`start`,onOpenAutoFocus:KM,onCloseAutoFocus:_,children:[v,x]}),t[28]=x,t[29]=_,t[30]=S):S=t[30];let C;t[31]!==c||t[32]!==S||t[33]!==g?(C=(0,K.jsxs)(lj,{open:c,onOpenChange:l,children:[g,S]}),t[31]=c,t[32]=S,t[33]=g,t[34]=C):C=t[34];let w;return t[35]!==C||t[36]!==p?(w=(0,K.jsx)(fc,{as:`span`,className:p,children:C}),t[35]=C,t[36]=p,t[37]=w):w=t[37],w}function KM(e){e.preventDefault()}function qM(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`mathInline`,rawComponentName:`mathInline`,error:String(n),stack:t.componentStack})),y(`mathInline`)}var JM=Ot.extend({addNodeView(){return bc(GM)}});function YM(e){return e.editorView}function XM(e){if(!e.isDestroyed)return e.extensionManager.extensions.find(e=>e.name===`collaboration`)?.options?.document}function ZM(e){return e?e.startsWith(`Unregistered component:`)?`info`:e.startsWith(`Render error in`)?`warn`:`error`:`error`}var QM={info:{wrapperClass:`border-muted-foreground/30 bg-muted/30`,badgeClass:`text-muted-foreground bg-muted`,label:`unknown`},warn:{wrapperClass:`border-amber-400/60 dark:border-amber-500/40 bg-amber-50/50 dark:bg-amber-900/10`,badgeClass:`text-amber-600 dark:text-amber-400 bg-amber-100 dark:bg-amber-900/30`,label:`render error`},error:{wrapperClass:`border-destructive/60 bg-destructive/5`,badgeClass:`text-destructive bg-destructive/10`,label:`parse error`}},$M=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[gn.contextHash,r]]}addChild(e,t){e.prop(gn.contextHash)!=this.hash&&(e=new bn(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new bn(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new bn(xn.none,e,t,n,this.hashProp)})}},Q;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(Q||={});var eN=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},tN=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return aN(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function nN(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==Q.OrderedList?fN:dN)(n,t,!1);return r>0&&(e.type!=Q.BulletList||lN(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var rN={[Q.Blockquote](e,t,n){return n.next==62?(n.markers.push(BN(Q.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(iN(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[Q.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Q.OrderedList]:nN,[Q.BulletList]:nN,[Q.Document](){return!0}};function iN(e){return e==32||e==9||e==10||e==13}function aN(e,t=0){for(;t<e.length&&iN(e.charCodeAt(t));)t++;return t}function oN(e,t,n){for(;t>n&&iN(e.charCodeAt(t-1));)t--;return t}function sN(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function cN(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function lN(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!iN(n))return-1}return n&&e.next==45&&mN(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(EN.SetextHeading)>-1||r<3?-1:1}function uN(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function dN(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||iN(e.text.charCodeAt(e.pos+1)))&&(!n||uN(t,Q.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function fN(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!iN(e.text.charCodeAt(r+1))||n&&!uN(t,Q.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function pN(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function mN(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&iN(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var hN=/^[ \t]*$/,gN=/-->/,_N=/\?>/,vN=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,gN],[/^\s*<\?/,_N],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,hN],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,hN]];function yN(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=vN.length-+!!n;e<t;e++)if(vN[e][0].test(r))return e;return-1}function bN(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function xN(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==Q.CodeText?e[r].to=n:e.push(BN(Q.CodeText,t,n))}var SN={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(xN(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){xN(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==Q.CodeText?xN(o,e.from,e.to):o.push(e);s=[]}xN(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&xN(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=Q.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(Q.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=sN(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=oN(t.text,t.text.length,o),c=[BN(Q.CodeMark,r,r+a)];o<s&&c.push(BN(Q.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&xN(c,e.lineStart-1,e.lineStart),c.push(BN(Q.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(xN(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(xN(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(Q.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=cN(t);return n<0?!1:(e.startContext(Q.Blockquote,t.pos),e.addNode(Q.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(lN(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(Q.HorizontalRule,n),!0},BulletList(e,t){let n=dN(t,e,!1);if(n<0)return!1;e.block.type!=Q.BulletList&&e.startContext(Q.BulletList,t.basePos,t.next);let r=bN(t,t.pos+1);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=fN(t,e,!1);if(n<0)return!1;e.block.type!=Q.OrderedList&&e.startContext(Q.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=bN(t,t.pos+n);return e.startContext(Q.ListItem,t.basePos,r-t.baseIndent),e.addNode(Q.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=pN(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=oN(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!iN(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(Q.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(Q.HeaderMark,o-r,a-r);let c=s.finish(Q.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=yN(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=vN[n][1],a=[],o=i!=hN;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==gN?Q.CommentBlock:i==_N?Q.ProcessingInstructionBlock:Q.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},CN=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
11
- `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&aN(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,BN(Q.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(QN(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(BN(Q.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(XN(e,aN(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=aN(e,this.pos),n=0;if(t>this.pos){let r=ZN(e,t,this.start);if(r){let t=wN(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=wN(e,this.pos),n>0&&n<e.length?n:-1}else return wN(e,this.pos)}};function wN(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!iN(n))return-1}return t}var TN=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:mN(t),i=t.next;if(r<0)return!1;let a=BN(Q.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,BN(i==61?Q.SetextHeading1:Q.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},EN={LinkReference(e,t){return t.content.charCodeAt(0)==91?new CN(t):null},SetextHeading(){return new TN}},DN=[(e,t)=>pN(t)>=0,(e,t)=>sN(t)>=0,(e,t)=>cN(t)>=0,(e,t)=>dN(t,e,!0)>=0,(e,t)=>fN(t,e,!0)>=0,(e,t)=>lN(t,e,!0)>=0,(e,t)=>yN(t,e,!0)>=0],ON={text:``,end:0},kN=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new tN,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=$M.create(Q.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new nP(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new eN(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
12
- `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=rP(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=ON;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+Q[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
13
- `?``:t;else{let e=t.indexOf(`
14
- `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=$M.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new bn(this.parser.nodeSet.types[e],IN,IN,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(eP(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?AN(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=eP(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Q.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?BN(this.parser.getNodeType(e),t,n,r):new zN(e,t)}get buffer(){return new LN(this.parser.nodeSet)}};function AN(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=AN(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new bn(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var jN=class e extends Mn{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new kN(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=NN(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(MN(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=Q.ATXHeading1&&c<=Q.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(xn.define({id:c,name:n,props:l&&[[gn.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof Dn?t[n]=s:Object.assign(t,s))}r=new jn(e),t&&(r=r.extend(Sn(t)))}if(MN(n.props)&&(r=r.extend(...n.props)),MN(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(MN(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?PN(s,e.before):e.after?PN(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(MN(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?PN(l,e.before):e.after?PN(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new $N(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function MN(e){return e!=null&&e.length>0}function NN(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=NN(e[0]);if(e.length==1)return t;let n=NN(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||IN).concat(t||IN),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function PN(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var FN=[xn.none];for(let e=1,t;t=Q[e];e++)FN[e]=xn.define({id:e,name:t,props:e>=Q.Escape?[]:[[gn.group,e in rN?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var IN=[],LN=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return bn.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},RN=class{constructor(e,t,n,r=IN){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new LN(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},zN=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return IN}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function BN(e,t,n,r){return new RN(e,t,n,r)}var VN={resolve:`Emphasis`,mark:`EmphasisMark`},HN={resolve:`Emphasis`,mark:`EmphasisMark`},UN={},WN={},GN=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},KN=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,qN=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{qN=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var JN={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(KN.charCodeAt(t)==r)return e.append(BN(Q.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(BN(Q.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(BN(Q.InlineCode,n,r+1,[BN(Q.CodeMark,n,n+i),BN(Q.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(BN(Q.Autolink,n,n+1+i[0].length,[BN(Q.LinkMark,n,n+1),BN(Q.URL,n+1,n+i[0].length),BN(Q.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(BN(Q.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(BN(Q.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(BN(Q.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=qN.test(i),s=qN.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new GN(t==95?VN:HN,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(BN(Q.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(BN(Q.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new GN(UN,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new GN(WN,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof GN&&(r.type==UN||r.type==WN)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=YN(e,i,r.type==UN?Q.Link:Q.Image,r.from,n+1);if(r.type==UN)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof GN&&t.type==UN&&(t.side=0)}return a.to}}return-1}};function YN(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(BN(Q.LinkMark,r,r+(n==Q.Image?2:1))),t.push(BN(Q.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=XN(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=ZN(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(BN(Q.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(BN(Q.LinkMark,n,s)))}else if(o==91){let n=QN(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return BN(n,r,s,t)}function XN(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return BN(Q.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(iN(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?BN(Q.URL,t+n,i+n):i==e.length?null:!1}}function ZN(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return BN(Q.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function QN(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:BN(Q.LinkLabel,t+n,a+1+n);else{if(r&&!iN(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var $N=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new GN(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof GN&&(t.type==UN||t.type==WN))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof GN&&n.type.resolve&&n.side&2))continue;let r=n.type==VN||n.type==HN,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof GN&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof RN&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new GN(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new GN(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof RN&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof GN&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof GN?t:null}skipSpace(e){return aN(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?BN(this.parser.getNodeType(e),t,n,r):new zN(e,t)}};$N.linkStart=UN,$N.imageStart=WN;function eP(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof RN&&(n[r]=new RN(t.type,t.from,t.to,eP(t.children,[e])))}else n.splice(r++,0,e)}return n}var tP=[Q.CodeBlock,Q.ListItem,Q.OrderedList,Q.BulletList],nP=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
15
- `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(gn.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=rP(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new bn(e.parser.nodeSet.types[Q.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(tP.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function rP(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var iP=Sn({"Blockquote/...":G.quote,HorizontalRule:G.contentSeparator,"ATXHeading1/... SetextHeading1/...":G.heading1,"ATXHeading2/... SetextHeading2/...":G.heading2,"ATXHeading3/...":G.heading3,"ATXHeading4/...":G.heading4,"ATXHeading5/...":G.heading5,"ATXHeading6/...":G.heading6,"Comment CommentBlock":G.comment,Escape:G.escape,Entity:G.character,"Emphasis/...":G.emphasis,"StrongEmphasis/...":G.strong,"Link/... Image/...":G.link,"OrderedList/... BulletList/...":G.list,"BlockQuote/...":G.quote,"InlineCode CodeText":G.monospace,"URL Autolink":G.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":G.processingInstruction,"CodeInfo LinkLabel":G.labelName,LinkTitle:G.string,Paragraph:G.content}),aP=new jN(new jn(FN).extend(iP),Object.keys(SN).map(e=>SN[e]),Object.keys(SN).map(e=>EN[e]),Object.keys(SN),DN,rN,Object.keys(JN).map(e=>JN[e]),Object.keys(JN),[]);function oP(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function sP(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Cn((e,r)=>{let i=e.type.id;if(t&&(i==Q.CodeBlock||i==Q.FencedCode)){let n=``;if(i==Q.FencedCode){let t=e.node.getChild(Q.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Q.CodeText,bracketed:i==Q.FencedCode}}else if(n&&(i==Q.HTMLBlock||i==Q.HTMLTag||i==Q.CommentBlock))return{parser:n,overlay:oP(e.node,e.from,e.to)};return null})}}var cP={resolve:`Strikethrough`,mark:`StrikethroughMark`},lP={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":G.strikethrough}},{name:`StrikethroughMark`,style:G.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=qN.test(r),c=qN.test(i);return e.addDelimiter(cP,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function uP(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function dP(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var fP=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,pP=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&fP.test(r=t.text.slice(t.pos))){let i=[];uP(e,n.content,0,i,n.start)==uP(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];uP(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},mP={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":G.heading}},`TableRow`,{name:`TableCell`,style:G.content},{name:`TableDelimiter`,style:G.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return dP(t.content,0)?new pP:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof pP)||!dP(t.text,t.basePos))return!1;let r=e.peekLine();return fP.test(r)&&uP(e,t.text,t.basePos)==uP(e,r,t.basePos)},before:`SetextHeading`}]},hP=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},gP={defineNodes:[{name:`Task`,block:!0,style:G.list},{name:`TaskMarker`,style:G.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new hP:null},after:`SetextHeading`}]},_P=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,vP=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,yP=/[\w-]+\.[\w-]+($|\/)/,bP=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,xP=/\/[a-zA-Z\d@.]+/gy;function SP(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function CP(e,t){vP.lastIndex=t;let n=vP.exec(e);if(!n||yP.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&SP(e,t,r,`)`)>SP(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function wP(e,t){bP.lastIndex=t;let n=bP.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var TP=[mP,gP,lP,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;_P.lastIndex=r;let i=_P.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=CP(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=wP(e.text,r):(a=wP(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(xP.lastIndex=a,i=xP.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function EP(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),iN(s))break}return-1}}var DP={defineNodes:[{name:`Superscript`,style:G.special(G.content)},{name:`SuperscriptMark`,style:G.processingInstruction}],parseInline:[{name:`Superscript`,parse:EP(94,`Superscript`,`SuperscriptMark`)}]},OP={defineNodes:[{name:`Subscript`,style:G.special(G.content)},{name:`SubscriptMark`,style:G.processingInstruction}],parseInline:[{name:`Subscript`,parse:EP(126,`Subscript`,`SubscriptMark`)}]},kP={defineNodes:[{name:`Emoji`,style:G.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},AP=55,jP=1,MP=56,NP=2,PP=57,FP=3,IP=4,LP=5,RP=6,zP=7,BP=8,VP=9,HP=10,UP=11,WP=12,GP=13,KP=58,qP=14,JP=15,YP=59,XP=21,ZP=23,QP=24,$P=25,eF=27,tF=28,nF=29,rF=32,iF=35,aF=37,oF=38,sF=0,cF=1,lF={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},uF={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},dF={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function fF(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var pF=null,mF=null,hF=0;function gF(e,t){let n=e.pos+t;if(hF==n&&mF==e)return pF;let r=e.peek(t),i=``;for(;fF(r);)i+=String.fromCharCode(r),r=e.peek(++t);return mF=e,hF=n,pF=i?i.toLowerCase():r==bF||r==xF?void 0:null}var _F=60,vF=62,yF=47,bF=63,xF=33,SF=45;function CF(e,t){this.name=e,this.parent=t}var wF=[RP,HP,zP,BP,VP],TF=new dr({start:null,shift(e,t,n,r){return wF.indexOf(t)>-1?new CF(gF(r,1)||``,e):e},reduce(e,t){return t==XP&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==RP||i==aF?new CF(gF(r,1)||``,e):e},strict:!1}),EF=new lr((e,t)=>{if(e.next!=_F){e.next<0&&t.context&&e.acceptToken(KP);return}e.advance();let n=e.next==yF;n&&e.advance();let r=gF(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?JP:qP);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(UP);if(i&&uF[i])return e.acceptToken(KP,-2);if(t.dialectEnabled(sF))return e.acceptToken(WP);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(GP)}else{if(r==`script`)return e.acceptToken(zP);if(r==`style`)return e.acceptToken(BP);if(r==`textarea`)return e.acceptToken(VP);if(lF.hasOwnProperty(r))return e.acceptToken(HP);i&&dF[i]&&dF[i][r]?e.acceptToken(KP,-1):e.acceptToken(RP)}},{contextual:!0}),DF=new lr(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(YP);break}if(e.next==SF)t++;else if(e.next==vF&&t>=2){n>=3&&e.acceptToken(YP,-2);break}else t=0;e.advance()}});function OF(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var kF=new lr((e,t)=>{if(e.next==yF&&e.peek(1)==vF){let n=t.dialectEnabled(cF)||OF(t.context);e.acceptToken(n?LP:IP,2)}else e.next==vF&&e.acceptToken(IP,1)});function AF(e,t,n){let r=2+e.length;return new lr(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==_F||a==1&&i.next==yF||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==vF){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var jF=AF(`script`,AP,jP),MF=AF(`style`,MP,NP),NF=AF(`textarea`,PP,FP),PF=Sn({"Text RawText IncompleteTag IncompleteCloseTag":G.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":G.angleBracket,TagName:G.tagName,"MismatchedCloseTag/TagName":[G.tagName,G.invalid],AttributeName:G.attributeName,"AttributeValue UnquotedAttributeValue":G.attributeValue,Is:G.definitionOperator,"EntityReference CharacterReference":G.character,Comment:G.blockComment,ProcessingInst:G.processingInstruction,DoctypeDecl:G.documentMeta}),FF=ur.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO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!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:TF,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[PF],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ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5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function IF(e,t){let n=Object.create(null);for(let r of e.getChildren(QP)){let e=r.getChild($P),i=r.getChild(eF)||r.getChild(tF);e&&(n[t.read(e.from,e.to)]=i?i.type.id==eF?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function LF(e,t){let n=e.getChild(ZP);return n?t.read(n.from,n.to):` `}function RF(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=IF(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function zF(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return Cn((e,t)=>{let s=e.type.id;if(s==nF)return RF(e,t,n);if(s==rF)return RF(e,t,r);if(s==iF)return RF(e,t,i);if(s==XP&&a.length){let n=e.node,r=n.firstChild,i=r&&LF(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=IF(r,t)))){let t=n.lastChild,i=t.type.id==oF?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==QP){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=LF(n.parent,t))continue;let e=n.lastChild;if(e.type.id==eF){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==tF)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var BF=135,VF=1,HF=136,UF=137,WF=2,GF=138,KF=3,qF=4,JF=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],YF=58,XF=40,ZF=95,QF=91,$F=45,eI=46,tI=35,nI=37,rI=38,iI=92,aI=10,oI=42;function sI(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function cI(e){return e>=48&&e<=57}function lI(e){return cI(e)||e>=97&&e<=102||e>=65&&e<=70}var uI=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(sI(c)||c==$F||c==ZF||a&&cI(c))!a&&(c!=$F||s>0)&&(a=!0),o===s&&c==$F&&o++,r.advance();else if(c==iI&&r.peek(1)!=aI){if(r.advance(),lI(r.next)){do r.advance();while(lI(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(WF)?t:c==XF?n:e);break}}},dI=new lr(uI(HF,WF,UF),{contextual:!0}),fI=new lr(uI(GF,KF,qF),{contextual:!0}),pI=new lr(e=>{if(JF.includes(e.peek(-1))){let{next:t}=e;(sI(t)||t==ZF||t==tI||t==eI||t==oI||t==QF||t==YF&&sI(e.peek(1))||t==$F||t==rI)&&e.acceptToken(BF)}}),mI=new lr(e=>{if(!JF.includes(e.peek(-1))){let{next:t}=e;if(t==nI&&(e.advance(),e.acceptToken(VF)),sI(t)){do e.advance();while(sI(e.next)||cI(e.next));e.acceptToken(VF)}}}),hI=Sn({"AtKeyword import charset namespace keyframes media supports font-feature-values":G.definitionKeyword,"from to selector scope MatchFlag":G.keyword,NamespaceName:G.namespace,KeyframeName:G.labelName,KeyframeRangeName:G.operatorKeyword,TagName:G.tagName,ClassName:G.className,PseudoClassName:G.constant(G.className),IdName:G.labelName,"FeatureName PropertyName":G.propertyName,AttributeName:G.attributeName,NumberLiteral:G.number,KeywordQuery:G.keyword,UnaryQueryOp:G.operatorKeyword,"CallTag ValueName FontName":G.atom,VariableName:G.variableName,Callee:G.operatorKeyword,Unit:G.unit,"UniversalSelector NestingSelector":G.definitionOperator,"MatchOp CompareOp":G.compareOperator,"ChildOp SiblingOp, LogicOp":G.logicOperator,BinOp:G.arithmeticOperator,Important:G.modifier,Comment:G.blockComment,ColorLiteral:G.color,"ParenthesizedContent StringLiteral":G.string,":":G.punctuation,"PseudoOp #":G.derefOperator,"; , |":G.separator,"( )":G.paren,"[ ]":G.squareBracket,"{ }":G.brace}),gI={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},_I={__proto__:null,or:104,and:104,not:112,only:112,layer:186},vI={__proto__:null,selector:118,layer:182},yI={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},bI={__proto__:null,to:223},xI=ur.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#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WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[hI],skippedNodes:[0,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jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[pI,mI,dI,fI,1,2,3,4,new cr(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>gI[e]||-1},{term:138,get:e=>_I[e]||-1},{term:4,get:e=>vI[e]||-1},{term:28,get:e=>yI[e]||-1},{term:136,get:e=>bI[e]||-1}],tokenPrec:2256}),SI=null;function CI(){if(!SI&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));SI=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return SI||[]}var wI=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),TI=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),EI=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),DI=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),OI=/^(\w[\w-]*|-\w[\w-]*|)$/,kI=/^-(-[\w-]*)?$/;function AI(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var jI=new An,MI=[`Declaration`];function NI(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function PI(e,t,n){if(t.to-t.from>4096){let r=jI.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(rr.IncludeAnonymous);if(o.firstChild())do for(let t of PI(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return jI.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(MI)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var FI=(e=>t=>{let{state:n,pos:r}=t,i=Tn(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:CI(),validFor:OI};if(i.name==`ValueName`)return{from:i.from,options:TI,validFor:OI};if(i.name==`PseudoClassName`)return{from:i.from,options:wI,validFor:OI};if(e(i)||(t.explicit||a)&&AI(i,n.doc))return{from:e(i)||a?i.from:r,options:PI(n.doc,NI(i),e),validFor:kI};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:CI(),validFor:OI};return{from:i.from,options:EI,validFor:OI}}if(i.name==`AtKeyword`)return{from:i.from,options:DI,validFor:OI};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:wI,validFor:OI}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:TI,validFor:OI}:o.name==`Block`||o.name==`Styles`?{from:r,options:CI(),validFor:OI}:null})(e=>e.name==`VariableName`),II=Xn.define({name:`css`,parser:xI.configure({props:[er.add({Declaration:$n()}),nr.add({"Block KeyframeList":Fn})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function LI(){return new qn(II,II.data.of({autocomplete:FI}))}var RI=316,zI=317,BI=1,VI=2,HI=3,UI=4,WI=318,GI=320,KI=321,qI=5,JI=6,YI=0,XI=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ZI=125,QI=59,$I=47,eL=42,tL=43,nL=45,rL=60,iL=44,aL=63,oL=46,sL=91,cL=new dr({start:!1,shift(e,t){return t==qI||t==JI||t==GI?e:t==KI},strict:!1}),lL=new lr((e,t)=>{let{next:n}=e;(n==ZI||n==-1||t.context)&&e.acceptToken(WI)},{contextual:!0,fallback:!0}),uL=new lr((e,t)=>{let{next:n}=e,r;XI.indexOf(n)>-1||n==$I&&((r=e.peek(1))==$I||r==eL)||n!=ZI&&n!=QI&&n!=-1&&!t.context&&e.acceptToken(RI)},{contextual:!0}),dL=new lr((e,t)=>{e.next==sL&&!t.context&&e.acceptToken(zI)},{contextual:!0}),fL=new lr((e,t)=>{let{next:n}=e;if(n==tL||n==nL){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(BI);e.acceptToken(n?BI:VI)}}else n==aL&&e.peek(1)==oL&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(HI))},{contextual:!0});function pL(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var mL=new lr((e,t)=>{if(e.next!=rL||!t.dialectEnabled(YI)||(e.advance(),e.next==$I))return;let n=0;for(;XI.indexOf(e.next)>-1;)e.advance(),n++;if(pL(e.next,!0)){for(e.advance(),n++;pL(e.next,!1);)e.advance(),n++;for(;XI.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==iL)return;for(let t=0;;t++){if(t==7){if(!pL(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(UI,-n)}),hL=Sn({"get set async static":G.modifier,"for while do if else switch try catch finally return throw break continue default case defer":G.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":G.operatorKeyword,"let var const using function class extends":G.definitionKeyword,"import export from":G.moduleKeyword,"with debugger new":G.keyword,TemplateString:G.special(G.string),super:G.atom,BooleanLiteral:G.bool,this:G.self,null:G.null,Star:G.modifier,VariableName:G.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":G.function(G.variableName),VariableDefinition:G.definition(G.variableName),Label:G.labelName,PropertyName:G.propertyName,PrivatePropertyName:G.special(G.propertyName),"CallExpression/MemberExpression/PropertyName":G.function(G.propertyName),"FunctionDeclaration/VariableDefinition":G.function(G.definition(G.variableName)),"ClassDeclaration/VariableDefinition":G.definition(G.className),"NewExpression/VariableName":G.className,PropertyDefinition:G.definition(G.propertyName),PrivatePropertyDefinition:G.definition(G.special(G.propertyName)),UpdateOp:G.updateOperator,"LineComment Hashbang":G.lineComment,BlockComment:G.blockComment,Number:G.number,String:G.string,Escape:G.escape,ArithOp:G.arithmeticOperator,LogicOp:G.logicOperator,BitOp:G.bitwiseOperator,CompareOp:G.compareOperator,RegExp:G.regexp,Equals:G.definitionOperator,Arrow:G.function(G.punctuation),": Spread":G.punctuation,"( )":G.paren,"[ ]":G.squareBracket,"{ }":G.brace,"InterpolationStart InterpolationEnd":G.special(G.brace),".":G.derefOperator,", ;":G.separator,"@":G.meta,TypeName:G.typeName,TypeDefinition:G.definition(G.typeName),"type enum interface implements namespace module declare":G.definitionKeyword,"abstract global Privacy readonly override":G.modifier,"is keyof unique infer asserts":G.operatorKeyword,JSXAttributeValue:G.attributeValue,JSXText:G.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":G.angleBracket,"JSXIdentifier JSXNameSpacedName":G.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":G.attributeName,"JSXBuiltin/JSXIdentifier":G.standard(G.tagName)}),gL={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},_L={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},vL={__proto__:null,"<":193},yL=ur.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#Da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(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:cL,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[hL],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+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[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>gL[e]||-1},{term:343,get:e=>_L[e]||-1},{term:95,get:e=>vL[e]||-1}],tokenPrec:15201}),bL=[ar("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),ar("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),ar("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),ar(`do {
16
- \${}
17
- } while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),ar(`while (\${}) {
18
- \${}
19
- }`,{label:`while`,detail:`loop`,type:`keyword`}),ar(`try {
20
- \${}
21
- } catch (\${error}) {
22
- \${}
23
- }`,{label:`try`,detail:`/ catch block`,type:`keyword`}),ar(`if (\${}) {
24
- \${}
25
- }`,{label:`if`,detail:`block`,type:`keyword`}),ar(`if (\${}) {
26
- \${}
27
- } else {
28
- \${}
29
- }`,{label:`if`,detail:`/ else block`,type:`keyword`}),ar(`class \${name} {
30
- constructor(\${params}) {
31
- \${}
32
- }
33
- }`,{label:`class`,detail:`definition`,type:`keyword`}),ar('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),ar('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],xL=bL.concat([ar(`interface \${name} {
34
- \${}
35
- }`,{label:`interface`,detail:`definition`,type:`keyword`}),ar("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),ar(`enum \${name} {
36
- \${}
37
- }`,{label:`enum`,detail:`definition`,type:`keyword`})]),SL=new An,CL=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function wL(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var TL=[`FunctionDeclaration`],EL={FunctionDeclaration:wL(`function`),ClassDeclaration:wL(`class`),ClassExpression:()=>!0,EnumDeclaration:wL(`constant`),TypeAliasDeclaration:wL(`type`),NamespaceDeclaration:wL(`namespace`),VariableDefinition(e,t){e.matchContext(TL)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function DL(e,t){let n=SL.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(rr.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=EL[t.name];if(e&&e(t,a)||CL.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of DL(e,t.node))r.push(n);return!1}}),SL.set(t,r),r}var OL=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,kL=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function AL(e){let t=Tn(e.state).resolveInner(e.pos,-1);if(kL.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&OL.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)CL.has(n.name)&&(r=r.concat(DL(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:OL}}var jL=Xn.define({name:`javascript`,parser:yL.configure({props:[er.add({IfStatement:$n({except:/^\s*({|else\b)/}),TryStatement:$n({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:zn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Jn({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":$n({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),nr.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Fn,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),ML={test:e=>/^JSX/.test(e.name),facet:Rn({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},NL=jL.configure({dialect:`ts`},`typescript`),PL=jL.configure({dialect:`jsx`,props:[Vn.add(e=>e.isTop?[ML]:void 0)]}),FL=jL.configure({dialect:`jsx ts`,props:[Vn.add(e=>e.isTop?[ML]:void 0)]},`typescript`),IL=e=>({label:e,type:`keyword`}),LL=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(IL),RL=LL.concat([`declare`,`implements`,`private`,`protected`,`public`].map(IL));function zL(e={}){let t=e.jsx?e.typescript?FL:PL:e.typescript?NL:jL,n=e.typescript?xL.concat(RL):bL.concat(LL);return new qn(t,[jL.data.of({autocomplete:or(kL,ir(n))}),jL.data.of({autocomplete:AL}),e.jsx?UL:[]])}function BL(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function VL(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var HL=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),UL=Nn.inputHandler.of((e,t,n,r,i)=>{if((HL?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!jL.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=Tn(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=VL(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:kn.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=BL(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=VL(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),WL=[`_blank`,`_self`,`_top`,`_parent`],GL=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],KL=[`get`,`post`,`put`,`delete`],qL=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],JL=[`true`,`false`],$={},YL={a:{attrs:{href:null,ping:null,type:null,media:null,target:WL,hreflang:null}},abbr:$,address:$,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:$,aside:$,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:$,base:{attrs:{href:null,target:WL}},bdi:$,bdo:$,blockquote:{attrs:{cite:null}},body:$,br:$,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:qL,formmethod:KL,formnovalidate:[`novalidate`],formtarget:WL,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:$,center:$,cite:$,code:$,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:$,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:$,div:$,dl:$,dt:$,em:$,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:$,figure:$,footer:$,form:{attrs:{action:null,name:null,"accept-charset":GL,autocomplete:[`on`,`off`],enctype:qL,method:KL,novalidate:[`novalidate`],target:WL}},h1:$,h2:$,h3:$,h4:$,h5:$,h6:$,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:$,hgroup:$,hr:$,html:{attrs:{manifest:null}},i:$,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:qL,formmethod:KL,formnovalidate:[`novalidate`],formtarget:WL,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:$,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:$,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:$,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:GL,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:$,noscript:$,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:$,param:{attrs:{name:null,value:null}},pre:$,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:$,rt:$,ruby:$,samp:$,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:GL}},section:$,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:$,source:{attrs:{src:null,type:null,media:null}},span:$,strong:$,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:$,summary:$,sup:$,table:$,tbody:$,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:$,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:$,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:$,time:{attrs:{datetime:null}},title:$,tr:$,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:$,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:$},XL={accesskey:null,class:null,contenteditable:JL,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:JL,autocorrect:JL,autocapitalize:JL,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":JL,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":JL,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":JL,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":JL,"aria-hidden":JL,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":JL,"aria-multiselectable":JL,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":JL,"aria-relevant":null,"aria-required":JL,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ZL=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of ZL)XL[e]=null;var QL=class{constructor(e,t){this.tags={...YL,...e},this.globalAttrs={...XL,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};QL.default=new QL;function $L(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function eR(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function tR(e,t,n){return n.tags[$L(e,eR(t))]?.children||n.allTags}function nR(e,t){let n=[];for(let r=eR(t);r&&!r.type.isTop;r=eR(r.parent)){let i=$L(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var rR=/^[:\-\.\w\u00b7-\uffff]*$/;function iR(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=eR(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:tR(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(nR(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function aR(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:nR(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:rR}}function oR(e,t,n,r){let i=[],a=0;for(let r of tR(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of nR(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function sR(e,t,n,r,i){let a=eR(n),o=a?t.tags[$L(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:rR}}function cR(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=eR(n),i=r?t.tags[$L(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function lR(e,t){let{state:n,pos:r}=t,i=Tn(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?aR(n,i,i.from,r):iR(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?iR(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?aR(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?sR(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?cR(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?oR(n,e,i,r):null}function uR(e){return lR(QL.default,e)}function dR(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new QL(t,n):QL.default;return e=>lR(r,e)}var fR=jL.parser.configure({top:`SingleExpression`}),pR=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:NL.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:PL.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:FL.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:fR},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:jL.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:II.parser}],mR=[{name:`style`,parser:II.parser.configure({top:`Styles`})}].concat(ZL.map(e=>({name:e,parser:jL.parser}))),hR=Xn.define({name:`html`,parser:FF.configure({props:[er.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),nr.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Gn.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),gR=hR.configure({wrap:zF(pR,mR)});function _R(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=zF((e.nestedLanguages||[]).concat(pR),(e.nestedAttributes||[]).concat(mR))),new qn(n?hR.configure({wrap:n,dialect:t}):t?gR.configure({dialect:t}):gR,[gR.data.of({autocomplete:dR(e)}),e.autoCloseTags===!1?[]:yR,zL().support,LI().support])}var vR=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),yR=Nn.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!gR.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=Tn(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=$L(o.doc,t.parent,n))&&!vR.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=$L(o.doc,e,n))&&!vR.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:kn.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),bR=Rn({commentTokens:{block:{open:`<!--`,close:`-->`}}}),xR=new gn,SR=aP.configure({props:[nr.add(e=>!e.is(`Block`)||e.is(`Document`)||CR(e)!=null||wR(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),xR.add(CR),er.add({Document:()=>null}),Un.add({Document:bR})]});function CR(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function wR(e){return e.name==`OrderedList`||e.name==`BulletList`}function TR(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=CR(e.type))!=null&&r<=t)break;n=e}return n.to}var ER=Ln.of((e,t,n)=>{for(let r=Tn(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(xR);if(e==null)continue;let t=TR(r,e);if(t>n)return{from:n,to:t}}return null});function DR(e){return new Bn(bR,e,[],`markdown`)}var OR=DR(SR),kR=DR(SR.configure([TP,OP,DP,kP,{props:[nr.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function AR(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):In.matchLanguageName(e,n,!0),t instanceof In)return t.support?t.support.language.parser:Zn.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var jR=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+NR(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function MR(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new jR(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new jR(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new jR(i.parent,s,s+t,a[1],e,n,i))}}return r}function NR(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function PR(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=NR(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function FR(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(vn)!=` `)return e;let r=_n(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var IR=((e={})=>({state:t,dispatch:n})=>{let r=Tn(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!kR.isActiveAt(t,n.from,-1)&&!kR.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=MR(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&PR(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&PR(e.item,i,r),{range:kn.cursor(t+n.length),changes:r}}else{let e=zR(c,t,s);return{range:kn.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&PR(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?_n(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=FR(p,t),RR(l.node,t.doc)&&(p=zR(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:kn.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function LR(e){return e.name==`QuoteMark`||e.name==`ListMark`}function RR(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function zR(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?_n(n.text,4,e[t+1].from)-r.length:null,t<i);return FR(r,t)}function BR(e,t){let n=e.resolveInner(t,-1),r=t;LR(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(LR(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var VR=[{key:`Enter`,run:IR},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=Tn(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&kR.isActiveAt(e,t.from)){let t=a.lineAt(i),r=MR(BR(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:kn.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(_n(t.text,4,n.to)-_n(t.text,4,n.from));return r==t.from&&(i=FR(i,e)),{range:kn.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:kn.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],HR=_R({matchClosingTags:!1});function UR(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=OR,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=HR}=e;if(!(i instanceof jN))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,ER],u;o&&l.push(JR),n instanceof qn?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?AR(t,u):void 0;c.push(sP({codeParser:d,htmlParser:s.language.parser})),r&&l.push(Wn.high(Kn.of(VR)));let f=DR(i.configure(c));return a&&l.push(f.data.of({autocomplete:WR})),new qn(f,l)}function WR(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=Tn(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:KR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var GR=null;function KR(){if(GR)return GR;let e=uR(new sr(yn.create({extensions:HR}),0,!0));return GR=e?e.options:[]}var qR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,JR=Nn.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!kR.isActiveAt(t.state,n.from,1)))return!1;let i=Tn(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||qR.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function YR(){return YR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YR.apply(null,arguments)}var XR=e=>{var{theme:t,settings:n={},styles:r=[]}=e,i={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(i[`&`]=a),n.fontFamily&&(i[`&.cm-editor .cm-scroller`]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[`.cm-gutters`].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[`.cm-gutters`].color=n.gutterForeground),n.gutterBorder&&(i[`.cm-gutters`].borderRightColor=n.gutterBorder),n.caret&&(i[`.cm-content`]={caretColor:n.caret},i[`.cm-cursor, .cm-dropCursor`]={borderLeftColor:n.caret});var o={};return n.gutterActiveForeground&&(o.color=n.gutterActiveForeground),n.lineHighlight&&(i[`.cm-activeLine`]={backgroundColor:n.lineHighlight},o.backgroundColor=n.lineHighlight),i[`.cm-activeLineGutter`]=o,n.selection&&(i[`&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection`]={background:n.selection+` !important`}),n.selectionMatch&&(i[`& .cm-selectionMatch`]={backgroundColor:n.selectionMatch}),[Nn.theme(i,{dark:t===`dark`}),wn(Qn.define(r))]},ZR={background:`#2E3235`,foreground:`#DDDDDD`,caret:`#DDDDDD`,selection:`#202325`,selectionMatch:`#202325`,gutterBackground:`#292d30`,gutterForeground:`#808080`,gutterBorder:`1px solid #ffffff10`,lineHighlight:`#B9D2FF30`},QR=[{tag:G.keyword,color:`#fda331`},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:`#b5bd68`},{tag:[G.variableName],color:`#6fb3d2`},{tag:[G.function(G.variableName)],color:`#fda331`},{tag:[G.labelName],color:`#fc6d24`},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:`#fda331`},{tag:[G.definition(G.name),G.separator],color:`#cc99cc`},{tag:[G.brace],color:`#cc99cc`},{tag:[G.annotation],color:`#fc6d24`},{tag:[G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:`#fda331`},{tag:[G.typeName,G.className],color:`#6fb3d2`},{tag:[G.operator,G.operatorKeyword],color:`#cc99cc`},{tag:[G.tagName],color:`#fda331`},{tag:[G.squareBracket],color:`#cc99cc`},{tag:[G.angleBracket],color:`#cc99cc`},{tag:[G.attributeName],color:`#6fb3d2`},{tag:[G.regexp],color:`#fda331`},{tag:[G.quote],color:`#DDDDDD`},{tag:[G.string],color:`#b5bd68`},{tag:G.link,color:`#6987AF`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[G.url,G.escape,G.special(G.string)],color:`#8abeb7`},{tag:[G.meta],color:`#A54543`},{tag:[G.comment],color:`#808080`,fontStyle:`italic`},{tag:G.monospace,color:`#DDDDDD`},{tag:G.strong,fontWeight:`bold`,color:`#fda331`},{tag:G.emphasis,fontStyle:`italic`,color:`#6fb3d2`},{tag:G.strikethrough,textDecoration:`line-through`},{tag:G.heading,fontWeight:`bold`,color:`#DDDDDD`},{tag:G.special(G.heading1),fontWeight:`bold`,color:`#DDDDDD`},{tag:G.heading1,fontWeight:`bold`,color:`#DDDDDD`},{tag:[G.heading2,G.heading3,G.heading4],fontWeight:`bold`,color:`#DDDDDD`},{tag:[G.heading5,G.heading6],color:`#DDDDDD`},{tag:[G.atom,G.bool,G.special(G.variableName)],color:`#8abeb7`},{tag:[G.processingInstruction,G.inserted],color:`#8abeb7`},{tag:[G.contentSeparator],color:`#6fb3d2`},{tag:G.invalid,color:`#B9D2FF`,borderBottom:`1px dotted #fc6d24`}],$R=e=>{var{theme:t=`dark`,settings:n={},styles:r=[]}=e||{};return XR({theme:t,settings:YR({},ZR,n),styles:[...QR,...r]})};$R();var ez={background:`#ffffff`,foreground:`#2e3440`,caret:`#3b4252`,selection:`#eceff4`,selectionMatch:`#e5e9f0`,gutterBackground:`#eceff4`,gutterForeground:`#2e3440`,gutterBorder:`none`,lineHighlight:`#02255f11`},tz=[{tag:G.keyword,color:`#5e81ac`},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:`#d08770`},{tag:[G.variableName],color:`#d08770`},{tag:[G.function(G.variableName)],color:`#5e81ac`},{tag:[G.labelName],color:`#81a1c1`},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:`#5e81ac`},{tag:[G.definition(G.name),G.separator],color:`#a3be8c`},{tag:[G.brace],color:`#8fbcbb`},{tag:[G.annotation],color:`#d30102`},{tag:[G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:`#88c0d0`},{tag:[G.typeName,G.className],color:`#ebcb8b`},{tag:[G.operator,G.operatorKeyword],color:`#a3be8c`},{tag:[G.tagName],color:`#b48ead`},{tag:[G.squareBracket],color:`#bf616a`},{tag:[G.angleBracket],color:`#d08770`},{tag:[G.attributeName],color:`#ebcb8b`},{tag:[G.regexp],color:`#5e81ac`},{tag:[G.quote],color:`#3b4252`},{tag:[G.string],color:`#d08770`},{tag:G.link,color:`#8fbcbb`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[G.url,G.escape,G.special(G.string)],color:`#d08770`},{tag:[G.meta],color:`#88c0d0`},{tag:[G.comment],color:`#434c5e`,fontStyle:`italic`},{tag:G.strong,fontWeight:`bold`,color:`#5e81ac`},{tag:G.emphasis,fontStyle:`italic`,color:`#5e81ac`},{tag:G.strikethrough,textDecoration:`line-through`},{tag:G.heading,fontWeight:`bold`,color:`#5e81ac`},{tag:G.special(G.heading1),fontWeight:`bold`,color:`#5e81ac`},{tag:G.heading1,fontWeight:`bold`,color:`#5e81ac`},{tag:[G.heading2,G.heading3,G.heading4],fontWeight:`bold`,color:`#5e81ac`},{tag:[G.heading5,G.heading6],color:`#5e81ac`},{tag:[G.atom,G.bool,G.special(G.variableName)],color:`#d08770`},{tag:[G.processingInstruction,G.inserted],color:`#8fbcbb`},{tag:[G.contentSeparator],color:`#ebcb8b`},{tag:G.invalid,color:`#434c5e`,borderBottom:`1px dotted #d30102`}],nz=e=>{var{theme:t=`light`,settings:n={},styles:r=[]}=e||{};return XR({theme:t,settings:YR({},ez,n),styles:[...tz,...r]})};nz();var rz=[In.of({name:`javascript`,alias:[`js`,`jsx`],extensions:[`js`,`mjs`,`cjs`,`jsx`],load:async()=>zL({jsx:!0})}),In.of({name:`typescript`,alias:[`ts`,`tsx`],extensions:[`ts`,`mts`,`cts`,`tsx`],load:async()=>zL({typescript:!0,jsx:!0})}),In.of({name:`json`,alias:[`jsonc`],extensions:[`json`,`jsonc`],load:()=>n(()=>import(`./dist-W2rlYChw.js`).then(e=>e.json()),__vite__mapDeps([25,26,4,27,28]),import.meta.url)}),In.of({name:`yaml`,alias:[`yml`],extensions:[`yaml`,`yml`],load:()=>n(()=>import(`./dist-Z6vgTDkw.js`).then(e=>e.yaml()),__vite__mapDeps([29,26,4,27,28]),import.meta.url)}),In.of({name:`css`,alias:[`scss`,`less`],extensions:[`css`,`scss`,`less`],load:async()=>LI()}),In.of({name:`html`,alias:[`htm`],extensions:[`html`,`htm`],load:async()=>_R()}),In.of({name:`python`,alias:[`py`],extensions:[`py`,`pyw`],load:()=>n(()=>import(`./dist-BNOfnTlI.js`).then(e=>e.python()),__vite__mapDeps([30,31,26,4,27,28]),import.meta.url)}),In.of({name:`rust`,alias:[`rs`],extensions:[`rs`],load:()=>n(()=>import(`./dist-BNZ2DXnR.js`).then(e=>e.rust()),__vite__mapDeps([32,26,4,27,28]),import.meta.url)}),In.of({name:`markdown`,alias:[`md`,`mdx`],extensions:[`md`,`mdx`,`markdown`],load:async()=>UR()}),In.of({name:`bash`,alias:[`sh`,`shell`,`zsh`],extensions:[`sh`,`bash`,`zsh`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:t},{shell:r}]=await Promise.all([n(()=>import(`./dist-B-xmnigy.js`).then(e=>e.m),__vite__mapDeps([26,4,27]),import.meta.url),n(()=>import(`./shell-BkCD5kyH.js`),[],import.meta.url)]);return new t(e.define(r))}}),In.of({name:`go`,alias:[`golang`],extensions:[`go`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:t},{go:r}]=await Promise.all([n(()=>import(`./dist-B-xmnigy.js`).then(e=>e.m),__vite__mapDeps([26,4,27]),import.meta.url),n(()=>import(`./go-e6pdpn6U.js`),[],import.meta.url)]);return new t(e.define(r))}}),In.of({name:`math`,alias:[`latex`,`tex`],extensions:[`tex`,`latex`],load:async()=>{let[{StreamLanguage:e,LanguageSupport:t},{stex:r}]=await Promise.all([n(()=>import(`./dist-B-xmnigy.js`).then(e=>e.m),__vite__mapDeps([26,4,27]),import.meta.url),n(()=>import(`./stex-CJTvJH5f.js`),[],import.meta.url)]);return new t(e.define(r))}})],iz=En.define(),az=En.define(),oz=Yn.line({class:`agent-flash`}),sz=On.define({create(){return Yn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(iz)){let{from:r,to:i}=n.value,a=[];for(let e=r;e<=i;){let n=t.state.doc.lineAt(e);a.push(oz.range(n.from)),e=n.to+1}e=e.update({add:a,sort:!0})}else n.is(az)&&(e=Yn.none);return e},provide:e=>Nn.decorations.from(e)});function cz(e){let t=e.getMap(`agent-flash`);return[sz,Pn.define(e=>{let n=0,r=Date.now(),i=null,a=null,o=!1;function s(){let t=e.state.doc.length;t!==0&&(o||(e.dispatch({effects:iz.of({from:0,to:t})}),a&&clearTimeout(a),a=setTimeout(()=>{a=null,!o&&e.dispatch({effects:az.of(null)})},vt)))}let c=e=>{if(Ze(t),!yt(t,r))return;r=Date.now();let a=Date.now();if(a-n<500){if(!i){let e=500-(a-n);i=setTimeout(()=>{i=null,n=Date.now(),s()},e)}return}n=a,s()};t.observe(c);let l=()=>{document.visibilityState===`visible`?yt(t,r)&&(r=Date.now(),n=Date.now(),s()):r=Date.now()};return document.addEventListener(`visibilitychange`,l),{update(e){},destroy(){o=!0,t.unobserve(c),document.removeEventListener(`visibilitychange`,l),i&&=(clearTimeout(i),null),a&&=(clearTimeout(a),null)}}})]}var lz=/\[([^\]\n]*)\]\((<[^>\n]+>|[^)\s\n]+)(?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?\)/g,uz=Yn.mark({class:`cm-md-internal-link`});function dz(e,t){return t>0&&e[t-1]===`!`}function fz(e){let t=e[2]??``;return t.startsWith(`<`)&&t.endsWith(`>`)?t.slice(1,-1):t}function pz(e){let t=new Hn;for(let{from:n,to:r}of e.visibleRanges){let i=e.state.doc.sliceString(n,r);lz.lastIndex=0;let a=lz.exec(i);for(;a!==null;){let e=dz(i,a.index)?null:Bk(fz(a));e&&e.kind!==`external`&&t.add(n+a.index,n+a.index+a[0].length,uz),a=lz.exec(i)}}return t.finish()}var mz=Pn.fromClass(class{decorations;constructor(e){this.decorations=pz(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=pz(e.view))}},{decorations:e=>e.decorations}),hz=Nn.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);lz.lastIndex=0;let i=lz.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=dz(r.text,i.index)?null:Bk(fz(i));if(t&&t.kind!==`external`)return e.preventDefault(),t.kind===`doc`&&Gk(e)?(Wk(t),!0):(qk(t),!0)}i=lz.exec(r.text)}return!1}}),gz=Nn.theme({".cm-md-internal-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-md-internal-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function _z(){return[mz,hz,gz]}var vz=5e3,yz=null,bz=0,xz=null,Sz=new Map;async function Cz(){let e=Date.now();return yz&&e-bz<vz?yz:(yz=await UA(),bz=e,xz=kz(yz),yz)}async function wz(e){let t=Date.now(),n=Sz.get(e);if(n!==void 0&&t-n.time<vz)return n.headings;try{let n=await WA(e);return Sz.set(e,{headings:n,time:t}),n}catch(n){return console.warn(`[wiki-link-source] /api/page-headings fetch failed:`,n),Sz.set(e,{headings:[],time:t}),[]}}var Tz=/\[\[[^\]]*?\]\]/g,Ez=Yn.mark({class:`cm-wiki-link`}),Dz=Yn.mark({class:`cm-wiki-link cm-wiki-link-broken`});function Oz(e){let t=new Set;for(let n of e)if(t.add(n.docName.toLowerCase()),n.title&&t.add(n.title.toLowerCase()),n.kind===`asset`){let e=n.docName.replace(/^\//,``);t.add(e.toLowerCase());let r=e.lastIndexOf(`/`);t.add((r===-1?e:e.slice(r+1)).toLowerCase())}return t}function kz(e){let t=Oz(e);for(let n of e){if(n.kind===`asset`)continue;let e=n.docName.split(`/`);e.pop();let r=``;for(let n of e)r=r?`${r}/${n}`:n,t.add(r.toLowerCase())}return t}function Az(e){return e.split(/[#|]/)[0].trim().toLowerCase()}function jz(e){let t=new Hn,n=yz?xz:null;for(let{from:r,to:i}of e.visibleRanges){let a=e.state.doc.sliceString(r,i);Tz.lastIndex=0;let o=Tz.exec(a);for(;o!==null;){let e=Ez;if(n){let t=Az(o[0].slice(2,-2));t&&!n.has(t)&&(e=Dz)}t.add(r+o.index,r+o.index+o[0].length,e),o=Tz.exec(a)}}return t.finish()}var Mz=Pn.fromClass(class{decorations;cacheWarmAtBuild;constructor(e){this.cacheWarmAtBuild=yz!==null,this.decorations=jz(e),this.cacheWarmAtBuild||this.warmCache(e)}update(e){let t=yz!==null;(e.docChanged||e.viewportChanged||!this.cacheWarmAtBuild&&t)&&(this.cacheWarmAtBuild=t,this.decorations=jz(e.view))}warmCache(e){Cz().then(()=>{try{e.dispatch({})}catch{}}).catch(e=>{console.warn(`[wiki-link-source] warmCache fetch failed:`,e)})}},{decorations:e=>e.decorations}),Nz=/\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/g,Pz=Nn.domEventHandlers({mousedown(e,t){if(!e.ctrlKey&&!e.metaKey)return!1;let n=t.posAtCoords({x:e.clientX,y:e.clientY});if(n===null)return!1;let r=t.state.doc.lineAt(n);Nz.lastIndex=0;let i=Nz.exec(r.text);for(;i!==null;){let t=r.from+i.index,a=t+i[0].length;if(n>=t&&n<=a){let t=i[1]?.trim(),n=i[2]?.trim()||null;if(t){let r=Le(t,n);if(!r)return!1;if(e.preventDefault(),r.kind===`external`)Hk(r.url);else if(r.kind===`asset`){let t=AC(r.url,new Set((yz??[]).filter(e=>e.kind===`asset`).map(e=>e.docName.replace(/^\//,``))))??r.url.replace(/^\//,``);Gk(e)?window.open(dt(t),`_blank`,`noopener,noreferrer`):window.location.hash=dt(t)}else Gk(e)?Wk(r):window.location.hash=r.anchor?`#/${r.docName}?anchor=${encodeURIComponent(r.anchor)}`:`#/${r.docName}`}return!0}i=Nz.exec(r.text)}return!1}});async function Fz(e){let t=e.state.doc.sliceString(0,e.pos).match(/\[\[([^\]]*)$/);if(!t)return null;let n=t[1],r=e.pos-n.length,i=n.indexOf(`#`);if(i>0){let e=n.slice(0,i),t=n.slice(i+1),a=r+i+1,o=await wz(e);if(!o.length)return null;let s=RA(o,t);return s.length?{from:a,filter:!1,options:s.map(e=>({label:e.text,detail:`H${e.level}`,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`;t.dispatch({changes:{from:r,to:i,insert:e.slug+a},selection:{anchor:r+e.slug.length+a.length}})}}))}:null}return{from:r,filter:!1,options:FA(await Cz().catch(e=>(console.warn(`[wiki-link-source] Failed to fetch pages:`,e),[])),n).map(e=>({label:e.title,detail:e.title===e.docName?void 0:e.docName,apply(t,n,r,i){let a=t.state.doc.sliceString(i,i+2)===`]]`?``:`]]`,o=e.kind===`asset`?`${e.docName}|${e.title}${a}`:e.docName+a;t.dispatch({changes:{from:r,to:i,insert:o},selection:{anchor:r+o.length}})}}))}}var Iz=Nn.theme({".cm-wiki-link":{color:`oklch(52.7% 0.154 228.4)`,fontWeight:`500`},".cm-wiki-link:hover":{textDecoration:`underline`,cursor:`pointer`}});function Lz(){return[Mz,Pz,Iz,kR.data.of({autocomplete:Fz})]}var Rz=$R({settings:{background:`transparent`,gutterBackground:`transparent`}}),zz=nz({settings:{background:`transparent`,gutterBackground:`transparent`},styles:[{tag:[G.brace,G.processingInstruction,G.inserted],color:`#3d6968`},{tag:G.link,color:`#3d6968`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[G.keyword,G.function(G.variableName),G.regexp,G.color,G.constant(G.name),G.standard(G.name)],color:`#345575`},{tag:[G.heading,G.special(G.heading1),G.heading1,G.heading2,G.heading3,G.heading4],color:`#345575`,fontWeight:`bold`},{tag:[G.heading5,G.heading6],color:`#345575`},{tag:G.strong,color:`#345575`,fontWeight:`bold`},{tag:G.emphasis,color:`#345575`,fontStyle:`italic`},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName,G.variableName,G.angleBracket,G.string,G.url,G.escape,G.special(G.string),G.atom,G.bool,G.special(G.variableName)],color:`#9a5739`},{tag:[G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace,G.meta],color:`#3d6968`},{tag:[G.definition(G.name),G.separator,G.operator,G.operatorKeyword],color:`#4a6938`},{tag:[G.typeName,G.className,G.attributeName,G.contentSeparator],color:`#8b6500`},{tag:G.tagName,color:`#774d70`},{tag:G.squareBracket,color:`#964148`},{tag:G.labelName,color:`#3a5e85`}]});function Bz(e){let{themeCompartment:t,resolvedTheme:n,ydoc:r}=e,i=n===`dark`?Rz:zz;return[UR({base:kR,extensions:[TP],codeLanguages:rz}),Lz(),_z(),...r?[cz(r)]:[],Kn.of([]),t.of(i),Nn.lineWrapping,...e.extraKeymaps?[e.extraKeymaps]:[]]}function Vz(e,t,n){let{state:r}=e,i=r.selection.main;if(!i.empty)return!1;if(t===`line`){let e=r.doc.lineAt(i.head);return n<0?e.from===0:e.to===r.doc.length}return n<0?i.head===0:i.head===r.doc.length}function Hz(e){let{pmSel:t,nodePos:n,nodeSize:r,cmDocLen:i,cmSel:a,cmHasFocus:o}=e;if(t instanceof bt&&t.from===n)return o?{kind:`noop`}:{kind:`focus`};let s=n+1,c=n+r-1;if(t.from>=s&&t.to<=c){let e=Math.max(0,Math.min(t.anchor-s,i)),n=Math.max(0,Math.min(t.head-s,i));return a.anchor===e&&a.head===n&&o?{kind:`noop`}:{kind:`selection`,anchor:e,head:n}}return{kind:`noop`}}function Uz(e,t){let n=mM().parseWithFallback(e),r;try{r=t.nodeFromJSON(n)}catch(e){return console.warn(JSON.stringify({event:`raw-mdx-upgrade-failure`,reason:e instanceof Error?e.message:String(e)})),null}if(r.childCount===0)return null;let i=[];for(let e=0;e<r.childCount;e++){let t=r.child(e);if(t.type.name===`rawMdxFallback`)return null;i.push(t)}return i}function Wz(e,t){if(e===t)return null;let n=0,r=e.length,i=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)n++;for(;r>n&&i>n&&e.charCodeAt(r-1)===t.charCodeAt(i-1);)r--,i--;return{from:n,to:r,text:t.slice(n,i)}}var Gz=`Unregistered component:`;function Kz(e){if(!e.startsWith(Gz))return null;let t=e.slice(23).trim();return t.length>0?t:null}function qz(e){let t=(0,J.c)(49),{node:n,editor:r,getPos:i}=e,a=(0,q.useRef)(null),o=(0,q.useRef)(null),s=(0,q.useRef)(!1),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=new tr,t[0]=c):c=t[0];let l=(0,q.useRef)(c),{resolvedTheme:u}=se(),d=n.attrs.reason||`Parse failed`,f;t[1]===d?f=t[2]:(f=ZM(d),t[1]=d,t[2]=f);let p=f,m=QM[p],h;t[3]!==d||t[4]!==p?(h=p===`info`?Kz(d):null,t[3]=d,t[4]=p,t[5]=h):h=t[5];let g=h,_;t[6]!==r||t[7]!==i?(_=e=>{let t=typeof i==`function`?i():void 0;if(t===void 0)return;let n=YM(r);if(!n)return;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return;let o=t+1,c=t+a.nodeSize-1;s.current=!0;try{let t=n.state.tr;if(e.length===0)t.delete(o,c);else{let r=n.state.schema.text(e);t.replaceWith(o,c,r)}n.dispatch(t)}catch(e){let t=e;throw s.current=!1,t}s.current=!1},t[6]=r,t[7]=i,t[8]=_):_=t[8];let v=_,y;t[9]!==r||t[10]!==v||t[11]!==i||t[12]!==n.textContent||t[13]!==u?(y=()=>{let e=a.current;if(!e)return;let t=l.current,c=Kn.of([{key:`Mod-z`,run:()=>(r.commands.undo(),!0)},{key:`Mod-y`,run:()=>(r.commands.redo(),!0)},{key:`Mod-Shift-z`,run:()=>(r.commands.redo(),!0)}]),d=e=>{let t=typeof i==`function`?i():void 0;if(typeof t!=`number`)return!1;let n=YM(r);if(!n)return!1;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return!1;let o=e<0?t:t+a.nodeSize,s=Dt.near(n.state.doc.resolve(o),e);return n.dispatch(n.state.tr.setSelection(s).scrollIntoView()),n.focus(),!0},f=Kn.of([{key:`ArrowUp`,run:e=>Vz(e,`line`,-1)?d(-1):!1},{key:`ArrowLeft`,run:e=>Vz(e,`char`,-1)?d(-1):!1},{key:`ArrowDown`,run:e=>Vz(e,`line`,1)?d(1):!1},{key:`ArrowRight`,run:e=>Vz(e,`char`,1)?d(1):!1}]),p=Bz({themeCompartment:t,resolvedTheme:u,ydoc:XM(r)??void 0,extraKeymaps:c});p.push(f),p.push(Nn.updateListener.of(e=>{if(e.docChanged&&!s.current&&v(e.state.doc.toString()),e.focusChanged&&e.view.hasFocus&&!s.current){let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=YM(r);if(!t)return;let n=t.state.selection;if(n instanceof bt&&n.from===e)return;let a=t.state.doc.nodeAt(e);if(!a||a.type.name!==`rawMdxFallback`)return;s.current=!0;try{t.dispatch(t.state.tr.setSelection(bt.create(t.state.doc,e)))}catch(e){let t=e;throw s.current=!1,t}s.current=!1}if(e.focusChanged&&!e.view.hasFocus&&!s.current){let t=typeof i==`function`?i():void 0;if(typeof t!=`number`)return;let n=YM(r);if(!n)return;let a=n.state.doc.nodeAt(t);if(!a||a.type.name!==`rawMdxFallback`)return;let o=Uz(e.view.state.doc.toString(),n.state.schema);if(!o)return;s.current=!0;try{n.dispatch(n.state.tr.replaceWith(t,t+a.nodeSize,o))}catch(e){let t=e;throw s.current=!1,t}s.current=!1}}));let m=new Nn({doc:n.textContent,extensions:p,parent:e});o.current=m;let h=Yz,g=m.contentDOM;g.addEventListener(`keydown`,h),g.addEventListener(`paste`,h),g.addEventListener(`drop`,h),g.addEventListener(`cut`,h);let _=()=>{g.removeEventListener(`keydown`,h),g.removeEventListener(`paste`,h),g.removeEventListener(`drop`,h),g.removeEventListener(`cut`,h)};return()=>{_(),m.destroy(),o.current=null}},t[9]=r,t[10]=v,t[11]=i,t[12]=n.textContent,t[13]=u,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[15]=b):b=t[15],(0,q.useEffect)(y,b);let x,S;t[16]===u?(x=t[17],S=t[18]):(x=()=>{let e=o.current;if(!e)return;let t=u===`dark`?Rz:zz;e.dispatch({effects:l.current.reconfigure(t)})},S=[u],t[16]=u,t[17]=x,t[18]=S),(0,q.useEffect)(x,S);let C,w;t[19]!==r||t[20]!==i?(w=()=>{let e=()=>{let e=typeof i==`function`?i():void 0;if(typeof e!=`number`)return;let t=o.current;if(!t||s.current)return;let n=YM(r);if(!n)return;let a=n.state.doc.nodeAt(e);if(!a)return;let c=Hz({pmSel:n.state.selection,nodePos:e,nodeSize:a.nodeSize,cmDocLen:t.state.doc.length,cmSel:{anchor:t.state.selection.main.anchor,head:t.state.selection.main.head},cmHasFocus:t.hasFocus});if(c.kind!==`noop`){s.current=!0;try{c.kind===`selection`&&t.dispatch({selection:{anchor:c.anchor,head:c.head}}),t.hasFocus||t.focus()}catch(e){let t=e;throw s.current=!1,t}s.current=!1}};return r.on(`selectionUpdate`,e),()=>{r.off(`selectionUpdate`,e)}},C=[r,i],t[19]=r,t[20]=i,t[21]=C,t[22]=w):(C=t[21],w=t[22]),(0,q.useEffect)(w,C);let T=n.textContent,E,D;t[23]===T?(E=t[24],D=t[25]):(E=()=>{let e=o.current;if(!e||s.current)return;let t=Wz(e.state.doc.toString(),T);if(t){s.current=!0;try{e.dispatch({changes:{from:t.from,to:t.to,insert:t.text}})}catch(e){let t=e;throw s.current=!1,t}s.current=!1}},D=[T],t[23]=T,t[24]=E,t[25]=D),(0,q.useEffect)(E,D);let O;t[26]!==r||t[27]!==i?(O=()=>{let e=typeof i==`function`?i():void 0;typeof e==`number`&&r.chain().focus().setNodeSelection(e).deleteSelection().run()},t[26]=r,t[27]=i,t[28]=O):O=t[28];let k=O,A=g?`raw-mdx-fallback-wrapper jsx-component-wrapper jsx-component-wrapper--unregistered relative my-2 py-2 rounded border border-dashed ${m.wrapperClass}`:`raw-mdx-fallback-wrapper relative my-2 py-2 rounded border border-dashed ${m.wrapperClass}`,j;t[29]===g?j=t[30]:(j=g?{"data-jsx-component":``,role:`group`,"aria-label":`Unknown component: ${g}`}:{},t[29]=g,t[30]=j);let M=j,N=`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${m.badgeClass}`,P;t[31]!==d||t[32]!==m.label||t[33]!==N?(P=(0,K.jsx)(`span`,{className:N,title:d,children:m.label}),t[31]=d,t[32]=m.label,t[33]=N,t[34]=P):P=t[34];let F;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,K.jsx)(ri,{size:12}),t[35]=F):F=t[35];let I;t[36]===k?I=t[37]:(I=(0,K.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":`Delete block`,onClick:k,children:F}),t[36]=k,t[37]=I);let L;t[38]!==P||t[39]!==I?(L=(0,K.jsxs)(`div`,{className:`absolute top-1 right-1 z-10 flex items-center gap-1.5`,contentEditable:!1,onMouseDown:Jz,children:[P,I]}),t[38]=P,t[39]=I,t[40]=L):L=t[40];let R=`Editing broken MDX source: ${d}`,z;t[41]===R?z=t[42]:(z=(0,K.jsx)(`div`,{ref:a,className:`raw-mdx-fallback-cm`,role:`group`,"aria-label":R}),t[41]=R,t[42]=z);let B;return t[43]!==p||t[44]!==L||t[45]!==z||t[46]!==M||t[47]!==A?(B=(0,K.jsxs)(fc,{className:A,contentEditable:!1,"data-drag-handle":``,draggable:`true`,"data-severity":p,...M,children:[L,z]}),t[43]=p,t[44]=L,t[45]=z,t[46]=M,t[47]=A,t[48]=B):B=t[48],B}function Jz(e){return e.stopPropagation()}function Yz(){}function Xz(e,t){if(!e.selection.empty)return null;let n=t===`up`||t===`left`?-1:1,r=e.selection.$head,i=n>0?r.after():r.before();if(typeof i!=`number`)return null;let a=Dt.near(e.doc.resolve(i),n);return a.$head?.parent.type.name===`rawMdxFallback`?a:null}function Zz(e,t){let{state:n,view:r}=e;if(!r.endOfTextblock(t))return!1;let i=Xz(n,t);return i?(r.dispatch(n.tr.setSelection(i)),!0):!1}var Qz=ne.extend({addKeyboardShortcuts(){return{ArrowLeft:({editor:e})=>Zz(e,`left`),ArrowRight:({editor:e})=>Zz(e,`right`),ArrowUp:({editor:e})=>Zz(e,`up`),ArrowDown:({editor:e})=>Zz(e,`down`)}},addNodeView(){return bc(qz,{stopEvent:()=>!0,ignoreMutation:()=>!0})}});function $z(e){let t=(0,J.c)(47),{items:n,selectedIndex:r,categoryLabels:i,onSelect:a,onHoverIndex:o}=e,s=(0,q.useRef)(null),c=(0,q.useId)(),l=r>=0&&r<n.length?`${c}-option-${r}`:void 0,u=tB,d,f;if(t[0]===r?(d=t[1],f=t[2]):(d=()=>{let e=s.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,q.useEffect)(d,f),n.length===0){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`div`,{ref:s,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:{maxHeight:`var(--suggestion-menu-max-height, 40vh)`},onMouseDown:u,children:`No results`}),t[3]=e):e=t[3],e}let p,m,h,g,_,v,y,b,x,S,C,w,T;if(t[4]!==l||t[5]!==i||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==a||t[10]!==r){let e=[],d=0,f=new Map;for(let t of n){f.set(t,d++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}m=r>=0&&r<n.length?n[r]:null;let E;t[24]===n?E=t[25]:(E=n.some(eB),t[24]=n,t[25]=E),p=E,v=`flex items-start gap-2`,y=s,b=`listbox`,x=`Slash commands`,S=l,C=-1,w=u,T=`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,t[26]===Symbol.for(`react.memo_cache_sentinel`)?(h={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[26]=h):h=t[26];let D=m?`${m.label}${m.preview?`. ${m.preview.description}`:``}`:``;t[27]===D?g=t[28]:(g=(0,K.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:D}),t[27]=D,t[28]=g),_=e.map(e=>(0,K.jsxs)(`div`,{role:`group`,"aria-labelledby":`${c}-group-${e.key}`,children:[(0,K.jsx)(`div`,{id:`${c}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:i[e.key]??e.key}),e.items.map(e=>{let t=f.get(e)??0,n=t===r,i=e.icon;return(0,K.jsxs)(`button`,{id:`${c}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseEnter:()=>o?.(t),onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,K.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key)),t[4]=l,t[5]=i,t[6]=n,t[7]=c,t[8]=o,t[9]=a,t[10]=r,t[11]=p,t[12]=m,t[13]=h,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T}else p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23];let E;t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==y||t[33]!==b||t[34]!==x||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T?(E=(0,K.jsxs)(`div`,{ref:y,role:b,"aria-label":x,"aria-activedescendant":S,tabIndex:C,onMouseDown:w,className:T,style:h,children:[g,_]}),t[29]=h,t[30]=g,t[31]=_,t[32]=y,t[33]=b,t[34]=x,t[35]=S,t[36]=C,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==p||t[41]!==m?(D=p?(0,K.jsx)(`aside`,{"aria-hidden":`true`,onMouseDown:u,className:`w-64 rounded-lg border bg-popover p-2 shadow-md ${m?.preview?``:`invisible`}`,children:m?.preview?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain`,children:m.preview.render()}),(0,K.jsx)(`p`,{className:`px-1 pb-1 text-xs text-muted-foreground`,children:m.preview.description})]}):null}):null,t[40]=p,t[41]=m,t[42]=D):D=t[42];let O;return t[43]!==v||t[44]!==E||t[45]!==D?(O=(0,K.jsxs)(`div`,{className:v,children:[E,D]}),t[43]=v,t[44]=E,t[45]=D,t[46]=O):O=t[46],O}function eB(e){return e.preview}function tB(e){return e.preventDefault()}var nB=new ke(`slashCommand`),rB=o.create({name:`slashCommand`,addOptions(){return{itemsSources:[()=>LT],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[lv({editor:this.editor,pluginKey:nB,char:`/`,startOfLine:!1,items:({query:t})=>{let n=e.options.itemsSources.flatMap(e=>{try{return e()}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),r=Object.keys(e.options.categoryLabels),i=e=>{let t=r.indexOf(e);return t===-1?1/0:t};return RT(n.map((e,t)=>({item:e,i:t})).sort((e,t)=>{let n=i(e.item.category)-i(t.item.category);return n===0?e.i-t.i:n}).map(e=>e.item),t)},command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${n.name}"`,e);return}try{n.command(e)}catch(e){console.error(`[slash-command] command "${n.name}" threw an error`,e)}},render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=e=>{e!==r&&(r=e,s())},s=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command,onHoverIndex:o})};return{onStart(s){n=s,r=0;let c=mv(()=>n,`slash-command`);i.popup=c.popup,a=c.doPosition,t=new vc($z,{props:{items:s.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:s.command,onHoverIndex:o},editor:s.editor}),c.popup.appendChild(t.element),i.stopAutoUpdate=c.startAutoUpdate(),c.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),s(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,s(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,s(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){hv(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}}),iB=new ke(`sourceDirty`),aB=o.create({name:`sourceDirtyObserver`,addProseMirrorPlugins(){return[new At({key:iB,appendTransaction(e,t,n){if(!e.some(e=>!e.getMeta(i_))||!e.some(e=>e.docChanged))return null;let r=new wt;for(let t of e)r.appendMapping(t.mapping);let i=r.invert(),a=[];if(n.doc.descendants((e,n)=>{if(e.type.name!==`jsxComponent`||e.attrs.sourceDirty)return;let r=i.map(n),o=t.doc.nodeAt(r),s=!o||o.type.name!==`jsxComponent`,c=typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0;if(s&&c)return;if(!o){(e.content.size>0||Object.keys(e.attrs.props??{}).length>0)&&a.push({pos:n});return}if(o.type.name!==`jsxComponent`){a.push({pos:n});return}let l=!oB(o.attrs.props,e.attrs.props),u=!o.content.eq(e.content);(l||u)&&a.push({pos:n})}),a.length===0)return null;let o=n.tr;for(let{pos:e}of a)o.setNodeAttribute(e,`sourceDirty`,!0);return o}})]}});function oB(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!oB(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!oB(e[r],t[r]))return!1;return!0}var sB=`ok:tag-click`;function cB(e){if(typeof document>`u`)return;let t={value:e};document.dispatchEvent(new CustomEvent(sB,{detail:t}))}function lB(e){return e instanceof Element?e.closest(`a[data-tag]`):null}var uB=o.create({name:`tagClick`,addProseMirrorPlugins(){return[new At({props:{handleDOMEvents:{click(e,t){let n=lB(t.target);if(!n)return!1;let r=n.getAttribute(`data-tag`);return r?(t.preventDefault(),t.stopPropagation(),cB(r),!0):!1}}}})]}});function dB(e,t,n){if(typeof t!=`number`||!n||!Ie.test(n))return!1;let{state:r,view:i}=e,a=r.doc.nodeAt(t);if(!a||a.type.name!==`tag`)return!1;let o=r.tr.setNodeMarkup(t,null,{...a.attrs,value:n}),s=t+a.nodeSize;return o.insertText(` `,s),o.setSelection(h.create(o.doc,s+1)),i.dispatch(o),i.focus(),!0}function fB(e,t){if(typeof t!=`number`)return;let{state:n,view:r}=e,i=n.doc.nodeAt(t);if(!i||i.type.name!==`tag`)return;let a=n.tr.delete(t,t+i.nodeSize);r.dispatch(a),r.focus()}function pB(e){let t=(0,J.c)(3),{value:n}=e,r=`#tag/${n}`,i;return t[0]!==r||t[1]!==n?(i=(0,K.jsxs)(`a`,{className:`tag`,"data-tag":n,href:r,children:[`#`,n]}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function mB(e){let t=(0,J.c)(14),{initialDraft:n,onCommit:r,onCancel:i}=e,a=(0,q.useRef)(null),[o,s]=(0,q.useState)(n),c=(0,q.useRef)(!1),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=requestAnimationFrame(()=>{a.current?.focus()});return()=>cancelAnimationFrame(e)},u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,q.useEffect)(l,u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono`,children:`#`}),t[2]=d):d=t[2];let f=Math.max(o.length,8),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{let t=e.target.value;(t===``||Ie.test(t))&&s(t)},t[3]=p):p=t[3];let m,h;t[4]!==o||t[5]!==i||t[6]!==r?(m=e=>{e.key===`Enter`||e.key===` `?(e.preventDefault(),c.current=!0,r(o)||(c.current=!1,i())):(e.key===`Escape`||e.key===`Backspace`&&o===``)&&(e.preventDefault(),i())},h=()=>{if(!c.current){if(o===``){i();return}Ie.test(o)?r(o):i()}},t[4]=o,t[5]=i,t[6]=r,t[7]=m,t[8]=h):(m=t[7],h=t[8]);let g;return t[9]!==o||t[10]!==f||t[11]!==m||t[12]!==h?(g=(0,K.jsxs)(`span`,{className:`tag tag-placeholder inline-flex items-center rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground`,"data-component-type":`tag-placeholder`,children:[d,(0,K.jsx)(`input`,{ref:a,type:`text`,value:o,size:f,placeholder:`tag-name`,"aria-label":`Tag value`,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,className:`bg-transparent border-0 p-0 outline-none focus:outline-none focus:ring-0 text-inherit font-inherit`,onChange:p,onKeyDown:m,onBlur:h})]}),t[9]=o,t[10]=f,t[11]=m,t[12]=h,t[13]=g):g=t[13],g}function hB(e){let t=(0,J.c)(5),{node:n,getPos:r,editor:i}=e,a=typeof n.attrs.value==`string`?n.attrs.value:``;if(a===``){let e;return t[0]!==i||t[1]!==r?(e=(0,K.jsx)(fc,{as:`span`,children:(0,K.jsx)(mB,{initialDraft:``,onCommit:e=>dB(i,typeof r==`function`?r():void 0,e),onCancel:()=>fB(i,typeof r==`function`?r():void 0)})}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let o;return t[3]===a?o=t[4]:(o=(0,K.jsx)(fc,{as:`span`,children:(0,K.jsx)(pB,{value:a})}),t[3]=a,t[4]=o),o}var gB=T.extend({priority:200,addNodeView(){return bc(hB)},addKeyboardShortcuts(){return{Backspace:()=>{if(gv.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(gv.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[Cv(this.editor)]}});function _B(e){let t=(0,J.c)(116),{open:n,target:r,alias:i,anchor:a,pages:o,assetPaths:s,onOpenChange:c,onSave:l}=e,[u,d]=(0,q.useState)(r),[f,p]=(0,q.useState)(i??``),[m,h]=(0,q.useState)(a??``),g=(0,q.useId)(),_=(0,q.useId)(),v=(0,q.useId)(),y=(0,q.useId)(),b;t[0]!==s||t[1]!==u?(b=AC(u,s),t[0]=s,t[1]=u,t[2]=b):b=t[2];let x=b,S;t[3]!==s||t[4]!==u||t[5]!==o?(S=jC(u,o,s),t[3]=s,t[4]=u,t[5]=o,t[6]=S):S=t[6];let C=KA(u,S&&!x&&n),w,T;t[7]!==i||t[8]!==a||t[9]!==n||t[10]!==r?(w=()=>{n&&(d(r),p(i??``),h(a??``))},T=[n,r,i,a],t[7]=i,t[8]=a,t[9]=n,t[10]=r,t[11]=w,t[12]=T):(w=t[11],T=t[12]),(0,q.useEffect)(w,T);let E;t[13]!==f||t[14]!==m||t[15]!==u||t[16]!==c||t[17]!==l?(E=function(){let e=u.trim();e&&(l(e,f.trim()||null,m.trim()||null),c(!1))},t[13]=f,t[14]=m,t[15]=u,t[16]=c,t[17]=l,t[18]=E):E=t[18];let D=E,O;t[19]===D?O=t[20]:(O=function(e){e.key===`Enter`&&D()},t[19]=D,t[20]=O);let k=O,A,j,M,N,P,F,I,L,R,z,B,V,H,U,ee,te;if(t[21]!==_||t[22]!==m||t[23]!==u||t[24]!==k||t[25]!==y||t[26]!==C||t[27]!==c||t[28]!==n||t[29]!==g){let e=new Map,r=C?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;M=sn,V=n,H=c,j=$t,t[46]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsx)(nn,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),t[46]=B):B=t[46],A=on,F=`dialog-content`,I=``,L=`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-background p-6 shadow-xl data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,K.jsx)(un,{className:`mb-1 text-base font-semibold`,children:`Edit wiki link`}),z=(0,K.jsx)(ln,{className:`mb-4 text-sm text-muted-foreground`,children:`Modify the link target, anchor, and display label.`}),t[47]=R,t[48]=z):(R=t[47],z=t[48]),N=`mb-4 space-y-6`;let a;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-red-500`,children:`*`}),t[49]=a):a=t[49];let o;t[50]===g?o=t[51]:(o=(0,K.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:g,children:[`Page `,a]}),t[50]=g,t[51]=o);let s;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>d(e.target.value),t[52]=s):s=t[52];let l;t[53]!==u||t[54]!==k||t[55]!==g?(l=(0,K.jsx)(hn,{id:g,value:u,onChange:s,placeholder:`page-name`,autoFocus:!0,"aria-required":`true`,onKeyDown:k}),t[53]=u,t[54]=k,t[55]=g,t[56]=l):l=t[56],t[57]!==o||t[58]!==l?(P=(0,K.jsxs)(`div`,{children:[o,l]}),t[57]=o,t[58]=l,t[59]=P):P=t[59];let f;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional heading anchor)`}),t[60]=f):f=t[60],t[61]===_?U=t[62]:(U=(0,K.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:_,children:[`Section`,` `,f]}),t[61]=_,t[62]=U);let p;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>h(e.target.value),t[63]=p):p=t[63],t[64]!==_||t[65]!==m||t[66]!==k?(ee=(0,K.jsx)(hn,{id:_,value:m,onChange:p,placeholder:`heading-slug`,onKeyDown:k}),t[64]=_,t[65]=m,t[66]=k,t[67]=ee):ee=t[67],te=i&&(0,K.jsx)(`div`,{role:`listbox`,id:y,"aria-label":`Heading anchors`,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":m===e.slug,className:Wt(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,m===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>h(m===e.slug?``:e.slug),children:[(0,K.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,K.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[21]=_,t[22]=m,t[23]=u,t[24]=k,t[25]=y,t[26]=C,t[27]=c,t[28]=n,t[29]=g,t[30]=A,t[31]=j,t[32]=M,t[33]=N,t[34]=P,t[35]=F,t[36]=I,t[37]=L,t[38]=R,t[39]=z,t[40]=B,t[41]=V,t[42]=H,t[43]=U,t[44]=ee,t[45]=te}else A=t[30],j=t[31],M=t[32],N=t[33],P=t[34],F=t[35],I=t[36],L=t[37],R=t[38],z=t[39],B=t[40],V=t[41],H=t[42],U=t[43],ee=t[44],te=t[45];let ne;t[68]!==U||t[69]!==ee||t[70]!==te?(ne=(0,K.jsxs)(`div`,{children:[U,ee,te]}),t[68]=U,t[69]=ee,t[70]=te,t[71]=ne):ne=t[71];let re;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,K.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional display text)`}),t[72]=re):re=t[72];let ie;t[73]===v?ie=t[74]:(ie=(0,K.jsxs)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:v,children:[`Label`,` `,re]}),t[73]=v,t[74]=ie);let ae;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>p(e.target.value),t[75]=ae):ae=t[75];let oe;t[76]!==v||t[77]!==f||t[78]!==k?(oe=(0,K.jsx)(hn,{id:v,value:f,onChange:ae,placeholder:`Custom display text`,onKeyDown:k}),t[76]=v,t[77]=f,t[78]=k,t[79]=oe):oe=t[79];let se;t[80]!==ie||t[81]!==oe?(se=(0,K.jsxs)(`div`,{children:[ie,oe]}),t[80]=ie,t[81]=oe,t[82]=se):se=t[82];let ce;t[83]!==N||t[84]!==P||t[85]!==ne||t[86]!==se?(ce=(0,K.jsxs)(`div`,{className:N,children:[P,ne,se]}),t[83]=N,t[84]=P,t[85]=ne,t[86]=se,t[87]=ce):ce=t[87];let le;t[88]===c?le=t[89]:(le=(0,K.jsx)(Kt,{variant:`outline`,onClick:()=>c(!1),children:`Cancel`}),t[88]=c,t[89]=le);let ue;t[90]===u?ue=t[91]:(ue=u.trim(),t[90]=u,t[91]=ue);let de=!ue,fe;t[92]!==D||t[93]!==de?(fe=(0,K.jsx)(Kt,{onClick:D,disabled:de,children:`Save`}),t[92]=D,t[93]=de,t[94]=fe):fe=t[94];let pe;t[95]!==le||t[96]!==fe?(pe=(0,K.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[le,fe]}),t[95]=le,t[96]=fe,t[97]=pe):pe=t[97];let me;t[98]!==A||t[99]!==F||t[100]!==I||t[101]!==L||t[102]!==R||t[103]!==z||t[104]!==ce||t[105]!==pe?(me=(0,K.jsxs)(A,{"data-slot":F,"data-ok-layer-spawned":I,className:L,children:[R,z,ce,pe]}),t[98]=A,t[99]=F,t[100]=I,t[101]=L,t[102]=R,t[103]=z,t[104]=ce,t[105]=pe,t[106]=me):me=t[106];let he;t[107]!==j||t[108]!==B||t[109]!==me?(he=(0,K.jsxs)(j,{children:[B,me]}),t[107]=j,t[108]=B,t[109]=me,t[110]=he):he=t[110];let ge;return t[111]!==M||t[112]!==V||t[113]!==H||t[114]!==he?(ge=(0,K.jsx)(M,{open:V,onOpenChange:H,children:he}),t[111]=M,t[112]=V,t[113]=H,t[114]=he,t[115]=ge):ge=t[115],ge}function vB(e){let t=(0,J.c)(132),{editor:n,getPos:r,onClose:i}=e,a=r(),o=a==null?null:n.state.doc.nodeAt(a),s=String(o?.attrs.target??``),c=Mt(o?.attrs.alias),l=Mt(o?.attrs.anchor),u=Se({target:s,alias:c,anchor:l}),{addPage:d,assetPaths:f,folderPaths:p,pages:m,pagesBySlug:h,loading:g}=pt(),_=Le(s,l),v=_?.kind===`external`?_:null,y=_?.kind===`asset`?AC(_.url,f):null,b=y?null:eA(s,{pages:m,folderPaths:p,pagesBySlug:h,fallbackTargets:OC(s)}),[x,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null),T=b?tA(b):null;if(!o)return null;let E;t[0]!==n.state||t[1]!==n.view||t[2]!==r?(E=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n.state,t[1]=n.view,t[2]=r,t[3]=E):E=t[3];let D=E,O;t[4]!==n.state||t[5]!==n.view||t[6]!==r||t[7]!==i?(O=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),i())},t[4]=n.state,t[5]=n.view,t[6]=r,t[7]=i,t[8]=O):O=t[8];let k=O,A;t[9]!==c||t[10]!==n.state||t[11]!==n.view||t[12]!==r||t[13]!==u||t[14]!==s?(A=function(e){if(e!==s){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:c??u}))}},t[9]=c,t[10]=n.state,t[11]=n.view,t[12]=r,t[13]=u,t[14]=s,t[15]=A):A=t[15];let j=A,M;t[16]!==T||t[17]!==b?(M=function(e){return e===`folder-index`?T:b?.kind===`create`?{initialDir:b.initialDir,suggestedName:b.suggestedName}:null},t[16]=T,t[17]=b,t[18]=M):M=t[18];let N=M,P;t[19]!==d||t[20]!==N||t[21]!==C||t[22]!==i||t[23]!==w||t[24]!==j?(P=async function(e){let t=N(e);if(!(!t||C)){w(e);try{await oA(t,{addPage:d,onCreated(t){e===`missing`&&j(t),window.location.hash=`#/${t}`,i()}}),w(null)}catch(e){let t=e;cn.error(t instanceof Error?t.message:`Failed to create page`),w(null)}}},t[19]=d,t[20]=N,t[21]=C,t[22]=i,t[23]=w,t[24]=j,t[25]=P):P=t[25];let F=P,I;t[26]!==l||t[27]!==y||t[28]!==v||t[29]!==F||t[30]!==b?(I=function(e){if(v){Rk(v.url)?window.open(v.url,`_blank`,`noopener,noreferrer`):console.warn(`[safe-nav] blocked non-safe scheme:`,v.url);return}if(y){let t=dt(y);e.newTab?window.open(t,`_blank`,`noopener,noreferrer`):window.location.hash=t;return}if(!b)return;if(b.kind===`create`){F(`missing`);return}let t=b.hashDocName;if(e.newTab){Wk({docName:t,anchor:l});return}if(l){let e=window.location.hash.match(/^#\/([^?#/]+)/);if((e?decodeURIComponent(e[1]):null)===t){let e=document.getElementById(l);e&&e.scrollIntoView({behavior:`smooth`,block:`start`})}window.location.hash=`#/${t}?anchor=${encodeURIComponent(l)}`;return}window.location.hash=`#/${t}`},t[26]=l,t[27]=y,t[28]=v,t[29]=F,t[30]=b,t[31]=I):I=t[31];let L=I,R=!v&&!g&&y!==null,z=!v&&!g&&b?.kind===`navigate`&&b.displayState===`resolved`,B=!v&&!g&&b?.kind===`navigate`&&b.displayState===`folder`,V=!v&&!g&&!y&&b?.kind===`create`,H,U,ee,te,ne,re,ie,ae,oe,se;if(t[32]!==n.state||t[33]!==n.view||t[34]!==v||t[35]!==r||t[36]!==R||t[37]!==B||t[38]!==z||t[39]!==V||t[40]!==g||t[41]!==i){if(g){let e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(Hr,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[52]=e):e=t[52],U={icon:e,text:`Loading…`,className:`text-muted-foreground`}}else if(v){let e;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(Tr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[53]=e):e=t[53],U={icon:e,text:`External wiki link`,className:`text-foreground`}}else if(R){let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(Er,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[54]=e):e=t[54],U={icon:e,text:`Asset`,className:`text-foreground`}}else if(B){let e;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(jr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[55]=e):e=t[55],U={icon:e,text:`Folder (no index)`,className:`text-foreground`}}else if(V){let e;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(br,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[56]=e):e=t[56],U={icon:e,text:`Page not found`,className:`text-red-700 dark:text-red-300`}}else if(z){let e;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[57]=e):e=t[57],U={icon:e,text:`Wiki link`,className:`text-foreground`}}else{let e;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(br,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[58]=e):e=t[58],U={icon:e,text:`Unrecognized wiki link`,className:`text-muted-foreground`}}let e;t[59]!==n.state||t[60]!==n.view||t[61]!==r?(e=()=>{let e=r();if(typeof e!=`number`)return new DOMRect;let t=n.state.doc.nodeAt(e);if(!t)return new DOMRect;try{return Be(n.view,e,e+t.nodeSize)}catch{return new DOMRect}},t[59]=n.state,t[60]=n.view,t[61]=r,t[62]=e):e=t[62];let a;t[63]!==n.view.dom||t[64]!==e?(a={getBoundingClientRect:e,contextElement:n.view.dom},t[63]=n.view.dom,t[64]=e,t[65]=a):a=t[65];let o=a;H=Qk,te=`wiki-link`,ne=`Wiki link options`,re=i,ie=o,se=`mb-2 flex items-start gap-2 pr-8`,ee=(0,K.jsx)(`div`,{className:Wt(`mt-0.5 flex shrink-0`,U.className),children:U.icon}),oe=`flex-1 min-w-0`,ae=Wt(`text-sm font-medium`,U.className),t[32]=n.state,t[33]=n.view,t[34]=v,t[35]=r,t[36]=R,t[37]=B,t[38]=z,t[39]=V,t[40]=g,t[41]=i,t[42]=H,t[43]=U,t[44]=ee,t[45]=te,t[46]=ne,t[47]=re,t[48]=ie,t[49]=ae,t[50]=oe,t[51]=se}else H=t[42],U=t[43],ee=t[44],te=t[45],ne=t[46],re=t[47],ie=t[48],ae=t[49],oe=t[50],se=t[51];let ce;t[66]!==U.text||t[67]!==ae?(ce=(0,K.jsx)(`div`,{className:ae,children:U.text}),t[66]=U.text,t[67]=ae,t[68]=ce):ce=t[68];let le=y??(v?v.url:`${s}${l?`#${l}`:``}`),ue=y??(v?v.url:`${s}${l?`#${l}`:``}`),de;t[69]!==le||t[70]!==ue?(de=(0,K.jsx)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,title:le,children:ue}),t[69]=le,t[70]=ue,t[71]=de):de=t[71];let fe;t[72]!==ce||t[73]!==de||t[74]!==oe?(fe=(0,K.jsxs)(`div`,{className:oe,children:[ce,de]}),t[72]=ce,t[73]=de,t[74]=oe,t[75]=fe):fe=t[75];let pe;t[76]!==ee||t[77]!==fe||t[78]!==se?(pe=(0,K.jsxs)(`div`,{className:se,children:[ee,fe]}),t[76]=ee,t[77]=fe,t[78]=se,t[79]=pe):pe=t[79];let me;t[80]!==v||t[81]!==L||t[82]!==V||t[83]!==i?(me=V?null:(0,K.jsx)(Kt,{size:`sm`,variant:`default`,onClick:()=>{L({}),i()},children:v?`Open in new tab`:`Open`}),t[80]=v,t[81]=L,t[82]=V,t[83]=i,t[84]=me):me=t[84];let he;t[85]!==C||t[86]!==F||t[87]!==V?(he=V?(0,K.jsx)(Kt,{size:`sm`,variant:`default`,disabled:C!==null,onClick:()=>void F(`missing`),children:C===`missing`?`Creating…`:`Create page`}):null,t[85]=C,t[86]=F,t[87]=V,t[88]=he):he=t[88];let ge;t[89]!==C||t[90]!==T||t[91]!==F||t[92]!==B?(ge=B&&T?(0,K.jsxs)(Kt,{size:`sm`,variant:`outline`,disabled:C!==null,onClick:()=>void F(`folder-index`),children:[(0,K.jsx)(Dr,{className:`size-3.5`,"aria-hidden":`true`}),C===`folder-index`?`Creating…`:`Create index`]}):null,t[89]=C,t[90]=T,t[91]=F,t[92]=B,t[93]=ge):ge=t[93];let _e;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,K.jsx)(`div`,{className:`flex-1`}),t[94]=_e):_e=t[94];let ve;t[95]===S?ve=t[96]:(ve=()=>S(!0),t[95]=S,t[96]=ve);let ye;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,K.jsx)(qr,{className:`size-3.5`,"aria-hidden":`true`}),t[97]=ye):ye=t[97];let be;t[98]===ve?be=t[99]:(be=(0,K.jsxs)(Kt,{size:`sm`,variant:`outline`,onClick:ve,children:[ye,`Edit`]}),t[98]=ve,t[99]=be);let xe;t[100]===V?xe=t[101]:(xe=V?(0,K.jsx)(ii,{className:`size-3.5`,"aria-hidden":`true`}):(0,K.jsx)(ri,{className:`size-3.5`,"aria-hidden":`true`}),t[100]=V,t[101]=xe);let Ce=V?`Unlink`:`Remove`,we;t[102]!==k||t[103]!==xe||t[104]!==Ce?(we=(0,K.jsxs)(Kt,{size:`sm`,variant:`destructive`,onClick:k,children:[xe,Ce]}),t[102]=k,t[103]=xe,t[104]=Ce,t[105]=we):we=t[105];let Te;t[106]!==me||t[107]!==he||t[108]!==ge||t[109]!==be||t[110]!==we?(Te=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[me,he,ge,_e,be,we]}),t[106]=me,t[107]=he,t[108]=ge,t[109]=be,t[110]=we,t[111]=Te):Te=t[111];let Ee;t[112]!==H||t[113]!==te||t[114]!==ne||t[115]!==re||t[116]!==ie||t[117]!==pe||t[118]!==Te?(Ee=(0,K.jsxs)(H,{kind:te,ariaLabel:ne,onDeactivate:re,triggerReference:ie,children:[pe,Te]}),t[112]=H,t[113]=te,t[114]=ne,t[115]=re,t[116]=ie,t[117]=pe,t[118]=Te,t[119]=Ee):Ee=t[119];let De;t[120]!==c||t[121]!==l||t[122]!==f||t[123]!==x||t[124]!==D||t[125]!==m||t[126]!==S||t[127]!==s?(De=(0,K.jsx)(_B,{open:x,target:s,alias:c,anchor:l,pages:m,assetPaths:f,onOpenChange:S,onSave:D}),t[120]=c,t[121]=l,t[122]=f,t[123]=x,t[124]=D,t[125]=m,t[126]=S,t[127]=s,t[128]=De):De=t[128];let Oe;return t[129]!==Ee||t[130]!==De?(Oe=(0,K.jsxs)(K.Fragment,{children:[Ee,De]}),t[129]=Ee,t[130]=De,t[131]=Oe):Oe=t[131],Oe}var yB=0;function bB(){return`wiki-link-${++yB}`}function xB(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}var SB=Nt.extend({priority:200,addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=bB(),{dom:i}=xB({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),a=t,o=()=>{let e=n();return typeof e==`number`?e:void 0},s=hA(e);return s.register({type:`wikiLink`,nodeId:r,getPos:o,controls:{propPanel:t=>(0,q.createElement)(vB,{editor:e,getPos:o,onClose:t.deactivate})},handlePrimary:({newTab:e})=>{let t=a.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=Le(n,typeof t.anchor==`string`?t.anchor:null);if(!r)return!1;if(r.kind===`doc`)return e?(Wk({docName:r.docName,anchor:r.anchor}),!0):!1;if(r.kind===`asset`){let t=AC(r.url,et()?.assetPaths??new Set)??r.url.replace(/^\//,``);return e?Hk(dt(t)):window.location.hash=dt(t),!0}return!e||!Rk(r.url)?!1:(Hk(r.url),!0)}}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;a=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);return i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`),i.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{s.deregister(r)}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(AA.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(AA.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[GA(this.editor)]}}),CB=0;function wB(){return`wiki-link-embed-${++CB}`}function TB(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`a`);n.setAttribute(`data-wiki-embed`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`href`,e.href),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Embed: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-embed-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}function EB(e){let t=(e.doc??(typeof document<`u`?document:{createElement:null})).createElement(`img`);return t.setAttribute(`data-wiki-embed`,``),t.setAttribute(`data-node-id`,e.nodeId),t.setAttribute(`data-target`,e.target),t.setAttribute(`data-alias`,e.alias??``),t.setAttribute(`src`,e.src),t.setAttribute(`alt`,e.alias??e.target),{dom:t}}function DB(e){let t=Pe(e);return t!==null&&Ve.has(t)}var OB=f.extend({addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=wB(),i=t,a=String(t.attrs.target??``),o=t.attrs.alias==null?null:String(t.attrs.alias),s=t.attrs.anchor==null?null:String(t.attrs.anchor),c=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(DB(a)){let{dom:e}=EB({nodeId:r,target:a,alias:o,src:c??a});return{dom:e,ignoreMutation:()=>!0,update:t=>{if(t.type.name!==`wikiLinkEmbed`)return!1;i=t;let n=String(t.attrs.target??``),r=t.attrs.alias==null?null:String(t.attrs.alias),a=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(!DB(n))return!1;let o=a??n;return e.setAttribute(`data-target`,n),e.setAttribute(`data-alias`,r??``),e.setAttribute(`src`,o),e.setAttribute(`alt`,r??n),!0}}}let{dom:l}=TB({nodeId:r,target:a,alias:o,anchor:s,href:c??a});l.addEventListener(`click`,e=>{e.preventDefault()});let u=()=>{let e=n();return typeof e==`number`?e:void 0},d=hA(e);return d.register({type:`wikiLinkEmbed`,nodeId:r,getPos:u,controls:{},handlePrimary:({newTab:e})=>{let t=i.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=(typeof t.resolvedSrc==`string`&&t.resolvedSrc.length>0?t.resolvedSrc:null)??n,a=Pe(n);if(a===null)return!1;let o=ge(r,``)??n;return Ik({url:r,projectRelPath:o,ext:a,title:o.split(`/`).pop()??r,forceOsDelegation:e}),!0}}),{dom:l,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLinkEmbed`)return!1;i=e;let t=String(e.attrs.target??``);if(DB(t))return!1;let n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor),a=(e.attrs.resolvedSrc==null?null:String(e.attrs.resolvedSrc))??t;return l.setAttribute(`data-target`,t),l.setAttribute(`data-alias`,n??``),l.setAttribute(`data-anchor`,r??``),l.setAttribute(`href`,a),l.setAttribute(`aria-label`,`Embed: ${t}${r?`#${r}`:``}`),l.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{d.deregister(r)}}}}}),kB=[...E.map(e=>e.name===`jsxComponent`?BM:e.name===`rawMdxFallback`?Qz:e.name===`wikiLink`?SB:e.name===`wikiLinkEmbed`?OB:e.name===`link`?ij:e.name===`mathInline`?JM:e.name===`tag`?gB:e),rB.configure({itemsSources:[()=>LT,PT,IT],categoryLabels:{content:`Components`,layout:`Layout`,media:`Media`,data:`Data`}}),vC.configure({onDrop(e,t,n){for(let r of t)UC(r,e,n)},onPaste(e,t,n){for(let n of t)UC(n,e,e.state.selection.from)}}),Nk,uB,Mk,Ak,HT,aB,yC,qT,aM,o.create({name:`chunkWrapperDecoration`,addProseMirrorPlugins(){return[$T()]}})];function AB(e){return e===z}var jB=3e4,MB=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},NB=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},PB=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},FB=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},IB=class extends Error{docName;missingCapability;constructor(e,t){super(`Server is missing capability "${t}" required to open "${e}".`),this.name=`ServerCapabilityMismatchError`,this.docName=e,this.missingCapability=t}},LB=new Map,RB=!1;function zB(){for(let e of LB.values())if(!e.settled)return!0;return!1}function BB(){typeof document>`u`||document.visibilityState===`visible`&&VB(Date.now())}function VB(e){let t=[];for(let[n,r]of LB){if(r.settled)continue;let i=e-r.createdAt;if(i<3e4)continue;r.settled=!0;let a=new MB(n,i);GB(r),r.reject(a),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return zB()||UB(),t.length}function HB(){RB||typeof document>`u`||(document.addEventListener(`visibilitychange`,BB),RB=!0)}function UB(){RB&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,BB),RB=!1))}var WB=new Map;function GB(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function KB(e,t){let n=LB.get(e);if(n)return n.promise;let r=WB.get(e);if(r!==void 0){WB.delete(e);let n=r===`timeout`?new MB(e,0):new NB(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),Y(`ok/sync/create`,{docName:e,warm:!1,armed:r}),Y(`ok/sync/reject`,{docName:e,reason:`armed-${r}`});let i=JB(n);return LB.set(e,YB(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`),Y(`ok/sync/create`,{docName:e,warm:!0}),Y(`ok/sync/resolve`,{docName:e,elapsedMs:0,warm:!0});let n=Promise.resolve();return LB.set(e,qB(n,t)),n}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=LB.get(e);if(!t||t.settled)return;t.settled=!0,t.resolved=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`),Y(`ok/sync/resolve`,{docName:e,elapsedMs:n,warm:!1}),GB(t),zB()||UB(),t.resolve()},l=t=>{let n=LB.get(e);if(!n||n.settled)return;n.settled=!0;let r=new NB(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),Y(`ok/sync/reject`,{docName:e,reason:`pre-sync-disconnect`}),GB(n),zB()||UB(),n.reject(r)},u=setTimeout(()=>{let t=LB.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new MB(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`),Y(`ok/sync/reject`,{docName:e,reason:`timeout`,elapsedMs:n}),GB(t),zB()||UB(),t.reject(r)},jB),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,resolved:!1,detached:!1};return LB.set(e,d),t.on(`synced`,c),t.on(`close`,l),HB(),Y(`ok/sync/create`,{docName:e,warm:!1}),s}function qB(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!0,detached:!0}}function JB(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function YB(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!1,detached:!0}}function XB(e){return LB.get(e)?.resolved===!0}function ZB(e){let t=LB.get(e);t&&(t.settled=!0,GB(t),LB.delete(e),zB()||UB())}function QB(e,t){let n=LB.get(e);return!n||n.settled?!1:(n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),GB(n),zB()||UB(),n.reject(t),!0)}var $B=Object.freeze({kind:`tab-replay`}),eV=Object.freeze({kind:`idle`});function tV(e,t){return()=>{}}var nV=De(kB),rV=4e3,iV=1e4,aV=class extends Error{constructor(e,t){super(`client persistence clearData timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`ClientPersistenceClearTimeoutError`}},oV=`ok-last-observed-branch`,sV=5e3,cV=1*1024*1024,lV=Zv(`MAX_POOL`,10);function uV(e,t,n=null){let r={};if(e!==null&&(r.principalId=e.principalId,r.tabSessionId=e.tabSessionId),t!==null&&t.length>0&&(r.expectedServerInstanceId=t),n!==null&&n.length>0&&(r.expectedBranch=n),Object.keys(r).length!==0)return JSON.stringify(r)}var dV=class{_entries=new Map;get entries(){return this._entries}lruOrder=[];activeDocName=null;maxSize;wsUrl;recycleDebounceMs;clearDataTimeoutMs;onChange=null;tabIdentity=null;serverRestartRecoveryState=eV;cachedServerInstanceId=null;pendingServerInstanceKnown=null;recoveryMismatchStaleClaim;bufferedUpdates=new Map;persistenceFactory;storage;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n?.recycleDebounceMs??rV,this.clearDataTimeoutMs=n?.clearDataTimeoutMs??iV,this.persistenceFactory=n?.persistenceFactory??fC,n?.storage===void 0?this.storage=globalThis.localStorage===void 0?null:globalThis.localStorage:this.storage=n.storage}setTabIdentity(e){this.tabIdentity=e}setExpectedServerInstanceId(e){if(this.cachedServerInstanceId=e,!(e===null||e.length===0)){if(this.pendingServerInstanceKnown!==null){let t=this.pendingServerInstanceKnown;this.pendingServerInstanceKnown=null,t.resolve(e)}this.attachDeferredPersistence(e)}}whenServerInstanceKnown(){if(this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0)return Promise.resolve(this.cachedServerInstanceId);if(this.pendingServerInstanceKnown!==null)return this.pendingServerInstanceKnown.promise;let e,t=new Promise(t=>{e=t});return this.pendingServerInstanceKnown={promise:t,resolve:e},t}buildPersistence(e,t,n){return this.persistenceFactory({branch:this.getOrInitObservedBranch()??`_unknown_`,serverInstanceId:e,docName:t,doc:n})}attachDeferredPersistence(e){for(let t of this._entries.values())if(t.kind===`active`&&t.persistence===null)try{t.persistence=this.buildPersistence(e,t.docName,t.provider.document)}catch(e){let n=e instanceof Error?e.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(t.docName),errorName:n,errorMessage:e instanceof Error?e.message:String(e)})}}getServerRestartRecoveryState(){return this.serverRestartRecoveryState}observeDiskAck(e,t){let n=this.entries.get(e);!n||n.kind!==`active`||(n.lastDiskAckedSV=hC(n.lastDiskAckedSV,t))}observeDiskAckBatch(e){for(let[t,n]of Object.entries(e))this.observeDiskAck(t,n)}lastObservedBranch=null;lastObservedBranchInitialized=!1;getOrInitObservedBranch(){if(this.lastObservedBranchInitialized)return this.lastObservedBranch;this.lastObservedBranchInitialized=!0;try{let e=this.storage?.getItem(oV)??null;e!==null&&e.length>0&&(this.lastObservedBranch=e)}catch{}return this.lastObservedBranch}persistObservedBranch(e){this.lastObservedBranch=e,this.lastObservedBranchInitialized=!0;try{e===null||e.length===0?this.storage?.removeItem(oV):this.storage?.setItem(oV,e)}catch{}}withClearDataTimeout(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new aV(e,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);t.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e)})})}recoveryTelemetryBase(e,t){let n={docName:e,branch:this.getOrInitObservedBranch()??`_unknown_`},r=t===void 0?this.recoveryMismatchStaleClaim:t;return r!==void 0&&r.length>0&&(n.serverInstanceId=r),n}emitStructuredClientRecoveryEvent(e){console.warn(JSON.stringify(e))}clearRecoveryMismatchStaleClaimIfTerminal(){let e=this.serverRestartRecoveryState.kind;(e===`idle`||e===`failed`)&&(this.recoveryMismatchStaleClaim=void 0)}beginServerRestartRecovery(e,t){this.serverRestartRecoveryState={kind:`recovering`,phase:`clearing-local-cache`,docNames:e,failedDocNames:[],startedAt:t};for(let t of e)ZB(t);this.notify()}enterServerRestartReconnect(e,t,n,r){if(e.length===0){this.serverRestartRecoveryState=t.length===0?eV:{kind:`failed`,reason:r,docNames:t,failedDocNames:t,startedAt:n},this.clearRecoveryMismatchStaleClaimIfTerminal(),this.notify();return}this.serverRestartRecoveryState={kind:`recovering`,phase:`reconnecting`,docNames:e,failedDocNames:t,startedAt:n,...t.length>0?{clearFailureReason:r}:{}},this.notify()}markServerRestartRecoverySynced(e){let t=this.serverRestartRecoveryState;if(t.kind!==`recovering`||t.phase!==`reconnecting`||!t.docNames.includes(e))return;let n=t.docNames.filter(t=>t!==e);if(n.length>0){this.serverRestartRecoveryState={...t,docNames:n};return}if(t.failedDocNames.length>0){this.serverRestartRecoveryState={kind:`failed`,reason:t.clearFailureReason??`clear-data-failed`,docNames:t.failedDocNames,failedDocNames:t.failedDocNames,startedAt:t.startedAt},this.clearRecoveryMismatchStaleClaimIfTerminal();return}this.serverRestartRecoveryState=eV,this.clearRecoveryMismatchStaleClaimIfTerminal()}setObservedBranch(e){this.persistObservedBranch(e)}compareAndUpdateObservedBranch(e){let t=this.getOrInitObservedBranch();return this.persistObservedBranch(e),t!==null&&t!==e}onBranchMismatch=null;branchMismatchInFlight=null;mismatchInFlight=null;setOnBranchMismatch(e){if(e===null){this.onBranchMismatch=null;return}this.onBranchMismatch=()=>{if(this.branchMismatchInFlight!==null)return;let t=Promise.resolve().then(e).finally(()=>{this.branchMismatchInFlight===t&&(this.branchMismatchInFlight=null)});this.branchMismatchInFlight=t}}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}evictListeners=new Set;onEvict(e){return this.evictListeners.add(e),()=>{this.evictListeners.delete(e)}}fireEvict(e){for(let t of this.evictListeners)try{t(e)}catch(t){console.warn(`[ProviderPool] evict listener threw for ${e}:`,t)}}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}open(e){if(AB(e))return null;let t=this.entries.get(e);if(t)return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),t;this.entries.size>=this.maxSize&&this.evictLru();let n=this.cachedServerInstanceId,r=uV(this.tabIdentity,n,this.getOrInitObservedBranch()),i=new BS({url:gC(this.wsUrl),name:e,forceSyncInterval:sV,...r===void 0?{}:{token:r}}),a=this.cachedServerInstanceId,o={kind:`active`,provider:i,persistence:a!==null&&a.length>0?this.buildPersistence(a,e,i.document):null,lastServerSyncedSV:null,lastDiskAckedSV:null,observerCleanup:null,observerFireCounterCleanup:tV(i.document,e),syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),hasSynced:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1};if(i.on(`status`,({status:t})=>{o.kind!==`active`||this.entries.get(e)!==o||t===`disconnected`&&(o.syncState=`disconnected`,this.notify())}),i.on(`synced`,()=>{if(!(o.kind!==`active`||this.entries.get(e)!==o)&&(o.syncState=`synced`,o.hasSynced=!0,o.lastServerSyncedSV=pC(i.document),o.pendingRecycleTimer&&=(clearTimeout(o.pendingRecycleTimer),null),this.markServerRestartRecoverySynced(e),this.notify(),!o.observerCleanup))try{let t=i.document,n=new Ae({extensions:kB});o.observerCleanup=uM({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:n,schema:nV,onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),o.bridgeSetupFailed=!0,QB(e,new FB(e,t))}}),i.on(`disconnect`,()=>{o.kind!==`active`||this.entries.get(e)!==o||(o.syncState=`disconnected`,this.notify(),o.hasSynced&&i.unsyncedChanges===0&&!o.pendingRecycleTimer&&(o.pendingRecycleTimer=setTimeout(()=>{o.kind===`active`&&(o.pendingRecycleTimer=null,this.entries.get(e)===o&&this.recycleDisconnectedEntry(e))},this.recycleDebounceMs)))}),i.on(`authenticationFailed`,({reason:e})=>{if(![`server-instance-mismatch`,`branch-mismatch`].includes(e)){console.warn(JSON.stringify({event:`ok-auth-failed-unknown-reason`,reason:e}));return}let t=e;if(t===`server-instance-mismatch`){if(n===null||this.cachedServerInstanceId!==n)return;let e=n;this.cachedServerInstanceId=null,this.handleServerInstanceMismatch(e);return}if(t===`branch-mismatch`){this.onBranchMismatch?.();return}}),this.bufferedUpdates.get(e)!==void 0){let t=this.recoveryMismatchStaleClaim,n=()=>{if(i.off(`synced`,n),o.kind!==`active`||this.entries.get(e)!==o)return;let r=this.bufferedUpdates.get(e);if(r!==void 0){this.bufferedUpdates.delete(e);try{Op(i.document,r,$B)}catch(n){let i=n instanceof Error?n.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-failed`,...this.recoveryTelemetryBase(e,t),replayByteLength:r.byteLength,errorName:i,errorMessage:n instanceof Error?n.message:String(n)})}}};i.on(`synced`,n)}return this._entries.set(e,o),this.touch(e),this.notify(),o}handleServerInstanceMismatch(e){this.recoveryMismatchStaleClaim=e.length>0?e:void 0;let t=Array.from(this.entries.entries()),n=Date.now(),r=this.activeDocName,i=r!==null&&t.some(([e,t])=>e===r&&t.kind===`active`)?[r]:[],a=r??t.find(([,e])=>e.kind===`active`)?.[0]??``;a.length>0&&this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-epoch-mismatch`,...this.recoveryTelemetryBase(a)}),this.beginServerRestartRecovery(i,n);for(let[e,n]of t)n.kind===`active`&&!i.includes(e)&&ZB(e);for(let[e,n]of t){if(n.kind!==`active`)continue;let t=n.lastDiskAckedSV??n.lastServerSyncedSV;if(t===null){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-skipped-no-baseline`,...this.recoveryTelemetryBase(e),reason:`no-disk-ack-or-server-sync-vector`});continue}let r=mC(n.provider.document,t);if(r.byteLength>cV){Y(`ok/pool/buffer-overflow`,{docName:e,bytes:r.byteLength});continue}r.byteLength>0&&this.bufferedUpdates.set(e,r)}let o=[];for(let[e,n]of t)n.kind===`active`&&n.persistence!==null&&o.push({docName:e,promise:this.withClearDataTimeout(e,n.persistence.clearData())});let s=Promise.allSettled(o.map(e=>e.promise)).then(e=>{let t=[],i=[],a=!1;e.forEach((e,n)=>{let r=o[n];if(!r)return;let s=r.docName;if(e.status===`rejected`){t.push(s);let n=e.reason instanceof aV;if(n&&(a=!0),n)this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`timeout`});else{let t=e.reason instanceof Error?e.reason.name:`unknown`;this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`rejected`,errorName:t,errorMessage:e.reason instanceof Error?e.reason.message:String(e.reason)})}}else i.push(s)});let s=i.filter(e=>e===r);if(t.length>0){let e=a?`clear-data-timeout`:`clear-data-failed`;console.warn(JSON.stringify({event:`ok-mismatch-recycle-partial-clears-failed`,failedDocs:t,clearedDocs:i})),this.enterServerRestartReconnect(s,t,n,e);for(let e of i)this.recycleDisconnectedEntry(e);return}this.enterServerRestartReconnect(s,[],n,`clear-data-failed`),this.recycleAllEntries()}).finally(()=>{this.mismatchInFlight===s&&(this.mismatchInFlight=null)});this.mismatchInFlight=s}awaitMismatchSettled(){return this.mismatchInFlight??Promise.resolve()}recycleAllEntries(){let e=Array.from(this.entries.keys());for(let t of e)this.recycleDisconnectedEntry(t)}prewarm(e){if(AB(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.bufferedUpdates.delete(e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}async closeAndClearPersistence(e){let t=this.entries.get(e);if(t?.kind===`active`&&t.persistence!==null){try{await t.persistence.clearData()}catch(t){console.warn(`[ProviderPool] clearData on rename failed for ${e}:`,t)}this.close(e);return}t&&this.close(e);let n=this.getOrInitObservedBranch(),r=this.cachedServerInstanceId;if(n===null||r===null)return;let i=`ok-ydoc:${n}:${r}:${e}`;try{await new Promise((e,t)=>{let n=indexedDB.deleteDatabase(i);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`[ProviderPool] IDB delete blocked for ${i}`),t(Error(`idb-clear-blocked: ${i}`))}})}catch(e){console.warn(`[ProviderPool] IDB delete on rename failed for ${i}:`,e)}}clearBufferedUpdates(){this.bufferedUpdates.clear()}__test_seedBufferedUpdate(e,t){this.bufferedUpdates.set(e,t)}__test_bufferedUpdatesSize(){return this.bufferedUpdates.size}__test_hasBufferedUpdate(e){return this.bufferedUpdates.has(e)}__test_getBufferedUpdate(e){return this.bufferedUpdates.get(e)}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this._entries.values())this.destroyEntry(e);this._entries.clear(),this.lruOrder=[],this.activeDocName=null,this.onChange=null,this.bufferedUpdates.clear(),this.onBranchMismatch=null,this.branchMismatchInFlight=null,this.evictListeners.clear(),this.serverRestartRecoveryState=eV,this.cachedServerInstanceId=null,this.pendingServerInstanceKnown=null,this.tabIdentity=null,this.recoveryMismatchStaleClaim=void 0}evictLru(){for(let e of this.lruOrder)if(e!==this.activeDocName){Y(`ok/pool/evict-lru`,{docName:e}),this.close(e);return}}destroyEntry(e){if(e.kind===`tearing-down`)return;let t=e.observerCleanup,n=e.observerFireCounterCleanup,r=e.persistence,i=e.pendingRecycleTimer,a=e.docName,o=e;o.kind=`tearing-down`,o.persistence=null,o.observerCleanup=null,o.observerFireCounterCleanup=null,o.pendingRecycleTimer=null,i&&clearTimeout(i),ZB(a),this.fireEvict(a),t?.(),n?.(),r!==null&&r.destroy().catch(e=>{console.warn(`[ProviderPool] persistence destroy failed for ${a}:`,e)});try{o.provider.destroy()}catch(e){console.warn(`[ProviderPool] Provider destroy failed for ${a}:`,e)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.kind!==`active`)return;let n=this.activeDocName===e;if(Y(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},fV=crypto.randomUUID(),pV=!1;function mV(e){pV||(pV=!0,console.warn(`[principal-fetch] failed to resolve principal — falling back to random identity.`,e))}var hV=(0,q.createContext)(null),gV=null;function _V(e){return gV||(gV=new dV(lV,e),Fy(gV)),gV}var vV={activeDocName:null,activeProvider:null,syncState:`connecting`,serverRestartRecovery:{kind:`idle`},poolEntries:[]};function yV(){if(typeof window>`u`)return null;let e=window.okDesktop;return e?.config.mode===`editor`?e:null}function bV(){return typeof window>`u`||window.okDesktop?.config.mode===`editor`?null:tb(window.location.origin)}function xV(){if(typeof window>`u`)return[];let e=bV();return e?nb(window.localStorage===void 0?null:window.localStorage,e,lV).openTabs:[]}function SV(e){let t=Uy(e);return t.kind===`doc`?Ge(t.docName):Te(t.folderPath)}function CV(e){let t=rt(e);if(!t)return null;let n=t.trim();if(/\/+$/.test(n)){let e=n.replace(/\/+$/g,``);return e?Vy(e):null}return By(t)}function wV(e,t){return e?Hy(e):t?By(t):null}function TV(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,serverRestartRecovery:e.getServerRestartRecoveryState(),poolEntries:n}}function EV(e){let t=(0,J.c)(103),{children:n}=e,[r,i]=(0,q.useState)(vV),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(xV),[l,u]=(0,q.useState)(!1),d=(0,q.useRef)(!1),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(`doc`),[b,S]=(0,q.useState)(null),[C,w]=(0,q.useState)(0),{collabUrl:T,terminal:E,lastError:D,retry:O}=Kv(),k,A;t[0]!==T||t[1]!==f||t[2]!==l?(k=()=>{if(T===null||l||!f)return;let e=!1,t=yV(),n=bV(),r=typeof localStorage<`u`?localStorage:null;return(t?t.project.getSessionState():Promise.resolve(n?nb(r,n,lV):{openTabs:[],activeDocName:null,activeTabId:null,updatedAt:null})).then(t=>{if(e)return;let n=$y(t,lV);if(d.current)return;let r=_V(T);for(let e of n.openTabs){let t=Wy(e);t&&r.open(t)}c(e=>{let t=n.openTabs;for(let n of e)t=Ky(t,n,lV);return t});let i=rt(window.location.hash)===null&&window.location.hash.length===0,a=n.activeTabId??(n.activeDocName?By(n.activeDocName):null)??n.openTabs[0]??null;i&&a&&(window.location.hash=SV(a))}).catch(jV).finally(()=>{e||u(!0)}),()=>{e=!0}},A=[T,f,l],t[0]=T,t[1]=f,t[2]=l,t[3]=k,t[4]=A):(k=t[3],A=t[4]),(0,q.useEffect)(k,A);let j,M;t[5]!==a||t[6]!==s||t[7]!==r.activeDocName||t[8]!==l?(j=()=>{if(!l)return;let e=eb(s,wV(a,r.activeDocName)),t=yV();if(t){t.project.setSessionState(e).catch(AV);return}let n=bV();n&&rb(typeof localStorage<`u`?localStorage:null,n,e)},M=[a,s,r.activeDocName,l],t[5]=a,t[6]=s,t[7]=r.activeDocName,t[8]=l,t[9]=j,t[10]=M):(j=t[9],M=t[10]),(0,q.useEffect)(j,M);let N;t[11]===l?N=t[12]:(N=function(){l||(d.current=!0)},t[11]=l,t[12]=N);let P=N,F,I;t[13]===T?(F=t[14],I=t[15]):(F=()=>{if(T===null)return;let e=!1;p(!1);let t=_V(T);return i(TV(t)),t.setOnBranchMismatch(()=>kv(t)),t.setOnChange(()=>i(TV(t))),fetch(`/api/principal`).then(kV).then(n=>{if(e)return;let r=x.safeParse(n);r.success?(t.setTabIdentity({principalId:r.data.id,tabSessionId:fV}),h(r.data)):mV(r.error)}).catch(t=>{e||mV(t)}).finally(()=>{e||p(!0)}),kv(t),()=>{e=!0,t.setOnChange(null)}},I=[T],t[13]=T,t[14]=F,t[15]=I),(0,q.useEffect)(F,I);let L;t[16]!==T||t[17]!==P?(L=e=>{if(Y(`ok/nav/open-document`,{docName:e,transition:!1}),T===null)return;P();let t=_V(T);t.open(e)&&(c(t=>Ky(t,By(e),lV)),t.setActive(e),o({kind:`doc`,target:e,docName:e}))},t[16]=T,t[17]=P,t[18]=L):L=t[18];let R=L,z;t[19]===R?z=t[20]:(z=e=>{Y(`ok/nav/open-document`,{docName:e,transition:!1}),R(e)},t[19]=R,t[20]=z);let B=z,V;t[21]!==T||t[22]!==P?(V=(e,t)=>{if(T===null)return;t.markPendingSessionMutation&&P();let n=_V(T),r=je(e);if(r){if(!n.open(r))return;c(e=>Ky(e,By(r),lV)),n.setActive(r)}else{n.clearActive();let t=Hy(e);t&&c(e=>Ky(e,t,lV))}o(e)},t[21]=T,t[22]=P,t[23]=V):V=t[23];let H=V,U;t[24]===H?U=t[25]:(U=e=>{H(e,{markPendingSessionMutation:!0})},t[24]=H,t[25]=U);let ee=U,te;t[26]===H?te=t[27]:(te=e=>{Y(`ok/nav/open-target`,{docName:je(e),kind:e.kind,transition:!1}),H(e,{markPendingSessionMutation:!1})},t[26]=H,t[27]=te);let ne=te,re;t[28]===T?re=t[29]:(re=()=>{if(T===null){o(null);return}_V(T).clearActive(),o(null)},t[28]=T,t[29]=re);let ie;t[30]!==T||t[31]!==P?(ie=e=>{T!==null&&(P(),_V(T).close(e),c(t=>qy(t,By(e))),o(t=>t&&(je(t)===e?null:t)))},t[30]=T,t[31]=P,t[32]=ie):ie=t[32];let ae,oe;t[33]!==a||t[34]!==T||t[35]!==P||t[36]!==r.activeDocName?(ae=e=>{P();let t=null,n=Wy(e);if(T!==null){let e=_V(T);n&&e.close(n)}let i=wV(a,r.activeDocName);if(c(n=>(t=Zy(n,i,e),qy(n,e))),i===e){if(t){window.location.hash=SV(t);return}T!==null&&_V(T).clearActive(),o(null),window.location.hash=``}},oe=e=>{P();let t=new Set(e.filter(OV));if(t.size===0)return;if(T!==null){let e=_V(T);for(let n of t){let t=Wy(n);t&&e.close(t)}}let n=null,i=wV(a,r.activeDocName);if(c(e=>(n=Qy(e,i,t),e.filter(e=>!t.has(e)))),!i||!t.has(i)){o(e=>{if(!e)return e;let n=Hy(e);return n&&t.has(n)?null:e});return}if(n){window.location.hash=SV(n);return}T!==null&&_V(T).clearActive(),o(null),window.location.hash=``},t[33]=a,t[34]=T,t[35]=P,t[36]=r.activeDocName,t[37]=ae,t[38]=oe):(ae=t[37],oe=t[38]);let se;t[39]!==a||t[40]!==T||t[41]!==P||t[42]!==s||t[43]!==r.activeDocName?(se=e=>{let{pages:t,folderPaths:n}=e,i=Jy(s,{pages:t,folderPaths:n,keepMissingDocName:a?.kind===`missing`?a.target:null});if(i.length===s.length)return;let l=new Set(i),u=s.filter(e=>!l.has(e)),d=new Set(u);if(P(),T!==null){let e=_V(T);for(let t of u){let n=Wy(t);n&&e.close(n)}}c(i);let f=typeof window<`u`?CV(window.location.hash):null,p=wV(a,r.activeDocName),m=f&&d.has(f)?f:p&&d.has(p)?p:null;if(!m){o(e=>{if(!e)return e;let t=Hy(e);return t&&d.has(t)?null:e});return}let h=Qy(s,m,u);if(h){window.location.hash=SV(h);return}T!==null&&_V(T).clearActive(),o(null),window.location.hash=``},t[39]=a,t[40]=T,t[41]=P,t[42]=s,t[43]=r.activeDocName,t[44]=se):se=t[44];let ce;t[45]!==T||t[46]!==P||t[47]!==s?(ce=(e,t)=>{let n=t===void 0?[]:t;P();let r=Yy(s,e,lV,n);if(T!==null){let e=_V(T);for(let t of r){let n=Wy(t);n&&e.open(n)}}c(r)},t[45]=T,t[46]=P,t[47]=s,t[48]=ce):ce=t[48];let le,ue,de;t[49]===T?(le=t[50],ue=t[51],de=t[52]):(le=async e=>{T!==null&&(await _V(T).closeAndClearPersistence(e),o(t=>t&&(je(t)===e?null:t)))},ue=e=>{T!==null&&_V(T).recycle(e)},de=e=>{T!==null&&_V(T).prewarm(e)},t[49]=T,t[50]=le,t[51]=ue,t[52]=de);let fe,pe,me,he,ge;t[53]===T?(fe=t[54],pe=t[55],me=t[56],he=t[57],ge=t[58]):(fe=e=>{T!==null&&_V(T).setExpectedServerInstanceId(e)},pe=async e=>{if(T===null)return;let t=_V(T);t.setObservedBranch(e),await Ev(t,e)},me=async e=>{if(T===null)return;let t=_V(T);t.compareAndUpdateObservedBranch(e)&&await Ev(t,e)},he=(e,t)=>{T!==null&&_V(T).observeDiskAck(e,t)},ge=async()=>{T!==null&&await kv(_V(T))},t[53]=T,t[54]=fe,t[55]=pe,t[56]=me,t[57]=he,t[58]=ge);let _e;t[59]!==b||t[60]!==v?(_e=e=>{if(v===`agent`&&b===e){y(`doc`);return}S(e),y(`agent`),w(DV)},t[59]=b,t[60]=v,t[61]=_e):_e=t[61];let ve;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>{y(`doc`),S(null)},t[62]=ve):ve=t[62];let ye;t[63]!==a||t[64]!==D||t[65]!==E||t[66]!==T||t[67]!==b||t[68]!==C||t[69]!==v||t[70]!==R||t[71]!==B||t[72]!==s||t[73]!==ee||t[74]!==ne||t[75]!==m||t[76]!==O||t[77]!==r.activeDocName||t[78]!==r.activeProvider||t[79]!==r.poolEntries||t[80]!==r.serverRestartRecovery||t[81]!==r.syncState||t[82]!==g||t[83]!==re||t[84]!==ie||t[85]!==ae||t[86]!==oe||t[87]!==se||t[88]!==ce||t[89]!==le||t[90]!==ue||t[91]!==de||t[92]!==fe||t[93]!==pe||t[94]!==me||t[95]!==he||t[96]!==ge||t[97]!==_e||t[98]!==l?(ye={principal:m,activeTarget:a,activeDocName:r.activeDocName,activeProvider:r.activeProvider,openTabs:s,tabSessionLoaded:l,syncState:r.syncState,serverRestartRecovery:r.serverRestartRecovery,poolEntries:r.poolEntries,openDocument:R,openDocumentTransition:B,openTarget:ee,openTargetTransition:ne,clearTarget:re,closeDocument:ie,closeTab:ae,closeTabs:oe,syncOpenTabsWithKnownTargets:se,remapTabsForRename:ce,closeAndClearForRename:le,recycleDocument:ue,prewarm:de,systemProvider:g,setSystemProvider:_,updateServerInstanceId:fe,onBranchSwitched:pe,observeBranch:me,observeDiskAck:he,refreshServerInfo:ge,collabUrl:T,collabTerminal:E,collabLastError:D,retryCollab:O,docPanelMode:v,docPanelAgentId:b,docPanelExpandSignal:C,openActivityPanel:_e,closeActivityPanel:ve},t[63]=a,t[64]=D,t[65]=E,t[66]=T,t[67]=b,t[68]=C,t[69]=v,t[70]=R,t[71]=B,t[72]=s,t[73]=ee,t[74]=ne,t[75]=m,t[76]=O,t[77]=r.activeDocName,t[78]=r.activeProvider,t[79]=r.poolEntries,t[80]=r.serverRestartRecovery,t[81]=r.syncState,t[82]=g,t[83]=re,t[84]=ie,t[85]=ae,t[86]=oe,t[87]=se,t[88]=ce,t[89]=le,t[90]=ue,t[91]=de,t[92]=fe,t[93]=pe,t[94]=me,t[95]=he,t[96]=ge,t[97]=_e,t[98]=l,t[99]=ye):ye=t[99];let be=ye,xe;return t[100]!==n||t[101]!==be?(xe=(0,K.jsx)(hV,{value:be,children:n}),t[100]=n,t[101]=be,t[102]=xe):xe=t[102],xe}function DV(e){return e+1}function OV(e){return e.length>0}function kV(e){return e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))}function AV(e){console.warn(`[editor-tabs] failed to persist tab session:`,e)}function jV(e){console.warn(`[editor-tabs] failed to restore tab session:`,e)}function MV(){let e=(0,q.use)(hV);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function NV(){let e=(0,J.c)(3),{openDocumentTransition:t,openTargetTransition:n}=MV(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{xC as $,Br as $t,_j as A,$p as At,eA as B,oc as Bt,mM as C,$_ as Ct,jj as D,nm as Dt,qj as E,Am as Et,sj as F,Uc as Ft,uO as G,ni as Gt,_k as H,Y as Ht,hA as I,Hc as It,UT as J,Jr as Jt,lO as K,ti as Kt,pA as L,rc as Lt,lj as M,Cf as Mt,dj as N,wf as Nt,Tj as O,tm as Ot,uj as P,td as Pt,MC as Q,Vr as Qt,oA as R,tc as Rt,YM as S,q_ as St,cM as T,fp as Tt,uk as U,Jo as Ut,Hk as V,Zo as Vt,ck as W,ri as Wt,iw as X,Kr as Xt,bT as Y,qr as Yt,FC as Z,Hr as Zt,Rz as _,wv as _t,PB as a,Mr as an,Hy as at,$R as b,bv as bt,MB as c,Dr as cn,xy as ct,XB as d,br as dn,ey as dt,zr as en,BS as et,AB as f,vr as fn,iy as ft,Bz as g,fr as gn,Dv as gt,cB as h,pr as hn,Rv as ht,FB as i,Nr as in,Xy as it,gj as j,Jp as jt,hj as k,Yp as kt,ZB as l,Tr as ln,My as lt,sB as m,mr as mn,Zv as mt,MV as n,Fr as nn,Vy as nt,NB as o,jr as on,Cy as ot,kB as p,_r as pn,ry as pt,oE as q,ei as qt,NV as r,Pr as rn,Uy as rt,IB as s,kr as sn,wy as st,EV as t,Lr as tn,By as tt,KB as u,xr as un,Qv as ut,zz as v,Tv as vt,lM as w,Gg as wt,UR as x,__ as xt,nz as y,yv as yt,tA as z,cc as zt};