@inkeep/open-knowledge 0.4.0 → 0.4.1

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 (508) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +10 -5
  2. package/dist/alias-JE7RI5QX-BCGl9_yw.mjs +1 -0
  3. package/dist/assets/skills/open-knowledge/SKILL.md +3 -3
  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 -38
  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/config-schema.json +0 -23
  125. package/dist/config.project.schema.json +0 -13
  126. package/dist/config.user.schema.json +0 -10
  127. package/dist/constants-D6K9fctf.mjs +2 -0
  128. package/dist/cp-XOYR4ABJ-CQdiaiBl.mjs +1 -0
  129. package/dist/{curl-47BFPSFW-C2kRcGkX.mjs → curl-47BFPSFW-BzVtpc-O.mjs} +2 -2
  130. package/dist/cut-OPC3VAGB-oTKBumd9.mjs +1 -0
  131. package/dist/date-DD7FVA2V-BrmKZaC_.mjs +1 -0
  132. package/dist/diff-HJF2MPDN-BNIGqrz6.mjs +1 -0
  133. package/dist/dirname-LEMTZZFS-BwH_Sy4c.mjs +1 -0
  134. package/dist/{dist-DfIz2LcA.mjs → dist-CGdW0JZ5.mjs} +69 -68
  135. package/dist/{dist-D4M20vXU.mjs → dist-CM-e7rrB.mjs} +1065 -91
  136. package/dist/dist-iEhrVwoD.mjs +1 -0
  137. package/dist/du-WO2ENHXQ-CaFJHtt9.mjs +1 -0
  138. package/dist/echo-O45JWWI2-BVUJjhWK.mjs +1 -0
  139. package/dist/env-5EPCWSXR-DH5CCl6V.mjs +1 -0
  140. package/dist/{execAsync-CulVJBMN.mjs → execAsync-Bpfn4nfY.mjs} +1 -1
  141. package/dist/{execAsync-CzW9fUYQ.mjs → execAsync-D93HRpVy.mjs} +1 -1
  142. package/dist/{execAsync-DuQoqWaW.mjs → execAsync-DMx5TUjh.mjs} +1 -1
  143. package/dist/expand-DTNXU4LQ-eK5V8PVi.mjs +1 -0
  144. package/dist/expansion-ENLSRCXJ-DJReNXZq.mjs +1 -0
  145. package/dist/expr-5T3UU5KE-DTdq14FE.mjs +1 -0
  146. package/dist/file-ZIGAJ4YS-WHJtEeVR.mjs +1 -0
  147. package/dist/find-TPUOAIUQ-Dk362bwv.mjs +1 -0
  148. package/dist/flag-coverage-QT4N2Z44-C5s46vwi.mjs +2 -0
  149. package/dist/fold-LDSORVYE-CkRa6rpW.mjs +1 -0
  150. package/dist/{getMachineId-bsd-DAmB-Ym0.mjs → getMachineId-bsd-B3nMvpKd.mjs} +2 -2
  151. package/dist/{getMachineId-bsd-FYDP9w5Q.mjs → getMachineId-bsd-CbGsKq4x.mjs} +2 -2
  152. package/dist/{getMachineId-bsd-mPrX3ckm.mjs → getMachineId-bsd-Cbosky3N.mjs} +2 -2
  153. package/dist/{getMachineId-darwin-B0Qw-MTj.mjs → getMachineId-darwin-BNex6tJ8.mjs} +2 -2
  154. package/dist/{getMachineId-darwin-C79HtyON.mjs → getMachineId-darwin-BnJVzhVS.mjs} +2 -2
  155. package/dist/{getMachineId-darwin-Co8Jnu5v.mjs → getMachineId-darwin-UUooObuL.mjs} +2 -2
  156. package/dist/{getMachineId-linux-BizmCjYq.mjs → getMachineId-linux-BCV7VFT0.mjs} +1 -1
  157. package/dist/{getMachineId-linux-BvLCCmKQ.mjs → getMachineId-linux-Bo4OhbSY.mjs} +1 -1
  158. package/dist/{getMachineId-linux-BBORs2cS.mjs → getMachineId-linux-D4ybKI-D.mjs} +1 -1
  159. package/dist/{getMachineId-unsupported-CbR45h2D.mjs → getMachineId-unsupported-4i2apDO3.mjs} +1 -1
  160. package/dist/{getMachineId-unsupported-DbGFOAw1.mjs → getMachineId-unsupported-DKWpTC9E.mjs} +1 -1
  161. package/dist/{getMachineId-unsupported-Bgp-Es9j.mjs → getMachineId-unsupported-DYYMUAWj.mjs} +1 -1
  162. package/dist/{getMachineId-win-Cy0XHq4X.mjs → getMachineId-win-CHxnm_JZ.mjs} +2 -2
  163. package/dist/{getMachineId-win-D5gDnBHa.mjs → getMachineId-win-E9RqBHbs.mjs} +2 -2
  164. package/dist/{getMachineId-win-CT_Y5i_4.mjs → getMachineId-win-W9lSyLKl.mjs} +2 -2
  165. package/dist/grep-3AIAIJVR-9FFpNxXg.mjs +1 -0
  166. package/dist/gzip-AQXSGOVS-B69jDA3r.mjs +1 -0
  167. package/dist/head-HT2B6D2J-LVz3MZgn.mjs +1 -0
  168. package/dist/help-VVWX7SA5-NiesqNE9.mjs +1 -0
  169. package/dist/history-J4QRNGRO-CJ6sdqLF.mjs +1 -0
  170. package/dist/hostname-BK6HG2DE-BTiQGLXj.mjs +1 -0
  171. package/dist/html-to-markdown-TFCECAGV-gA9lIhli.mjs +1 -0
  172. package/dist/index.d.mts +75 -4
  173. package/dist/index.mjs +1 -1
  174. package/dist/init-3AFVYf9q.mjs +1 -0
  175. package/dist/init-CdsG66O_.mjs +408 -0
  176. package/dist/{is-object-DF0ZeuvD.mjs → is-object-C-4FJ0rP.mjs} +1 -1
  177. package/dist/join-GG2LDHE5-DP2t9Lzd.mjs +1 -0
  178. package/dist/jq-ODXZBPLY-DIh5TTSi.mjs +1 -0
  179. package/dist/{js-exec-M6UR76J5-IyD-lpzv.mjs → js-exec-M6UR76J5-2jDKLOtz.mjs} +2 -2
  180. package/dist/{lib-BOCdCkg7.mjs → lib-CxZz7HCo.mjs} +1 -1
  181. package/dist/ln-4TRFBYAT-CcfWdebC.mjs +1 -0
  182. package/dist/loader-Bncr5BJi.mjs +4 -0
  183. package/dist/loader-DTI1TGWC.mjs +1 -0
  184. package/dist/ls-KSXFZCWH-Ck3u5K5M.mjs +1 -0
  185. package/dist/{lzma-vr8hBkhz.mjs → lzma-noRZ7I73.mjs} +1 -1
  186. package/dist/md5sum-INMIK4DX-B5BLDgGd.mjs +1 -0
  187. package/dist/mkdir-TDEMSB6C-BHFCS7vA.mjs +1 -0
  188. package/dist/mv-Z6MORUFL-CmLWSH1J.mjs +1 -0
  189. package/dist/nl-U5YJDM32-Cn7q_PFe.mjs +1 -0
  190. package/dist/od-VJEF2UR5-BMxC8c-2.mjs +1 -0
  191. package/dist/paste-7N6AFSDS-C9XyEur2.mjs +1 -0
  192. package/dist/preview-BvnHrXsi.mjs +1 -0
  193. package/dist/{preview-FAMk9J0z.mjs → preview-CpFNaoeP.mjs} +2 -2
  194. package/dist/printf-CX64KX2P-Hzp-xme8.mjs +1 -0
  195. package/dist/public/assets/ActivityModeContent-B9qJjoag.js +2 -0
  196. package/dist/public/assets/ConsentDialogBody-Nm0bF6eX.js +2 -0
  197. package/dist/public/assets/DocumentContext-DXmaxXXr.js +37 -0
  198. package/dist/public/assets/GraphPanel-lypmG_hQ.js +46 -0
  199. package/dist/public/assets/McpConsentDialogBody-0w9-K4mU.js +1 -0
  200. package/dist/public/assets/SettingsDialog-B0r_NhKC.js +11 -0
  201. package/dist/public/assets/SourceEditor-CzC_EQwX.js +2 -0
  202. package/dist/public/assets/{_baseFor-DTImdh6y.js → _baseFor-CVV1DSgL.js} +1 -1
  203. package/dist/public/assets/{agent-presence-CaGG2gp7.js → agent-presence-BrTlNKmt.js} +1 -1
  204. package/dist/public/assets/{arc-VNWsD8TF.js → arc-DoxD41WW.js} +1 -1
  205. package/dist/public/assets/architecture-YZFGNWBL-C7rs88Cj.js +1 -0
  206. package/dist/public/assets/{architectureDiagram-Q4EWVU46-C7EDVIb_.js → architectureDiagram-Q4EWVU46-Du5oNRD5.js} +1 -1
  207. package/dist/public/assets/{blockDiagram-DXYQGD6D-RDoQRmSR.js → blockDiagram-DXYQGD6D-CuxUJ8VP.js} +1 -1
  208. package/dist/public/assets/button-C1nwPVFQ.js +1 -0
  209. package/dist/public/assets/{c4Diagram-AHTNJAMY-DWq5v6f-.js → c4Diagram-AHTNJAMY-D58kKzW4.js} +1 -1
  210. package/dist/public/assets/channel-kvPH_LHg.js +1 -0
  211. package/dist/public/assets/{chunk-2KRD3SAO-BTibUhx6.js → chunk-2KRD3SAO-uai9wz3V.js} +1 -1
  212. package/dist/public/assets/{chunk-336JU56O-Bm6IwRki.js → chunk-336JU56O-CtkQ28bg.js} +2 -2
  213. package/dist/public/assets/chunk-426QAEUC-jRhC4EYv.js +1 -0
  214. package/dist/public/assets/{chunk-4BX2VUAB-Dzrv7xRQ.js → chunk-4BX2VUAB-BTctgoF3.js} +1 -1
  215. package/dist/public/assets/{chunk-4TB4RGXK-n_VCZ-Dw.js → chunk-4TB4RGXK-Cnl-K_AI.js} +1 -1
  216. package/dist/public/assets/chunk-55IACEB6-dtXOOCuI.js +1 -0
  217. package/dist/public/assets/{chunk-5FUZZQ4R-CwFS-NM9.js → chunk-5FUZZQ4R-DF0EG1O8.js} +1 -1
  218. package/dist/public/assets/{chunk-5PVQY5BW-Cf3pEIAB.js → chunk-5PVQY5BW-BpceE2BZ.js} +1 -1
  219. package/dist/public/assets/{chunk-67CJDMHE-B1qjR6o5.js → chunk-67CJDMHE-DiSIolj4.js} +1 -1
  220. package/dist/public/assets/{chunk-7N4EOEYR-9LthribN.js → chunk-7N4EOEYR-Yp7Nf16N.js} +1 -1
  221. package/dist/public/assets/{chunk-AA7GKIK3-DFgv_Jxv.js → chunk-AA7GKIK3--s2NNuet.js} +1 -1
  222. package/dist/public/assets/{chunk-BSJP7CBP-BMfaq0VP.js → chunk-BSJP7CBP-BrRqu__W.js} +1 -1
  223. package/dist/public/assets/{chunk-CIAEETIT-DUfZ-zCl.js → chunk-CIAEETIT-BUzaopy6.js} +1 -1
  224. package/dist/public/assets/{chunk-EDXVE4YY-BKbUy63F.js → chunk-EDXVE4YY-Bo83e0iq.js} +1 -1
  225. package/dist/public/assets/{chunk-ENJZ2VHE-DIZOQmDi.js → chunk-ENJZ2VHE-CY9yto8o.js} +1 -1
  226. package/dist/public/assets/{chunk-FMBD7UC4-DA5iFIgZ.js → chunk-FMBD7UC4-DEzvlUl3.js} +1 -1
  227. package/dist/public/assets/{chunk-FOC6F5B3-DlEcGgqD.js → chunk-FOC6F5B3-BtjWNx10.js} +1 -1
  228. package/dist/public/assets/{chunk-ICPOFSXX-BDU_0nPa.js → chunk-ICPOFSXX-BC5Xd13f.js} +2 -2
  229. package/dist/public/assets/{chunk-K5T4RW27-CZi_8YH2.js → chunk-K5T4RW27-CfU2wPmV.js} +1 -1
  230. package/dist/public/assets/{chunk-KGLVRYIC-q8yxX2UV.js → chunk-KGLVRYIC-BV1pDifD.js} +1 -1
  231. package/dist/public/assets/{chunk-LIHQZDEY-BqlaDvTQ.js → chunk-LIHQZDEY-C40dIbib.js} +1 -1
  232. package/dist/public/assets/{chunk-ORNJ4GCN-B6A2jdfA.js → chunk-ORNJ4GCN-8cFqvOFf.js} +1 -1
  233. package/dist/public/assets/{chunk-OYMX7WX6-BtgGgZZ0.js → chunk-OYMX7WX6-D0C6jdl8.js} +1 -1
  234. package/dist/public/assets/chunk-QZHKN3VN-Bz4XrtbS.js +1 -0
  235. package/dist/public/assets/{chunk-U2HBQHQK-LrOM0aht.js → chunk-U2HBQHQK-DenE4TdD.js} +1 -1
  236. package/dist/public/assets/{chunk-X2U36JSP-CsEhwsxu.js → chunk-X2U36JSP-DSyuGkzP.js} +1 -1
  237. package/dist/public/assets/{chunk-XPW4576I-D3W7wPR1.js → chunk-XPW4576I-CLO5Bb_q.js} +1 -1
  238. package/dist/public/assets/{chunk-YZCP3GAM-C2TR8l-U.js → chunk-YZCP3GAM-D8kUvWu6.js} +1 -1
  239. package/dist/public/assets/{chunk-ZZ45TVLE-DGa_Hgat.js → chunk-ZZ45TVLE-DHB0SHUz.js} +1 -1
  240. package/dist/public/assets/classDiagram-6PBFFD2Q-MrFnlVPS.js +1 -0
  241. package/dist/public/assets/classDiagram-v2-HSJHXN6E-DFkKo4Ct.js +1 -0
  242. package/dist/public/assets/clone-jj9sSaF-.js +1 -0
  243. package/dist/public/assets/config-validation-events-CajjS6y9.js +10 -0
  244. package/dist/public/assets/consent-store-lB0p7dI5.js +1 -0
  245. package/dist/public/assets/{cose-bilkent-S5V4N54A-cxoevGhk.js → cose-bilkent-S5V4N54A-6FB6GAoi.js} +1 -1
  246. package/dist/public/assets/{dagre-DoC3Vx7E.js → dagre-D2_448Gx.js} +1 -1
  247. package/dist/public/assets/{dagre-KV5264BT-CjRUxU3J.js → dagre-KV5264BT-Bn9RtFC-.js} +1 -1
  248. package/dist/public/assets/{diagram-5BDNPKRD-DlgILr6_.js → diagram-5BDNPKRD-XCR9sVhK.js} +1 -1
  249. package/dist/public/assets/{diagram-G4DWMVQ6-CA3PL8En.js → diagram-G4DWMVQ6-Bz0ngc_7.js} +1 -1
  250. package/dist/public/assets/{diagram-MMDJMWI5-DVx-bZhM.js → diagram-MMDJMWI5-o_IQFxK_.js} +1 -1
  251. package/dist/public/assets/{diagram-TYMM5635-DCl_Xx4h.js → diagram-TYMM5635-D2QJXyfV.js} +1 -1
  252. package/dist/public/assets/dialog-BFN-ujuF.js +1 -0
  253. package/dist/public/assets/{dist-ByDNshqn.js → dist-BYGzJeLM.js} +1 -1
  254. package/dist/public/assets/dist-Bej94Urx.js +1 -0
  255. package/dist/public/assets/dist-BrsSsfiw.js +1 -0
  256. package/dist/public/assets/dist-CXGJFbY5.js +9 -0
  257. package/dist/public/assets/dist-Cg-Qaqw_.js +1 -0
  258. package/dist/public/assets/dist-Cq1LYbUj.js +1 -0
  259. package/dist/public/assets/{dist-BJPjDIRr.js → dist-CyaBbyDQ.js} +1 -1
  260. package/dist/public/assets/dist-DsbVHLNy.js +1 -0
  261. package/dist/public/assets/{dist-BEF_m-Pp.js → dist-Du-s1q8P.js} +1 -1
  262. package/dist/public/assets/dist-OTL8-1C2.js +45 -0
  263. package/dist/public/assets/doc-hash-Cp6jbuyP.js +422 -0
  264. package/dist/public/assets/{erDiagram-SMLLAGMA-ChTvmoDx.js → erDiagram-SMLLAGMA-C1Mr5jbs.js} +1 -1
  265. package/dist/public/assets/{flatten-DXpXo4tl.js → flatten-DFiFicpD.js} +1 -1
  266. package/dist/public/assets/{flowDiagram-DWJPFMVM-8ceKQudh.js → flowDiagram-DWJPFMVM--ukgnTYS.js} +1 -1
  267. package/dist/public/assets/{ganttDiagram-T4ZO3ILL-uadeK_KN.js → ganttDiagram-T4ZO3ILL-CVeIdgCM.js} +1 -1
  268. package/dist/public/assets/gitGraph-7Q5UKJZL-Bmgp5n-M.js +1 -0
  269. package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BcANz6_Q.js → gitGraphDiagram-UUTBAWPF-BSivDyLh.js} +1 -1
  270. package/dist/public/assets/{graphlib-D3l3HBM4.js → graphlib-DvRtwu4N.js} +1 -1
  271. package/dist/public/assets/index-Cuiz8Dsb.js +1853 -0
  272. package/dist/public/assets/index-zh5eSlzN.css +1 -0
  273. package/dist/public/assets/info-OMHHGYJF-DCMX4pS_.js +1 -0
  274. package/dist/public/assets/{infoDiagram-42DDH7IO-qKcHjiUa.js → infoDiagram-42DDH7IO-DtO1Tc8U.js} +1 -1
  275. package/dist/public/assets/input-BOmkuBId.js +1 -0
  276. package/dist/public/assets/{isEmpty-D9j5AQZB.js → isEmpty-gGVpRSDa.js} +1 -1
  277. package/dist/public/assets/isSymbol-D0ur5y-p.js +1 -0
  278. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-DyndBZjz.js → ishikawaDiagram-UXIWVN3A-BY3noyNF.js} +1 -1
  279. package/dist/public/assets/{journeyDiagram-VCZTEJTY-CTiuXUzg.js → journeyDiagram-VCZTEJTY-DdFdkR8_.js} +1 -1
  280. package/dist/public/assets/{kanban-definition-6JOO6SKY-D03tqXqX.js → kanban-definition-6JOO6SKY-WoLnXp48.js} +1 -1
  281. package/dist/public/assets/{label-BOVWulDu.js → label-Dv_9VZWz.js} +1 -1
  282. package/dist/public/assets/{line-CZuyNGqX.js → line-C59Ezo8Z.js} +1 -1
  283. package/dist/public/assets/{linear-CoY1VP-w.js → linear-faBQNtcz.js} +1 -1
  284. package/dist/public/assets/mcp-consent-store-DZ1pCmhN.js +1 -0
  285. package/dist/public/assets/{mermaid-parser.core-D4O7MeLl.js → mermaid-parser.core-CFsvu03i.js} +2 -2
  286. package/dist/public/assets/{mermaid.core-4xgx5kDJ.js → mermaid.core-CWYso-V4.js} +3 -3
  287. package/dist/public/assets/{mindmap-definition-QFDTVHPH-BaMNW13B.js → mindmap-definition-QFDTVHPH-BG3Kwhhs.js} +1 -1
  288. package/dist/public/assets/{now-CJgVN_7h.js → now-D_m-3Vjm.js} +1 -1
  289. package/dist/public/assets/{ordinal-BZbu6HlW.js → ordinal-BLFwWMHf.js} +1 -1
  290. package/dist/public/assets/packet-4T2RLAQJ-DveBhlQF.js +1 -0
  291. package/dist/public/assets/{panel-BaN47PCr.js → panel-8fydlQgn.js} +1 -1
  292. package/dist/public/assets/pie-ZZUOXDRM-yiLyabeZ.js +1 -0
  293. package/dist/public/assets/{pieDiagram-DEJITSTG-_dBzvPAb.js → pieDiagram-DEJITSTG-B1wtn7py.js} +1 -1
  294. package/dist/public/assets/{propagation-api-CuTE-jIt.js → propagation-api-3kmMXRwS.js} +1 -1
  295. package/dist/public/assets/{quadrantDiagram-34T5L4WZ-jnOwhGSn.js → quadrantDiagram-34T5L4WZ-yboV7Kxh.js} +1 -1
  296. package/dist/public/assets/radar-PYXPWWZC-D8GV_2fZ.js +1 -0
  297. package/dist/public/assets/{reduce-Cn1fAmcq.js → reduce-DmI60TfL.js} +1 -1
  298. package/dist/public/assets/{requirementDiagram-MS252O5E-DpZY5MOe.js → requirementDiagram-MS252O5E-BpVLqxNT.js} +1 -1
  299. package/dist/public/assets/{sankeyDiagram-XADWPNL6-CNLrFRka.js → sankeyDiagram-XADWPNL6-CH1ZYL1H.js} +1 -1
  300. package/dist/public/assets/{sequenceDiagram-FGHM5R23-Cqjio9cN.js → sequenceDiagram-FGHM5R23-CwQvwa3m.js} +1 -1
  301. package/dist/public/assets/{src-CVigMQ0t.js → src-DOAilbaA.js} +1 -1
  302. package/dist/public/assets/{stateDiagram-FHFEXIEX-rE9sZdwc.js → stateDiagram-FHFEXIEX-DL3pXt3n.js} +1 -1
  303. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-6f8E13YF.js +1 -0
  304. package/dist/public/assets/stex-CzCFWeB9.js +1 -0
  305. package/dist/public/assets/{target-navigation-intent-CNDuSbLi.js → target-navigation-intent-D0C4LZky.js} +1 -1
  306. package/dist/public/assets/{telemetry-impl-iq6UBtaA.js → telemetry-impl-H--5W_Jc.js} +2 -2
  307. package/dist/public/assets/textarea-CaFqgjns.js +1 -0
  308. package/dist/public/assets/{timeline-definition-GMOUNBTQ-B_X3o8J_.js → timeline-definition-GMOUNBTQ-CDbb3c--.js} +1 -1
  309. package/dist/public/assets/toggle-group-Dq1Ta0Sb.js +1 -0
  310. package/dist/public/assets/tooltip-BVo05ikW.js +1 -0
  311. package/dist/public/assets/treeView-SZITEDCU-A2Cj-I1J.js +1 -0
  312. package/dist/public/assets/treemap-W4RFUUIX-uOn6xcZK.js +1 -0
  313. package/dist/public/assets/typing-burst-detector-Bj_bIEkO.js +2 -0
  314. package/dist/public/assets/{vennDiagram-DHZGUBPP-Cs25K1vw.js → vennDiagram-DHZGUBPP-BaHOUqGA.js} +1 -1
  315. package/dist/public/assets/wardley-RL74JXVD-DrTPuxUO.js +1 -0
  316. package/dist/public/assets/{wardleyDiagram-NUSXRM2D-RgfpVD8G.js → wardleyDiagram-NUSXRM2D-5ysokC2z.js} +1 -1
  317. package/dist/public/assets/{xychartDiagram-5P7HB3ND-BrRrEDJB.js → xychartDiagram-5P7HB3ND-CFQqcNjf.js} +1 -1
  318. package/dist/public/index.html +43 -26
  319. package/dist/pwd-D4OZ7N27-CxX1ETVW.mjs +1 -0
  320. package/dist/{python3-AUFTPCU6-BaJugIdp.mjs → python3-AUFTPCU6-C74hXpFG.mjs} +2 -2
  321. package/dist/readlink-MI4GCHJF-DeD4E7nz.mjs +1 -0
  322. package/dist/rev-XOSYPP45-BnymxcnA.mjs +1 -0
  323. package/dist/rg-FOQSCCX3-BiJSKli9.mjs +1 -0
  324. package/dist/rm-RTZG23RL-Djvo3nEY.mjs +1 -0
  325. package/dist/rmdir-XTQXT7RK-OI_3n90A.mjs +1 -0
  326. package/dist/schemas/v0/config.project.schema.json +0 -13
  327. package/dist/schemas/v0/config.user.schema.json +0 -10
  328. package/dist/sed-VFTTATXJ-Tyu5G4I6.mjs +1 -0
  329. package/dist/seq-RN5ZUASB-CG-hfPIu.mjs +1 -0
  330. package/dist/sha1sum-VJPNLNU6-CEXqRxvP.mjs +1 -0
  331. package/dist/sha256sum-PI32XWXY-Bxzw_ykX.mjs +1 -0
  332. package/dist/sleep-VZFPZFWA-WRTGZhTn.mjs +1 -0
  333. package/dist/sort-DCNRDA7U-CuSJrCSQ.mjs +1 -0
  334. package/dist/split-SITCSYCZ-DqKN3r-A.mjs +1 -0
  335. package/dist/sqlite3-56UMWEY3-C6G8A9IC.mjs +1 -0
  336. package/dist/src-DMe_jLWZ.mjs +2 -0
  337. package/dist/start-BTbMaVtC.mjs +1 -0
  338. package/dist/start-BtHrrb3o.mjs +3 -0
  339. package/dist/stat-BT5A227F-D3-4IZjb.mjs +1 -0
  340. package/dist/strings-7PLOGTPD-DoJhZcXP.mjs +1 -0
  341. package/dist/tac-SJGXQ4T2-CGNEtOiG.mjs +1 -0
  342. package/dist/tail-S5ULNTJU-17nfIM0G.mjs +1 -0
  343. package/dist/tar-ANUBEFJY-C-eZUMPO.mjs +1 -0
  344. package/dist/tee-O7VXZDCO-D4C0E2s8.mjs +1 -0
  345. package/dist/time-DEUO3QV2-Wc9ZVUVu.mjs +1 -0
  346. package/dist/timeout-VRKMCG72-2MptSPRD.mjs +1 -0
  347. package/dist/touch-DX2IJOQ4-DOTz2-NU.mjs +1 -0
  348. package/dist/tr-2HXZRDSW-5aOBfN_I.mjs +1 -0
  349. package/dist/tree-LYXBS7DC-BVyeg_3R.mjs +1 -0
  350. package/dist/true-WHJNXCHG-QiTH9f1Z.mjs +1 -0
  351. package/dist/unexpand-RGTMIGZM-m3YwxdOg.mjs +1 -0
  352. package/dist/uniq-SUNANL47-CuhWyTTO.mjs +1 -0
  353. package/dist/wc-TQB3VNOX-CaEqXvYd.mjs +1 -0
  354. package/dist/which-XZHEH76L-DA_Bm_KM.mjs +1 -0
  355. package/dist/whoami-DGKU3D2X-Bdt58SNY.mjs +1 -0
  356. package/dist/xan-BXDXYEIB-CWBZ1rgf.mjs +1 -0
  357. package/dist/xan-view-ECQUO7AJ-eo_owVyX.mjs +1 -0
  358. package/dist/xargs-I6EZUCYF-VBH5v0oN.mjs +1 -0
  359. package/dist/yq-MJMAR36V-eZBfA9vJ.mjs +1 -0
  360. package/package.json +1 -1
  361. package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +0 -1
  362. package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +0 -1
  363. package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +0 -1
  364. package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +0 -1
  365. package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +0 -1
  366. package/dist/build-B6buVrsB.mjs +0 -2
  367. package/dist/cat-RDUMLXKC-CeNrSElK.mjs +0 -1
  368. package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +0 -1
  369. package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +0 -1
  370. package/dist/colors-T3xmlXQT.mjs +0 -1
  371. package/dist/column-WLPMMSTS-6o4DDsDk.mjs +0 -1
  372. package/dist/comm-5SLSESQG-C2GatHU6.mjs +0 -1
  373. package/dist/constants-BWv15Llm.mjs +0 -2
  374. package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +0 -1
  375. package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +0 -1
  376. package/dist/date-DD7FVA2V-Dubgjr6a.mjs +0 -1
  377. package/dist/diff-HJF2MPDN-DjGBLQph.mjs +0 -1
  378. package/dist/dirname-LEMTZZFS-B477CImE.mjs +0 -1
  379. package/dist/dist-Bu-MwAbD.mjs +0 -1
  380. package/dist/du-WO2ENHXQ-C4c5wweW.mjs +0 -1
  381. package/dist/echo-O45JWWI2-TudodhHR.mjs +0 -1
  382. package/dist/env-5EPCWSXR-CTcNEMpy.mjs +0 -1
  383. package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +0 -1
  384. package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +0 -1
  385. package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +0 -1
  386. package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +0 -1
  387. package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +0 -1
  388. package/dist/flag-coverage-QT4N2Z44--nNG-HLV.mjs +0 -2
  389. package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +0 -1
  390. package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +0 -1
  391. package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +0 -1
  392. package/dist/head-HT2B6D2J-BR4RHRTk.mjs +0 -1
  393. package/dist/help-VVWX7SA5-M6C6klSC.mjs +0 -1
  394. package/dist/history-J4QRNGRO-C1r7-kvT.mjs +0 -1
  395. package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +0 -1
  396. package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +0 -1
  397. package/dist/init-B1cOyI0L.mjs +0 -397
  398. package/dist/init-DssmNpgE.mjs +0 -1
  399. package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +0 -1
  400. package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +0 -1
  401. package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +0 -1
  402. package/dist/loader-CHkc9V89.mjs +0 -1
  403. package/dist/loader-CWaAs1JL.mjs +0 -4
  404. package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +0 -1
  405. package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +0 -1
  406. package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +0 -1
  407. package/dist/mrmime-C2W7cgq2.mjs +0 -2
  408. package/dist/mv-Z6MORUFL-CN471qcL.mjs +0 -1
  409. package/dist/nl-U5YJDM32-CFzXKze3.mjs +0 -1
  410. package/dist/od-VJEF2UR5-C2R4Accu.mjs +0 -1
  411. package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +0 -1
  412. package/dist/preview-BjoTulUl.mjs +0 -1
  413. package/dist/printf-CX64KX2P-Ce--gWAq.mjs +0 -1
  414. package/dist/public/assets/ActivityModeContent-BS-F_q5b.js +0 -2
  415. package/dist/public/assets/DocumentContext-CKgn09Wu.js +0 -37
  416. package/dist/public/assets/GraphPanel-BYxZ6mOr.js +0 -46
  417. package/dist/public/assets/McpConsentDialogBody-C-eBNOSk.js +0 -1
  418. package/dist/public/assets/OutlinePanel-B1VwD6nb.js +0 -2
  419. package/dist/public/assets/SettingsPane-Byz_-VcF.js +0 -11
  420. package/dist/public/assets/SourceEditor-CF1C1jlS.js +0 -2
  421. package/dist/public/assets/architecture-YZFGNWBL-BiRl99NU.js +0 -1
  422. package/dist/public/assets/button-qDXa0MxS.js +0 -1
  423. package/dist/public/assets/channel-C0UNiHDS.js +0 -1
  424. package/dist/public/assets/checkbox-kWXLLH40.js +0 -1
  425. package/dist/public/assets/chunk-426QAEUC-BexV_O4G.js +0 -1
  426. package/dist/public/assets/chunk-55IACEB6-yo8vOoww.js +0 -1
  427. package/dist/public/assets/chunk-QZHKN3VN-Dm2czGiD.js +0 -1
  428. package/dist/public/assets/classDiagram-6PBFFD2Q-DqMO_sxB.js +0 -1
  429. package/dist/public/assets/classDiagram-v2-HSJHXN6E-BbC-74zc.js +0 -1
  430. package/dist/public/assets/clone-DpRB82L-.js +0 -1
  431. package/dist/public/assets/config-validation-events-BX5T6Pv4.js +0 -7
  432. package/dist/public/assets/dialog-CV9Q4JrD.js +0 -45
  433. package/dist/public/assets/dist-Bf3rdSRu.js +0 -1
  434. package/dist/public/assets/dist-CSfB7p8y.js +0 -9
  435. package/dist/public/assets/dist-DVWct0HX.js +0 -1
  436. package/dist/public/assets/dist-Gvva1zQ6.js +0 -1
  437. package/dist/public/assets/doc-hash-CfmBVnag.js +0 -421
  438. package/dist/public/assets/gitGraph-7Q5UKJZL-CN7yaTu1.js +0 -1
  439. package/dist/public/assets/index-B4T9ZPge.js +0 -1854
  440. package/dist/public/assets/index-DFiz58v4.css +0 -1
  441. package/dist/public/assets/info-OMHHGYJF-oSrA8B1G.js +0 -1
  442. package/dist/public/assets/isSymbol-C4J31wCa.js +0 -1
  443. package/dist/public/assets/packet-4T2RLAQJ-N-KqWOhj.js +0 -1
  444. package/dist/public/assets/pie-ZZUOXDRM-BcRf7Q2g.js +0 -1
  445. package/dist/public/assets/radar-PYXPWWZC-CqcGRFrW.js +0 -1
  446. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CrJSNsUc.js +0 -1
  447. package/dist/public/assets/stex-DQW679lh.js +0 -1
  448. package/dist/public/assets/tooltip-csUfbEtd.js +0 -1
  449. package/dist/public/assets/treeView-SZITEDCU-B1rO_oUt.js +0 -1
  450. package/dist/public/assets/treemap-W4RFUUIX-DXE3h2Bn.js +0 -1
  451. package/dist/public/assets/wardley-RL74JXVD-ChWi2iyS.js +0 -1
  452. package/dist/pwd-D4OZ7N27-C18XewhV.mjs +0 -1
  453. package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +0 -1
  454. package/dist/rev-XOSYPP45-2mnFFZWW.mjs +0 -1
  455. package/dist/rg-FOQSCCX3-BJahNfSe.mjs +0 -1
  456. package/dist/rm-RTZG23RL-D9-0WGRY.mjs +0 -1
  457. package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +0 -1
  458. package/dist/sed-VFTTATXJ-mYhAmixc.mjs +0 -1
  459. package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +0 -1
  460. package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +0 -1
  461. package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +0 -1
  462. package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +0 -1
  463. package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +0 -1
  464. package/dist/split-SITCSYCZ-b9hfEJw7.mjs +0 -1
  465. package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +0 -1
  466. package/dist/src-B_Vh13Py.mjs +0 -1
  467. package/dist/start-CSRc43Yr.mjs +0 -3
  468. package/dist/start-DVUu2YvT.mjs +0 -1
  469. package/dist/stat-BT5A227F-Dzp4sgau.mjs +0 -1
  470. package/dist/strings-7PLOGTPD-DT41jX9d.mjs +0 -1
  471. package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +0 -1
  472. package/dist/tail-S5ULNTJU-0-sYrYik.mjs +0 -1
  473. package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +0 -1
  474. package/dist/tee-O7VXZDCO-CwnGG0go.mjs +0 -1
  475. package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +0 -1
  476. package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +0 -1
  477. package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +0 -1
  478. package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +0 -1
  479. package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +0 -1
  480. package/dist/true-WHJNXCHG-DxCMVdqj.mjs +0 -1
  481. package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +0 -1
  482. package/dist/uniq-SUNANL47-Ceg51JdA.mjs +0 -1
  483. package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +0 -1
  484. package/dist/which-XZHEH76L-DH_U2-Cj.mjs +0 -1
  485. package/dist/whoami-DGKU3D2X-BholYNPM.mjs +0 -1
  486. package/dist/xan-BXDXYEIB-b1eAtgch.mjs +0 -1
  487. package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +0 -1
  488. package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +0 -1
  489. package/dist/yq-MJMAR36V-1r29nH4p.mjs +0 -1
  490. /package/dist/public/assets/{ActivityPanelDiffView-B_49ivYc.js → ActivityPanelDiffView-DeDaG2lq.js} +0 -0
  491. /package/dist/public/assets/{__vite-browser-external-6Gb3h3lj.js → __vite-browser-external-sCjVW6Bj.js} +0 -0
  492. /package/dist/public/assets/{array-DO1uCttT.js → array-COEOjKUv.js} +0 -0
  493. /package/dist/public/assets/{colors-BjbB2MOj.js → colors-D6LRuSY-.js} +0 -0
  494. /package/dist/public/assets/{cytoscape.esm-AyAnQ5hQ.js → cytoscape.esm-4jw_vW_Q.js} +0 -0
  495. /package/dist/public/assets/{defaultLocale-B6RGN4id.js → defaultLocale-CoF2cqkH.js} +0 -0
  496. /package/dist/public/assets/{dist-0bM9CqzR.js → dist-Bog19bCH.js} +0 -0
  497. /package/dist/public/assets/{go-BRhAdNMM.js → go-wMvjCq97.js} +0 -0
  498. /package/dist/public/assets/{init-BmUWJJHz.js → init-8GNx5phc.js} +0 -0
  499. /package/dist/public/assets/{isObjectLike-CjYO71dq.js → isObjectLike-DFnkciUU.js} +0 -0
  500. /package/dist/public/assets/{katex-DBuiuHex.js → katex-DX-tM4Fr.js} +0 -0
  501. /package/dist/public/assets/{min-CwjSmrJ6.js → min-BiwsSkbB.js} +0 -0
  502. /package/dist/public/assets/{path-CoPyR7c2.js → path-C-grg3CZ.js} +0 -0
  503. /package/dist/public/assets/{pdf-DaFpV-4n.js → pdf-CtJiipL_.js} +0 -0
  504. /package/dist/public/assets/{pdf.worker-Cq62cyp3.js → pdf.worker-BZq-wJdz.js} +0 -0
  505. /package/dist/public/assets/{rough.esm-ec8xsRC7.js → rough.esm-DDK-gphn.js} +0 -0
  506. /package/dist/public/assets/{shell-DT_H80Gx.js → shell-DdhS5_h8.js} +0 -0
  507. /package/dist/public/assets/{src-CWigLjcs.js → src-L3wpjxBL.js} +0 -0
  508. /package/dist/public/assets/{trace-api-CbLDdnQA.js → trace-api-CiCjX4Sz.js} +0 -0
@@ -0,0 +1,422 @@
1
+ import{o as e,r as t,t as n}from"./chunk-CFjPhJqf.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{C as o,d as s,h as c,m as l,s as u,v as d,w as f,x as p}from"./button-C1nwPVFQ.js";import{n as m,t as h}from"./trace-api-CiCjX4Sz.js";import{n as g,t as _}from"./w3c-keyname-B5t0fahT.js";import{t as v}from"./dist-Cg-Qaqw_.js";var y=e(r(),1),b=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},x=[`light`,`dark`],S=`(prefers-color-scheme: dark)`,C=typeof window>`u`,w=y.createContext(void 0),T={setTheme:e=>{},themes:[]},E=()=>y.useContext(w)??T,ee=e=>y.useContext(w)?y.createElement(y.Fragment,null,e.children):y.createElement(ne,{...e}),te=[`light`,`dark`],ne=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=te,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=y.useState(()=>ie(i,o)),[m,h]=y.useState(()=>f===`system`?D():f),g=c?Object.values(c):a,_=y.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=D());let a=c?c[i]:i,l=t?ae(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=x.includes(o)?o:null,t=x.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=y.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),b=y.useCallback(t=>{h(D(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);y.useEffect(()=>{let e=window.matchMedia(S);return e.addListener(b),b(e),()=>e.removeListener(b)},[b]),y.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),y.useEffect(()=>{_(e??f)},[e,f]);let C=y.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return y.createElement(w.Provider,{value:C},y.createElement(re,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},re=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return y.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${b.toString()})(${u})`}})}),ie=(e,t)=>{if(C)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},ae=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},D=e=>(e||=window.matchMedia(S),e.matches?`dark`:`light`),oe=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),se=o(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);Object.freeze({status:`aborted`});function O(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var ce=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},le=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},ue={};function de(e){return e&&Object.assign(ue,e),ue}function fe(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function pe(e,t){return typeof t==`bigint`?t.toString():t}function me(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function he(e){return e==null}function ge(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function _e(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ve=Symbol(`evaluating`);function ye(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ve)return r===void 0&&(r=ve,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function be(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xe(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Se(e){return JSON.stringify(e)}function Ce(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var we=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Te(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ee=me(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function De(e){if(Te(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Te(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Oe(e){return De(e)?{...e}:Array.isArray(e)?[...e]:e}var ke=new Set([`string`,`number`,`symbol`]);function Ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function je(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function k(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Me(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ne={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return je(e,xe(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return be(this,`shape`,e),e},checks:[]}))}function tee(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return je(e,xe(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return be(this,`shape`,r),r},checks:[]}))}function Pe(e,t){if(!De(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return je(e,xe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return be(this,`shape`,n),n}}))}function Fe(e,t){if(!De(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return je(e,xe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return be(this,`shape`,n),n}}))}function Ie(e,t){return je(e,xe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return be(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Le(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return je(t,xe(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return be(this,`shape`,i),i},checks:[]}))}function Re(e,t,n){return je(t,xe(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return be(this,`shape`,i),i}}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Be(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ve(e){return typeof e==`string`?e:e?.message}function He(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Ve(e.inst?._zod.def?.error?.(e))??Ve(t?.error?.(e))??Ve(n.customError?.(e))??Ve(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ue(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function We(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ge=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,pe,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ke=O(`$ZodError`,Ge),qe=O(`$ZodError`,Ge,{Parent:Error});function nee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Je(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var Ye=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ce;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>He(e,a,de())));throw we(t,i?.callee),t}return o.value},Xe=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>He(e,a,de())));throw we(t,i?.callee),t}return o.value},Ze=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ce;return a.issues.length?{success:!1,error:new(e??Ke)(a.issues.map(e=>He(e,i,de())))}:{success:!0,data:a.value}},Qe=Ze(qe),$e=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>He(e,i,de())))}:{success:!0,data:a.value}},et=$e(qe),tt=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ye(e)(t,n,i)},nt=e=>(t,n,r)=>Ye(e)(t,n,r),rt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Xe(e)(t,n,i)},it=e=>async(t,n,r)=>Xe(e)(t,n,r),at=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ze(e)(t,n,i)},ot=e=>(t,n,r)=>Ze(e)(t,n,r),st=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return $e(e)(t,n,i)},ct=e=>async(t,n,r)=>$e(e)(t,n,r),lt=/^[cC][^\s-]{8,}$/,ut=/^[0-9a-z]+$/,dt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ft=/^[0-9a-vA-V]{20}$/,pt=/^[A-Za-z0-9]{27}$/,mt=/^[a-zA-Z0-9_-]{21}$/,ht=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_t=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function bt(){return new RegExp(yt,`u`)}var xt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,St=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ct=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ree=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wt=/^[A-Za-z0-9_-]*$/,aee=/^\+[1-9]\d{6,14}$/,Tt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,oee=RegExp(`^${Tt}$`);function Et(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dt(e){return RegExp(`^${Et(e)}$`)}function Ot(e){let t=Et({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Tt}T(?:${r})$`)}var kt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},At=/^-?\d+$/,jt=/^-?\d+(?:\.\d+)?$/,Mt=/^(?:true|false)$/i,Nt=/^null$/i,Pt=/^[^A-Z]*$/,Ft=/^[^a-z]*$/,It=O(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lt={number:`number`,bigint:`bigint`,object:`date`},Rt=O(`$ZodCheckLessThan`,(e,t)=>{It.init(e,t);let n=Lt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=O(`$ZodCheckGreaterThan`,(e,t)=>{It.init(e,t);let n=Lt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bt=O(`$ZodCheckMultipleOf`,(e,t)=>{It.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):_e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Vt=O(`$ZodCheckNumberFormat`,(e,t)=>{It.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ne[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=At)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ht=O(`$ZodCheckMaxLength`,(e,t)=>{var n;It.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ue(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ut=O(`$ZodCheckMinLength`,(e,t)=>{var n;It.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ue(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wt=O(`$ZodCheckLengthEquals`,(e,t)=>{var n;It.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ue(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gt=O(`$ZodCheckStringFormat`,(e,t)=>{var n,r;It.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kt=O(`$ZodCheckRegex`,(e,t)=>{Gt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qt=O(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Pt,Gt.init(e,t)}),Jt=O(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ft,Gt.init(e,t)}),Yt=O(`$ZodCheckIncludes`,(e,t)=>{It.init(e,t);let n=Ae(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xt=O(`$ZodCheckStartsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`^${Ae(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Zt=O(`$ZodCheckEndsWith`,(e,t)=>{It.init(e,t);let n=RegExp(`.*${Ae(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qt=O(`$ZodCheckOverwrite`,(e,t)=>{It.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),$t=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
+ `))}},en={major:4,minor:3,patch:6},tn=O(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=en;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ze(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ce;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ze(e,t))});else{if(e.issues.length===t)continue;r||=ze(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ze(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ce;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ce;return o.then(e=>t(e,r,a))}return t(o,r,a)}}ye(e,`~standard`,()=>({validate:t=>{try{let n=Qe(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return et(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),nn=O(`$ZodString`,(e,t)=>{tn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),rn=O(`$ZodStringFormat`,(e,t)=>{Gt.init(e,t),nn.init(e,t)}),an=O(`$ZodGUID`,(e,t)=>{t.pattern??=gt,rn.init(e,t)}),on=O(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=_t(e)}else t.pattern??=_t();rn.init(e,t)}),sn=O(`$ZodEmail`,(e,t)=>{t.pattern??=vt,rn.init(e,t)}),cn=O(`$ZodURL`,(e,t)=>{rn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ln=O(`$ZodEmoji`,(e,t)=>{t.pattern??=bt(),rn.init(e,t)}),un=O(`$ZodNanoID`,(e,t)=>{t.pattern??=mt,rn.init(e,t)}),dn=O(`$ZodCUID`,(e,t)=>{t.pattern??=lt,rn.init(e,t)}),fn=O(`$ZodCUID2`,(e,t)=>{t.pattern??=ut,rn.init(e,t)}),pn=O(`$ZodULID`,(e,t)=>{t.pattern??=dt,rn.init(e,t)}),mn=O(`$ZodXID`,(e,t)=>{t.pattern??=ft,rn.init(e,t)}),hn=O(`$ZodKSUID`,(e,t)=>{t.pattern??=pt,rn.init(e,t)}),gn=O(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ot(t),rn.init(e,t)}),see=O(`$ZodISODate`,(e,t)=>{t.pattern??=oee,rn.init(e,t)}),_n=O(`$ZodISOTime`,(e,t)=>{t.pattern??=Dt(t),rn.init(e,t)}),vn=O(`$ZodISODuration`,(e,t)=>{t.pattern??=ht,rn.init(e,t)}),yn=O(`$ZodIPv4`,(e,t)=>{t.pattern??=xt,rn.init(e,t),e._zod.bag.format=`ipv4`}),bn=O(`$ZodIPv6`,(e,t)=>{t.pattern??=St,rn.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),xn=O(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ct,rn.init(e,t)}),Sn=O(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ree,rn.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Cn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var wn=O(`$ZodBase64`,(e,t)=>{t.pattern??=iee,rn.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Cn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Tn(e){if(!wt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var En=O(`$ZodBase64URL`,(e,t)=>{t.pattern??=wt,rn.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Tn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Dn=O(`$ZodE164`,(e,t)=>{t.pattern??=aee,rn.init(e,t)});function On(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var kn=O(`$ZodJWT`,(e,t)=>{rn.init(e,t),e._zod.check=n=>{On(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),An=O(`$ZodNumber`,(e,t)=>{tn.init(e,t),e._zod.pattern=e._zod.bag.pattern??jt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),jn=O(`$ZodNumberFormat`,(e,t)=>{Vt.init(e,t),An.init(e,t)}),Mn=O(`$ZodBoolean`,(e,t)=>{tn.init(e,t),e._zod.pattern=Mt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Nn=O(`$ZodNull`,(e,t)=>{tn.init(e,t),e._zod.pattern=Nt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Pn=O(`$ZodUnknown`,(e,t)=>{tn.init(e,t),e._zod.parse=e=>e}),Fn=O(`$ZodNever`,(e,t)=>{tn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function In(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}var Ln=O(`$ZodArray`,(e,t)=>{tn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>In(t,n,e))):In(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Rn(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Be(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function zn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Me(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Bn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Rn(e,n,i,t,u))):Rn(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Vn=O(`$ZodObject`,(e,t)=>{if(tn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=me(()=>zn(t));ye(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Te,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Rn(n,t,e,s,r))):Rn(i,t,e,s,r)}return i?Bn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Hn=O(`$ZodObjectJIT`,(e,t)=>{Vn.init(e,t);let n=e._zod.parse,r=me(()=>zn(t)),i=e=>{let t=new $t([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Se(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Se(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
4
+ if (${n}.issues.length) {
5
+ if (${o} in input) {
6
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${n}.value === undefined) {
14
+ if (${o} in input) {
15
+ newResult[${o}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${o}] = ${n}.value;
19
+ }
20
+
21
+ `):t.write(`
22
+ if (${n}.issues.length) {
23
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ })));
27
+ }
28
+
29
+ if (${n}.value === undefined) {
30
+ if (${o} in input) {
31
+ newResult[${o}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${o}] = ${n}.value;
35
+ }
36
+
37
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Te,s=!ue.jitless,c=s&&Ee.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Bn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Un(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ze(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>He(e,r,de())))}),t)}var Wn=O(`$ZodUnion`,(e,t)=>{tn.init(e,t),ye(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ye(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ye(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ye(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ge(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Un(t,i,e,a)):Un(s,i,e,a)}}),Gn=O(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Wn.init(e,t);let n=e._zod.parse;ye(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=me(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Te(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Kn=O(`$ZodIntersection`,(e,t)=>{tn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Jn(e,t,n)):Jn(e,i,a)}});function qn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(De(e)&&De(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=qn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=qn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ze(e))return e;let o=qn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Yn=O(`$ZodRecord`,(e,t)=>{tn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!De(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Be(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Be(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&jt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>He(e,r,de())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Be(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Be(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Xn=O(`$ZodEnum`,(e,t)=>{tn.init(e,t);let n=fe(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ke.has(typeof e)).map(e=>typeof e==`string`?Ae(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Zn=O(`$ZodLiteral`,(e,t)=>{if(tn.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ae(e):e?Ae(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Qn=O(`$ZodTransform`,(e,t)=>{tn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new le(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ce;return n.value=i,n}});function $n(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var er=O(`$ZodOptional`,(e,t)=>{tn.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ye(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ye(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ge(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>$n(t,e.value)):$n(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),tr=O(`$ZodExactOptional`,(e,t)=>{er.init(e,t),ye(e._zod,`values`,()=>t.innerType._zod.values),ye(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),nr=O(`$ZodNullable`,(e,t)=>{tn.init(e,t),ye(e._zod,`optin`,()=>t.innerType._zod.optin),ye(e._zod,`optout`,()=>t.innerType._zod.optout),ye(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ge(e.source)}|null)$`):void 0}),ye(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),rr=O(`$ZodDefault`,(e,t)=>{tn.init(e,t),e._zod.optin=`optional`,ye(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ir(e,t)):ir(r,t)}});function ir(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ar=O(`$ZodPrefault`,(e,t)=>{tn.init(e,t),e._zod.optin=`optional`,ye(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),or=O(`$ZodNonOptional`,(e,t)=>{tn.init(e,t),ye(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>sr(t,e)):sr(i,e)}});function sr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var cr=O(`$ZodCatch`,(e,t)=>{tn.init(e,t),ye(e._zod,`optin`,()=>t.innerType._zod.optin),ye(e._zod,`optout`,()=>t.innerType._zod.optout),ye(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>He(e,n,de()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>He(e,n,de()))},input:e.value}),e.issues=[]),e)}}),lr=O(`$ZodPipe`,(e,t)=>{tn.init(e,t),ye(e._zod,`values`,()=>t.in._zod.values),ye(e._zod,`optin`,()=>t.in._zod.optin),ye(e._zod,`optout`,()=>t.out._zod.optout),ye(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ur(e,t.in,n)):ur(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ur(e,t.out,n)):ur(r,t.out,n)}});function ur(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var dr=O(`$ZodReadonly`,(e,t)=>{tn.init(e,t),ye(e._zod,`propValues`,()=>t.innerType._zod.propValues),ye(e._zod,`values`,()=>t.innerType._zod.values),ye(e._zod,`optin`,()=>t.innerType?._zod?.optin),ye(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(fr):fr(r)}});function fr(e){return e.value=Object.freeze(e.value),e}var pr=O(`$ZodCustom`,(e,t)=>{It.init(e,t),tn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>mr(t,n,r,e));mr(i,n,r,e)}});function mr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(We(e))}}var hr,gr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function _r(){return new gr}(hr=globalThis).__zod_globalRegistry??(hr.__zod_globalRegistry=_r());var vr=globalThis.__zod_globalRegistry;function yr(e,t){return new e({type:`string`,...k(t)})}function br(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...k(t)})}function xr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...k(t)})}function Sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...k(t)})}function Cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...k(t)})}function wr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...k(t)})}function Tr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...k(t)})}function Er(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...k(t)})}function Dr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...k(t)})}function Or(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...k(t)})}function kr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...k(t)})}function cee(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...k(t)})}function lee(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...k(t)})}function uee(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...k(t)})}function dee(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...k(t)})}function fee(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...k(t)})}function pee(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...k(t)})}function mee(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...k(t)})}function hee(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...k(t)})}function gee(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...k(t)})}function _ee(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...k(t)})}function vee(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...k(t)})}function yee(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...k(t)})}function bee(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...k(t)})}function xee(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...k(t)})}function See(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...k(t)})}function Cee(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...k(t)})}function wee(e,t){return new e({type:`number`,checks:[],...k(t)})}function Tee(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...k(t)})}function Eee(e,t){return new e({type:`boolean`,...k(t)})}function Dee(e,t){return new e({type:`null`,...k(t)})}function Oee(e){return new e({type:`unknown`})}function kee(e,t){return new e({type:`never`,...k(t)})}function Ar(e,t){return new Rt({check:`less_than`,...k(t),value:e,inclusive:!1})}function jr(e,t){return new Rt({check:`less_than`,...k(t),value:e,inclusive:!0})}function Mr(e,t){return new zt({check:`greater_than`,...k(t),value:e,inclusive:!1})}function Nr(e,t){return new zt({check:`greater_than`,...k(t),value:e,inclusive:!0})}function Pr(e,t){return new Bt({check:`multiple_of`,...k(t),value:e})}function Fr(e,t){return new Ht({check:`max_length`,...k(t),maximum:e})}function Ir(e,t){return new Ut({check:`min_length`,...k(t),minimum:e})}function Lr(e,t){return new Wt({check:`length_equals`,...k(t),length:e})}function Rr(e,t){return new Kt({check:`string_format`,format:`regex`,...k(t),pattern:e})}function zr(e){return new qt({check:`string_format`,format:`lowercase`,...k(e)})}function Br(e){return new Jt({check:`string_format`,format:`uppercase`,...k(e)})}function Vr(e,t){return new Yt({check:`string_format`,format:`includes`,...k(t),includes:e})}function Hr(e,t){return new Xt({check:`string_format`,format:`starts_with`,...k(t),prefix:e})}function Ur(e,t){return new Zt({check:`string_format`,format:`ends_with`,...k(t),suffix:e})}function Wr(e){return new Qt({check:`overwrite`,tx:e})}function Gr(e){return Wr(t=>t.normalize(e))}function Kr(){return Wr(e=>e.trim())}function qr(){return Wr(e=>e.toLowerCase())}function Jr(){return Wr(e=>e.toUpperCase())}function Yr(){return Wr(e=>Ce(e))}function Xr(e,t,n){return new e({type:`array`,element:t,...k(n)})}function Zr(e,t,n){let r=k(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Qr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...k(n)})}function $r(e){let t=ei(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(We(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(We(r))}},e(n.value,n)));return t}function ei(e,t){let n=new It({check:`custom`,...k(t)});return n._zod.check=e,n}function ti(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??vr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ni(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ni(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&ai(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ri(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
38
+
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ii(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:si(t,`input`,e.processors),output:si(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ai(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ai(r.element,n);if(r.type===`set`)return ai(r.valueType,n);if(r.type===`lazy`)return ai(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return ai(r.innerType,n);if(r.type===`intersection`)return ai(r.left,n)||ai(r.right,n);if(r.type===`record`||r.type===`map`)return ai(r.keyType,n)||ai(r.valueType,n);if(r.type===`pipe`)return ai(r.in,n)||ai(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ai(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ai(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ai(e,n))return!0;return!!(r.rest&&ai(r.rest,n))}return!1}var oi=(e,t={})=>n=>{let r=ti({...n,processors:t});return ni(e,r),ri(r,e),ii(r,e)},si=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ti({...i??{},target:a,io:t,processors:n});return ni(e,o),ri(o,e),ii(o,e)},ci={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},li=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ci[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ui=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},di=(e,t,n,r)=>{n.type=`boolean`},fi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pi=(e,t,n,r)=>{n.not={}},mi=(e,t,n,r)=>{let i=e._zod.def,a=fe(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},hi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},gi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},_i=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},vi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ni(a.element,t,{...r,path:[...r.path,`items`]})},yi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ni(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ni(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},bi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ni(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},xi=(e,t,n,r)=>{let i=e._zod.def,a=ni(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ni(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Si=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ni(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ni(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ni(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ci=(e,t,n,r)=>{let i=e._zod.def,a=ni(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},wi=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ti=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ei=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Di=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Oi=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;ni(a,t,r);let o=t.seen.get(e);o.ref=a},ki=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ai=(e,t,n,r)=>{let i=e._zod.def;ni(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ji=O(`ZodISODateTime`,(e,t)=>{gn.init(e,t),na.init(e,t)});function Mi(e){return bee(ji,e)}var Ni=O(`ZodISODate`,(e,t)=>{see.init(e,t),na.init(e,t)});function Pi(e){return xee(Ni,e)}var Fi=O(`ZodISOTime`,(e,t)=>{_n.init(e,t),na.init(e,t)});function Ii(e){return See(Fi,e)}var Li=O(`ZodISODuration`,(e,t)=>{vn.init(e,t),na.init(e,t)});function Ri(e){return Cee(Li,e)}var zi=(e,t)=>{Ke.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Je(e,t)},flatten:{value:t=>nee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,pe,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,pe,2)}},isEmpty:{get(){return e.issues.length===0}}})};O(`ZodError`,zi);var Bi=O(`ZodError`,zi,{Parent:Error}),Vi=Ye(Bi),Hi=Xe(Bi),Ui=Ze(Bi),Wi=$e(Bi),Gi=tt(Bi),Ki=nt(Bi),qi=rt(Bi),Ji=it(Bi),Yi=at(Bi),Xi=ot(Bi),Zi=st(Bi),Qi=ct(Bi),$i=O(`ZodType`,(e,t)=>(tn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:si(e,`input`),output:si(e,`output`)}}),e.toJSONSchema=oi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(xe(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>je(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),e.refine=(t,n)=>e.check(_o(t,n)),e.superRefine=t=>e.check(vo(t)),e.overwrite=t=>e.check(Wr(t)),e.optional=()=>Za(e),e.exactOptional=()=>$a(e),e.nullable=()=>to(e),e.nullish=()=>Za(to(e)),e.nonoptional=t=>so(e,t),e.array=()=>M(e),e.or=t=>La([e,t]),e.and=t=>Va(e,t),e.transform=t=>fo(e,Ya(t)),e.default=t=>ro(e,t),e.prefault=t=>ao(e,t),e.catch=t=>lo(e,t),e.pipe=t=>fo(e,t),e.readonly=()=>mo(e),e.describe=t=>{let n=e.clone();return vr.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return vr.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return vr.get(e);let n=e.clone();return vr.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),ea=O(`_ZodString`,(e,t)=>{nn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Rr(...t)),e.includes=(...t)=>e.check(Vr(...t)),e.startsWith=(...t)=>e.check(Hr(...t)),e.endsWith=(...t)=>e.check(Ur(...t)),e.min=(...t)=>e.check(Ir(...t)),e.max=(...t)=>e.check(Fr(...t)),e.length=(...t)=>e.check(Lr(...t)),e.nonempty=(...t)=>e.check(Ir(1,...t)),e.lowercase=t=>e.check(zr(t)),e.uppercase=t=>e.check(Br(t)),e.trim=()=>e.check(Kr()),e.normalize=(...t)=>e.check(Gr(...t)),e.toLowerCase=()=>e.check(qr()),e.toUpperCase=()=>e.check(Jr()),e.slugify=()=>e.check(Yr())}),ta=O(`ZodString`,(e,t)=>{nn.init(e,t),ea.init(e,t),e.email=t=>e.check(br(ra,t)),e.url=t=>e.check(Er(oa,t)),e.jwt=t=>e.check(yee(xa,t)),e.emoji=t=>e.check(Dr(sa,t)),e.guid=t=>e.check(xr(ia,t)),e.uuid=t=>e.check(Sr(aa,t)),e.uuidv4=t=>e.check(Cr(aa,t)),e.uuidv6=t=>e.check(wr(aa,t)),e.uuidv7=t=>e.check(Tr(aa,t)),e.nanoid=t=>e.check(Or(ca,t)),e.guid=t=>e.check(xr(ia,t)),e.cuid=t=>e.check(kr(la,t)),e.cuid2=t=>e.check(cee(ua,t)),e.ulid=t=>e.check(lee(da,t)),e.base64=t=>e.check(gee(va,t)),e.base64url=t=>e.check(_ee(ya,t)),e.xid=t=>e.check(uee(fa,t)),e.ksuid=t=>e.check(dee(pa,t)),e.ipv4=t=>e.check(fee(ma,t)),e.ipv6=t=>e.check(pee(ha,t)),e.cidrv4=t=>e.check(mee(ga,t)),e.cidrv6=t=>e.check(hee(_a,t)),e.e164=t=>e.check(vee(ba,t)),e.datetime=t=>e.check(Mi(t)),e.date=t=>e.check(Pi(t)),e.time=t=>e.check(Ii(t)),e.duration=t=>e.check(Ri(t))});function A(e){return yr(ta,e)}var na=O(`ZodStringFormat`,(e,t)=>{rn.init(e,t),ea.init(e,t)}),ra=O(`ZodEmail`,(e,t)=>{sn.init(e,t),na.init(e,t)}),ia=O(`ZodGUID`,(e,t)=>{an.init(e,t),na.init(e,t)}),aa=O(`ZodUUID`,(e,t)=>{on.init(e,t),na.init(e,t)}),oa=O(`ZodURL`,(e,t)=>{cn.init(e,t),na.init(e,t)}),sa=O(`ZodEmoji`,(e,t)=>{ln.init(e,t),na.init(e,t)}),ca=O(`ZodNanoID`,(e,t)=>{un.init(e,t),na.init(e,t)}),la=O(`ZodCUID`,(e,t)=>{dn.init(e,t),na.init(e,t)}),ua=O(`ZodCUID2`,(e,t)=>{fn.init(e,t),na.init(e,t)}),da=O(`ZodULID`,(e,t)=>{pn.init(e,t),na.init(e,t)}),fa=O(`ZodXID`,(e,t)=>{mn.init(e,t),na.init(e,t)}),pa=O(`ZodKSUID`,(e,t)=>{hn.init(e,t),na.init(e,t)}),ma=O(`ZodIPv4`,(e,t)=>{yn.init(e,t),na.init(e,t)}),ha=O(`ZodIPv6`,(e,t)=>{bn.init(e,t),na.init(e,t)}),ga=O(`ZodCIDRv4`,(e,t)=>{xn.init(e,t),na.init(e,t)}),_a=O(`ZodCIDRv6`,(e,t)=>{Sn.init(e,t),na.init(e,t)}),va=O(`ZodBase64`,(e,t)=>{wn.init(e,t),na.init(e,t)}),ya=O(`ZodBase64URL`,(e,t)=>{En.init(e,t),na.init(e,t)}),ba=O(`ZodE164`,(e,t)=>{Dn.init(e,t),na.init(e,t)}),xa=O(`ZodJWT`,(e,t)=>{kn.init(e,t),na.init(e,t)}),Sa=O(`ZodNumber`,(e,t)=>{An.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.gt=(t,n)=>e.check(Mr(t,n)),e.gte=(t,n)=>e.check(Nr(t,n)),e.min=(t,n)=>e.check(Nr(t,n)),e.lt=(t,n)=>e.check(Ar(t,n)),e.lte=(t,n)=>e.check(jr(t,n)),e.max=(t,n)=>e.check(jr(t,n)),e.int=t=>e.check(wa(t)),e.safe=t=>e.check(wa(t)),e.positive=t=>e.check(Mr(0,t)),e.nonnegative=t=>e.check(Nr(0,t)),e.negative=t=>e.check(Ar(0,t)),e.nonpositive=t=>e.check(jr(0,t)),e.multipleOf=(t,n)=>e.check(Pr(t,n)),e.step=(t,n)=>e.check(Pr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function j(e){return wee(Sa,e)}var Ca=O(`ZodNumberFormat`,(e,t)=>{jn.init(e,t),Sa.init(e,t)});function wa(e){return Tee(Ca,e)}var Ta=O(`ZodBoolean`,(e,t)=>{Mn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function Ea(e){return Eee(Ta,e)}var Da=O(`ZodNull`,(e,t)=>{Nn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r)});function Oa(e){return Dee(Da,e)}var ka=O(`ZodUnknown`,(e,t)=>{Pn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Aa(){return Oee(ka)}var ja=O(`ZodNever`,(e,t)=>{Fn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function Ma(e){return kee(ja,e)}var Na=O(`ZodArray`,(e,t)=>{Ln.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Ir(t,n)),e.nonempty=t=>e.check(Ir(1,t)),e.max=(t,n)=>e.check(Fr(t,n)),e.length=(t,n)=>e.check(Lr(t,n)),e.unwrap=()=>e.element});function M(e,t){return Xr(Na,e,t)}var Pa=O(`ZodObject`,(e,t)=>{Hn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),ye(e,`shape`,()=>t.shape),e.keyof=()=>Ga(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Aa()}),e.loose=()=>e.clone({...e._zod.def,catchall:Aa()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ma()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Pe(e,t),e.safeExtend=t=>Fe(e,t),e.merge=t=>Ie(e,t),e.pick=t=>eee(e,t),e.omit=t=>tee(e,t),e.partial=(...t)=>Le(Xa,e,t[0]),e.required=(...t)=>Re(oo,e,t[0])});function N(e,t){return new Pa({type:`object`,shape:e??{},...k(t)})}function Fa(e,t){return new Pa({type:`object`,shape:e,catchall:Aa(),...k(t)})}var Ia=O(`ZodUnion`,(e,t)=>{Wn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.options=t.options});function La(e,t){return new Ia({type:`union`,options:e,...k(t)})}var Ra=O(`ZodDiscriminatedUnion`,(e,t)=>{Ia.init(e,t),Gn.init(e,t)});function za(e,t,n){return new Ra({type:`union`,options:t,discriminator:e,...k(n)})}var Ba=O(`ZodIntersection`,(e,t)=>{Kn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r)});function Va(e,t){return new Ba({type:`intersection`,left:e,right:t})}var Ha=O(`ZodRecord`,(e,t)=>{Yn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ua(e,t,n){return new Ha({type:`record`,keyType:e,valueType:t,...k(n)})}var Wa=O(`ZodEnum`,(e,t)=>{Xn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Wa({...t,checks:[],...k(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Wa({...t,checks:[],...k(r),entries:i})}});function Ga(e,t){return new Wa({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...k(t)})}var Ka=O(`ZodLiteral`,(e,t)=>{Zn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qa(e,t){return new Ka({type:`literal`,values:Array.isArray(e)?e:[e],...k(t)})}var Ja=O(`ZodTransform`,(e,t)=>{Qn.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new le(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(We(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(We(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ya(e){return new Ja({type:`transform`,transform:e})}var Xa=O(`ZodOptional`,(e,t)=>{er.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`optional`,innerType:e})}var Qa=O(`ZodExactOptional`,(e,t)=>{tr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`optional`,innerType:e})}var eo=O(`ZodNullable`,(e,t)=>{nr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e){return new eo({type:`nullable`,innerType:e})}var no=O(`ZodDefault`,(e,t)=>{rr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ro(e,t){return new no({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Oe(t)}})}var io=O(`ZodPrefault`,(e,t)=>{ar.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e,t){return new io({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Oe(t)}})}var oo=O(`ZodNonOptional`,(e,t)=>{or.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e,t){return new oo({type:`nonoptional`,innerType:e,...k(t)})}var co=O(`ZodCatch`,(e,t)=>{cr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lo(e,t){return new co({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var uo=O(`ZodPipe`,(e,t)=>{lr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.in=t.in,e.out=t.out});function fo(e,t){return new uo({type:`pipe`,in:e,out:t})}var po=O(`ZodReadonly`,(e,t)=>{dr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mo(e){return new po({type:`readonly`,innerType:e})}var ho=O(`ZodCustom`,(e,t)=>{pr.init(e,t),$i.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function go(e,t){return Zr(ho,e??(()=>!0),t)}function _o(e,t={}){return Qr(ho,e,t)}function vo(e){return $r(e)}var yo=i(),bo=e(f(),1),xo=a(),So=Symbol.for(`yaml.alias`),Co=Symbol.for(`yaml.document`),wo=Symbol.for(`yaml.map`),To=Symbol.for(`yaml.pair`),Eo=Symbol.for(`yaml.scalar`),Do=Symbol.for(`yaml.seq`),Oo=Symbol.for(`yaml.node.type`),ko=e=>!!e&&typeof e==`object`&&e[Oo]===So,Ao=e=>!!e&&typeof e==`object`&&e[Oo]===Co,jo=e=>!!e&&typeof e==`object`&&e[Oo]===wo,Mo=e=>!!e&&typeof e==`object`&&e[Oo]===To,No=e=>!!e&&typeof e==`object`&&e[Oo]===Eo,Po=e=>!!e&&typeof e==`object`&&e[Oo]===Do;function Fo(e){if(e&&typeof e==`object`)switch(e[Oo]){case wo:case Do:return!0}return!1}function Io(e){if(e&&typeof e==`object`)switch(e[Oo]){case So:case wo:case Eo:case Do:return!0}return!1}var Lo=e=>(No(e)||Fo(e))&&!!e.anchor,Ro=Symbol(`break visit`),zo=Symbol(`skip children`),Bo=Symbol(`remove node`);function Vo(e,t){let n=Go(t);Ao(e)?Ho(null,e.contents,n,Object.freeze([e]))===Bo&&(e.contents=null):Ho(null,e,n,Object.freeze([]))}Vo.BREAK=Ro,Vo.SKIP=zo,Vo.REMOVE=Bo;function Ho(e,t,n,r){let i=Ko(e,t,n,r);if(Io(i)||Mo(i))return qo(e,r,i),Ho(e,i,n,r);if(typeof i!=`symbol`){if(Fo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Ho(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Ro)return Ro;else i===Bo&&(t.items.splice(e,1),--e)}}else if(Mo(t)){r=Object.freeze(r.concat(t));let e=Ho(`key`,t.key,n,r);if(e===Ro)return Ro;e===Bo&&(t.key=null);let i=Ho(`value`,t.value,n,r);if(i===Ro)return Ro;i===Bo&&(t.value=null)}}return i}async function Uo(e,t){let n=Go(t);Ao(e)?await Wo(null,e.contents,n,Object.freeze([e]))===Bo&&(e.contents=null):await Wo(null,e,n,Object.freeze([]))}Uo.BREAK=Ro,Uo.SKIP=zo,Uo.REMOVE=Bo;async function Wo(e,t,n,r){let i=await Ko(e,t,n,r);if(Io(i)||Mo(i))return qo(e,r,i),Wo(e,i,n,r);if(typeof i!=`symbol`){if(Fo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Wo(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Ro)return Ro;else i===Bo&&(t.items.splice(e,1),--e)}}else if(Mo(t)){r=Object.freeze(r.concat(t));let e=await Wo(`key`,t.key,n,r);if(e===Ro)return Ro;e===Bo&&(t.key=null);let i=await Wo(`value`,t.value,n,r);if(i===Ro)return Ro;i===Bo&&(t.value=null)}}return i}function Go(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Ko(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(jo(t))return n.Map?.(e,t,r);if(Po(t))return n.Seq?.(e,t,r);if(Mo(t))return n.Pair?.(e,t,r);if(No(t))return n.Scalar?.(e,t,r);if(ko(t))return n.Alias?.(e,t,r)}function qo(e,t,n){let r=t[t.length-1];if(Fo(r))r.items[e]=n;else if(Mo(r))e===`key`?r.key=n:r.value=n;else if(Ao(r))r.contents=n;else{let e=ko(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Jo={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Yo=e=>e.replace(/[!,[\]{}]/g,e=>Jo[e]),Xo=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Yo(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Io(e.contents)){let t={};Vo(e.contents,(e,n)=>{Io(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
40
+ `)}};Xo.defaultYaml={explicit:!1,version:`1.2`},Xo.defaultTags={"!!":`tag:yaml.org,2002:`};function Zo(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Qo(e){let t=new Set;return Vo(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function $o(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function es(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Qo(e);let a=$o(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(No(t.node)||Fo(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function ts(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=ts(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=ts(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=ts(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=ts(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function ns(e,t,n){if(Array.isArray(e))return e.map((e,t)=>ns(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Lo(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var rs=class{constructor(e){Object.defineProperty(this,Oo,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Ao(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=ns(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?ts(i,{"":o},``,o):o}},is=class extends rs{constructor(e){super(So),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Vo(e,{Node:(e,t)=>{(ko(t)||Lo(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(ns(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=as(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Zo(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function as(e,t,n){if(ko(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Fo(t)){let r=0;for(let i of t.items){let t=as(e,i,n);t>r&&(r=t)}return r}else if(Mo(t)){let r=as(e,t.key,n),i=as(e,t.value,n);return Math.max(r,i)}return 1}var ss=e=>!e||typeof e!=`function`&&typeof e!=`object`,P=class extends rs{constructor(e){super(Eo),this.value=e}toJSON(e,t){return t?.keep?this.value:ns(this.value,e,t)}toString(){return String(this.value)}};P.BLOCK_FOLDED=`BLOCK_FOLDED`,P.BLOCK_LITERAL=`BLOCK_LITERAL`,P.PLAIN=`PLAIN`,P.QUOTE_DOUBLE=`QUOTE_DOUBLE`,P.QUOTE_SINGLE=`QUOTE_SINGLE`;var cs=`tag:yaml.org,2002:`;function ls(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function us(e,t,n){if(Ao(e)&&(e=e.contents),Io(e))return e;if(Mo(e)){let t=n.schema[wo].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new is(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=cs+t.slice(2));let l=ls(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new P(e);return c&&(c.node=t),t}l=e instanceof Map?o[wo]:Symbol.iterator in Object(e)?o[Do]:o[wo]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new P(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function ds(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return us(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var fs=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,ps=class extends rs{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Io(t)||Mo(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(fs(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Fo(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ds(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Fo(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&No(i)?i.value:i:Fo(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Mo(t))return!1;let n=t.value;return n==null||e&&No(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Fo(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Fo(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,ds(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},ms=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function hs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var gs=(e,t,n)=>e.endsWith(`
41
+ `)?hs(n,t):n.includes(`
42
+ `)?`
43
+ `+hs(n,t):(e.endsWith(` `)?``:` `)+n,_s=`flow`,vs=`block`,ys=`quoted`;function bs(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=xs(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
44
+ `)n===`block`&&(h=xs(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
45
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
46
+ `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function xs(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
47
+ `);r=t,i=t+1,a=e[i]}return r}var Ss=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Cs=e=>/^(%|---|\.\.\.)/m.test(e);function ws(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
48
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Ts(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Cs(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
49
+
50
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
51
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:bs(o,a,ys,Ss(t,!1))}function Es(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
52
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Ts(e,t);let n=t.indent||(Cs(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:bs(r,n,_s,Ss(t,!1))}function Ds(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Ts;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Es:i&&!t?Ts:n?Es:Ts}return r(e,t)}var Os;try{Os=RegExp(`(^|(?<!
53
+ ))
54
+ +(?!
55
+ |$)`,`g`)}catch{Os=/\n+(?!\n|$)/g}function ks({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Ds(n,r);let l=r.indent||(r.forceBlockIndent||Cs(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===P.BLOCK_FOLDED?!1:t===P.BLOCK_LITERAL?!0:!ws(n,c,l.length);if(!n)return u?`|
56
+ `:`>
57
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
58
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
59
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
60
+ `&&(p=p.slice(0,-1)),p.replace(Os,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
61
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
62
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=Ss(r,!0);o!==`folded`&&t!==P.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=bs(`${v}${e}${p}`,l,vs,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function As(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
63
+ `)||u&&/[[\]{},]/.test(a))return Ds(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
64
+ `)?Ds(a,t):ks(e,t,n,r);if(!s&&!u&&i!==P.PLAIN&&a.includes(`
65
+ `))return ks(e,t,n,r);if(Cs(a)){if(c===``)return t.forceBlockIndent=!0,ks(e,t,n,r);if(s&&c===l)return Ds(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Ds(a,t)}return s?d:bs(d,c,_s,Ss(t,!1))}function js(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==P.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=P.QUOTE_DOUBLE);let c=e=>{switch(e){case P.BLOCK_FOLDED:case P.BLOCK_LITERAL:return i||a?Ds(o.value,t):ks(o,t,n,r);case P.QUOTE_DOUBLE:return Ts(o.value,t);case P.QUOTE_SINGLE:return Es(o.value,t);case P.PLAIN:return As(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Ms(e,t){let n=Object.assign({blockQuote:!0,commentString:ms,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Ns(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(No(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Ps(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(No(e)||Fo(e))&&e.anchor;a&&Zo(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Fs(e,t,n,r){if(Mo(e))return e.toString(t,n,r);if(ko(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Io(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Ns(t.doc.schema.tags,a);let o=Ps(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):No(a)?js(a,t,n,r):a.toString(t,n,r);return o?No(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Is({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Io(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Fo(e)||!Io(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Fo(e)||(No(e)?e.type===P.BLOCK_FOLDED||e.type===P.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Fs(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=gs(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=gs(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=gs(g,n.indent,l(f))));let _,v,y;Io(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&No(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Po(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Fs(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
66
+ `:``,v){let e=l(v);S+=`\n${hs(e,n.indent)}`}x===``&&!n.inFlow?S===`
67
+ `&&y&&(S=`
68
+
69
+ `):S+=`\n${n.indent}`}else if(!p&&Fo(t)){let e=x[0],r=x.indexOf(`
70
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
71
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=gs(g,n.indent,l(y)):h&&i&&i(),g}function Ls(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Rs=`<<`,zs={identify:e=>e===Rs||typeof e==`symbol`&&e.description===Rs,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new P(Symbol(Rs)),{addToJSMap:Vs}),stringify:()=>Rs},Bs=(e,t)=>(zs.identify(t)||No(t)&&(!t.type||t.type===P.PLAIN)&&zs.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===zs.tag&&e.default);function Vs(e,t,n){if(n=e&&ko(n)?n.resolve(e.doc):n,Po(n))for(let r of n.items)Hs(e,t,r);else if(Array.isArray(n))for(let r of n)Hs(e,t,r);else Hs(e,t,n)}function Hs(e,t,n){let r=e&&ko(n)?n.resolve(e.doc):n;if(!jo(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Us(e,t,{key:n,value:r}){if(Io(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Bs(e,n))Vs(e,t,r);else{let i=ns(n,``,e);if(t instanceof Map)t.set(i,ns(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Ws(n,i,e),o=ns(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Ws(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Io(e)&&n?.doc){let t=Ms(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Ls(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Gs(e,t,n){return new Ks(us(e,void 0,n),us(t,void 0,n))}var Ks=class e{constructor(e,t=null){Object.defineProperty(this,Oo,{value:To}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Io(n)&&(n=n.clone(t)),Io(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Us(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Is(this,e,t,n):JSON.stringify(this)}};function qs(e,t,n){return(t.inFlow??e.flow?Ys:Js)(e,t,n)}function Js({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Io(i))!d&&i.spaceBefore&&f.push(``),Xs(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Mo(i)){let e=Io(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Xs(n,f,e.commentBefore,d))}d=!1;let s=Fs(i,u,()=>o=null,()=>d=!0);o&&(s+=gs(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
72
+ `}}return e?(p+=`
73
+ `+hs(l(e),c),s&&s()):d&&o&&o(),p}function Ys({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Io(i))i.spaceBefore&&d.push(``),Xs(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Mo(i)){let e=Io(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Xs(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Io(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Fs(i,c,()=>a=null);l||=d.length>u||o.includes(`
74
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=gs(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
75
+ `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Xs({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=hs(t(r),e);n.push(i.trimStart())}}function Zs(e,t){let n=No(t)?t.value:t;for(let r of e)if(Mo(r)&&(r.key===t||r.key===n||No(r.key)&&r.key.value===n))return r}var Qs=class extends ps{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(wo,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Gs(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Mo(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Ks(e,e?.value):new Ks(e.key,e.value);let r=Zs(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);No(r.value)&&ss(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Zs(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Zs(this.items,e)?.value;return(!t&&No(n)?n.value:n)??void 0}has(e){return!!Zs(this.items,e)}set(e,t){this.add(new Ks(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Us(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Mo(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),qs(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},$s={collection:`map`,default:!0,nodeClass:Qs,tag:`tag:yaml.org,2002:map`,resolve(e,t){return jo(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Qs.from(e,t,n)},ec=class extends ps{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Do,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=tc(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=tc(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&No(r)?r.value:r}has(e){let t=tc(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=tc(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];No(r)&&ss(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(ns(e,String(r++),t));return n}toString(e,t,n){return e?qs(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(us(a,void 0,n))}}return i}};function tc(e){let t=No(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var nc={collection:`seq`,default:!0,nodeClass:ec,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Po(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>ec.from(e,t,n)},rc={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),js(e,t,n,r)}},ic={identify:e=>e==null,createNode:()=>new P(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new P(null),stringify:({source:e},t)=>typeof e==`string`&&ic.test.test(e)?e:t.options.nullStr},ac={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new P(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&ac.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function oc({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var sc={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:oc},cc={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():oc(e)}},lc={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new P(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:oc},uc=e=>typeof e==`bigint`||Number.isInteger(e),dc=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function fc(e,t,n){let{value:r}=e;return uc(r)&&r>=0?n+r.toString(t):oc(e)}var pc={identify:e=>uc(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>dc(e,2,8,n),stringify:e=>fc(e,8,`0o`)},mc={identify:uc,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>dc(e,0,10,n),stringify:oc},hc={identify:e=>uc(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>dc(e,2,16,n),stringify:e=>fc(e,16,`0x`)},Aee=[$s,nc,rc,ic,ac,pc,mc,hc,sc,cc,lc];function gc(e){return typeof e==`bigint`||Number.isInteger(e)}var _c=({value:e})=>JSON.stringify(e),jee=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:_c},{identify:e=>e==null,createNode:()=>new P(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:_c},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:_c},{identify:gc,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>gc(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:_c}],Mee=[$s,nc].concat(jee,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),vc={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=P.BLOCK_LITERAL,t!==P.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===P.BLOCK_LITERAL?`
76
+ `:` `)}return js({comment:e,type:t,value:s},r,i,a)}};function yc(e,t){if(Po(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Mo(r)){if(jo(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Ks(new P(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Mo(r)?r:new Ks(r)}}else t(`Expected a sequence for this tag`);return e}function bc(e,t,n){let{replacer:r}=n,i=new ec(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Gs(o,s,n))}return i}var xc={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:yc,createNode:bc},Sc=class e extends ec{constructor(){super(),this.add=Qs.prototype.add.bind(this),this.delete=Qs.prototype.delete.bind(this),this.get=Qs.prototype.get.bind(this),this.has=Qs.prototype.has.bind(this),this.set=Qs.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Mo(e)?(r=ns(e.key,``,t),i=ns(e.value,r,t)):r=ns(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=bc(e,t,n),i=new this;return i.items=r.items,i}};Sc.tag=`tag:yaml.org,2002:omap`;var Cc={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Sc,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=yc(e,t),r=[];for(let{key:e}of n.items)No(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Sc,n)},createNode:(e,t,n)=>Sc.from(e,t,n)};function wc({value:e,source:t},n){return t&&(e?Tc:Ec).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Tc={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new P(!0),stringify:wc},Ec={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new P(!1),stringify:wc},Nee={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:oc},Pee={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():oc(e)}},Fee={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new P(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:oc},Dc=e=>typeof e==`bigint`||Number.isInteger(e);function Oc(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function kc(e,t,n){let{value:r}=e;if(Dc(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return oc(e)}var Iee={identify:Dc,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Oc(e,2,2,n),stringify:e=>kc(e,2,`0b`)},Lee={identify:Dc,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Oc(e,1,8,n),stringify:e=>kc(e,8,`0`)},Ac={identify:Dc,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Oc(e,0,10,n),stringify:oc},jc={identify:Dc,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Oc(e,2,16,n),stringify:e=>kc(e,16,`0x`)},Mc=class e extends Qs{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Mo(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Ks(e.key,null):new Ks(e,null),Zs(this.items,t.key)||this.items.push(t)}get(e,t){let n=Zs(this.items,e);return!t&&Mo(n)?No(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Zs(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ks(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Gs(e,null,n));return i}};Mc.tag=`tag:yaml.org,2002:set`;var Nc={collection:`map`,identify:e=>e instanceof Set,nodeClass:Mc,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Mc.from(e,t,n),resolve(e,t){if(jo(e)){if(e.hasAllNullValues(!0))return Object.assign(new Mc,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Pc(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function Fc(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return oc(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Ic={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Pc(e,n),stringify:Fc},Lc={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Pc(e,!1),stringify:Fc},Rc={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Rc.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Pc(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},zc=[$s,nc,rc,ic,Tc,Ec,Iee,Lee,Ac,jc,Nee,Pee,Fee,vc,zs,Cc,xc,Nc,Ic,Lc,Rc],Bc=new Map([[`core`,Aee],[`failsafe`,[$s,nc,rc]],[`json`,Mee],[`yaml11`,zc],[`yaml-1.1`,zc]]),Vc={binary:vc,bool:ac,float:lc,floatExp:cc,floatNaN:sc,floatTime:Lc,int:mc,intHex:hc,intOct:pc,intTime:Ic,map:$s,merge:zs,null:ic,omap:Cc,pairs:xc,seq:nc,set:Nc,timestamp:Rc},Hc={"tag:yaml.org,2002:binary":vc,"tag:yaml.org,2002:merge":zs,"tag:yaml.org,2002:omap":Cc,"tag:yaml.org,2002:pairs":xc,"tag:yaml.org,2002:set":Nc,"tag:yaml.org,2002:timestamp":Rc};function Uc(e,t,n){let r=Bc.get(t);if(r&&!e)return n&&!r.includes(zs)?r.concat(zs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(Bc.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(zs)),i.reduce((e,t)=>{let n=typeof t==`string`?Vc[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Vc).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Wc=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Gc=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Uc(e,`compat`):e?Uc(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Hc:{},this.tags=Uc(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,wo,{value:$s}),Object.defineProperty(this,Eo,{value:rc}),Object.defineProperty(this,Do,{value:nc}),this.sortMapEntries=typeof a==`function`?a:a===!0?Wc:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Kc(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=Ms(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(hs(t,``))}let o=!1,s=null;if(e.contents){if(Io(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(hs(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Fs(e.contents,i,()=>s=null,t);s&&(c+=gs(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Fs(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
77
+ `)?(n.push(`...`),n.push(hs(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(hs(a(t),``)))}return n.join(`
78
+ `)+`
79
+ `}var qc=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Oo,{value:Co});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Xo({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Oo]:{value:Co}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Io(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Jc(this.contents)&&this.contents.add(e)}addIn(e,t){Jc(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Qo(this);e.anchor=!t||n.has(t)?$o(t||`a`,n):t}return new is(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=es(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=us(e,l,p);return o&&Fo(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Ks(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Jc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fs(e)?this.contents==null?!1:(this.contents=null,!0):Jc(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Fo(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return fs(e)?!t&&No(this.contents)?this.contents.value:this.contents:Fo(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Fo(this.contents)?this.contents.has(e):!1}hasIn(e){return fs(e)?this.contents!==void 0:Fo(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ds(this.schema,[e],t):Jc(this.contents)&&this.contents.set(e,t)}setIn(e,t){fs(e)?this.contents=t:this.contents==null?this.contents=ds(this.schema,Array.from(e),t):Jc(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Xo({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Xo({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Gc(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=ns(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?ts(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Kc(this,e)}};function Jc(e){if(Fo(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Yc=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Xc=class extends Yc{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Zc=class extends Yc{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Qc=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
80
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function $c(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function el(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
81
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(el(t.key)||el(t.value))return!0}return!1;default:return!0}}function tl(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&el(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function nl(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||No(e)&&No(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var rl=`All mapping items must start at the same column`;function il({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Qs)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=$c(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,rl)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
82
+ `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||el(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,rl);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&tl(r.indent,u,i),n.atKey=!1,nl(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=$c(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&tl(r.indent,f,i),s=c.range[2];let l=new Ks(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
83
+ `+_.comment:g.comment=_.comment);let e=new Ks(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function al({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??ec)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=$c(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&tl(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function ol(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var sl=`Block collections are not allowed within flow collections`,cl=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function ll({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?Qs:ec))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=$c(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
84
+ `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&el(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Mo(t)&&(t=t.value??t.key),t.comment?t.comment+=`
85
+ `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],cl(m)&&i(r.range,`BLOCK_IN_FLOW`,sl)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);cl(f)&&i(g.range,`BLOCK_IN_FLOW`,sl),n.atKey=!1;let _=$c(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?cl(m)&&i(v.range,`BLOCK_IN_FLOW`,sl):_.comment&&(g.comment?g.comment+=`
86
+ `+_.comment:g.comment=_.comment);let y=new Ks(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;nl(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Qs(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=ol(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
87
+ `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function ul(e,t,n,r,i,a){let o=n.type===`block-map`?il(e,t,n,r,a):n.type===`block-seq`?al(e,t,n,r,a):ll(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function dl(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Qs.tagName&&s===`map`||o===ec.tagName&&s===`seq`)return ul(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),ul(e,t,n,i,o)}let l=ul(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Io(u)?u:new P(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function fl(e,t,n){let r=t.offset,i=pl(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?P.BLOCK_FOLDED:P.BLOCK_LITERAL,o=t.source?ml(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
88
+ `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
89
+ `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===P.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
90
+ `):t.length>c||r[0]===` `?(f===` `?f=`
91
+ `:!p&&f===`
92
+ `&&(f=`
93
+
94
+ `),d+=f+t.slice(c)+r,f=`
95
+ `,p=!0):r===``?f===`
96
+ `?d+=`
97
+ `:f=`
98
+ `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
99
+ `+o[e][0].slice(c);d[d.length-1]!==`
100
+ `&&(d+=`
101
+ `);break;default:d+=`
102
+ `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function pl({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function ml(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function hl(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=P.PLAIN,c=gl(a,l);break;case`single-quoted-scalar`:s=P.QUOTE_SINGLE,c=_l(a,l);break;case`double-quoted-scalar`:s=P.QUOTE_DOUBLE,c=yl(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=ol(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function gl(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),vl(e)}function _l(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),vl(e.slice(1,-1)).replace(/''/g,`'`)}function vl(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
103
+ `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
104
+ `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
105
+ `?i+=a:a=`
106
+ `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function yl(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
107
+ `))if(i===`
108
+ `){let{fold:t,offset:i}=bl(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=xl[i];if(a)n+=a;else if(i===`
109
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
110
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=Sl(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
111
+ `&&!(a===`\r`&&e[r+2]===`
112
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function bl(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
113
+ `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
114
+ `);)r===`
115
+ `&&(n+=`
116
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var xl={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
117
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Sl(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function Cl(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?fl(e,t,r):hl(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Eo]:c?wl(e.schema,i,c,n,r):t.type===`scalar`?Tl(e,i,t,r):e.schema[Eo];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=No(a)?a:new P(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new P(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function wl(e,t,n,r,i){if(n===`!`)return e[Eo];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Eo])}function Tl({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Eo];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Eo];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function El(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Dl={composeNode:Ol,composeEmptyNode:kl};function Ol(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Al(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Cl(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=dl(Dl,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=kl(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!No(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function kl(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Cl(e,{type:`scalar`,offset:El(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Al({options:e},{offset:t,source:n,end:r},i){let a=new is(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=ol(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function jl(e,t,{offset:n,start:r,value:i,end:a},o){let s=new qc(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=$c(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Ol(c,i,l,o):kl(c,l.end,r,null,l,o);let u=s.contents.range[2],d=ol(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Ml(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Nl(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
118
+
119
+ `:`
120
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Pl=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Ml(e);r?this.warnings.push(new Zc(i,t,n)):this.errors.push(new Xc(i,t,n))},this.directives=new Xo({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Nl(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Fo(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Mo(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Nl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Ml(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=jl(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Xc(Ml(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Xc(Ml(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=ol(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Xc(Ml(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new qc(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Fl=Symbol(`break visit`),Il=Symbol(`skip children`),Ll=Symbol(`remove item`);function Rl(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),zl(Object.freeze([]),e,t)}Rl.BREAK=Fl,Rl.SKIP=Il,Rl.REMOVE=Ll,Rl.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Rl.parentCollection=(e,t)=>{let n=Rl.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function zl(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=zl(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Fl)return Fl;else r===Ll&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Bl(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
121
+ `:case`\r
122
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Vl(e){switch(e){case void 0:case` `:case`
123
+ `:case`\r`:case` `:return!0;default:return!1}}var Hl=new Set(`0123456789ABCDEFabcdef`),Ul=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Wl=new Set(`,[]{}`),Gl=new Set(` ,[]{}
124
+ \r `),Kl=e=>!e||Gl.has(e),ql=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
125
+ `?!0:t===`\r`?this.buffer[e+1]===`
126
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
127
+ `||!t&&!this.atEnd)return e+n+1}return t===`
128
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Vl(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
129
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Vl(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Vl(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Vl(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Kl),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Vl(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Kl),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Vl(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
130
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
131
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Vl(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
132
+ `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
133
+ `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
134
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
135
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
136
+ `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Vl(r)||e&&Wl.has(r))break;t=n}else if(Vl(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
137
+ `?(n+=1,r=`
138
+ `,i=this.buffer[n+1]):t=n),i===`#`||e&&Wl.has(i))break;if(r===`
139
+ `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Wl.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(Kl))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(Vl(t)||e&&Wl.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Vl(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Ul.has(t))t=this.buffer[++e];else if(t===`%`&&Hl.has(this.buffer[e+1])&&Hl.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
140
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
141
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Jl=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Yl(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Xl(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Zl(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Ql(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function $l(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function eu(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Yl(t.start,`explicit-key-ind`)&&!Yl(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Zl(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var tu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new ql,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Bl(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&eu(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Xl(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:Xl(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=$l(Ql(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
142
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
143
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Yl(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=$l(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Yl(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Zl(t.key)&&!Yl(t.sep,`newline`)){let e=$l(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Yl(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Yl(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Yl(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=$l(Ql(t));eu(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
144
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
145
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=$l(Ql(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=$l(Ql(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function nu(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Jl||null,prettyErrors:t}}function ru(e,t={}){let{lineCounter:n,prettyErrors:r}=nu(t),i=new tu(n?.addNewLine),a=new Pl(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Xc(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Qc(e,n)),o.warnings.forEach(Qc(e,n))),o}var iu=Symbol.for(`@inkeep/open-knowledge/field-registry`),au=globalThis;au[iu]===void 0&&(au[iu]=_r());var ou=au[iu];function su(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=cu(t)?ou.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function cu(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}var lu=Fa({title:A().optional(),description:A().optional(),tags:M(A()).optional()});Fa({match:A().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:lu});var uu=Fa({content:Fa({dir:A().register(ou,{scope:`project`,agentSettable:!1,defaultScope:`project`}).default(`.`)}).default({dir:`.`}),appearance:Fa({theme:Ga([`light`,`dark`,`system`]).register(ou,{scope:`user`,agentSettable:!1,defaultScope:`user`}).optional()}).default({}),autoSync:Fa({enabled:Ea().register(ou,{scope:`project-local`,agentSettable:!1,defaultScope:`project-local`}).nullable().default(null)}).default({enabled:null})}),du=`open-knowledge-config`;function fu(e,t,n){let r=h.getTracer(du),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:m.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function pu(e,t){let n=h.getActiveSpan();n&&n.addEvent(e,t)}function mu(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function hu(e,t){let n=e;for(let e of t){n=mu(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function gu(e,t){let n=hu(e,t);if(n!==void 0)return su(n)}function _u(e,t){return e===`either`?!0:e===t}function vu(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=gu(uu,i);a?.scope!==void 0&&(_u(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function yu(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&(Fo(e.getIn(r,!0))||e.deleteIn(r))}}function bu(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){yu(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}yu(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function xu(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function Su(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?wu(e.position):`start`in e||`end`in e?wu(e):`line`in e||`column`in e?Cu(e):``}function Cu(e){return Tu(e&&e.line)+`:`+Tu(e&&e.column)}function wu(e){return Cu(e&&e.start)+`-`+Cu(e&&e.end)}function Tu(e){return e&&typeof e==`number`?e:1}var Eu=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Su(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Eu.prototype.file=``,Eu.prototype.name=``,Eu.prototype.reason=``,Eu.prototype.message=``,Eu.prototype.stack=``,Eu.prototype.column=void 0,Eu.prototype.line=void 0,Eu.prototype.ancestors=void 0,Eu.prototype.cause=void 0,Eu.prototype.fatal=void 0,Eu.prototype.place=void 0,Eu.prototype.ruleId=void 0,Eu.prototype.source=void 0;var Du=n(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,te=E-ee;E<o&&te<s&&e.charAt(o-E-1)==t.charAt(s-te-1);)E++,te++;if(f[T]=E,E>o)y+=2;else if(te>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
146
+ `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
147
+ `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
148
+ `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
149
+ `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}));function Ou(e){this.content=e}Ou.prototype={constructor:Ou,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Ou(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ou(n)},addToStart:function(e,t){return new Ou([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ou(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Ou(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ou.from(e),e.size?new Ou(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ou.from(e),e.size?new Ou(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ou.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ou.from=function(e){if(e instanceof Ou)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ou(t)};function ku(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ku(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Au(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Au(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ku(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Au(this,e,t,n)}findIndex(e){if(e==0)return Mu(0,e);if(e==this.size)return Mu(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Mu(t+1,i):Mu(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);var ju={index:0,offset:0};function Mu(e,t){return ju.index=e,ju.offset=t,ju}function Nu(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Nu(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Nu(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Pu=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Nu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Pu.none=[];var Fu=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Lu(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Iu(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(F.empty,0,0);function Iu(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Iu(a.content,t-i-1,n-i-1)))}function Lu(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Lu(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Ru(e,t,n){if(n.openStart>e.depth)throw new Fu(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Fu(`Inconsistent open depths`);return zu(e,t,n,0)}function zu(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=zu(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return Wu(a,Ku(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Wu(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=qu(n,e);return Wu(a,Gu(e,i,o,t,r))}}function Bu(e,t){if(!t.type.compatibleContent(e.type))throw new Fu(`Cannot join `+t.type.name+` onto `+e.type.name)}function Vu(e,t,n){let r=e.node(n);return Bu(r,t.node(n)),r}function Hu(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Uu(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Hu(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Hu(i.child(e),r);t&&t.depth==n&&t.textOffset&&Hu(t.nodeBefore,r)}function Wu(e,t){return e.type.checkContent(t),e.copy(t)}function Gu(e,t,n,r,i){let a=e.depth>i&&Vu(e,t,i+1),o=r.depth>i&&Vu(n,r,i+1),s=[];return Uu(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Bu(a,o),Hu(Wu(a,Gu(e,t,n,r,i+1)),s)):(a&&Hu(Wu(a,Ku(e,t,i+1)),s),Uu(t,n,i,s),o&&Hu(Wu(o,Ku(n,r,i+1)),s)),Uu(r,null,i,s),new F(s)}function Ku(e,t,n){let r=[];return Uu(null,e,n,r),e.depth>n&&Hu(Wu(Vu(e,t,n+1),Ku(e,t,n+1)),r),Uu(t,null,n,r),new F(r)}function qu(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Ju=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pu.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Qu(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Zu.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Zu.set(t,r=new Yu);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Xu,i}},Yu=class{constructor(){this.elts=[],this.i=0}},Xu=12,Zu=new WeakMap,Qu=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},$u=Object.create(null),ed=class e{constructor(e,t,n,r=Pu.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Nu(this.attrs,t||e.defaultAttrs||$u)&&Pu.sameSet(this.marks,n||Pu.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Ru(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ju.resolveCached(this,e)}resolveNoCache(e){return Ju.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),nd(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pu.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pu.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};ed.prototype.text=void 0;var td=class e extends ed{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function nd(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var rd=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new id(t,n);if(r.next==null)return e.empty;let i=ad(r);r.next&&r.err(`Unexpected trailing text`);let a=hd(fd(i));return gd(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
150
+ `)}};rd.empty=new rd(!0);var id=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function ad(e){let t=[];do t.push(od(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function od(e){let t=[];do t.push(sd(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function sd(e){let t=dd(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=ld(e,t);else break;return t}function cd(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function ld(e,t){let n=cd(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:cd(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function ud(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function dd(e){if(e.eat(`(`)){let t=ad(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=ud(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function fd(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function pd(e,t){return t-e}function md(e,t){let n=[];return r(t),n.sort(pd);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function hd(e){let t=Object.create(null);return n(md(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);md(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new rd(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(pd);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function gd(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function _d(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function vd(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function yd(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function bd(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Cd(e,r,t[r]);return n}var xd=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=bd(e,n.attrs),this.defaultAttrs=_d(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==rd.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:vd(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ed(this,this.computeAttrs(e),F.from(t),Pu.setFrom(n))}createChecked(e=null,t,n){return t=F.from(t),this.checkContent(t),new ed(this,this.computeAttrs(e),t,Pu.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=F.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(F.empty,!0);return i?new ed(this,e,t.append(i),Pu.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){yd(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Pu.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Sd(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Cd=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Sd(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},wd=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=bd(e,r.attrs),this.excluded=null;let i=_d(this.attrs);this.instance=i?new Pu(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Pu(this,vd(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){yd(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Td=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Ou.from(e.nodes),t.marks=Ou.from(e.marks||{}),this.nodes=xd.compile(this.spec.nodes,this),this.marks=wd.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=rd.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Ed(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Ed(this,n.split(` `))}this.nodeFromJSON=e=>ed.fromJSON(this,e),this.markFromJSON=e=>Pu.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof xd))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new td(n,n.defaultAttrs,e,Pu.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Ed(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Dd(e){return e.tag!=null}function Od(e){return e.style!=null}var kd=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Dd(e))this.tags.push(e);else if(Od(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Rd(this,t,!1);return n.addAll(e,Pu.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Rd(this,t,!0);return n.addAll(e,Pu.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Bd(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Vd(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Vd(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Ad={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},jd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Md={ol:!0,ul:!0},Nd=1,Pd=2,Fd=4;function Id(e,t,n){return t==null?e&&e.whitespace==`pre`?Nd|Pd:n&~Fd:(t?Nd:0)|(t===`full`?Pd:0)}var Ld=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Pu.none,this.match=i||(a&Fd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Nd)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ad.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Rd=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Id(null,t.preserveWhitespace,0)|(n?Fd:0);i=r?new Ld(r.type,r.attrs,Pu.none,!0,t.topMatch||r.type.contentMatch,a):n?new Ld(null,null,Pu.none,!0,null,a):new Ld(e.schema.topNodeType,null,Pu.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Pd?`full`:this.localPreserveWS||(r.options&Nd)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
151
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Md.hasOwnProperty(a)&&this.parser.normalizeLists&&zd(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:jd.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Ad.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
152
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Pu.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Hd(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Id(e,i,a.options);a.options&Fd&&a.content.length==0&&(o|=Fd);let s=Pu.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Hd(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Ld(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Nd);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function zd(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Md.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Bd(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Vd(e){let t={};for(let n in e)t[n]=e[n];return t}function Hd(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Ud=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Gd(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Yd(Gd(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Yd(Gd(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Yd(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Wd(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Wd(e.marks)}};function Wd(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Gd(e){return e.document||window.document}var Kd=new WeakMap;function qd(e){let t=Kd.get(e);return t===void 0&&Kd.set(e,t=Jd(e)),t}function Jd(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Yd(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=qd(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Yd(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Xd=65535,Zd=2**16;function Qd(e,t){return e+t*Zd}function $d(e){return e&Xd}function ef(e){return(e-(e&Xd))/Zd}var tf=1,nf=2,rf=4,af=8,of=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&af)>0}get deletedBefore(){return(this.delInfo&(tf|rf))>0}get deletedAfter(){return(this.delInfo&(nf|rf))>0}get deletedAcross(){return(this.delInfo&rf)>0}},sf=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=$d(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ef(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Qd(o/3,e-s),f=e==s?nf:e==u?tf:rf;return(t<0?e!=s:e!=u)&&(f|=af),new of(a,f,d)}r+=l-c}return n?e+r:new of(e+r,0,null)}touches(e,t){let n=0,r=$d(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};sf.empty=new sf([]);var cf=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new of(e,r,null)}},lf=Object.create(null),uf=class{getMap(){return sf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=lf[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in lf)throw RangeError(`Duplicate use of step JSON ID `+e);return lf[e]=t,t.prototype.jsonID=e,t}},df=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Fu)return e.fail(t.message);throw t}}};function ff(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(ff(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return F.fromArray(r)}var pf=class e extends uf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new I(ff(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return df.fromReplace(e,this.from,this.to,i)}invert(){return new mf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};uf.jsonID(`addMark`,pf);var mf=class e extends uf{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new I(ff(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return df.fromReplace(e,this.from,this.to,n)}invert(){return new pf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};uf.jsonID(`removeMark`,mf);var hf=class e extends uf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return df.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return df.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new gf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};uf.jsonID(`addNodeMark`,hf);var gf=class e extends uf{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return df.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return df.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new hf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};uf.jsonID(`removeNodeMark`,gf);var _f=class e extends uf{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&yf(e,this.from,this.to)?df.fail(`Structure replace would overwrite content`):df.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new sf([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?I.empty:new I(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?I.empty:new I(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,I.fromJSON(t,n.slice),!!n.structure)}};_f.MAP_BIAS=1,uf.jsonID(`replace`,_f);var vf=class e extends uf{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(yf(e,this.from,this.gapFrom)||yf(e,this.gapTo,this.to)))return df.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return df.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?df.fromReplace(e,this.from,this.to,n):df.fail(`Content does not fit in gap`)}getMap(){return new sf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(t,n.slice),n.insert,!!n.structure)}};uf.jsonID(`replaceAround`,vf);function yf(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function bf(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new mf(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new pf(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function xf(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof wd){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new mf(t.from,t.to,t.style)))}function Sf(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new _f(s,l,I.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new mf(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new I(F.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new _f(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(F.empty,!0);e.replace(s,s,new I(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Cf(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function wf(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Cf(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Tf(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=F.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=F.from(r.node(e).copy(u)),d++):c--;let f=F.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=F.from(i.node(e).copy(f)),p++):l++;e.step(new vf(c,l,o,s,new I(u.append(f),d,p),u.size-d,!0))}function Ef(e,t,n=null,r=e){let i=Of(e,t),a=i&&kf(r,t);return a?i.map(Df).concat({type:t,attrs:n}).concat(a.map(Df)):null}function Df(e){return{type:e,attrs:null}}function Of(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function kf(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Af(e,t,n){let r=F.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=F.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new vf(i,a,i,a,new I(r,0,0),n.length,!0))}function jf(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Pf(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Nf(e,t,n,a),Sf(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new vf(c,l,c+1,l-1,new I(F.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Mf(e,t,n,a),!1}})}function Mf(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Nf(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
153
+ `))}})}function Pf(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Ff(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new vf(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new I(F.from(o),0,0),1,!0))}function If(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Lf(e,t,n=1,r){let i=e.doc.resolve(t),a=F.empty,o=F.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=F.from(i.node(e).copy(a));let t=r&&r[s];o=F.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new _f(t,t,new I(a.append(o),n,n),!0))}function Rf(e,t){let n=e.resolve(t),r=n.index();return Bf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zf(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Bf(e,t){return!!(e&&t&&!e.isLeaf&&zf(e,t))}function Vf(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Bf(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Hf(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Nf(e,r.node(),r.before(),s)}o.inlineContent&&Sf(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new _f(l,c.map(t+n,-1),I.empty,!0)),r===!0){let t=e.doc.resolve(l);Mf(e,t.node(),t.before(),e.steps.length)}return e}function Uf(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Wf(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Gf(e,t,n=t,r=I.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Kf(i,a,r)?new _f(t,n,r):new qf(i,a,r).fit()}function Kf(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var qf=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=F.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=F.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new I(i,a,o);return e>-1?new vf(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new _f(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Xf(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(F.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Xf(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new I(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Xf(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new I(Jf(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new I(Jf(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Zf(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Yf(this.placed,t,F.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?I.empty:new I(Jf(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new I(Jf(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Qf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Qf(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Qf(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Yf(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Yf(this.placed,this.depth,F.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(F.empty,!0);e.childCount&&(this.placed=Yf(this.placed,this.frontier.length,e))}};function Jf(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Jf(e.firstChild.content,t-1,n)))}function Yf(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Yf(e.lastChild.content,t-1,n)))}function Xf(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Zf(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Zf(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(F.empty,!0)))),e.copy(r)}function Qf(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!$f(n,a.content,o)?s:null}function $f(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ep(e){return e.spec.defining||e.spec.definingForContent}function tp(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Kf(i,a,r))return e.step(new _f(t,n,r));let o=ap(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=ep(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new I(np(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function np(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(np(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(F.empty,!0))}return e}function rp(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Uf(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new I(F.from(r),0,0))}function ip(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=ap(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function ap(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var op=class e extends uf{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return df.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return df.fromReplace(e,this.pos,this.pos+1,new I(F.from(r),0,+!t.isLeaf))}getMap(){return sf.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};uf.jsonID(`attr`,op);var sp=class e extends uf{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return df.ok(n)}getMap(){return sf.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};uf.jsonID(`docAttr`,sp);var cp=class extends Error{};cp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},cp.prototype=Object.create(Error.prototype),cp.prototype.constructor=cp,cp.prototype.name=`TransformError`;var lp=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new cf}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new cp(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=I.empty){let r=Gf(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new I(F.from(n),0,0))}delete(e,t){return this.replace(e,t,I.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return tp(this,e,t,n),this}replaceRangeWith(e,t,n){return rp(this,e,t,n),this}deleteRange(e,t){return ip(this,e,t),this}lift(e,t){return Tf(this,e,t),this}join(e,t=1){return Hf(this,e,t),this}wrap(e,t){return Af(this,e,t),this}setBlockType(e,t=e,n,r=null){return jf(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Ff(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new op(e,t,n)),this}setDocAttribute(e,t){return this.step(new sp(e,t)),this}addNodeMark(e,t){return this.step(new hf(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Pu)t.isInSet(n.marks)&&this.step(new gf(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new gf(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Lf(this,e,t,n),this}addMark(e,t,n){return bf(this,e,t,n),this}removeMark(e,t,n){return xf(this,e,t,n),this}clearIncompatible(e,t,n){return Sf(this,e,t,n),this}},up=Object.create(null),L=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new dp(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=I.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?I.empty:t),o==0&&yp(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),yp(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new R(e):vp(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?vp(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):vp(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new gp(e.node(0))}static atStart(e){return vp(e,e,0,0,1)||new gp(e)}static atEnd(e){return vp(e,e,e.content.size,e.childCount,-1)||new gp(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=up[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in up)throw RangeError(`Duplicate use of selection JSON ID `+e);return up[e]=t,t.prototype.jsonID=e,t}getBookmark(){return R.between(this.$anchor,this.$head).getBookmark()}};L.prototype.visible=!0;var dp=class{constructor(e,t){this.$from=e,this.$to=t}},fp=!1;function pp(e){!fp&&!e.parent.inlineContent&&(fp=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var R=class e extends L{constructor(e,t=e){pp(e),pp(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return L.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=I.empty){if(super.replace(e,t),t==I.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new mp(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=L.findFrom(n,r,!0)||L.findFrom(n,-r,!0);if(e)n=e.$head;else return L.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(L.findFrom(t,-r,!0)||L.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};L.jsonID(`text`,R);var mp=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 R.between(e.resolve(this.anchor),e.resolve(this.head))}},z=class e extends L{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?L.near(a):new e(a)}content(){return new I(F.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new hp(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};z.prototype.visible=!1,L.jsonID(`node`,z);var hp=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new mp(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&z.isSelectable(n)?new z(t):L.near(t)}},gp=class e extends L{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=I.empty){if(t==I.empty){e.delete(0,e.doc.content.size);let t=L.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return _p}};L.jsonID(`all`,gp);var _p={map(){return this},resolve(e){return new gp(e)}};function vp(e,t,n,r,i,a=!1){if(t.inlineContent)return R.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=vp(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&z.isSelectable(r))return z.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function yp(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof _f||i instanceof vf))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(L.near(e.doc.resolve(o),n))}var bp=1,xp=2,Sp=4,Cp=class extends lp{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|bp)&~xp,this.storedMarks=null,this}get selectionSet(){return(this.updated&bp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=xp,this}ensureMarks(e){return Pu.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&xp)>0}addStep(e,t){super.addStep(e,t),this.updated&=~xp,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Pu.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(L.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Sp,this}get scrolledIntoView(){return(this.updated&Sp)>0}};function wp(e,t){return!t||!e?e:e.bind(t)}var Tp=class{constructor(e,t,n){this.name=e,this.init=wp(t.init,n),this.apply=wp(t.apply,n)}},Ep=[new Tp(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Tp(`selection`,{init(e,t){return e.selection||L.atStart(t.doc)},apply(e){return e.selection}}),new Tp(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Tp(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Dp=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ep.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Tp(e.key,e.spec.state,e))})}},Op=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Cp(this)}static create(t){let n=new Dp(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Dp(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Dp(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=ed.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=L.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function kp(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=kp(i,t,{})),n[r]=i}return n}var Ap=class{constructor(e){this.spec=e,this.props={},e.props&&kp(e.props,this,this.props),this.key=e.key?e.key.key:Mp(`plugin`)}getState(e){return e[this.key]}},jp=Object.create(null);function Mp(e){return e in jp?e+`$`+ ++jp[e]:(jp[e]=0,e+`$`)}var Np=class{constructor(e=`key`){this.key=Mp(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Pp=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Fp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Ip=(e,t,n)=>{let r=Fp(e,n);if(!r)return!1;let i=Hp(r);if(!i){let n=r.blockRange(),i=n&&wf(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(om(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Bp(a,`end`)||z.isSelectable(a)))for(let n=r.depth;;n--){let o=Gf(e.doc,r.before(n),r.after(n),I.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(Bp(a,`end`)?L.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):z.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Lp=(e,t,n)=>{let r=Fp(e,n);if(!r)return!1;let i=Hp(r);return i?zp(e,i,t):!1},Rp=(e,t,n)=>{let r=Up(e,n);if(!r)return!1;let i=Kp(r);return i?zp(e,i,t):!1};function zp(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Gf(e.doc,i,o,I.empty);if(!s||s.from!=i||s instanceof _f&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(R.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Bp(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Vp=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Hp(r)}let o=a&&a.nodeBefore;return!o||!z.isSelectable(o)?!1:(t&&t(e.tr.setSelection(z.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Hp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Up(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Wp=(e,t,n)=>{let r=Up(e,n);if(!r)return!1;let i=Kp(r);if(!i)return!1;let a=i.nodeAfter;if(om(e,i,t,1))return!0;if(r.parent.content.size==0&&(Bp(a,`start`)||z.isSelectable(a))){let n=Gf(e.doc,r.before(),r.after(),I.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Bp(a,`start`)?L.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):z.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Gp=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Kp(r)}let o=a&&a.nodeAfter;return!o||!z.isSelectable(o)?!1:(t&&t(e.tr.setSelection(z.create(e.doc,a.pos)).scrollIntoView()),!0)};function Kp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var qp=(e,t)=>{let n=e.selection,r=n instanceof z,i;if(r){if(n.node.isTextblock||!Rf(e.doc,n.from))return!1;i=n.from}else if(i=Vf(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(z.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Jp=(e,t)=>{let n=e.selection,r;if(n instanceof z){if(n.node.isTextblock||!Rf(e.doc,n.to))return!1;r=n.to}else if(r=Vf(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Yp=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&wf(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Xp=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
154
+ `).scrollIntoView()),!0)};function Zp(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Qp=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Zp(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(L.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},$p=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof gp||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Zp(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(R.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},em=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(If(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&wf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function tm(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof z&&t.selection.node.isBlock)return!r.parentOffset||!If(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=Zp(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof R||t.selection instanceof gp)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=If(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,If(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var nm=tm(),rm=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(z.create(e.doc,i))),!0)},im=(e,t)=>(t&&t(e.tr.setSelection(new gp(e.doc))),!0);function am(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Rf(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function om(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&am(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=F.empty;for(let e=o.length-1;e>=0;e--)s=F.from(o[e].create(null,s));s=F.from(i.copy(s));let c=e.tr.step(new vf(t.pos-1,r,t.pos,r,new I(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Rf(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:L.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&wf(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Bp(a,`start`,!0)&&Bp(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=F.empty;for(let e=o.length-1;e>=0;e--)r=F.from(o[e].copy(r));n(e.tr.step(new vf(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new I(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function sm(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(R.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var cm=sm(-1),lm=sm(1);function um(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Ef(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function dm(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function fm(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var pm=fm(Pp,Ip,Vp),mm=fm(Pp,Wp,Gp),hm={Enter:fm(Xp,$p,em,nm),"Mod-Enter":Qp,Backspace:pm,"Mod-Backspace":pm,"Shift-Backspace":pm,Delete:mm,"Mod-Delete":mm,"Mod-a":im},gm={"Ctrl-h":hm.Backspace,"Alt-Backspace":hm[`Mod-Backspace`],"Ctrl-d":hm.Delete,"Ctrl-Alt-Backspace":hm[`Mod-Delete`],"Alt-Delete":hm[`Mod-Delete`],"Alt-d":hm[`Mod-Delete`],"Ctrl-a":cm,"Ctrl-e":lm};for(let e in hm)gm[e]=hm[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function _m(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return vm(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function vm(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Qu(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Qu(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Ef(a,n,r,t);return s?(e&&ym(e,t,s,i,n),!0):!1}function ym(e,t,n,r,i){let a=F.empty;for(let e=n.length-1;e>=0;e--)a=F.from(n[e].type.create(n[e].attrs,a));e.step(new vf(t.start-(r?2:0),t.end,t.start,t.end,new I(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&If(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function bm(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?xm(t,n,e,a):Sm(t,n,a):!0:!1}}function xm(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new vf(a-1,o,a,o,new I(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Qu(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=wf(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Rf(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Sm(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?F.empty:F.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new vf(d-+!!s,f+ +!!c,d+1,f-1,new I((s?F.empty:F.from(i.copy(F.empty))).append(c?F.empty:F.from(i.copy(F.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Cm(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=F.from(r?e.create():null),o=new I(F.from(e.create(null,F.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new vf(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var wm=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Tm=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Em=null,Dm=function(e,t,n){let r=Em||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Om=function(){Em=null},km=function(e,t,n,r){return n&&(jm(e,t,n,r,-1)||jm(e,t,n,r,1))},Am=/^(img|br|input|textarea|hr)$/i;function jm(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Mm(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Im(e)||Am.test(e.nodeName)||e.contentEditable==`false`)return!1;t=wm(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Mm(e):0}else return!1}}function Mm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Nm(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Mm(e)}else if(e.parentNode&&!Im(e))t=wm(e),e=e.parentNode;else return null}}function Pm(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Im(e))t=wm(e)+1,e=e.parentNode;else return null}}function Fm(e,t,n){for(let r=t==0,i=t==Mm(e);r||i;){if(e==n)return!0;let t=wm(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Mm(e)}}function Im(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Lm=function(e){return e.focusNode&&km(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Rm(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function zm(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Bm(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Mm(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Mm(r.startContainer),r.startOffset)}}}var Vm=typeof navigator<`u`?navigator:null,Hm=typeof document<`u`?document:null,Um=Vm&&Vm.userAgent||``,Wm=/Edge\/(\d+)/.exec(Um),Gm=/MSIE \d/.exec(Um),Km=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Um),qm=!!(Gm||Km||Wm),Jm=Gm?document.documentMode:Km?+Km[1]:Wm?+Wm[1]:0,Ym=!qm&&/gecko\/(\d+)/i.test(Um);Ym&&+(/Firefox\/(\d+)/.exec(Um)||[0,0])[1];var Xm=!qm&&/Chrome\/(\d+)/.exec(Um),Zm=!!Xm,Qm=Xm?+Xm[1]:0,$m=!qm&&!!Vm&&/Apple Computer/.test(Vm.vendor),eh=$m&&(/Mobile\/\w+/.test(Um)||!!Vm&&Vm.maxTouchPoints>2),th=eh||(Vm?/Mac/.test(Vm.platform):!1),nh=Vm?/Win/.test(Vm.platform):!1,rh=/Android \d/.test(Um),ih=!!Hm&&`webkitFontSmoothing`in Hm.documentElement.style,ah=ih?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function oh(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function sh(e,t){return typeof e==`number`?e:e[t]}function Ree(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ch(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Tm(o);continue}let e=o,n=e==a.body,s=n?oh(a):Ree(e),c=0,l=0;if(t.top<s.top+sh(r,`top`)?l=-(s.top-t.top+sh(i,`top`)):t.bottom>s.bottom-sh(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+sh(i,`top`)-s.top:t.bottom-s.bottom+sh(i,`bottom`)),t.left<s.left+sh(r,`left`)?c=-(s.left-t.left+sh(i,`left`)):t.right>s.right-sh(r,`right`)&&(c=t.right-s.right+sh(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Tm(o)}}function zee(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:lh(e.dom)}}function lh(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Tm(r));return t}function Bee({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;uh(n,r==0?0:r-t)}function uh(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var dh=null;function Vee(e){if(e.setActive)return e.setActive();if(dh)return e.focus(dh);let t=lh(e);e.focus(dh==null?{get preventScroll(){return dh={preventScroll:!0},!0}}:void 0),dh||(dh=!1,uh(t,0))}function fh(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Dm(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Hee(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:fh(n,i)}function Hee(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=gh(r,1);if(n.top!=n.bottom&&ph(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function ph(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Uee(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Wee(e,t,n){let{node:r,offset:i}=fh(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Gee(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function mh(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(ph(t,i))return mh(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Kee(e,t){let n=e.dom.ownerDocument,r,i=0,a=Bm(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!ph(t,n)||(o=mh(e.dom,t,n),!o))return null}if($m)for(let e=o;r&&e;e=Tm(e))e.draggable&&(r=void 0);if(o=Uee(o,t),r){if(Ym&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;ih&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Gee(e,r,i,t))}s??=Wee(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function hh(e){return e.top<e.bottom||e.left<e.right}function gh(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(hh(e))return e}return Array.prototype.find.call(n,hh)||e.getBoundingClientRect()}var qee=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _h(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=ih||Ym;if(r.nodeType==3)if(o&&(qee.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=gh(Dm(r,i,i),n);if(Ym&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=gh(Dm(r,i-1,i-1),-1);if(t.top==e.top){let n=gh(Dm(r,i,i+1),-1);if(n.top!=e.top)return vh(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,vh(gh(Dm(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Mm(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return yh(e.getBoundingClientRect(),!1)}if(a==null&&i<Mm(r)){let e=r.childNodes[i];if(e.nodeType==1)return yh(e.getBoundingClientRect(),!0)}return yh(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Mm(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Dm(e,Mm(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return vh(gh(t,1),!1)}if(a==null&&i<Mm(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Dm(e,0,+!o):e.nodeType==1?e:null:null;if(t)return vh(gh(t,-1),!0)}return vh(gh(r.nodeType==3?Dm(r):r,-n),n>=0)}function vh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function yh(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function bh(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Jee(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return bh(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=_h(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Dm(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Yee=/[\u0590-\u08ac]/;function Xee(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Yee.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:bh(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var xh=null,Sh=null,Ch=!1;function Zee(e,t,n){return xh==t&&Sh==n?Ch:(xh=t,Sh=n,Ch=n==`up`||n==`down`?Jee(e,t,n):Xee(e,t,n))}var wh=0,Th=1,Eh=2,Dh=3,Oh=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=wh,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>wm(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Ph){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof kh&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?wm(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?wm(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=wm(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=wm(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Ym||$m)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
155
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:wm(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Ym&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&$m)&&km(o.node,o.offset,l.anchorNode,l.anchorOffset)&&km(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Ym)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Eh:Th,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Dh:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Eh:Dh}n=a}this.dirty=Eh}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Eh:Th;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},kh=class extends Oh{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==wh&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Qee=class extends Oh{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Ah=class e extends Oh{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Ud.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Dh||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Dh&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=wh){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=wh}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Uh(a,n,o,r)),t>0&&(a=Uh(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},jh=class e extends Oh{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Ud.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Bh(u,r,n),l?c=new $ee(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Nh(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,t,n){return this.dirty==wh&&e.eq(this.node)&&Vh(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new tte(this,a&&a.node,e);ite(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Pu.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Eh)&&(a&&this.protectLocalComposition(e,a),Fh(this.contentDOM,this.children,e),eh&&ate(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof R)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=ote(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new Qee(this,i,t,r);e.input.compositionNodes.push(a),this.children=Uh(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Dh||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=wh}updateOuterDeco(e){if(Vh(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=zh(this.dom,this.nodeDOM,Rh(this.outerDeco,this.node,t),Rh(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Mh(e,t,n,r,i){Bh(r,t,e);let a=new jh(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Nh=class e extends jh{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Dh||this.dirty!=wh&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=wh||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=wh,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Dh)}get domAtom(){return!1}isText(e){return this.node.text==e}},Ph=class extends Oh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==wh&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},$ee=class extends jh{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Dh)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Fh(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Hh(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Ah){let t=r?r.previousSibling:e.lastChild;Fh(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Hh(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Ih=function(e){e&&(this.nodeName=e)};Ih.prototype=Object.create(null);var Lh=[new Ih];function Rh(e,t,n){if(e.length==0)return Lh;let r=n?Lh[0]:new Ih,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Ih(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Ih(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function zh(e,t,n,r){if(n==Lh&&r==Lh)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Lh[0],i=t)}ete(i,o||Lh[0],a)}return i}function ete(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Bh(e,t,n){return zh(e,e,Lh,Rh(t,n,e.nodeType!=1))}function Vh(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Hh(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var tte=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=nte(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=wh,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Ah.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Dh&&a.dom==a.contentDOM&&(a.dirty=Eh),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof jh){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Dh&&Vh(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Eh,u.updateChildren(r,a+1),u.dirty=wh),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Vh(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=jh.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=jh.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new kh(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Ah;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Nh)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&(($m||Zm)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Ph(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function nte(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Ah)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function rte(e,t){return e.type.side-t.type.side}function ite(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(rte);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function ate(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function ote(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Uh(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Wh(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Lm(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&z.isSelectable(e)&&i.parent&&!(e.isInline&&Fm(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new z(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=tg(e,u,s,n)}return l}function Gh(e){return e.editable?e.hasFocus():rg(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Kh(e,t=!1){let n=e.state.selection;if($h(e,n),Gh(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Zm){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&km(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Qh(e);else{let{anchor:r,head:i}=n,a,o;qh&&!(n instanceof R)&&(n.$from.parent.inlineContent||(a=Jh(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Jh(e,n.to))),e.docView.setSelection(r,i,e,t),qh&&(a&&Xh(a),o&&Xh(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Zh(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var qh=$m||Zm&&Qm<63;function Jh(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if($m&&i&&i.contentEditable==`false`)return Yh(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Yh(i);if(a)return Yh(a)}}function Yh(e){return e.contentEditable=`true`,$m&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Xh(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Zh(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Gh(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Qh(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,wm(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&qm&&Jm<=11&&(n.disabled=!0,n.disabled=!1)}function $h(e,t){if(t instanceof z){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(eg(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else eg(e)}function eg(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function tg(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||R.between(t,n,r)}function ng(e){return e.editable&&!e.hasFocus()?!1:rg(e)}function rg(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ig(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return km(t.node,t.offset,n.anchorNode,n.anchorOffset)}function ag(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&L.findFrom(a,t)}function og(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function sg(e,t,n){let r=e.state.selection;if(r instanceof R){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return og(e,new R(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=ag(e.state,t);return n&&n instanceof z?og(e,n):!1}else if(!(th&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?z.isSelectable(i)?og(e,new z(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):ih?og(e,new R(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof z&&r.node.isInline)return og(e,new R(t>0?r.$to:r.$from));else{let n=ag(e.state,t);return n?og(e,n):!1}}function cg(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function lg(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function ug(e,t){return t<0?dg(e):fg(e)}function dg(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Ym&&n.nodeType==1&&r<cg(n)&&lg(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(lg(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(pg(n))break;else{let t=n.previousSibling;for(;t&&lg(t,-1);)i=n.parentNode,a=wm(t),t=t.previousSibling;if(t)n=t,r=cg(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?gg(e,n,r):i&&gg(e,i,a)}function fg(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=cg(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(lg(e,1))a=n,o=++r;else break}else if(pg(n))break;else{let t=n.nextSibling;for(;t&&lg(t,1);)a=t.parentNode,o=wm(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=cg(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&gg(e,a,o)}function pg(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function mg(e,t){for(;e&&t==e.childNodes.length&&!Im(e);)t=wm(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function hg(e,t){for(;e&&!t&&!Im(e);)t=wm(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function gg(e,t,n){if(t.nodeType!=3){let e,r;(r=mg(t,n))?(t=r,n=0):(e=hg(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Lm(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Kh(e)},50)}function _g(e,t){let n=e.state.doc.resolve(t);if(!(Zm||nh)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function vg(e,t,n){let r=e.state.selection;if(r instanceof R&&!r.empty||n.indexOf(`s`)>-1||th&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=ag(e.state,t);if(n&&n instanceof z)return og(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof gp?L.near(n,t):L.findFrom(n,t);return o?og(e,o):!1}return!1}function yg(e,t){if(!(e.state.selection instanceof R))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function bg(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function xg(e){if(!$m||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;bg(e,n,`true`),setTimeout(()=>bg(e,n,`false`),20)}return!1}function Sg(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Cg(e,t){let n=t.keyCode,r=Sg(t);if(n==8||th&&n==72&&r==`c`)return yg(e,-1)||ug(e,-1);if(n==46&&!t.shiftKey||th&&n==68&&r==`c`)return yg(e,1)||ug(e,1);if(n==13||n==27)return!0;if(n==37||th&&n==66&&r==`c`){let t=n==37?_g(e,e.state.selection.from)==`ltr`?-1:1:-1;return sg(e,t,r)||ug(e,t)}else if(n==39||th&&n==70&&r==`c`){let t=n==39?_g(e,e.state.selection.from)==`ltr`?1:-1:1;return sg(e,t,r)||ug(e,t)}else if(n==38||th&&n==80&&r==`c`)return vg(e,-1,r)||ug(e,-1);else if(n==40||th&&n==78&&r==`c`)return xg(e)||vg(e,1,r)||ug(e,1);else if(r==(th?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function wg(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Ud.fromSchema(e.state.schema),s=Fg(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Ng[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
156
+
157
+ `),slice:t}}function Tg(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new I(F.from(e.state.schema.text(t.replace(/\r\n?/g,`
158
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Ud.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Rg(n),ih&&zg(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||kd.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Eg.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Bg(Mg(s,+u[1],+u[2]),u[4]);else if(s=I.maxOpen(Dg(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Mg(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Eg=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Dg(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&kg(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Ag(a[a.length-1],i.length));let n=Og(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return F.from(a)}return e}function Og(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,F.from(e));return e}function kg(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=kg(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(F.from(Og(n,e,i+1))))}}function Ag(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Ag(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(F.empty,!0);return e.copy(n.append(r))}function jg(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=jg(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(F.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Mg(e,t,n){return t<e.openStart&&(e=new I(jg(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new I(jg(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ng={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Pg=null;function Fg(){return Pg||=document.implementation.createHTMLDocument(`title`)}var Ig=null;function Lg(e){let t=window.trustedTypes;return t?(Ig||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Ig.createHTML(e)):e}function Rg(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Fg().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Ng[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Lg(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function zg(e){let t=e.querySelectorAll(Zm?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Bg(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=F.from(t.create(r[e+1],i)),a++,o++}return new I(i,a,o)}var Vg={},Hg={},Ug={touchstart:!0,touchmove:!0},Wg=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Gg(e){for(let t in Vg){let n=Vg[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Xg(e,t)&&!Yg(e,t)&&(e.editable||!(t.type in Hg))&&n(e,t)},Ug[t]?{passive:!0}:void 0)}$m&&e.dom.addEventListener(`input`,()=>null),Jg(e)}function Kg(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function qg(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Jg(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Yg(e,t))})}function Yg(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Xg(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Zg(e,t){!Yg(e,t)&&Vg[t.type]&&(e.editable||!(t.type in Hg))&&Vg[t.type](e,t)}Hg.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!d_(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(rh&&Zm&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),eh&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Rm(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Cg(e,n)?n.preventDefault():Kg(e,`key`)},Hg.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Hg.keypress=(e,t)=>{let n=t;if(d_(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||th&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof R)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Qg(e){return{left:e.clientX,top:e.clientY}}function $g(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function e_(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function t_(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function n_(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&z.isSelectable(r)?(t_(e,new z(n),`pointer`),!0):!1}function r_(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof z&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(z.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(t_(e,z.create(e.state.doc,i),`pointer`),!0)}function i_(e,t,n,r,i){return e_(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?r_(e,n):n_(e,n))}function a_(e,t,n,r){return e_(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function o_(e,t,n,r){return e_(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||s_(e,n,r)}function s_(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(t_(e,R.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)t_(e,R.create(r,a+1,a+1+n.content.size),`pointer`);else if(z.isSelectable(n))t_(e,z.create(r,a),`pointer`);else continue;return!0}}function c_(e){return v_(e)}var l_=th?`metaKey`:`ctrlKey`;Vg.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=c_(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&$g(n,e.input.lastClick)&&!n[l_]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Qg(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new u_(e,o,n,!!r)):(a==`doubleClick`?a_:o_)(e,o.pos,o.inside,n)?n.preventDefault():Kg(e,`pointer`))};var u_=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[l_],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof z&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ym&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Kg(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kh(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Qg(e))),this.updateAllowDefault(e),this.allowDefault||!t?Kg(this.view,`pointer`):i_(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$m&&this.mightDrag&&!this.mightDrag.node.isAtom||Zm&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(t_(this.view,L.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Kg(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Kg(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};Vg.touchstart=e=>{e.input.lastTouch=Date.now(),c_(e),Kg(e,`pointer`)},Vg.touchmove=e=>{e.input.lastTouch=Date.now(),Kg(e,`pointer`)},Vg.contextmenu=e=>c_(e);function d_(e,t){return e.composing?!0:$m&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var f_=rh?5e3:-1;Hg.compositionstart=Hg.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof R&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Zm&&nh&&p_(e)))e.markCursor=e.state.storedMarks||n.marks(),v_(e,!0),e.markCursor=null;else if(v_(e,!t.selection.empty),Ym&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}m_(e,f_)};function p_(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Hg.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,m_(e,20))};function m_(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>v_(e),t))}function h_(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=__());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function g_(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Nm(t.focusNode,t.focusOffset),r=Pm(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function __(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function v_(e,t=!1){if(!(rh&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),h_(e),t||e.docView&&e.docView.dirty){let n=Wh(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function y_(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var b_=qm&&Jm<15||eh&&ah<604;Vg.copy=Hg.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=b_?null:n.clipboardData,{dom:o,text:s}=wg(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):y_(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function x_(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function S_(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?C_(e,r.value,null,i,t):C_(e,r.textContent,r.innerHTML,i,t)},50)}function C_(e,t,n,r,i){let a=Tg(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||I.empty)))return!0;if(!a)return!1;let o=x_(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function w_(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Hg.paste=(e,t)=>{let n=t;if(e.composing&&!rh)return;let r=b_?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&C_(e,w_(r),r.getData(`text/html`),i,n)?n.preventDefault():S_(e,n)};var T_=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},E_=th?`altKey`:`ctrlKey`;function D_(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[E_]:!n}Vg.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Qg(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof z?i.to-1:i.to))){if(r&&r.mightDrag)o=z.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=z.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=wg(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Zm||Qm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(b_?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,b_||n.dataTransfer.setData(`text/plain`,c),e.dragging=new T_(l,D_(e,n),o)},Vg.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Hg.dragover=Hg.dragenter=(e,t)=>t.preventDefault(),Hg.drop=(e,t)=>{try{O_(e,t,e.dragging)}finally{e.dragging=null}};function O_(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Qg(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Tg(e,w_(t.dataTransfer),b_?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&D_(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||I.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Wf(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&z.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new z(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(tg(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Vg.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Kh(e)},20))},Vg.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Vg.beforeinput=(e,t)=>{if(Zm&&rh&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Rm(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Hg)Vg[e]=Hg[e];function k_(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var A_=class e{constructor(e,t){this.toDOM=e,this.spec=t||F_,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new N_(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&k_(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},j_=class e{constructor(e,t){this.attrs=e,this.spec=t||F_}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new N_(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&k_(this.attrs,t.attrs)&&k_(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},M_=class e{constructor(e,t){this.attrs=e,this.spec=t||F_}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new N_(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&k_(this.attrs,t.attrs)&&k_(this.spec,t.spec)}destroy(){}},N_=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new A_(n,r))}static inline(t,n,r,i){return new e(t,n,new j_(r,i))}static node(t,n,r,i){return new e(t,n,new M_(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof j_}get widget(){return this.type instanceof A_}},P_=[],F_={},I_=class e{constructor(e,t){this.local=e.length?e:P_,this.children=t.length?t:P_}static create(e,t){return t.length?W_(t,e,0,F_):L_}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==L_||e.maps.length==0?this:this.mapInner(e,t,0,0,n||F_)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?z_(this.children,o||[],t,n,r,i,a):o?new e(o.sort(G_),P_):L_}add(t,n){return n.length?this==L_?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=H_(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,W_(s,e,o+1,F_)),a+=3}});let o=B_(a?U_(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(G_):this.local,i||this.children)}remove(e){return e.length==0||this==L_?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==L_?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):L_}forChild(t,n){if(this==L_)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof j_){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(G_),P_);return r?new R_([t,r]):t}return r||L_}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return K_(this.localsInner(e))}localsInner(e){if(this==L_)return P_;if(e.inlineContent||!this.local.some(j_.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof j_||t.push(this.local[e]);return t}forEachSet(e){e(this)}};I_.empty=new I_([],[]),I_.removeOverlap=K_;var L_=I_.empty,R_=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,F_));return e.from(r)}forChild(t,n){if(n.isLeaf)return I_.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=L_&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?K_(n?t:t.sort(G_)):P_}static from(t){switch(t.length){case 0:return L_;case 1:return t[0];default:return new e(t.every(e=>e instanceof I_)?t:t.reduce((e,t)=>e.concat(t instanceof I_?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function z_(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==L_?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=W_(V_(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new I_(t.sort(G_),s)}function B_(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new N_(i.from+t,i.to+t,i.type))}return n}function V_(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function H_(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function U_(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function W_(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=H_(e,t,o+n);if(s){a=!0;let e=W_(s,t,n+o+1,r);e!=L_&&i.push(o,o+t.nodeSize,e)}});let o=B_(a?U_(e):e,-n).sort(G_);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new I_(o,i):L_}function G_(e,t){return e.from-t.from||e.to-t.to}function K_(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),q_(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),q_(t,i,r.copy(a.from,r.to)));break}}}return t}function q_(e,t,n){for(;t<e.length&&G_(n,e[t])>0;)t++;e.splice(t,0,n)}function J_(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=L_&&t.push(r)}),e.cursorWrapper&&t.push(I_.create(e.state.doc,[e.cursorWrapper.deco])),R_.from(t)}var Y_={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X_=qm&&Jm<=11,Z_=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Q_=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Z_,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);qm&&Jm<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():$m&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),X_&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Y_)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ng(this.view)){if(this.suppressingSelectionUpdates)return Kh(this.view);if(qm&&Jm<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&km(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Tm(n))t.add(n);for(let r=e.anchorNode;r;r=Tm(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ng(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Ym&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||iv(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Lm(n)&&(c=Wh(e))&&c.eq(L.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Kh(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),tv(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,av(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Kh(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(qm&&Jm<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?wm(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?wm(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},$_=new WeakMap,ev=!1;function tv(e){if(!$_.has(e)&&($_.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ym,ev)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),ev=!0}}function nv(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return km(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function rv(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return nv(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?nv(e,n):null}function iv(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function av(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function ov(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Lm(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Zm&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||kd.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:sv,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function sv(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if($m&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||$m&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var cv=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lv(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Wh(e,t);if(n&&!e.state.selection.eq(n)){if(Zm&&rh&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Rm(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=ov(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=mv(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(eh&&e.input.lastIOSEnter>Date.now()-225||rh)&&i.some(e=>e.nodeType==1&&!cv.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Rm(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof R&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=uv(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof R&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),qm&&Jm<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((eh&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Rm(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&fv(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Rm(8,`Backspace`)))){rh&&Zm&&e.domObserver.suppressSelectionUpdates();return}Zm&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),rh&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Rm(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=uv(e,n.doc,l.sel);t&&!(Zm&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||qm&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){qm&&Jm<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Kh(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=dv(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function uv(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:tg(e,t.resolve(n.anchor),t.resolve(n.head))}function dv(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(F.from(l).eq(e))return{mark:s,type:o}}function fv(e,t,n,r,i){if(n-t<=i.pos-r.pos||pv(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(pv(a,!0,!0));return!o.parent.isTextblock||o.pos>n||pv(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function pv(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function mv(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&hv(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&hv(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function hv(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var gv=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Wg,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Cv),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=yv(this),vv(this),this.nodeViews=xv(this),this.docView=Mh(this.state.doc,_v(this),J_(this),this.dom,this),this.domObserver=new Q_(this,(e,t,n,r)=>lv(this,e,t,n,r)),this.domObserver.start(),Gg(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Jg(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Cv),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(h_(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=xv(this);Sv(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Jg(this),this.editable=yv(this),vv(this);let o=J_(this),s=_v(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&zee(this);if(i){this.domObserver.stop();let t=l&&(qm||Zm)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&bv(n.selection,e.selection);if(l){let n=Zm?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=g_(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Mh(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ig(this))?Kh(this,t):($h(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Bee(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof z){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&ch(this,t.getBoundingClientRect(),e)}else ch(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new T_(e.slice,e.move,r<0?void 0:z.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(qm){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Vee(this.dom),Kh(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Kee(this,e)}coordsAtPos(e,t=1){return _h(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Zee(this,t||this.state,e)}pasteHTML(e,t){return C_(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return C_(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return wg(this,e)}destroy(){this.docView&&(qg(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],J_(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Om())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Zg(this,e)}domSelectionRange(){let e=this.domSelection();return e?$m&&this.root.nodeType===11&&zm(this.dom.ownerDocument)==this.dom&&rv(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};gv.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function _v(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[N_.node(0,e.state.doc.content.size,t)]}function vv(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:N_.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function yv(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function bv(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function xv(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Sv(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Cv(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var wv=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Tv=typeof navigator<`u`&&/Win/.test(navigator.platform);function Ev(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))wv?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Dv(e){let t=Object.create(null);for(let n in e)t[Ev(n)]=e[n];return t}function Ov(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function kv(e){return new Ap({props:{handleKeyDown:Av(e)}})}function Av(e){let t=Dv(e);return function(e,n){let r=g(n),i,a=t[Ov(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Ov(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Tv&&n.ctrlKey&&n.altKey)&&(i=_[n.keyCode])&&i!=r){let r=t[Ov(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var jv=e(Du(),1),Mv=Object.defineProperty,Nv=(e,t)=>{for(var n in t)Mv(e,n,{get:t[n],enumerable:!0})};function Pv(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Fv=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Pv({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Iv={};Nv(Iv,{blur:()=>Lv,clearContent:()=>Rv,clearNodes:()=>zv,command:()=>Bv,createParagraphNear:()=>Vv,cut:()=>Hv,deleteCurrentNode:()=>Uv,deleteNode:()=>Gv,deleteRange:()=>Kv,deleteSelection:()=>qv,enter:()=>Jv,exitCode:()=>Yv,extendMarkRange:()=>ny,first:()=>ry,focus:()=>uy,forEach:()=>dy,insertContent:()=>fy,insertContentAt:()=>vy,joinBackward:()=>xy,joinDown:()=>by,joinForward:()=>Sy,joinItemBackward:()=>Cy,joinItemForward:()=>wy,joinTextblockBackward:()=>Ty,joinTextblockForward:()=>Ey,joinUp:()=>yy,keyboardShortcut:()=>ky,lift:()=>jy,liftEmptyBlock:()=>My,liftListItem:()=>Ny,newlineInCode:()=>Py,resetAttributes:()=>Ly,scrollIntoView:()=>Ry,selectAll:()=>zy,selectNodeBackward:()=>By,selectNodeForward:()=>Vy,selectParentNode:()=>Hy,selectTextblockEnd:()=>Uy,selectTextblockStart:()=>Wy,setContent:()=>Ky,setMark:()=>Gb,setMeta:()=>Kb,setNode:()=>qb,setNodeSelection:()=>Jb,setTextDirection:()=>Yb,setTextSelection:()=>Xb,sinkListItem:()=>Zb,splitBlock:()=>$b,splitListItem:()=>ex,toggleList:()=>ix,toggleMark:()=>ax,toggleNode:()=>ox,toggleWrap:()=>sx,undoInputRule:()=>cx,unsetAllMarks:()=>lx,unsetMark:()=>ux,unsetTextDirection:()=>dx,updateAttributes:()=>fx,wrapIn:()=>px,wrapInList:()=>mx});var Lv=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Rv=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),zv=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=wf(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Bv=e=>t=>e(t),Vv=()=>({state:e,dispatch:t})=>$p(e,t),Hv=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new R(r.doc.resolve(Math.max(o-1,0)))),!0},Uv=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Wv(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Gv=e=>({tr:t,state:n,dispatch:r})=>{let i=Wv(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Kv=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},qv=()=>({state:e,dispatch:t})=>Pp(e,t),Jv=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Yv=()=>({state:e,dispatch:t})=>Qp(e,t);function Xv(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Zv(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:Xv(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Qv(e,t,n={}){return e.find(e=>e.type===t&&Zv(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function $v(e,t,n={}){return!!Qv(e,t,n)}function ey(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Qv([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&$v([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&$v([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function ty(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var ny=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=ty(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=ey(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=R.create(o,e.from,e.to);n.setSelection(t)}}return!0},ry=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function iy(e){return e instanceof R}function ay(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function oy(e,t=null){if(!t)return null;let n=L.atStart(e),r=L.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?R.create(e,ay(0,i,a),ay(e.content.size,i,a)):R.create(e,ay(t,i,a),ay(t,i,a))}function sy(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function cy(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function ly(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var uy=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(cy()||sy())&&r.dom.focus(),ly()&&!cy()&&!sy()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!iy(n.state.selection))return o(),!0;let s=oy(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},dy=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),fy=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),py=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&py(r)}return e};function my(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return py(n)}function hy(e,t,n){if(e instanceof ed||e instanceof F)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return F.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),hy(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Td({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?kd.fromSchema(a).parseSlice(my(e),n.parseOptions):kd.fromSchema(a).parse(my(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=kd.fromSchema(t);return n.slice?r.parseSlice(my(e),n.parseOptions).content:r.parse(my(e),n.parseOptions)}return hy(``,t,n)}function gy(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof _f||i instanceof vf))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(L.near(e.doc.resolve(o),n))}var _y=e=>!(`type`in e),vy=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{hy(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=hy(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((_y(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof F){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&gy(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},yy=()=>({state:e,dispatch:t})=>qp(e,t),by=()=>({state:e,dispatch:t})=>Jp(e,t),xy=()=>({state:e,dispatch:t})=>Ip(e,t),Sy=()=>({state:e,dispatch:t})=>Wp(e,t),Cy=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Vf(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},wy=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Vf(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ty=()=>({state:e,dispatch:t})=>Lp(e,t),Ey=()=>({state:e,dispatch:t})=>Rp(e,t);function Dy(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Oy(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))cy()||Dy()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var ky=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Oy(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Ay(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Wv(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Zv(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var jy=(e,t={})=>({state:n,dispatch:r})=>Ay(n,Wv(e,n.schema),t)?Yp(n,r):!1,My=()=>({state:e,dispatch:t})=>em(e,t),Ny=e=>({state:t,dispatch:n})=>bm(Wv(e,t.schema))(t,n),Py=()=>({state:e,dispatch:t})=>Xp(e,t);function Fy(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Iy(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Ly=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Fy(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Wv(e,r.schema)),s===`mark`&&(o=ty(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Iy(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Iy(a.attrs,t))))})})}),c},Ry=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),zy=()=>({tr:e,dispatch:t})=>{if(t){let t=new gp(e.doc);e.setSelection(t)}return!0},By=()=>({state:e,dispatch:t})=>Vp(e,t),Vy=()=>({state:e,dispatch:t})=>Gp(e,t),Hy=()=>({state:e,dispatch:t})=>rm(e,t),Uy=()=>({state:e,dispatch:t})=>lm(e,t),Wy=()=>({state:e,dispatch:t})=>cm(e,t);function Gy(e,t,n={},r={}){return hy(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Ky=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Gy(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function qy(e,t){let n=ty(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function Jy(e,t){let n=new lp(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Yy(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Xy(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Zy(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Qy(e){return t=>Zy(t.$from,e)}function B(e,t,n){return e.config[t]===void 0&&e.parent?B(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?B(e.parent,t,n):null}):e.config[t]}function $y(e){return e.map(e=>{let t=B(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...$y(t())]:e}).flat(10)}function eb(e,t){let n=Ud.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function tb(e){return typeof e==`function`}function nb(e,t=void 0,...n){return tb(e)?t?e.bind(t)(...n):e(...n):e}function rb(e={}){return Object.keys(e).length===0&&e.constructor===Object}function ib(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function ab(e){let t=[],{nodeExtensions:n,markExtensions:r}=ib(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=B(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=B(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function ob(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function sb(e){let t=[],n=ob(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function cb(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...sb(n[e]),...sb(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function lb(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>cb(e,t),{})}function ub(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function db(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):ub(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function fb(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&rb(t)?!1:t!=null))}function pb(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function mb(e,t){let n=ab(e),{nodeExtensions:r,markExtensions:i}=ib(e);return new Td({topNode:r.find(e=>B(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=fb({...e.reduce((e,t)=>{let n=B(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:nb(B(r,`content`,a)),marks:nb(B(r,`marks`,a)),group:nb(B(r,`group`,a)),inline:nb(B(r,`inline`,a)),atom:nb(B(r,`atom`,a)),selectable:nb(B(r,`selectable`,a)),draggable:nb(B(r,`draggable`,a)),code:nb(B(r,`code`,a)),whitespace:nb(B(r,`whitespace`,a)),linebreakReplacement:nb(B(r,`linebreakReplacement`,a)),defining:nb(B(r,`defining`,a)),isolating:nb(B(r,`isolating`,a)),attrs:Object.fromEntries(i.map(pb))}),s=nb(B(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>db(e,i)));let c=B(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:lb(e,i)}));let l=B(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=fb({...e.reduce((e,t)=>{let n=B(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:nb(B(r,`inclusive`,a)),excludes:nb(B(r,`excludes`,a)),group:nb(B(r,`group`,a)),spanning:nb(B(r,`spanning`,a)),code:nb(B(r,`code`,a)),attrs:Object.fromEntries(i.map(pb))}),s=nb(B(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>db(e,i)));let c=B(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:lb(e,i)})),[r.name,o]}))})}function hb(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function gb(e){return e.sort((e,t)=>{let n=B(e,`priority`)||100,r=B(t,`priority`)||100;return n>r?-1:+(n<r)})}function _b(e){let t=gb($y(e)),n=hb(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function vb(e,t){return mb(_b(e),t)}function yb(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
159
+
160
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function bb(e,t){return yb(e,{from:0,to:e.content.size},t)}function xb(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Sb(e,t){let n=Wv(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Cb(e,t){let n=Fy(typeof t==`string`?t:t.name,e.schema);return n===`node`?Sb(e,t):n===`mark`?qy(e,t):{}}function wb(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Tb(e){let t=wb(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Eb(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Tb(r)}function Db(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=ey(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Ob=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function kb(e,t){return t.nodes[e]||t.marks[e]||null}function Ab(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var jb=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Mb(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?ty(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Zv(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Zv(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Nb(e,t,n={}){if(!t)return Ay(e,null,n)||Mb(e,null,n);let r=Fy(t,e.schema);return r===`node`?Ay(e,t,n):r===`mark`?Mb(e,t,n):!1}var Pb=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=Qy(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Fb=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Ib(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Lb(e,t){let{nodeExtensions:n}=ib(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=nb(B(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Rb(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Rb(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function zb(e){return e instanceof z}var Bb=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Vb(e,t){let n=t.mapping.mapResult(e.position);return{position:new Bb(n.pos),mapResult:n}}function Hb(e){return new Bb(e)}function Ub(e,t,n){let r=e.state.doc.content.size,i=ay(t,0,r),a=ay(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function Wb(e,t,n){let{selection:r}=t,i=null;if(iy(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Gb=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=ty(e,r.schema);if(i)if(o){let e=qy(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Wb(r,n,c)},Kb=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),qb=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Wv(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>dm(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>dm(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Jb=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=ay(e,0,n.content.size),i=z.create(n,r);t.setSelection(i)}return!0},Yb=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Xb=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=R.atStart(n).from,o=R.atEnd(n).to,s=ay(r,a,o),c=ay(i,a,o),l=R.create(n,s,c);t.setSelection(l)}return!0},Zb=e=>({state:t,dispatch:n})=>Cm(Wv(e,t.schema))(t,n);function Qb(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var $b=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Ab(l,s.node().type.name,s.node().attrs);if(a instanceof z&&a.node.isBlock)return!s.parentOffset||!If(o,s.pos)?!1:(r&&(e&&Qb(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Yy(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=If(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&If(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof R&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Qb(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},ex=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Wv(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=F.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=F.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Ab(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(F.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new I(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(R.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Ab(d,u.type.name,u.attrs),...t},m={...Ab(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!If(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},tx=(e,t)=>{let n=Qy(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Rf(e.doc,n.pos)&&e.join(n.pos),!0},nx=(e,t)=>{let n=Qy(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Rf(e.doc,r)&&e.join(r),!0};function rx(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return R.create(t,1,r)}var ix=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Wv(e,o.schema),m=Wv(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=Qy(e=>Lb(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Lb(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,te=!!T;if((ee||te)&&E){if(E.node.type===p)return S&&te?c().command(({tr:e,dispatch:t})=>{let n=rx(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Lb(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>tx(a,p)).command(()=>nx(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>tx(a,p)).command(()=>nx(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>tx(a,p)).command(()=>nx(a,p)).run()},ax=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=ty(e,r.schema);return Mb(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},ox=(e,t,n={})=>({state:r,commands:i})=>{let a=Wv(e,r.schema),o=Wv(t,r.schema),s=Ay(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},sx=(e,t={})=>({state:n,commands:r})=>{let i=Wv(e,n.schema);return Ay(n,i,t)?r.lift(i):r.wrapIn(i,t)},cx=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},lx=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},ux=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=ty(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=ey(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},dx=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},fx=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Fy(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Wv(e,r.schema)),s===`mark`&&(o=ty(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},px=(e,t={})=>({state:n,dispatch:r})=>um(Wv(e,n.schema),t)(n,r),mx=(e,t={})=>({state:n,dispatch:r})=>_m(Wv(e,n.schema),t)(n,r),hx=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}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},gx=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},_x=(e,t)=>{if(Xv(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function vx(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=jb(c)+i;return a.forEach(e=>{if(l)return;let a=_x(u,e.find);if(!a)return;let c=s.state.tr,d=Pv({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Fv({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function yx(e){let{editor:t,rules:n}=e,r=new Ap({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:eb(F.from(e),a.schema);let{from:i}=s;vx({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return vx({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&vx({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?vx({editor:t,from:a.pos,to:a.pos,text:`
161
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function bx(e){return Object.prototype.toString.call(e).slice(8,-1)}function xx(e){return bx(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function Sx(e,t){let n={...e};return xx(e)&&xx(t)&&Object.keys(t).forEach(r=>{xx(t[r])&&xx(e[r])?n[r]=Sx(e[r],t[r]):n[r]=t[r]}),n}var Cx=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...nb(B(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...nb(B(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Sx(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},wx=class e extends Cx{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Tx(e){return typeof e==`number`}var Ex=class{constructor(e){this.find=e.find,this.handler=e.handler}},Dx=(e,t,n)=>{if(Xv(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Ox(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Fv({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Dx(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var kx=null,Ax=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function jx(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Ox({editor:t,state:Pv({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new Ap({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(kx=t)},i=()=>{kx&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=kx;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:eb(F.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Ax(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Tx(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Mx=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=_b(e),this.schema=mb(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=B(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:kb(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return gb([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:kb(t.name,this.schema)},r=[],i=B(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&B(t,`exitable`,n)&&(a.ArrowRight=()=>wx.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=kv(a);r.push(o);let s=B(t,`addInputRules`,n);if(Ib(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=yx({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=B(t,`addPasteRules`,n);if(Ib(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=jx({editor:e,rules:t});r.push(...n)}}let l=B(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return ab(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=ib(this.extensions);return Object.fromEntries(t.filter(e=>!!B(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=B(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Wv(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:lb(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return gb([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:kb(n.name,this.schema)},i=B(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return gb([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:kb(n.name,this.schema)},i=B(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=ib(this.extensions);return Object.fromEntries(t.filter(e=>!!B(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=B(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ty(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=lb(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{gS(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:kb(e.name,this.schema)};e.type===`mark`&&(nb(B(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=B(e,`onBeforeCreate`,t),r=B(e,`onCreate`,t),i=B(e,`onUpdate`,t),a=B(e,`onSelectionUpdate`,t),o=B(e,`onTransaction`,t),s=B(e,`onFocus`,t),c=B(e,`onBlur`,t),l=B(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Mx.resolve=_b,Mx.sort=gb,Mx.flatten=$y,Nv({},{ClipboardTextSerializer:()=>Px,Commands:()=>Fx,Delete:()=>Ix,Drop:()=>Lx,Editable:()=>Rx,FocusEvents:()=>Bx,Keymap:()=>Vx,Paste:()=>Hx,Tabindex:()=>Ux,TextDirection:()=>Wx,focusEventsPluginKey:()=>zx});var Nx=class e extends Cx{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Px=Nx.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ap({key:new Np(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=xb(n);return yb(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),Fx=Nx.create({name:`commands`,addCommands(){return{...Iv}}}),Ix=Nx.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=Jy(e.before,[e,...t]);Eb(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof mf){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),Lx=Nx.create({name:`drop`,addProseMirrorPlugins(){return[new Ap({key:new Np(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Rx=Nx.create({name:`editable`,addProseMirrorPlugins(){return[new Ap({key:new Np(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),zx=new Np(`focusEvents`),Bx=Nx.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Ap({key:zx,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Vx=Nx.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:L.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return cy()||Dy()?i:r},addProseMirrorPlugins(){return[new Ap({key:new Np(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=L.atStart(t.doc).from,l=L.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!Rb(n.doc))return;let u=n.tr,d=Pv({state:n,transaction:u}),{commands:f}=new Fv({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Hx=Nx.create({name:`paste`,addProseMirrorPlugins(){return[new Ap({key:new Np(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Ux=Nx.create({name:`tabindex`,addProseMirrorPlugins(){return[new Ap({key:new Np(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),Wx=Nx.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=ib(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ap({key:new Np(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Gx=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Kx=`.ProseMirror {
162
+ position: relative;
163
+ }
164
+
165
+ .ProseMirror {
166
+ word-wrap: break-word;
167
+ white-space: pre-wrap;
168
+ white-space: break-spaces;
169
+ -webkit-font-variant-ligatures: none;
170
+ font-variant-ligatures: none;
171
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
172
+ }
173
+
174
+ .ProseMirror [contenteditable="false"] {
175
+ white-space: normal;
176
+ }
177
+
178
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
179
+ white-space: pre-wrap;
180
+ }
181
+
182
+ .ProseMirror pre {
183
+ white-space: pre-wrap;
184
+ }
185
+
186
+ img.ProseMirror-separator {
187
+ display: inline !important;
188
+ border: none !important;
189
+ margin: 0 !important;
190
+ width: 0 !important;
191
+ height: 0 !important;
192
+ }
193
+
194
+ .ProseMirror-gapcursor {
195
+ display: none;
196
+ pointer-events: none;
197
+ position: absolute;
198
+ margin: 0;
199
+ }
200
+
201
+ .ProseMirror-gapcursor:after {
202
+ content: "";
203
+ display: block;
204
+ position: absolute;
205
+ top: -2px;
206
+ width: 20px;
207
+ border-top: 1px solid black;
208
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
209
+ }
210
+
211
+ @keyframes ProseMirror-cursor-blink {
212
+ to {
213
+ visibility: hidden;
214
+ }
215
+ }
216
+
217
+ .ProseMirror-hideselection *::selection {
218
+ background: transparent;
219
+ }
220
+
221
+ .ProseMirror-hideselection *::-moz-selection {
222
+ background: transparent;
223
+ }
224
+
225
+ .ProseMirror-hideselection * {
226
+ caret-color: transparent;
227
+ }
228
+
229
+ .ProseMirror-focused .ProseMirror-gapcursor {
230
+ display: block;
231
+ }`;function qx(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var Jx=class extends hx{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Vb,createMappablePosition:Hb},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=oy(t,this.options.autofocus);this.editorState=Op.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=qx(Kx,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=tb(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new Mx([...this.options.enableCoreExtensions?[Rx,Px.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Fx,Bx,Vx,Ux,Lx,Hx,Ix,Wx.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new Fv({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Gy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=Gy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new gv(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Cb(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Nb(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return eb(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
232
+
233
+ `,textSerializers:n={}}=e||{};return bb(this.state.doc,{blockSeparator:t,textSerializers:{...xb(this.schema),...n}})}get isEmpty(){return Rb(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new Gx(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function Yx(e){return new gx({find:e.find,handler:({state:t,range:n,match:r})=>{let i=nb(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Db(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Xx(e){return new gx({find:e.find,handler:({state:t,range:n,match:r})=>{let i=nb(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Zx(e){return new gx({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=nb(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Qx(e){return new gx({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=nb(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Ef(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rf(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var $x=e=>`touches`in e,eS=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,$x(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function tS(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof z){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function nS(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function rS(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}Nv({},{createAtomBlockMarkdownSpec:()=>oS,createBlockMarkdownSpec:()=>sS,createInlineMarkdownSpec:()=>uS,parseAttributes:()=>iS,parseIndentedBlocks:()=>dS,renderNestedMarkdownContent:()=>fS,serializeAttributes:()=>aS});function iS(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function aS(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function oS(e){let{nodeName:t,name:n,parseAttributes:r=iS,serializeAttributes:i=aS,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function sS(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=iS,serializeAttributes:a=aS,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
234
+
235
+ ${t.renderChildren(e.content||[],`
236
+
237
+ `)}
238
+
239
+ :::`}}}function cS(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function lS(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function uS(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=cS,serializeAttributes:a=lS,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function dS(e,t,n){let r=e.split(`
240
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
241
+ `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
242
+ `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
243
+ `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
244
+ `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
245
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function fS(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
246
+ `).map(e=>e?t.indent(e):t.indent(``)).join(`
247
+ `);s+=e.type===`paragraph`?`
248
+
249
+ ${n}`:`
250
+ ${n}`}}),s}var pS=new WeakMap;function mS(e,t){let n=pS.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};pS.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function hS(e,t){let n=pS.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),pS.delete(e)))}function gS(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var _S=class e extends Cx{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},vS=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=z.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=z.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(cy()||sy())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function yS(e){return new Ex({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=nb(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Db(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var bS=4,xS=/^```([a-z]+)?[\s\n]$/,SS=/^~~~([a-z]+)?[\s\n]$/,CS=_S.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:bS,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,cb(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
251
+ `):`\`\`\`${r}
252
+
253
+ \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??bS,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
254
+ `,`
255
+ `).split(`
256
+ `).map(e=>o+e).join(`
257
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??bS,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
258
+ `,`
259
+ `).split(`
260
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(R.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
261
+ `,`
262
+ `).split(`
263
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
264
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
265
+
266
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(L.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Zx({find:xS,type:this.type,getAttributes:e=>({language:e[1]})}),Zx({find:SS,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ap({key:new Np(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
267
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(R.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),wS=CS,TS=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},ES=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,DS=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,OS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,AS=wx.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return TS(`strong`,{...cb(this.options.HTMLAttributes,e),children:TS(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Yx({find:ES,type:this.type}),Yx({find:OS,type:this.type})]},addPasteRules(){return[yS({find:DS,type:this.type}),yS({find:kS,type:this.type})]}}),jS=AS,MS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,NS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,PS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,FS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,IS=wx.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,cb(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Yx({find:MS,type:this.type}),Yx({find:PS,type:this.type})]},addPasteRules(){return[yS({find:NS,type:this.type}),yS({find:FS,type:this.type})]}}),LS=IS,RS=_S.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,cb(this.options.HTMLAttributes,e)]},renderText(){return`
268
+ `},renderMarkdown:()=>`
269
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zS=RS,BS=_S.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,cb(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Zx({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),VS=BS,HS=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,US=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,WS=`numeric`,GS=`ascii`,KS=`alpha`,qS=`asciinumeric`,JS=`alphanumeric`,YS=`domain`,XS=`emoji`,ZS=`scheme`,QS=`slashscheme`,$S=`whitespace`;function eC(e,t){return e in t||(t[e]=[]),t[e]}function tC(e,t,n){t[WS]&&(t[qS]=!0,t[JS]=!0),t[GS]&&(t[qS]=!0,t[KS]=!0),t[qS]&&(t[JS]=!0),t[KS]&&(t[JS]=!0),t[JS]&&(t[YS]=!0),t[XS]&&(t[YS]=!0);for(let r in t){let t=eC(r,n);t.indexOf(e)<0&&t.push(e)}}function nC(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function rC(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}rC.groups={},rC.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=rC.groups;let i;return t&&t.j?i=t:(i=new rC(t),n&&r&&tC(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=rC.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new rC,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new rC,a&&(r&&(o.t&&typeof o.t==`string`?tC(a,Object.assign(nC(o.t,r),n),r):n&&tC(a,n,r)),o.t=a),i.j[e]=o,o}};var iC=(e,t,n,r,i)=>e.ta(t,n,r,i),aC=(e,t,n,r,i)=>e.tr(t,n,r,i),oC=(e,t,n,r,i)=>e.ts(t,n,r,i),V=(e,t,n,r,i)=>e.tt(t,n,r,i),sC=`WORD`,cC=`UWORD`,lC=`ASCIINUMERICAL`,uC=`ALPHANUMERICAL`,dC=`LOCALHOST`,fC=`TLD`,pC=`UTLD`,mC=`SCHEME`,hC=`SLASH_SCHEME`,gC=`NUM`,_C=`WS`,vC=`NL`,yC=`OPENBRACE`,bC=`CLOSEBRACE`,xC=`OPENBRACKET`,SC=`CLOSEBRACKET`,CC=`OPENPAREN`,wC=`CLOSEPAREN`,TC=`OPENANGLEBRACKET`,EC=`CLOSEANGLEBRACKET`,DC=`FULLWIDTHLEFTPAREN`,OC=`FULLWIDTHRIGHTPAREN`,kC=`LEFTCORNERBRACKET`,AC=`RIGHTCORNERBRACKET`,jC=`LEFTWHITECORNERBRACKET`,MC=`RIGHTWHITECORNERBRACKET`,NC=`FULLWIDTHLESSTHAN`,PC=`FULLWIDTHGREATERTHAN`,FC=`AMPERSAND`,IC=`APOSTROPHE`,LC=`ASTERISK`,RC=`AT`,zC=`BACKSLASH`,BC=`BACKTICK`,VC=`CARET`,HC=`COLON`,UC=`COMMA`,WC=`DOLLAR`,GC=`DOT`,KC=`EQUALS`,qC=`EXCLAMATION`,JC=`HYPHEN`,YC=`PERCENT`,XC=`PIPE`,ZC=`PLUS`,QC=`POUND`,$C=`QUERY`,ew=`QUOTE`,tw=`FULLWIDTHMIDDLEDOT`,nw=`SEMI`,rw=`SLASH`,iw=`TILDE`,aw=`UNDERSCORE`,ow=`EMOJI`,sw=`SYM`,cw=Object.freeze({__proto__:null,ALPHANUMERICAL:uC,AMPERSAND:FC,APOSTROPHE:IC,ASCIINUMERICAL:lC,ASTERISK:LC,AT:RC,BACKSLASH:zC,BACKTICK:BC,CARET:VC,CLOSEANGLEBRACKET:EC,CLOSEBRACE:bC,CLOSEBRACKET:SC,CLOSEPAREN:wC,COLON:HC,COMMA:UC,DOLLAR:WC,DOT:GC,EMOJI:ow,EQUALS:KC,EXCLAMATION:qC,FULLWIDTHGREATERTHAN:PC,FULLWIDTHLEFTPAREN:DC,FULLWIDTHLESSTHAN:NC,FULLWIDTHMIDDLEDOT:tw,FULLWIDTHRIGHTPAREN:OC,HYPHEN:JC,LEFTCORNERBRACKET:kC,LEFTWHITECORNERBRACKET:jC,LOCALHOST:dC,NL:vC,NUM:gC,OPENANGLEBRACKET:TC,OPENBRACE:yC,OPENBRACKET:xC,OPENPAREN:CC,PERCENT:YC,PIPE:XC,PLUS:ZC,POUND:QC,QUERY:$C,QUOTE:ew,RIGHTCORNERBRACKET:AC,RIGHTWHITECORNERBRACKET:MC,SCHEME:mC,SEMI:nw,SLASH:rw,SLASH_SCHEME:hC,SYM:sw,TILDE:iw,TLD:fC,UNDERSCORE:aw,UTLD:pC,UWORD:cC,WORD:sC,WS:_C}),lw=/[a-z]/,uw=/\p{L}/u,dw=/\p{Emoji}/u,fw=/\d/,pw=/\s/,mw=`\r`,hw=`
270
+ `,gw=`️`,_w=`‍`,vw=``,yw=null,bw=null;function xw(e=[]){let t={};rC.groups=t;let n=new rC;yw??=Tw(HS),bw??=Tw(US),V(n,`'`,IC),V(n,`{`,yC),V(n,`}`,bC),V(n,`[`,xC),V(n,`]`,SC),V(n,`(`,CC),V(n,`)`,wC),V(n,`<`,TC),V(n,`>`,EC),V(n,`(`,DC),V(n,`)`,OC),V(n,`「`,kC),V(n,`」`,AC),V(n,`『`,jC),V(n,`』`,MC),V(n,`<`,NC),V(n,`>`,PC),V(n,`&`,FC),V(n,`*`,LC),V(n,`@`,RC),V(n,"`",BC),V(n,`^`,VC),V(n,`:`,HC),V(n,`,`,UC),V(n,`$`,WC),V(n,`.`,GC),V(n,`=`,KC),V(n,`!`,qC),V(n,`-`,JC),V(n,`%`,YC),V(n,`|`,XC),V(n,`+`,ZC),V(n,`#`,QC),V(n,`?`,$C),V(n,`"`,ew),V(n,`/`,rw),V(n,`;`,nw),V(n,`~`,iw),V(n,`_`,aw),V(n,`\\`,zC),V(n,`・`,tw);let r=aC(n,fw,gC,{[WS]:!0});aC(r,fw,r);let i=aC(r,lw,lC,{[qS]:!0}),a=aC(r,uw,uC,{[JS]:!0}),o=aC(n,lw,sC,{[GS]:!0});aC(o,fw,i),aC(o,lw,o),aC(i,fw,i),aC(i,lw,i);let s=aC(n,uw,cC,{[KS]:!0});aC(s,lw),aC(s,fw,a),aC(s,uw,s),aC(a,fw,a),aC(a,lw),aC(a,uw,a);let c=V(n,hw,vC,{[$S]:!0}),l=V(n,mw,_C,{[$S]:!0}),u=aC(n,pw,_C,{[$S]:!0});V(n,vw,u),V(l,hw,c),V(l,vw,u),aC(l,pw,u),V(u,mw),V(u,hw),aC(u,pw,u),V(u,vw,u);let d=aC(n,dw,ow,{[XS]:!0});V(d,`#`),aC(d,dw,d),V(d,gw,d);let f=V(d,_w);V(f,`#`),aC(f,dw,d);let p=[[lw,o],[fw,i]],m=[[lw,null],[uw,s],[fw,a]];for(let e=0;e<yw.length;e++)ww(n,yw[e],fC,sC,p);for(let e=0;e<bw.length;e++)ww(n,bw[e],pC,cC,m);tC(fC,{tld:!0,ascii:!0},t),tC(pC,{utld:!0,alpha:!0},t),ww(n,`file`,mC,sC,p),ww(n,`mailto`,mC,sC,p),ww(n,`http`,hC,sC,p),ww(n,`https`,hC,sC,p),ww(n,`ftp`,hC,sC,p),ww(n,`ftps`,hC,sC,p),tC(mC,{scheme:!0,ascii:!0},t),tC(hC,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[ZS]:!0}:{[QS]:!0};r.indexOf(`-`)>=0?i[YS]=!0:lw.test(r)?fw.test(r)?i[qS]=!0:i[GS]=!0:i[WS]=!0,oC(n,r,r,i)}return oC(n,`localhost`,dC,{ascii:!0}),n.jd=new rC(sw),{start:n,tokens:Object.assign({groups:t},cw)}}function Sw(e,t){let n=Cw(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Cw(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function ww(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new rC(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new rC(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function Tw(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var Ew={defaultProtocol:`http`,events:null,format:Ow,formatHref:Ow,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Dw(e,t=null){let n=Object.assign({},Ew);e&&(n=Object.assign(n,e instanceof Dw?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Dw.prototype={o:Ew,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Ew[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Ow(e){return e}function kw(e,t){this.t=`token`,this.v=e,this.tk=t}kw.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Ew.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Aw(e,t){class n extends kw{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var jw=Aw(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Mw=Aw(`text`),Nw=Aw(`nl`),Pw=Aw(`url`,{isLink:!0,toHref(e=Ew.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==dC&&e[1].t===HC}}),Fw=e=>new rC(e);function Iw({groups:e}){let t=e.domain.concat([FC,LC,RC,zC,BC,VC,WC,KC,JC,gC,YC,XC,ZC,QC,rw,sw,iw,aw]),n=[IC,HC,UC,GC,qC,YC,$C,ew,nw,TC,EC,yC,bC,SC,xC,CC,wC,DC,OC,kC,AC,jC,MC,NC,PC],r=[FC,IC,LC,zC,BC,VC,WC,KC,JC,yC,bC,YC,XC,ZC,QC,$C,rw,sw,iw,aw],i=Fw(),a=V(i,iw);iC(a,r,a),iC(a,e.domain,a);let o=Fw(),s=Fw(),c=Fw();iC(i,e.domain,o),iC(i,e.scheme,s),iC(i,e.slashscheme,c),iC(o,r,a),iC(o,e.domain,o);let l=V(o,RC);V(a,RC,l),V(s,RC,l),V(c,RC,l);let u=V(a,GC);iC(u,r,a),iC(u,e.domain,a);let d=Fw();iC(l,e.domain,d),iC(d,e.domain,d);let f=V(d,GC);iC(f,e.domain,d);let p=Fw(jw);iC(f,e.tld,p),iC(f,e.utld,p),V(l,dC,p);let m=V(d,JC);V(m,JC,m),iC(m,e.domain,d),iC(p,e.domain,d),V(p,GC,f),V(p,JC,m),iC(V(p,HC),e.numeric,jw);let h=V(o,JC),g=V(o,GC);V(h,JC,h),iC(h,e.domain,o),iC(g,r,a),iC(g,e.domain,o);let _=Fw(Pw);iC(g,e.tld,_),iC(g,e.utld,_),iC(_,e.domain,o),iC(_,r,a),V(_,GC,g),V(_,JC,h),V(_,RC,l);let v=V(_,HC),y=Fw(Pw);iC(v,e.numeric,y);let b=Fw(Pw),x=Fw();iC(b,t,b),iC(b,n,x),iC(x,t,b),iC(x,n,x),V(_,rw,b),V(y,rw,b);let S=V(s,HC),C=V(V(V(c,HC),rw),rw);iC(s,e.domain,o),V(s,GC,g),V(s,JC,h),iC(c,e.domain,o),V(c,GC,g),V(c,JC,h),iC(S,e.domain,b),V(S,rw,b),V(S,$C,b),iC(C,e.domain,b),iC(C,t,b),V(C,rw,b);let w=[[yC,bC],[xC,SC],[CC,wC],[TC,EC],[DC,OC],[kC,AC],[jC,MC],[NC,PC]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=V(b,r);V(x,r,a),V(a,i,b);let o=Fw(Pw);iC(a,t,o);let s=Fw();iC(a,n),iC(o,t,o),iC(o,n,s),iC(s,t,o),iC(s,n,s),V(o,i,b),V(s,i,b)}return V(i,dC,_),V(i,vC,Nw),{start:i,tokens:cw}}function Lw(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Rw(Mw,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Rw(e,t,r))}}return o.length>0&&a.push(Rw(Mw,t,o)),a}function Rw(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var zw=typeof console<`u`&&console&&console.warn||(()=>{}),Bw=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Vw={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Hw(){return rC.groups={},Vw.scanner=null,Vw.parser=null,Vw.tokenQueue=[],Vw.pluginQueue=[],Vw.customSchemes=[],Vw.initialized=!1,Vw}function Uw(e,t=!1){if(Vw.initialized&&zw(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Bw}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
271
+ 1. Must only contain digits, lowercase ASCII letters or "-"
272
+ 2. Cannot start or end with "-"
273
+ 3. "-" cannot repeat`);Vw.customSchemes.push([e,t])}function Ww(){Vw.scanner=xw(Vw.customSchemes);for(let e=0;e<Vw.tokenQueue.length;e++)Vw.tokenQueue[e][1]({scanner:Vw.scanner});Vw.parser=Iw(Vw.scanner.tokens);for(let e=0;e<Vw.pluginQueue.length;e++)Vw.pluginQueue[e][1]({scanner:Vw.scanner,parser:Vw.parser});return Vw.initialized=!0,Vw}function Gw(e){return Vw.initialized||Ww(),Lw(Vw.parser.start,e,Sw(Vw.scanner.start,e))}Gw.scan=Sw;function Kw(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new Dw(n),i=Gw(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var qw=`[\0- \xA0 ᠎ -\u2029  ]`,Jw=new RegExp(qw),Yw=RegExp(`${qw}$`),Xw=new RegExp(qw,`g`);function Zw(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function Qw(e){return new Ap({key:new Np(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Eb(Jy(n.doc,[...t])).forEach(({newRange:t})=>{let n=Xy(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Yw.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Jw).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=Gw(n).map(t=>t.toObject(e.defaultProtocol));if(!Zw(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Db(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function $w(e){return new Ap({key:new Np(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Cb(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function eT(e){return new Ap({key:new Np(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Kw(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function tT(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(Xw,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var nT=wx.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){Uw(e);return}Uw(e.scheme,e.optionalSlashes)})},onDestroy(){Hw()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!tT(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!tT(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!tT(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,cb(this.options.HTMLAttributes,e),0]:[`a`,cb(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!tT(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!tT(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[yS({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=Kw(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!tT(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Qw({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!tT(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push($w({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(eT({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),rT=nT,iT=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,aT=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,oT=wx.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,cb(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Yx({find:iT,type:this.type})]},addPasteRules(){return[yS({find:aT,type:this.type})]}}),sT,cT;if(typeof WeakMap<`u`){let e=new WeakMap;sT=t=>e.get(t),cT=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;sT=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},cT=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var lT=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return sT(e)||cT(e,uT(e))}};function uT(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=dT(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new lT(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&fT(s,o,e),s}function dT(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function fT(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=pT(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function pT(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function mT(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var hT=new Np(`selectingCells`);function gT(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function _T(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function vT(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function yT(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=gT(t.$head)||bT(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function bT(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function xT(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function ST(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function CT(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function wT(e,t,n){let r=e.node(-1),i=lT.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function TT(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function ET(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function DT(e,t,n){let r=mT(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var OT=class e extends L{constructor(e,t=e){let n=e.node(-1),r=lT.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new dp(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(xT(r)&&xT(i)&&CT(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return R.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=lT.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=TT(e,0,l)),u>0&&(e=TT(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(F.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new I(F.from(o),1,1)}replace(e,t=I.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?I.empty:t)}let i=L.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new I(F.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=lT.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=lT.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=lT.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=lT.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new kT(this.$anchorCell.pos,this.$headCell.pos)}};OT.prototype.visible=!1,L.jsonID(`cell`,OT);var kT=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){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&CT(t,n)?new OT(t,n):L.near(n,1)}};function AT(e){if(!(e.selection instanceof OT))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(N_.node(n,n+e.nodeSize,{class:`selectedCell`}))}),I_.create(e.doc,t)}function jT({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function MT({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function NT(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof z&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=OT.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=OT.rowSelection(e,e)}else if(!n){let e=lT.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=OT.create(i,t+1,n)}}else r instanceof R&&jT(r)?a=R.create(i,r.from):r instanceof R&&MT(r)&&(a=R.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var PT=new Np(`fix-tables`);function FT(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?FT(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function IT(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=LT(e,t,r,n))};return t?t.doc!=e.doc&&FT(t.doc,e.doc,0,r):e.doc.descendants(r),n}function LT(e,t,n,r){let i=lT.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,TT(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=mT(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(PT,{fixTables:!0})}function RT(e){let t=e.selection,n=yT(e),r=n.node(-1),i=n.start(-1),a=lT.get(r);return{...t instanceof OT?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function zT(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;DT(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,ET(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?mT(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function BT(e,t){if(!vT(e))return!1;if(t){let n=RT(e);t(zT(e.tr,n,n.left))}return!0}function VT(e,t){if(!vT(e))return!1;if(t){let n=RT(e);t(zT(e.tr,n,n.right))}return!0}function HT(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,TT(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function UT(e,t){if(!vT(e))return!1;if(t){let n=RT(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;HT(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=lT.get(e)}t(r)}return!0}function WT(e,t,n){let r=mT(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function GT(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;WT(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?mT(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,mT(r.type.schema).row.create(null,o)),e}function KT(e,t){if(!vT(e))return!1;if(t){let n=RT(e);t(GT(e.tr,n,n.top))}return!0}function qT(e,t){if(!vT(e))return!1;if(t){let n=RT(e);t(GT(e.tr,n,n.bottom))}return!0}function JT(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function YT(e,t){if(!vT(e))return!1;if(t){let n=RT(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;JT(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=lT.get(n.table)}t(r)}return!0}function XT(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function ZT({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function QT(e,t){let n=e.selection;if(!(n instanceof OT)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=RT(e),{map:i}=r;if(ZT(i,r))return!1;if(t){let n=e.tr,a={},o=F.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{XT(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...ET(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=XT(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new OT(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function $T(e,t){let n=mT(e.schema);return eE(({node:e})=>n[e.type.spec.tableRole])(e,t)}function eE(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof OT){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=_T(r.$from),!i)return!1;a=gT(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=RT(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof OT&&u.setSelection(new OT(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function tE(e,t){return function(n,r){if(!vT(n))return!1;let i=yT(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof OT?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function nE(e){return function(t,n){if(!vT(t))return!1;if(n){let r=mT(t.schema),i=RT(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function rE(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function iE(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?nE(e):function(t,n){if(!vT(t))return!1;if(n){let r=mT(t.schema),i=RT(t),a=t.tr,o=rE(`row`,i,r),s=rE(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}iE(`row`,{useDeprecatedLogic:!0}),iE(`column`,{useDeprecatedLogic:!0});var aE=iE(`cell`,{useDeprecatedLogic:!0});function oE(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function sE(e){return function(t,n){if(!vT(t))return!1;let r=oE(yT(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(R.between(e,ST(e))).scrollIntoView())}return!0}}function cE(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function lE(e,t){let n=e.selection;if(!(n instanceof OT))return!1;if(t){let r=e.tr,i=mT(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new I(i,0,0))}),r.docChanged&&t(r)}return!0}function uE(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=fE(mT(o).row,new I(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?fE(mT(o).row,new I(t,n,r)).content:t);else return null;return dE(o,s)}function dE(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(F.empty),n[i]<r){let a=mT(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(F.from(o))}return{height:t.length,width:r,rows:t}}function fE(e,t){let n=e.createAndFill();return new lp(n).replace(0,n.content.size,t).doc}function pE({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(TT(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(F.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(F.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function mE(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=mT(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,F.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function hE(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function gE(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,TT(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(TT(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function _E(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=lT.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=lT.get(a),f=d.mapping.maps.length}mE(d,o,a,n,l,u,f)&&p(),hE(d,o,a,n,c,l,s,f)&&p(),hE(d,o,a,n,c,l,u,f)&&p(),gE(d,o,a,n,s,u,c,f)&&p(),gE(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new I(i.rows[e-s],0,0))}p(),d.setSelection(new OT(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var vE=Av({ArrowLeft:bE(`horiz`,-1),ArrowRight:bE(`horiz`,1),ArrowUp:bE(`vert`,-1),ArrowDown:bE(`vert`,1),"Shift-ArrowLeft":xE(`horiz`,-1),"Shift-ArrowRight":xE(`horiz`,1),"Shift-ArrowUp":xE(`vert`,-1),"Shift-ArrowDown":xE(`vert`,1),Backspace:lE,"Mod-Backspace":lE,Delete:lE,"Mod-Delete":lE});function yE(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function bE(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof OT)return yE(n,r,L.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=TE(i,e,t);if(o==null)return!1;if(e==`horiz`)return yE(n,r,L.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=wT(i,e,t),s;return s=a?L.near(a,1):t<0?L.near(n.doc.resolve(i.before(-1)),-1):L.near(n.doc.resolve(i.after(-1)),1),yE(n,r,s)}}}function xE(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof OT)o=a;else{let r=TE(i,e,t);if(r==null)return!1;o=new OT(n.doc.resolve(r))}let s=wT(o.$headCell,e,t);return s?yE(n,r,new OT(o.$anchorCell,s)):!1}}function SE(e,t){let n=e.state.doc,r=gT(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new OT(r))),!0):!1}function CE(e,t,n){if(!vT(e.state))return!1;let r=uE(n),i=e.state.selection;if(i instanceof OT){r||={width:1,height:1,rows:[F.from(fE(mT(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=lT.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=pE(r,o.right-o.left,o.bottom-o.top),_E(e.state,e.dispatch,a,o,r),!0}else if(r){let t=yT(e.state),n=t.start(-1);return _E(e.state,e.dispatch,n,lT.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function wE(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=EE(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof OT)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=gT(e.state.selection.$anchor))!=null&&DE(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=DE(e,n),i=hT.getState(e.state)==null;if(!r||!CT(t,r))if(i)r=t;else return;let a=new OT(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(hT,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),hT.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(hT,-1))}function o(r){let o=r,s=hT.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(EE(e,o.target)!=n&&(c=DE(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function TE(e,t,n){if(!(e.state.selection instanceof R))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function EE(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function DE(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&gT(e.state.doc.resolve(r))||gT(e.state.doc.resolve(i))}var OE=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),kE(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,kE(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function kE(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var AE=new Np(`tableColumnResizing`);function jE({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=OE,lastColumnResizable:i=!0}={}){let a=new Ap({key:AE,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=mT(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new ME(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=AE.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{NE(t,n,e,i)},mouseleave:e=>{PE(e)},mousedown:(e,r)=>{FE(e,r,t,n)}},decorations:e=>{let t=AE.getState(e);if(t&&t.activeHandle>-1)return WE(e,t.activeHandle)},nodeViews:{}}});return a}var ME=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(AE);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return xT(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function NE(e,t,n,r){if(!e.editable)return;let i=AE.getState(e.state);if(i&&!i.dragging){let a=LE(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=RE(e,t,`left`,n):i-t.clientX<=n&&(o=RE(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=lT.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}BE(e,o)}}}function PE(e){if(!e.editable)return;let t=AE.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&BE(e,-1)}function FE(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=AE.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=IE(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(AE,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=AE.getState(e.state);r?.dragging&&(VE(e,r.activeHandle,zE(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(AE,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=AE.getState(e.state);if(i&&i.dragging){let a=zE(i.dragging,t,n);HE(e,i.activeHandle,a,r)}}return HE(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function IE(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function LE(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function RE(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=gT(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=lT.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function zE(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function BE(e,t){e.dispatch(e.state.tr.setMeta(AE,{setHandle:t}))}function VE(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=lT.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():UE(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function HE(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=lT.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&kE(a,c.firstChild,c,r,s,n)}function UE(e){return Array(e).fill(0)}function WE(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return I_.empty;let a=lT.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,AE.getState(e)?.dragging&&n.push(N_.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(N_.widget(s,c))}}return I_.create(e.doc,n)}function GE({allowTableNodeSelection:e=!1}={}){return new Ap({key:hT,state:{init(){return null},apply(e,t){let n=e.getMeta(hT);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:AT,handleDOMEvents:{mousedown:wE},createSelectionBetween(e){return hT.getState(e.state)==null?null:e.state.selection},handleTripleClick:SE,handleKeyDown:vE,handlePaste:CE},appendTransaction(t,n,r){return NT(r,IT(r,n),e)}})}function KE(e){return e===`left`||e===`right`||e===`center`?e:null}function qE(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return KE(t||n)}function JE(e){return KE(e?.align)}function YE(){return{default:null,parseHTML:e=>qE(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var XE=_S.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:YE()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,cb(this.options.HTMLAttributes,e),0]}}),ZE=_S.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:YE()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,cb(this.options.HTMLAttributes,e),0]}}),QE=_S.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,cb(this.options.HTMLAttributes,e),0]}});function $E(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function eD(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=$E(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=$E(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var tD=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),eD(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,eD(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function nD(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=$E(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function rD(e,t){return t?e.createChecked(null,t):e.createAndFill()}function iD(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function aD(e,t,n,r,i){let a=iD(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=rD(a.cell,i);if(e&&s.push(e),r){let e=rD(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function oD(e){return e instanceof OT}var sD=({editor:e})=>{let{selection:t}=e.state;if(!oD(t))return!1;let n=0;return Zy(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function cD(e){return(e||``).replace(/\s+/g,` `).trim()}function lD(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=cD(i),o=e.type===`tableHeader`,s=JE(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
274
+ `,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
275
+ `,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
276
+ `,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
277
+ `}),d}var uD=lD,dD=_S.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:tD,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=nD(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,cb(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=KE(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=KE(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>uD(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=aD(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(R.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>BT(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>VT(e,t),deleteColumn:()=>({state:e,dispatch:t})=>UT(e,t),addRowBefore:()=>({state:e,dispatch:t})=>KT(e,t),addRowAfter:()=>({state:e,dispatch:t})=>qT(e,t),deleteRow:()=>({state:e,dispatch:t})=>YT(e,t),deleteTable:()=>({state:e,dispatch:t})=>cE(e,t),mergeCells:()=>({state:e,dispatch:t})=>QT(e,t),splitCell:()=>({state:e,dispatch:t})=>$T(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>iE(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>iE(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>aE(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>QT(e,t)?!0:$T(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>tE(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>sE(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>sE(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&IT(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=OT.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:sD,"Mod-Backspace":sD,Delete:sD,"Mod-Delete":sD}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[jE({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],GE({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:nb(B(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});Nx.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(dD.configure(this.options.table)),this.options.tableCell!==!1&&e.push(XE.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(ZE.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(QE.configure(this.options.tableRow)),e}});var fD=/^\s*>\s$/,pD=_S.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return TS(`blockquote`,{...cb(this.options.HTMLAttributes,e),children:TS(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
278
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
279
+ `))}),n.join(`
280
+ >
281
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Qx({find:fD,type:this.type})]}}),mD=pD,hD=/(^|[^`])`([^`]+)`(?!`)$/,gD=/(^|[^`])`([^`]+)`(?!`)/g,_D=wx.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,cb(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Yx({find:hD,type:this.type})]},addPasteRules(){return[yS({find:gD,type:this.type})]}}),vD=_D,yD=_S.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
282
+
283
+ `):``}),bD=_S.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,cb(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!tS(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return zb(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(R.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(z.create(t.doc,n.pos)):t.setSelection(R.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(R.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Xx({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),xD=bD,SD=Object.defineProperty,CD=(e,t)=>{for(var n in t)SD(e,n,{get:t[n],enumerable:!0})},wD=`listItem`,TD=`textStyle`,ED=/^\s*([-+*])\s$/,DD=_S.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,cb(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
284
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wD,this.editor.getAttributes(TD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Qx({find:ED,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Qx({find:ED,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(TD),editor:this.editor})),[e]}}),OD=_S.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,cb(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>fS(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});CD({},{findListItemPos:()=>kD,getNextListDepth:()=>AD,handleBackspace:()=>PD,handleDelete:()=>LD,hasListBefore:()=>jD,hasListItemAfter:()=>RD,hasListItemBefore:()=>MD,listItemHasSubList:()=>ND,nextListIsDeeper:()=>FD,nextListIsHigher:()=>ID});var kD=(e,t)=>{let{$from:n}=t.selection,r=Wv(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},AD=(e,t)=>{let n=kD(e,t);if(!n)return!1;let[,r]=Ob(t,e,n.$pos.pos+4);return r},jD=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},MD=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},ND=(e,t,n)=>{if(!n)return!1;let r=Wv(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},PD=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Ay(e.state,t)&&jD(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Ay(e.state,t)||!Fb(e.state))return!1;let r=kD(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=ND(t,e.state,i);return MD(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},FD=(e,t)=>{let n=AD(e,t),r=kD(e,t);return!r||!n?!1:n>r.depth},ID=(e,t)=>{let n=AD(e,t),r=kD(e,t);return!r||!n?!1:n<r.depth},LD=(e,t)=>{if(!Ay(e.state,t)||!Pb(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:FD(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():ID(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},RD=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},zD=Nx.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&LD(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&LD(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&PD(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&PD(e,n,r)&&(t=!0)}),t}}}}),BD=/^(\s*)(\d+)\.\s+(.*)$/,ste=/^\s/;function cte(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(BD);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(BD))break;if(t.trim()===``)f.push(t),u+=`
285
+ `,d+=1;else if(t.match(ste))f.push(t),u+=`
286
+ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
287
+ `)}),r=d,n=d}return[t,r]}function VD(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
288
+ `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
289
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=VD(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
290
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function lte(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var ute=`listItem`,HD=`textStyle`,UD=/^(\d+)\.\s$/,WD=_S.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,cb(this.options.HTMLAttributes,n),0]:[`ol`,cb(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?lte(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
291
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
292
+ `),[i,a]=cte(r);if(i.length===0)return;let o=VD(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
293
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ute,this.editor.getAttributes(HD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Qx({find:UD,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Qx({find:UD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(HD)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),dte=/^\s*(\[([( |x])?\])\s$/,fte=_S.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,cb(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>fS(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=lb(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Qx({find:dte,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),pte=_S.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,cb(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
294
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=dS(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=dS(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Nx.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(DD.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(OD.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(zD.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(WD.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(fte.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(pte.configure(this.options.taskList)),e}});var GD=`&nbsp;`,KD=`\xA0`,mte=_S.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,cb(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===GD||n[0].text===GD||n[0].raw===KD||n[0].text===KD)&&r.length===1&&r[0].type===`text`&&(r[0].text===GD||r[0].text===KD)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?GD:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),hte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,gte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_te=wx.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,cb(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Yx({find:hte,type:this.type})]},addPasteRules(){return[yS({find:gte,type:this.type})]}}),vte=_S.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),yte=wx.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,cb(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function bte(e={}){return new Ap({view(t){return new xte(t,e)}})}var xte=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Wf(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},qD=class e extends L{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):L.near(r)}content(){return I.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Ste(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Cte(e)||!wte(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!z.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};qD.prototype.visible=!1,qD.findFrom=qD.findGapCursorFrom,L.jsonID(`gapcursor`,qD);var Ste=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return qD.valid(t)?new qD(t):L.near(t)}};function JD(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Cte(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||JD(e.type))return!0;if(e.inlineContent)return!1}}return!0}function wte(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||JD(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Tte(){return new Ap({props:{decorations:kte,createSelectionBetween(e,t,n){return t.pos==n.pos&&qD.valid(n)?new qD(n):null},handleClick:Dte,handleKeyDown:Ete,handleDOMEvents:{beforeinput:Ote}}})}var Ete=Av({ArrowLeft:YD(`horiz`,-1),ArrowRight:YD(`horiz`,1),ArrowUp:YD(`vert`,-1),ArrowDown:YD(`vert`,1)});function YD(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof R){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=qD.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new qD(c))),!0):!1}}function Dte(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!qD.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&z.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new qD(r))),!0)}function Ote(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof qD))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=F.empty;for(let e=r.length-1;e>=0;e--)i=F.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new I(i,0,0));return a.setSelection(R.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function kte(e){if(!(e.selection instanceof qD))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,I_.create(e.doc,[N_.widget(e.selection.head,t,{key:`gapcursor`})])}var XD=200,ZD=function(){};ZD.prototype.append=function(e){return e.length?(e=ZD.from(e),!this.length&&e||e.length<XD&&this.leafAppend(e)||this.length<XD&&e.leafPrepend(this)||this.appendInner(e)):this},ZD.prototype.prepend=function(e){return e.length?ZD.from(e).append(this):this},ZD.prototype.appendInner=function(e){return new Ate(this,e)},ZD.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ZD.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},ZD.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},ZD.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},ZD.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},ZD.from=function(e){return e instanceof ZD?e:e&&e.length?new QD(e):ZD.empty};var QD=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=XD)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=XD)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ZD);ZD.empty=new QD([]);var Ate=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(ZD),jte=500,$D=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new eO(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new eO(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new eO(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Nte&&(s=Mte(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new cf;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new eO(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new eO(i,o,l))}else r.push(new eO(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new eO(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>jte&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new eO(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(ZD.from(i.reverse()),a)}};$D.empty=new $D(ZD.empty,0);function Mte(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var eO=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},tO=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Nte=20;function Pte(e,t,n,r){let i=n.getMeta(sO),a;if(i)return i.historyState;n.getMeta(Lte)&&(e=new tO(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(sO))return o.getMeta(sO).redo?new tO(e.done.addTransform(n,void 0,r,oO(t)),e.undone,nO(n.mapping.maps),e.prevTime,e.prevComposition):new tO(e.done,e.undone.addTransform(n,void 0,r,oO(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Fte(n,e.prevRanges)),s=o?rO(e.prevRanges,n.mapping):nO(n.mapping.maps);return new tO(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,oO(t)),$D.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new tO(e.done.rebased(n,a),e.undone.rebased(n,a),rO(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new tO(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),rO(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Fte(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function nO(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function rO(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Ite(e,t,n){let r=oO(t),i=sO.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new tO(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(sO,{redo:n,historyState:c})}var iO=!1,aO=null;function oO(e){let t=e.plugins;if(aO!=t){iO=!1,aO=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){iO=!0;break}}return iO}var sO=new Np(`history`),Lte=new Np(`closeHistory`);function Rte(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ap({key:sO,state:{init(){return new tO($D.empty,$D.empty,null,0,-1)},apply(t,n,r){return Pte(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?lO:n==`historyRedo`?uO:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function cO(e,t){return(n,r)=>{let i=sO.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Ite(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var lO=cO(!1,!0),uO=cO(!0,!0);Nx.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Ap({key:new Np(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var zte=Nx.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[bte(this.options)]}});Nx.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Ap({key:new Np(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return I_.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(N_.node(t,t+e.nodeSize,{class:this.options.className}))}),I_.create(e,a)}}})]}});var Bte=Nx.create({name:`gapCursor`,addProseMirrorPlugins(){return[Tte()]},extendNodeSchema(e){return{allowGapCursor:nb(B(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),dO=`placeholder`;function Vte(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var Hte=Nx.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:dO,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${Vte(this.options.dataAttribute)}`:`data-${dO}`;return[new Ap({key:new Np(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&Rb(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=N_.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),I_.create(t,a)}}})]}});Nx.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Ap({key:new Np(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||zb(n.selection)||e.view.dragging?null:I_.create(n.doc,[N_.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function fO({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Ute=Nx.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Np(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Ap({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!fO({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!fO({node:r,types:n})}}})]}}),Wte=Nx.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>lO(e,t),redo:()=>({state:e,dispatch:t})=>uO(e,t)}},addProseMirrorPlugins(){return[Rte(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Gte=Nx.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(AS.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(pD.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(DD.configure(this.options.bulletList)),this.options.code!==!1&&e.push(_D.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(CS.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(yD.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(zte.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Bte.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(RS.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(BS.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Wte.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(bD.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(IS.configure(this.options.italic)),this.options.listItem!==!1&&e.push(OD.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(zD.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(nT.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(WD.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(mte.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(_te.configure(this.options.strike)),this.options.text!==!1&&e.push(vte.configure(this.options.text)),this.options.underline!==!1&&e.push(yte.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Ute.configure(this.options?.trailingNode)),e}}),Kte=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,qte=_S.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,cb(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new eS({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Xx({find:Kte,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),pO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};pO.prototype.normal={},pO.prototype.property={},pO.prototype.space=void 0;function mO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new pO(n,r,t)}function hO(e){return e.toLowerCase()}var gO=class{constructor(e,t){this.attribute=t,this.property=e}};gO.prototype.attribute=``,gO.prototype.booleanish=!1,gO.prototype.boolean=!1,gO.prototype.commaOrSpaceSeparated=!1,gO.prototype.commaSeparated=!1,gO.prototype.defined=!1,gO.prototype.mustUseProperty=!1,gO.prototype.number=!1,gO.prototype.overloadedBoolean=!1,gO.prototype.property=``,gO.prototype.spaceSeparated=!1,gO.prototype.space=void 0;var _O=t({boolean:()=>H,booleanish:()=>vO,commaOrSpaceSeparated:()=>SO,commaSeparated:()=>xO,number:()=>U,overloadedBoolean:()=>yO,spaceSeparated:()=>bO}),Jte=0,H=CO(),vO=CO(),yO=CO(),U=CO(),bO=CO(),xO=CO(),SO=CO();function CO(){return 2**++Jte}var wO=Object.keys(_O),TO=class extends gO{constructor(e,t,n,r){let i=-1;if(super(e,t),EO(this,`space`,r),typeof n==`number`)for(;++i<wO.length;){let e=wO[i];EO(this,wO[i],(n&_O[e])===_O[e])}}};TO.prototype.defined=!0;function EO(e,t,n){n&&(e[t]=n)}function DO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new TO(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hO(r)]=r,n[hO(a.attribute)]=r}return new pO(t,n,e.space)}var OO=DO({properties:{ariaActiveDescendant:null,ariaAtomic:vO,ariaAutoComplete:null,ariaBusy:vO,ariaChecked:vO,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:bO,ariaCurrent:null,ariaDescribedBy:bO,ariaDetails:null,ariaDisabled:vO,ariaDropEffect:bO,ariaErrorMessage:null,ariaExpanded:vO,ariaFlowTo:bO,ariaGrabbed:vO,ariaHasPopup:null,ariaHidden:vO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bO,ariaLevel:U,ariaLive:null,ariaModal:vO,ariaMultiLine:vO,ariaMultiSelectable:vO,ariaOrientation:null,ariaOwns:bO,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:vO,ariaReadOnly:vO,ariaRelevant:null,ariaRequired:vO,ariaRoleDescription:bO,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:vO,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function kO(e,t){return t in e?e[t]:t}function AO(e,t){return kO(e,t.toLowerCase())}var Yte=DO({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:xO,acceptCharset:bO,accessKey:bO,action:null,allow:null,allowFullScreen:H,allowPaymentRequest:H,allowUserMedia:H,alt:null,as:null,async:H,autoCapitalize:null,autoComplete:bO,autoFocus:H,autoPlay:H,blocking:bO,capture:null,charSet:null,checked:H,cite:null,className:bO,cols:U,colSpan:null,content:null,contentEditable:vO,controls:H,controlsList:bO,coords:U|xO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:yO,draggable:vO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:H,formTarget:null,headers:bO,height:U,hidden:yO,high:U,href:null,hrefLang:null,htmlFor:bO,httpEquiv:bO,id:null,imageSizes:null,imageSrcSet:null,inert:H,inputMode:null,integrity:null,is:null,isMap:H,itemId:null,itemProp:bO,itemRef:bO,itemScope:H,itemType:bO,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:H,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:H,muted:H,name:null,nonce:null,noModule:H,noValidate:H,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:H,optimum:U,pattern:null,ping:bO,placeholder:null,playsInline:H,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:H,referrerPolicy:null,rel:bO,required:H,reversed:H,rows:U,rowSpan:U,sandbox:bO,scope:null,scoped:H,seamless:H,selected:H,shadowRootClonable:H,shadowRootDelegatesFocus:H,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:vO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:H,useMap:null,value:vO,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bO,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:H,declare:H,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:H,noHref:H,noShade:H,noWrap:H,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:vO,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:H,disableRemotePlayback:H,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:AO}),Xte=DO({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:SO,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:bO,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:H,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xO,g2:xO,glyphName:xO,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:SO,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:SO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:SO,rev:SO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:SO,requiredFeatures:SO,requiredFonts:SO,requiredFormats:SO,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:SO,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:SO,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:SO,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:kO}),jO=DO({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),MO=DO({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:AO}),NO=DO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Zte=/[A-Z]/g,PO=/-[a-z]/g,Qte=/^data[-\w.:]+$/i;function FO(e,t){let n=hO(t),r=t,i=gO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Qte.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(PO,ene);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!PO.test(e)){let n=e.replace(Zte,$te);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=TO}return new i(r,t)}function $te(e){return`-`+e.toLowerCase()}function ene(e){return e.charAt(1).toUpperCase()}var IO=mO([OO,Yte,jO,MO,NO],`html`),LO=mO([OO,Xte,jO,MO,NO],`svg`);function RO(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function tne(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var zO=/[#.]/g;function nne(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){zO.lastIndex=i;let e=zO.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function BO(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function rne(e){return e.join(` `).trim()}function VO(e,t,n){let r=n?sne(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=nne(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,ine(i))a.unshift(i);else for(let[t,n]of Object.entries(i))ane(e,o.properties,t,n)}for(let e of a)HO(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function ine(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function ane(e,t,n,r){let i=FO(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?BO(r):i.commaSeparated?RO(r):i.commaOrSpaceSeparated?BO(RO(r).join(` `)):UO(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?one(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(UO(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function HO(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)HO(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?HO(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function UO(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||hO(n)===hO(t)))return!0}return n}function one(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function sne(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var cne=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),lne=VO(IO,`div`),WO=VO(LO,`g`,cne);function GO(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=KO(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=KO(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function KO(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
295
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var qO={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},JO={}.hasOwnProperty,YO=Object.prototype;function XO(e,t){let n=t||{};return ZO({file:n.file||void 0,location:!1,schema:n.space===`svg`?LO:IO,verbose:n.verbose||!1},e)}function ZO(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},ek(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:QO(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=GO(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},ek(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},ek(e,r,n),n}default:return n=$O(e,t),n}}function QO(e,t){let n=-1,r=[];for(;++n<t.length;){let i=ZO(e,t[n]);r.push(i)}return r}function $O(e,t){let n=e.schema;e.schema=t.namespaceURI===qO.svg?LO:IO;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;JO.call(YO,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?WO:lne)(t.tagName,i,QO(e,t.childNodes));if(ek(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&nk(r.startTag),o=r&&r.endTag&&nk(r.endTag),s=ZO(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function ek(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=tk(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function tk(e,t,n){let r=nk(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)JO.call(n.attrs,i)&&(r[FO(e.schema,i).property]=nk(n.attrs[i]));n.startTag;let a=nk(n.startTag),o=n.endTag?nk(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function nk(e){let t=rk({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=rk({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function rk(e){return e.line&&e.column?e:void 0}var ik=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),W;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(W||={});var ak={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function ok(e){return e>=55296&&e<=57343}function sk(e){return e>=56320&&e<=57343}function ck(e,t){return(e-55296)*1024+9216+t}function lk(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function uk(e){return e>=64976&&e<=65007||ik.has(e)}var G;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(G||={});var dk=65536,fk=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dk,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(sk(t))return this.pos++,this._addGap(),ck(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,W.EOF;return this._err(G.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let n=this.html.charCodeAt(t);return n===W.CARRIAGE_RETURN?W.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let e=this.html.charCodeAt(this.pos);return e===W.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,W.LINE_FEED):e===W.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ok(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===W.LINE_FEED||e===W.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){lk(e)?this._err(G.controlCharacterInInputStream):uk(e)&&this._err(G.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},pk;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(pk||={});function mk(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var hk=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),gk=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function _k(e){return e>=55296&&e<=57343||e>1114111?65533:gk.get(e)??e}var vk;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(vk||={});var yk=32,bk;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(bk||={});function xk(e){return e>=vk.ZERO&&e<=vk.NINE}function Sk(e){return e>=vk.UPPER_A&&e<=vk.UPPER_F||e>=vk.LOWER_A&&e<=vk.LOWER_F}function Ck(e){return e>=vk.UPPER_A&&e<=vk.UPPER_Z||e>=vk.LOWER_A&&e<=vk.LOWER_Z||xk(e)}function wk(e){return e===vk.EQUALS||Ck(e)}var Tk;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Tk||={});var Ek;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Ek||={});var Dk=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Tk.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ek.Strict}startEntity(e){this.decodeMode=e,this.state=Tk.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Tk.EntityStart:return e.charCodeAt(t)===vk.NUM?(this.state=Tk.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Tk.NamedEntity,this.stateNamedEntity(e,t));case Tk.NumericStart:return this.stateNumericStart(e,t);case Tk.NumericDecimal:return this.stateNumericDecimal(e,t);case Tk.NumericHex:return this.stateNumericHex(e,t);case Tk.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|yk)===vk.LOWER_X?(this.state=Tk.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Tk.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xk(r)||Sk(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xk(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===vk.SEMI)this.consumed+=1;else if(this.decodeMode===Ek.Strict)return 0;return this.emitCodePoint(_k(this.result),this.consumed),this.errors&&(e!==vk.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&bk.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Ok(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ek.Attribute&&(i===0||wk(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&bk.VALUE_LENGTH)>>14,i!==0){if(a===vk.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ek.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&bk.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~bk.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Tk.NamedEntity:return this.result!==0&&(this.decodeMode!==Ek.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Tk.NumericDecimal:return this.emitNumericEntity(0,2);case Tk.NumericHex:return this.emitNumericEntity(0,3);case Tk.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Tk.EntityStart:return 0}}};function Ok(e,t,n,r){let i=(t&bk.BRANCH_LENGTH)>>7,a=t&bk.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var K;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(K||={});var kk;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(kk||={});var Ak;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(Ak||={});var q;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(q||={});var J;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(J||={});var jk=new Map([[q.A,J.A],[q.ADDRESS,J.ADDRESS],[q.ANNOTATION_XML,J.ANNOTATION_XML],[q.APPLET,J.APPLET],[q.AREA,J.AREA],[q.ARTICLE,J.ARTICLE],[q.ASIDE,J.ASIDE],[q.B,J.B],[q.BASE,J.BASE],[q.BASEFONT,J.BASEFONT],[q.BGSOUND,J.BGSOUND],[q.BIG,J.BIG],[q.BLOCKQUOTE,J.BLOCKQUOTE],[q.BODY,J.BODY],[q.BR,J.BR],[q.BUTTON,J.BUTTON],[q.CAPTION,J.CAPTION],[q.CENTER,J.CENTER],[q.CODE,J.CODE],[q.COL,J.COL],[q.COLGROUP,J.COLGROUP],[q.DD,J.DD],[q.DESC,J.DESC],[q.DETAILS,J.DETAILS],[q.DIALOG,J.DIALOG],[q.DIR,J.DIR],[q.DIV,J.DIV],[q.DL,J.DL],[q.DT,J.DT],[q.EM,J.EM],[q.EMBED,J.EMBED],[q.FIELDSET,J.FIELDSET],[q.FIGCAPTION,J.FIGCAPTION],[q.FIGURE,J.FIGURE],[q.FONT,J.FONT],[q.FOOTER,J.FOOTER],[q.FOREIGN_OBJECT,J.FOREIGN_OBJECT],[q.FORM,J.FORM],[q.FRAME,J.FRAME],[q.FRAMESET,J.FRAMESET],[q.H1,J.H1],[q.H2,J.H2],[q.H3,J.H3],[q.H4,J.H4],[q.H5,J.H5],[q.H6,J.H6],[q.HEAD,J.HEAD],[q.HEADER,J.HEADER],[q.HGROUP,J.HGROUP],[q.HR,J.HR],[q.HTML,J.HTML],[q.I,J.I],[q.IMG,J.IMG],[q.IMAGE,J.IMAGE],[q.INPUT,J.INPUT],[q.IFRAME,J.IFRAME],[q.KEYGEN,J.KEYGEN],[q.LABEL,J.LABEL],[q.LI,J.LI],[q.LINK,J.LINK],[q.LISTING,J.LISTING],[q.MAIN,J.MAIN],[q.MALIGNMARK,J.MALIGNMARK],[q.MARQUEE,J.MARQUEE],[q.MATH,J.MATH],[q.MENU,J.MENU],[q.META,J.META],[q.MGLYPH,J.MGLYPH],[q.MI,J.MI],[q.MO,J.MO],[q.MN,J.MN],[q.MS,J.MS],[q.MTEXT,J.MTEXT],[q.NAV,J.NAV],[q.NOBR,J.NOBR],[q.NOFRAMES,J.NOFRAMES],[q.NOEMBED,J.NOEMBED],[q.NOSCRIPT,J.NOSCRIPT],[q.OBJECT,J.OBJECT],[q.OL,J.OL],[q.OPTGROUP,J.OPTGROUP],[q.OPTION,J.OPTION],[q.P,J.P],[q.PARAM,J.PARAM],[q.PLAINTEXT,J.PLAINTEXT],[q.PRE,J.PRE],[q.RB,J.RB],[q.RP,J.RP],[q.RT,J.RT],[q.RTC,J.RTC],[q.RUBY,J.RUBY],[q.S,J.S],[q.SCRIPT,J.SCRIPT],[q.SEARCH,J.SEARCH],[q.SECTION,J.SECTION],[q.SELECT,J.SELECT],[q.SOURCE,J.SOURCE],[q.SMALL,J.SMALL],[q.SPAN,J.SPAN],[q.STRIKE,J.STRIKE],[q.STRONG,J.STRONG],[q.STYLE,J.STYLE],[q.SUB,J.SUB],[q.SUMMARY,J.SUMMARY],[q.SUP,J.SUP],[q.TABLE,J.TABLE],[q.TBODY,J.TBODY],[q.TEMPLATE,J.TEMPLATE],[q.TEXTAREA,J.TEXTAREA],[q.TFOOT,J.TFOOT],[q.TD,J.TD],[q.TH,J.TH],[q.THEAD,J.THEAD],[q.TITLE,J.TITLE],[q.TR,J.TR],[q.TRACK,J.TRACK],[q.TT,J.TT],[q.U,J.U],[q.UL,J.UL],[q.SVG,J.SVG],[q.VAR,J.VAR],[q.WBR,J.WBR],[q.XMP,J.XMP]]);function Mk(e){return jk.get(e)??J.UNKNOWN}var Y=J,Nk={[K.HTML]:new Set([Y.ADDRESS,Y.APPLET,Y.AREA,Y.ARTICLE,Y.ASIDE,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.BUTTON,Y.CAPTION,Y.CENTER,Y.COL,Y.COLGROUP,Y.DD,Y.DETAILS,Y.DIR,Y.DIV,Y.DL,Y.DT,Y.EMBED,Y.FIELDSET,Y.FIGCAPTION,Y.FIGURE,Y.FOOTER,Y.FORM,Y.FRAME,Y.FRAMESET,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HEADER,Y.HGROUP,Y.HR,Y.HTML,Y.IFRAME,Y.IMG,Y.INPUT,Y.LI,Y.LINK,Y.LISTING,Y.MAIN,Y.MARQUEE,Y.MENU,Y.META,Y.NAV,Y.NOEMBED,Y.NOFRAMES,Y.NOSCRIPT,Y.OBJECT,Y.OL,Y.P,Y.PARAM,Y.PLAINTEXT,Y.PRE,Y.SCRIPT,Y.SECTION,Y.SELECT,Y.SOURCE,Y.STYLE,Y.SUMMARY,Y.TABLE,Y.TBODY,Y.TD,Y.TEMPLATE,Y.TEXTAREA,Y.TFOOT,Y.TH,Y.THEAD,Y.TITLE,Y.TR,Y.TRACK,Y.UL,Y.WBR,Y.XMP]),[K.MATHML]:new Set([Y.MI,Y.MO,Y.MN,Y.MS,Y.MTEXT,Y.ANNOTATION_XML]),[K.SVG]:new Set([Y.TITLE,Y.FOREIGN_OBJECT,Y.DESC]),[K.XLINK]:new Set,[K.XML]:new Set,[K.XMLNS]:new Set},Pk=new Set([Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6]);new Set([q.STYLE,q.SCRIPT,q.XMP,q.IFRAME,q.NOEMBED,q.NOFRAMES,q.PLAINTEXT]);var X;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(X||={});var Fk={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function Ik(e){return e>=W.DIGIT_0&&e<=W.DIGIT_9}function Lk(e){return e>=W.LATIN_CAPITAL_A&&e<=W.LATIN_CAPITAL_Z}function Rk(e){return e>=W.LATIN_SMALL_A&&e<=W.LATIN_SMALL_Z}function zk(e){return Rk(e)||Lk(e)}function Bk(e){return zk(e)||Ik(e)}function Vk(e){return e+32}function Hk(e){return e===W.SPACE||e===W.LINE_FEED||e===W.TABULATION||e===W.FORM_FEED}function Uk(e){return Hk(e)||e===W.SOLIDUS||e===W.GREATER_THAN_SIGN}function Wk(e){return e===W.NULL?G.nullCharacterReference:e>1114111?G.characterReferenceOutsideUnicodeRange:ok(e)?G.surrogateCharacterReference:uk(e)?G.noncharacterCharacterReference:lk(e)||e===W.CARRIAGE_RETURN?G.controlCharacterReference:null}var Gk=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new fk(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Dk(hk,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(G.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(G.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=Wk(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:pk.START_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:pk.END_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:pk.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:pk.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(mk(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(G.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Mk(e.tagName),e.type===pk.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(G.endTagWithAttributes),e.selfClosing&&this._err(G.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case pk.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case pk.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case pk.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:pk.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Hk(e)?pk.WHITESPACE_CHARACTER:e===W.NULL?pk.NULL_CHARACTER:pk.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(pk.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ek.Attribute:Ek.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case X.DATA:this._stateData(e);break;case X.RCDATA:this._stateRcdata(e);break;case X.RAWTEXT:this._stateRawtext(e);break;case X.SCRIPT_DATA:this._stateScriptData(e);break;case X.PLAINTEXT:this._statePlaintext(e);break;case X.TAG_OPEN:this._stateTagOpen(e);break;case X.END_TAG_OPEN:this._stateEndTagOpen(e);break;case X.TAG_NAME:this._stateTagName(e);break;case X.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case X.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case X.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case X.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case X.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case X.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case X.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case X.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case X.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case X.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case X.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case X.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case X.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case X.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case X.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case X.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case X.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case X.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case X.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case X.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case X.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case X.BOGUS_COMMENT:this._stateBogusComment(e);break;case X.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case X.COMMENT_START:this._stateCommentStart(e);break;case X.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case X.COMMENT:this._stateComment(e);break;case X.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case X.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case X.COMMENT_END:this._stateCommentEnd(e);break;case X.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case X.DOCTYPE:this._stateDoctype(e);break;case X.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case X.DOCTYPE_NAME:this._stateDoctypeName(e);break;case X.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case X.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case X.CDATA_SECTION:this._stateCdataSection(e);break;case X.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case X.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case X.CHARACTER_REFERENCE:this._stateCharacterReference();break;case X.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.TAG_OPEN;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitCodePoint(e);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case W.AMPERSAND:this._startCharacterReference();break;case W.LESS_THAN_SIGN:this.state=X.RCDATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.RAWTEXT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(zk(e))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.EXCLAMATION_MARK:this.state=X.MARKUP_DECLARATION_OPEN;break;case W.SOLIDUS:this.state=X.END_TAG_OPEN;break;case W.QUESTION_MARK:this._err(G.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e);break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=X.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(zk(e))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.GREATER_THAN_SIGN:this._err(G.missingEndTagName),this.state=X.DATA;break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.tagName+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(Lk(e)?Vk(e):e)}}_stateRcdataLessThanSign(e){e===W.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){zk(e)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case W.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case W.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===W.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){zk(e)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case W.SOLIDUS:this.state=X.SCRIPT_DATA_END_TAG_OPEN;break;case W.EXCLAMATION_MARK:this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=X.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){zk(e)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===W.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zk(e)?(this._emitChars(`<`),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){zk(e)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(ak.SCRIPT,!1)&&Uk(this.preprocessor.peek(ak.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<ak.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===W.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(ak.SCRIPT,!1)&&Uk(this.preprocessor.peek(ak.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<ak.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._err(G.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=X.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:this._err(G.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(Lk(e)?Vk(e):e)}}_stateAfterAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.EQUALS_SIGN:this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case W.APOSTROPHE:this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break;default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case W.APOSTROPHE:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.AMPERSAND:this._startCharacterReference();break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:case W.EQUALS_SIGN:case W.GRAVE_ACCENT:this._err(G.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case W.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(ak.DASH_DASH,!0)?(this._createCommentToken(ak.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(ak.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(ak.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(ak.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(G.cdataInHtmlContent),this._createCommentToken(ak.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(G.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_START_DASH;break;case W.GREATER_THAN_SIGN:{this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.GREATER_THAN_SIGN:this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END_DASH;break;case W.LESS_THAN_SIGN:t.data+=`<`,this.state=X.COMMENT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case W.EXCLAMATION_MARK:t.data+=`!`,this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break;case W.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==W.GREATER_THAN_SIGN&&e!==W.EOF&&this._err(G.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EXCLAMATION_MARK:this.state=X.COMMENT_END_BANG;break;case W.HYPHEN_MINUS:t.data+=`-`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:t.data+=`--!`,this.state=X.COMMENT_END_DASH;break;case W.GREATER_THAN_SIGN:this._err(G.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=X.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(G.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Lk(e))this._createDoctypeToken(String.fromCharCode(Vk(e))),this.state=X.DOCTYPE_NAME;else switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.NULL:this._err(G.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=X.DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:{this._err(G.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=X.DATA;break}case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.AFTER_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.NULL:this._err(G.unexpectedNullCharacter),t.name+=`�`;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(Lk(e)?Vk(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(ak.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(ak.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(G.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.NULL:this._err(G.unexpectedNullCharacter);break;case W.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case W.RIGHT_SQUARE_BRACKET:this.state=X.CDATA_SECTION_BRACKET;break;case W.EOF:this._err(G.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===W.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars(`]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA;break;case W.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(W.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Bk(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Bk(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===W.SEMICOLON&&this._err(G.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Kk=new Set([J.DD,J.DT,J.LI,J.OPTGROUP,J.OPTION,J.P,J.RB,J.RP,J.RT,J.RTC]),qk=new Set([...Kk,J.CAPTION,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]),Jk=new Set([J.APPLET,J.CAPTION,J.HTML,J.MARQUEE,J.OBJECT,J.TABLE,J.TD,J.TEMPLATE,J.TH]),Yk=new Set([...Jk,J.OL,J.UL]),Xk=new Set([...Jk,J.BUTTON]),Zk=new Set([J.ANNOTATION_XML,J.MI,J.MN,J.MO,J.MS,J.MTEXT]),Qk=new Set([J.DESC,J.FOREIGN_OBJECT,J.TITLE]),$k=new Set([J.TR,J.TEMPLATE,J.HTML]),eA=new Set([J.TBODY,J.TFOOT,J.THEAD,J.TEMPLATE,J.HTML]),tA=new Set([J.TABLE,J.TEMPLATE,J.HTML]),nA=new Set([J.TD,J.TH]),rA=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=J.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===J.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===K.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==K.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Pk,K.HTML)}popUntilTableCellPopped(){this.popUntilPopped(nA,K.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(tA,K.HTML)}clearBackToTableBodyContext(){this.clearBackTo(eA,K.HTML)}clearBackToTableRowContext(){this.clearBackTo($k,K.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===J.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===J.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case K.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case K.SVG:if(Qk.has(r))return!1;break;case K.MATHML:if(Zk.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Jk)}hasInListItemScope(e){return this.hasInDynamicScope(e,Yk)}hasInButtonScope(e){return this.hasInDynamicScope(e,Xk)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case K.HTML:if(Pk.has(t))return!0;if(Jk.has(t))return!1;break;case K.SVG:if(Qk.has(t))return!1;break;case K.MATHML:if(Zk.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===K.HTML)switch(this.tagIDs[e]){case J.TBODY:case J.THEAD:case J.TFOOT:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.OPTION:case J.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Kk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&qk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&qk.has(this.currentTagId);)this.pop()}},iA=3,aA;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(aA||={});var oA={type:aA.Marker},sA=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===aA.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<iA)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<iA)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=iA&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(oA)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:aA.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:aA.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(oA);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===aA.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===aA.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===aA.Element&&t.element===e)}},cA={createDocument(){return{nodeName:`#document`,mode:Ak.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};cA.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(cA.isTextNode(n)){n.value+=t;return}}cA.appendChild(e,cA.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&cA.isTextNode(r)?r.value+=t:cA.insertBefore(e,cA.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},lA=`html`,uA=`about:legacy-compat`,dA=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,fA=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),pA=[...fA,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],mA=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),hA=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],gA=[...hA,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function _A(e,t){return t.some(t=>e.startsWith(t))}function vA(e){return e.name===lA&&e.publicId===null&&(e.systemId===null||e.systemId===uA)}function yA(e){if(e.name!==lA)return Ak.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===dA)return Ak.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),mA.has(n))return Ak.QUIRKS;let e=t===null?pA:fA;if(_A(n,e))return Ak.QUIRKS;if(e=t===null?hA:gA,_A(n,e))return Ak.LIMITED_QUIRKS}return Ak.NO_QUIRKS}var bA={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},xA=`definitionurl`,SA=`definitionURL`,CA=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),wA=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:K.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:K.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:K.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:K.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:K.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:K.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:K.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:K.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:K.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:K.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:K.XMLNS}]]),TA=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),EA=new Set([J.B,J.BIG,J.BLOCKQUOTE,J.BODY,J.BR,J.CENTER,J.CODE,J.DD,J.DIV,J.DL,J.DT,J.EM,J.EMBED,J.H1,J.H2,J.H3,J.H4,J.H5,J.H6,J.HEAD,J.HR,J.I,J.IMG,J.LI,J.LISTING,J.MENU,J.META,J.NOBR,J.OL,J.P,J.PRE,J.RUBY,J.S,J.SMALL,J.SPAN,J.STRONG,J.STRIKE,J.SUB,J.SUP,J.TABLE,J.TT,J.U,J.UL,J.VAR]);function DA(e){let t=e.tagID;return t===J.FONT&&e.attrs.some(({name:e})=>e===kk.COLOR||e===kk.SIZE||e===kk.FACE)||EA.has(t)}function OA(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===xA){e.attrs[t].name=SA;break}}function kA(e){for(let t=0;t<e.attrs.length;t++){let n=CA.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function AA(e){for(let t=0;t<e.attrs.length;t++){let n=wA.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function jA(e){let t=TA.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Mk(e.tagName))}function MA(e,t){return t===K.MATHML&&(e===J.MI||e===J.MO||e===J.MN||e===J.MS||e===J.MTEXT)}function NA(e,t,n){if(t===K.MATHML&&e===J.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===kk.ENCODING){let t=n[e].value.toLowerCase();return t===bA.TEXT_HTML||t===bA.APPLICATION_XML}}return t===K.SVG&&(e===J.FOREIGN_OBJECT||e===J.DESC||e===J.TITLE)}function PA(e,t,n,r){return(!r||r===K.HTML)&&NA(e,t,n)||(!r||r===K.MATHML)&&MA(e,t)}var FA=`hidden`,IA=8,LA=3,Z;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Z||={});var RA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},zA=new Set([J.TABLE,J.TBODY,J.TFOOT,J.THEAD,J.TR]),BA={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:cA,onParseError:null},VA=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Z.INITIAL,this.originalInsertionMode=Z.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...BA,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Gk(this.options,this),this.activeFormattingElements=new sA(this.treeAdapter),this.fragmentContextID=n?Mk(this.treeAdapter.getTagName(n)):J.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new rA(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...BA,...t};e??=n.treeAdapter.createElement(q.TEMPLATE,K.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,K.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===J.TEMPLATE&&i.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??RA,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===K.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,K.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=Fk.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===q.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==K.HTML))switch(this.fragmentContextID){case J.TITLE:case J.TEXTAREA:this.tokenizer.state=Fk.RCDATA;break;case J.STYLE:case J.XMP:case J.IFRAME:case J.NOEMBED:case J.NOFRAMES:case J.NOSCRIPT:this.tokenizer.state=Fk.RAWTEXT;break;case J.SCRIPT:this.tokenizer.state=Fk.SCRIPT_DATA;break;case J.PLAINTEXT:this.tokenizer.state=Fk.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,K.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,K.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(q.HTML,K.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,J.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===pk.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===J.SVG&&this.treeAdapter.getTagName(t)===q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===K.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===J.MGLYPH||e.tagID===J.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,K.HTML)}_processToken(e){switch(e.type){case pk.CHARACTER:this.onCharacter(e);break;case pk.NULL_CHARACTER:this.onNullCharacter(e);break;case pk.COMMENT:this.onComment(e);break;case pk.DOCTYPE:this.onDoctype(e);break;case pk.START_TAG:this._processStartTag(e);break;case pk.END_TAG:this.onEndTag(e);break;case pk.EOF:this.onEof(e);break;case pk.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return PA(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===aA.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(J.P),this.openElements.popUntilTagNamePopped(J.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case J.TR:this.insertionMode=Z.IN_ROW;return;case J.TBODY:case J.THEAD:case J.TFOOT:this.insertionMode=Z.IN_TABLE_BODY;return;case J.CAPTION:this.insertionMode=Z.IN_CAPTION;return;case J.COLGROUP:this.insertionMode=Z.IN_COLUMN_GROUP;return;case J.TABLE:this.insertionMode=Z.IN_TABLE;return;case J.BODY:this.insertionMode=Z.IN_BODY;return;case J.FRAMESET:this.insertionMode=Z.IN_FRAMESET;return;case J.SELECT:this._resetInsertionModeForSelect(e);return;case J.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case J.HTML:this.insertionMode=this.headElement?Z.AFTER_HEAD:Z.BEFORE_HEAD;return;case J.TD:case J.TH:if(e>0){this.insertionMode=Z.IN_CELL;return}break;case J.HEAD:if(e>0){this.insertionMode=Z.IN_HEAD;return}break}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===J.TEMPLATE)break;if(e===J.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(e){return zA.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case J.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===K.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case J.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Nk[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aN(this,e);return}switch(this.insertionMode){case Z.INITIAL:ej(this,e);break;case Z.BEFORE_HTML:rj(this,e);break;case Z.BEFORE_HEAD:oj(this,e);break;case Z.IN_HEAD:uj(this,e);break;case Z.IN_HEAD_NO_SCRIPT:pj(this,e);break;case Z.AFTER_HEAD:gj(this,e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:yj(this,e);break;case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:mM(this,e);break;case Z.IN_TABLE_TEXT:DM(this,e);break;case Z.IN_COLUMN_GROUP:PM(this,e);break;case Z.AFTER_BODY:XM(this,e);break;case Z.AFTER_AFTER_BODY:nN(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){iN(this,e);return}switch(this.insertionMode){case Z.INITIAL:ej(this,e);break;case Z.BEFORE_HTML:rj(this,e);break;case Z.BEFORE_HEAD:oj(this,e);break;case Z.IN_HEAD:uj(this,e);break;case Z.IN_HEAD_NO_SCRIPT:pj(this,e);break;case Z.AFTER_HEAD:gj(this,e);break;case Z.TEXT:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:mM(this,e);break;case Z.IN_COLUMN_GROUP:PM(this,e);break;case Z.AFTER_BODY:XM(this,e);break;case Z.AFTER_AFTER_BODY:nN(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){YA(this,e);return}switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:YA(this,e);break;case Z.IN_TABLE_TEXT:OM(this,e);break;case Z.AFTER_BODY:XA(this,e);break;case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:ZA(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:$A(this,e);break;case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:this._err(e,G.misplacedDoctype);break;case Z.IN_TABLE_TEXT:OM(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,G.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?sN(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:ej(this,e);break;case Z.BEFORE_HTML:tj(this,e);break;case Z.BEFORE_HEAD:ij(this,e);break;case Z.IN_HEAD:sj(this,e);break;case Z.IN_HEAD_NO_SCRIPT:dj(this,e);break;case Z.AFTER_HEAD:mj(this,e);break;case Z.IN_BODY:Qj(this,e);break;case Z.IN_TABLE:CM(this,e);break;case Z.IN_TABLE_TEXT:OM(this,e);break;case Z.IN_CAPTION:AM(this,e);break;case Z.IN_COLUMN_GROUP:MM(this,e);break;case Z.IN_TABLE_BODY:FM(this,e);break;case Z.IN_ROW:LM(this,e);break;case Z.IN_CELL:zM(this,e);break;case Z.IN_SELECT:VM(this,e);break;case Z.IN_SELECT_IN_TABLE:UM(this,e);break;case Z.IN_TEMPLATE:GM(this,e);break;case Z.AFTER_BODY:JM(this,e);break;case Z.IN_FRAMESET:ZM(this,e);break;case Z.AFTER_FRAMESET:$M(this,e);break;case Z.AFTER_AFTER_BODY:tN(this,e);break;case Z.AFTER_AFTER_FRAMESET:rN(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?cN(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:ej(this,e);break;case Z.BEFORE_HTML:nj(this,e);break;case Z.BEFORE_HEAD:aj(this,e);break;case Z.IN_HEAD:cj(this,e);break;case Z.IN_HEAD_NO_SCRIPT:fj(this,e);break;case Z.AFTER_HEAD:hj(this,e);break;case Z.IN_BODY:uM(this,e);break;case Z.TEXT:fM(this,e);break;case Z.IN_TABLE:wM(this,e);break;case Z.IN_TABLE_TEXT:OM(this,e);break;case Z.IN_CAPTION:jM(this,e);break;case Z.IN_COLUMN_GROUP:NM(this,e);break;case Z.IN_TABLE_BODY:IM(this,e);break;case Z.IN_ROW:RM(this,e);break;case Z.IN_CELL:BM(this,e);break;case Z.IN_SELECT:HM(this,e);break;case Z.IN_SELECT_IN_TABLE:WM(this,e);break;case Z.IN_TEMPLATE:KM(this,e);break;case Z.AFTER_BODY:YM(this,e);break;case Z.IN_FRAMESET:QM(this,e);break;case Z.AFTER_FRAMESET:eN(this,e);break;case Z.AFTER_AFTER_BODY:nN(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Z.INITIAL:ej(this,e);break;case Z.BEFORE_HTML:rj(this,e);break;case Z.BEFORE_HEAD:oj(this,e);break;case Z.IN_HEAD:uj(this,e);break;case Z.IN_HEAD_NO_SCRIPT:pj(this,e);break;case Z.AFTER_HEAD:gj(this,e);break;case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:dM(this,e);break;case Z.TEXT:pM(this,e);break;case Z.IN_TABLE_TEXT:OM(this,e);break;case Z.IN_TEMPLATE:qM(this,e);break;case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:QA(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===W.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:this._insertCharacters(e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:vj(this,e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:mM(this,e);break;case Z.IN_TABLE_TEXT:EM(this,e);break;default:}}};function HA(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):lM(e,t),n}function UA(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function WA(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=LA;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=GA(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function GA(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function KA(e,t,n){let r=Mk(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===J.TEMPLATE&&i===K.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function qA(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function JA(e,t){for(let n=0;n<IA;n++){let n=HA(e,t);if(!n)break;let r=UA(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=WA(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&KA(e,a,i),qA(e,r,n)}}function YA(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function XA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function ZA(e,t){e._appendCommentNode(t,e.document)}function QA(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function $A(e,t){e._setDocumentType(t);let n=t.forceQuirks?Ak.QUIRKS:yA(t);vA(t)||e._err(t,G.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function ej(e,t){e._err(t,G.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ak.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function tj(e,t){t.tagID===J.HTML?(e._insertElement(t,K.HTML),e.insertionMode=Z.BEFORE_HEAD):rj(e,t)}function nj(e,t){let n=t.tagID;(n===J.HTML||n===J.HEAD||n===J.BODY||n===J.BR)&&rj(e,t)}function rj(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function ij(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.HEAD:e._insertElement(t,K.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break;default:oj(e,t)}}function aj(e,t){let n=t.tagID;n===J.HEAD||n===J.BODY||n===J.HTML||n===J.BR?oj(e,t):e._err(t,G.endTagWithoutMatchingOpenElement)}function oj(e,t){e._insertFakeElement(q.HEAD,J.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function sj(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TITLE:e._switchToTextParsing(t,Fk.RCDATA);break;case J.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Fk.RAWTEXT):(e._insertElement(t,K.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break;case J.NOFRAMES:case J.STYLE:e._switchToTextParsing(t,Fk.RAWTEXT);break;case J.SCRIPT:e._switchToTextParsing(t,Fk.SCRIPT_DATA);break;case J.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:uj(e,t)}}function cj(e,t){switch(t.tagID){case J.HEAD:e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break;case J.BODY:case J.BR:case J.HTML:uj(e,t);break;case J.TEMPLATE:lj(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function lj(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==J.TEMPLATE&&e._err(t,G.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,G.endTagWithoutMatchingOpenElement)}function uj(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function dj(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.BASEFONT:case J.BGSOUND:case J.HEAD:case J.LINK:case J.META:case J.NOFRAMES:case J.STYLE:sj(e,t);break;case J.NOSCRIPT:e._err(t,G.nestedNoscriptInHead);break;default:pj(e,t)}}function fj(e,t){switch(t.tagID){case J.NOSCRIPT:e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break;case J.BR:pj(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function pj(e,t){let n=t.type===pk.EOF?G.openElementsLeftAfterEof:G.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function mj(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.BODY:e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break;case J.FRAMESET:e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET;break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:e._err(t,G.abandonedHeadElementChild),e.openElements.push(e.headElement,J.HEAD),sj(e,t),e.openElements.remove(e.headElement);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:gj(e,t)}}function hj(e,t){switch(t.tagID){case J.BODY:case J.HTML:case J.BR:gj(e,t);break;case J.TEMPLATE:lj(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function gj(e,t){e._insertFakeElement(q.BODY,J.BODY),e.insertionMode=Z.IN_BODY,_j(e,t)}function _j(e,t){switch(t.type){case pk.CHARACTER:yj(e,t);break;case pk.WHITESPACE_CHARACTER:vj(e,t);break;case pk.COMMENT:YA(e,t);break;case pk.START_TAG:Qj(e,t);break;case pk.END_TAG:uM(e,t);break;case pk.EOF:dM(e,t);break;default:}}function vj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function yj(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bj(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function xj(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Sj(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET)}function Cj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function wj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Pk.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,K.HTML)}function Tj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ej(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),n||(e.formElement=e.openElements.current))}function Dj(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===J.LI&&r===J.LI||(n===J.DD||n===J.DT)&&(r===J.DD||r===J.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==J.ADDRESS&&r!==J.DIV&&r!==J.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function Oj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.tokenizer.state=Fk.PLAINTEXT}function kj(e,t){e.openElements.hasInScope(J.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1}function Aj(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(q.A);n&&(JA(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Mj(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(J.NOBR)&&(JA(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Pj(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ak.QUIRKS&&e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function Fj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ij(e){let t=mk(e,kk.TYPE);return t!=null&&t.toLowerCase()===FA}function Lj(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),Ij(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Rj(e,t){e._appendElement(t,K.HTML),t.ackSelfClosing=!0}function zj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Bj(e,t){t.tagName=q.IMG,t.tagID=J.IMG,Fj(e,t)}function Vj(e,t){e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Fk.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function Hj(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Fk.RAWTEXT)}function Uj(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Fk.RAWTEXT)}function Wj(e,t){e._switchToTextParsing(t,Fk.RAWTEXT)}function Gj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function Kj(e,t){e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function qj(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,K.HTML)}function Jj(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(J.RTC),e._insertElement(t,K.HTML)}function Yj(e,t){e._reconstructActiveFormattingElements(),OA(t),AA(t),t.selfClosing?e._appendElement(t,K.MATHML):e._insertElement(t,K.MATHML),t.ackSelfClosing=!0}function Xj(e,t){e._reconstructActiveFormattingElements(),kA(t),AA(t),t.selfClosing?e._appendElement(t,K.SVG):e._insertElement(t,K.SVG),t.ackSelfClosing=!0}function Zj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function Qj(e,t){switch(t.tagID){case J.I:case J.S:case J.B:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.SMALL:case J.STRIKE:case J.STRONG:jj(e,t);break;case J.A:Aj(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:wj(e,t);break;case J.P:case J.DL:case J.OL:case J.UL:case J.DIV:case J.DIR:case J.NAV:case J.MAIN:case J.MENU:case J.ASIDE:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.DETAILS:case J.ADDRESS:case J.ARTICLE:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:Cj(e,t);break;case J.LI:case J.DD:case J.DT:Dj(e,t);break;case J.BR:case J.IMG:case J.WBR:case J.AREA:case J.EMBED:case J.KEYGEN:Fj(e,t);break;case J.HR:zj(e,t);break;case J.RB:case J.RTC:qj(e,t);break;case J.RT:case J.RP:Jj(e,t);break;case J.PRE:case J.LISTING:Tj(e,t);break;case J.XMP:Hj(e,t);break;case J.SVG:Xj(e,t);break;case J.HTML:bj(e,t);break;case J.BASE:case J.LINK:case J.META:case J.STYLE:case J.TITLE:case J.SCRIPT:case J.BGSOUND:case J.BASEFONT:case J.TEMPLATE:sj(e,t);break;case J.BODY:xj(e,t);break;case J.FORM:Ej(e,t);break;case J.NOBR:Mj(e,t);break;case J.MATH:Yj(e,t);break;case J.TABLE:Pj(e,t);break;case J.INPUT:Lj(e,t);break;case J.PARAM:case J.TRACK:case J.SOURCE:Rj(e,t);break;case J.IMAGE:Bj(e,t);break;case J.BUTTON:kj(e,t);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:Nj(e,t);break;case J.IFRAME:Uj(e,t);break;case J.SELECT:Gj(e,t);break;case J.OPTION:case J.OPTGROUP:Kj(e,t);break;case J.NOEMBED:case J.NOFRAMES:Wj(e,t);break;case J.FRAMESET:Sj(e,t);break;case J.TEXTAREA:Vj(e,t);break;case J.NOSCRIPT:e.options.scriptingEnabled?Wj(e,t):Zj(e,t);break;case J.PLAINTEXT:Oj(e,t);break;case J.COL:case J.TH:case J.TD:case J.TR:case J.HEAD:case J.FRAME:case J.TBODY:case J.TFOOT:case J.THEAD:case J.CAPTION:case J.COLGROUP:break;default:Zj(e,t)}}function $j(e,t){if(e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function eM(e,t){e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,YM(e,t))}function tM(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function nM(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(J.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(J.FORM):n&&e.openElements.remove(n))}function rM(e){e.openElements.hasInButtonScope(J.P)||e._insertFakeElement(q.P,J.P),e._closePElement()}function iM(e){e.openElements.hasInListItemScope(J.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(J.LI),e.openElements.popUntilTagNamePopped(J.LI))}function aM(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function oM(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function sM(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cM(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(q.BR,J.BR),e.openElements.pop(),e.framesetOk=!1}function lM(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==J.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function uM(e,t){switch(t.tagID){case J.A:case J.B:case J.I:case J.S:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.NOBR:case J.SMALL:case J.STRIKE:case J.STRONG:JA(e,t);break;case J.P:rM(e);break;case J.DL:case J.UL:case J.OL:case J.DIR:case J.DIV:case J.NAV:case J.PRE:case J.MAIN:case J.MENU:case J.ASIDE:case J.BUTTON:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.ADDRESS:case J.ARTICLE:case J.DETAILS:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.LISTING:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:tM(e,t);break;case J.LI:iM(e);break;case J.DD:case J.DT:aM(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:oM(e);break;case J.BR:cM(e);break;case J.BODY:$j(e,t);break;case J.HTML:eM(e,t);break;case J.FORM:nM(e);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:sM(e,t);break;case J.TEMPLATE:lj(e,t);break;default:lM(e,t)}}function dM(e,t){e.tmplInsertionModeStack.length>0?qM(e,t):QA(e,t)}function fM(e,t){var n;t.tagID===J.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function pM(e,t){e._err(t,G.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function mM(e,t){if(e.openElements.currentTagId!==void 0&&zA.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case pk.CHARACTER:DM(e,t);break;case pk.WHITESPACE_CHARACTER:EM(e,t);break}else TM(e,t)}function hM(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CAPTION}function gM(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function _M(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.COLGROUP,J.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,MM(e,t)}function vM(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_TABLE_BODY}function yM(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.TBODY,J.TBODY),e.insertionMode=Z.IN_TABLE_BODY,FM(e,t)}function bM(e,t){e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function xM(e,t){Ij(t)?e._appendElement(t,K.HTML):TM(e,t),t.ackSelfClosing=!0}function SM(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,K.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function CM(e,t){switch(t.tagID){case J.TD:case J.TH:case J.TR:yM(e,t);break;case J.STYLE:case J.SCRIPT:case J.TEMPLATE:sj(e,t);break;case J.COL:_M(e,t);break;case J.FORM:SM(e,t);break;case J.TABLE:bM(e,t);break;case J.TBODY:case J.TFOOT:case J.THEAD:vM(e,t);break;case J.INPUT:xM(e,t);break;case J.CAPTION:hM(e,t);break;case J.COLGROUP:gM(e,t);break;default:TM(e,t)}}function wM(e,t){switch(t.tagID){case J.TABLE:e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode());break;case J.TEMPLATE:lj(e,t);break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:TM(e,t)}}function TM(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,_j(e,t),e.fosterParentingEnabled=n}function EM(e,t){e.pendingCharacterTokens.push(t)}function DM(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function OM(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)TM(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var kM=new Set([J.CAPTION,J.COL,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]);function AM(e,t){let n=t.tagID;kM.has(n)?e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,CM(e,t)):Qj(e,t)}function jM(e,t){let n=t.tagID;switch(n){case J.CAPTION:case J.TABLE:e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,n===J.TABLE&&wM(e,t));break;case J.BODY:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:uM(e,t)}}function MM(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.COL:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TEMPLATE:sj(e,t);break;default:PM(e,t)}}function NM(e,t){switch(t.tagID){case J.COLGROUP:e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TEMPLATE:lj(e,t);break;case J.COL:break;default:PM(e,t)}}function PM(e,t){e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE,e._processToken(t))}function FM(e,t){switch(t.tagID){case J.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_ROW;break;case J.TH:case J.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(q.TR,J.TR),e.insertionMode=Z.IN_ROW,LM(e,t);break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,CM(e,t));break;default:CM(e,t)}}function IM(e,t){let n=t.tagID;switch(t.tagID){case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,wM(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:case J.TR:break;default:wM(e,t)}}function LM(e,t){switch(t.tagID){case J.TH:case J.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CELL,e.activeFormattingElements.insertMarker();break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,FM(e,t));break;default:CM(e,t)}}function RM(e,t){switch(t.tagID){case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY);break;case J.TABLE:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,IM(e,t));break;case J.TBODY:case J.TFOOT:case J.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(J.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,IM(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:break;default:wM(e,t)}}function zM(e,t){let n=t.tagID;kM.has(n)?(e.openElements.hasInTableScope(J.TD)||e.openElements.hasInTableScope(J.TH))&&(e._closeTableCell(),LM(e,t)):Qj(e,t)}function BM(e,t){let n=t.tagID;switch(n){case J.TD:case J.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_ROW);break;case J.TABLE:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),RM(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:break;default:uM(e,t)}}function VM(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.OPTGROUP:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.HR:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.INPUT:case J.KEYGEN:case J.TEXTAREA:case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),t.tagID!==J.SELECT&&e._processStartTag(t));break;case J.SCRIPT:case J.TEMPLATE:sj(e,t);break;default:}}function HM(e,t){switch(t.tagID){case J.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===J.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===J.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop();break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop();break;case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode());break;case J.TEMPLATE:lj(e,t);break;default:}}function UM(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e._processStartTag(t)):VM(e,t)}function WM(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e.onEndTag(t)):HM(e,t)}function GM(e,t){switch(t.tagID){case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:sj(e,t);break;case J.CAPTION:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.tmplInsertionModeStack[0]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,CM(e,t);break;case J.COL:e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,MM(e,t);break;case J.TR:e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,FM(e,t);break;case J.TD:case J.TH:e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,LM(e,t);break;default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,Qj(e,t)}}function KM(e,t){t.tagID===J.TEMPLATE&&lj(e,t)}function qM(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):QA(e,t)}function JM(e,t){t.tagID===J.HTML?Qj(e,t):XM(e,t)}function YM(e,t){if(t.tagID===J.HTML){if(e.fragmentContext||(e.insertionMode=Z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===J.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else XM(e,t)}function XM(e,t){e.insertionMode=Z.IN_BODY,_j(e,t)}function ZM(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.FRAMESET:e._insertElement(t,K.HTML);break;case J.FRAME:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.NOFRAMES:sj(e,t);break;default:}}function QM(e,t){t.tagID===J.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==J.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function $M(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.NOFRAMES:sj(e,t);break;default:}}function eN(e,t){t.tagID===J.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function tN(e,t){t.tagID===J.HTML?Qj(e,t):nN(e,t)}function nN(e,t){e.insertionMode=Z.IN_BODY,_j(e,t)}function rN(e,t){switch(t.tagID){case J.HTML:Qj(e,t);break;case J.NOFRAMES:sj(e,t);break;default:}}function iN(e,t){t.chars=`�`,e._insertCharacters(t)}function aN(e,t){e._insertCharacters(t),e.framesetOk=!1}function oN(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==K.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function sN(e,t){if(DA(t))oN(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===K.MATHML?OA(t):r===K.SVG&&(jA(t),kA(t)),AA(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function cN(e,t){if(t.tagID===J.P||t.tagID===J.BR){oN(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===K.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([q.AREA,q.BASE,q.BASEFONT,q.BGSOUND,q.BR,q.COL,q.EMBED,q.FRAME,q.HR,q.IMG,q.INPUT,q.KEYGEN,q.LINK,q.META,q.PARAM,q.SOURCE,q.TRACK,q.WBR]);function lN(e,t){return VA.parse(e,t)}function uN(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=VA.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var dN={basename:fN,dirname:pN,extname:mN,join:hN,sep:`/`};function fN(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);vN(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function pN(e){if(vN(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function mN(e){vN(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function hN(...e){let t=-1,n;for(;++t<e.length;)vN(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:gN(n)}function gN(e){vN(e);let t=e.codePointAt(0)===47,n=_N(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function _N(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function vN(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var yN={cwd:bN};function bN(){return`/`}function xN(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function SN(e){if(typeof e==`string`)e=new URL(e);else if(!xN(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return CN(e)}function CN(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var wN=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],TN=class{constructor(e){let t;t=e?xN(e)?{path:e}:typeof e==`string`||kN(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:yN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<wN.length;){let e=wN[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)wN.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?dN.basename(this.path):void 0}set basename(e){DN(e,`basename`),EN(e,`basename`),this.path=dN.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?dN.dirname(this.path):void 0}set dirname(e){ON(this.basename,`dirname`),this.path=dN.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?dN.extname(this.path):void 0}set extname(e){if(EN(e,`extname`),ON(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=dN.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){xN(e)&&(e=SN(e)),DN(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?dN.basename(this.path,this.extname):void 0}set stem(e){DN(e,`stem`),EN(e,`stem`),this.path=dN.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Eu(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function EN(e,t){if(e&&e.includes(dN.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+dN.sep+"`")}function DN(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ON(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function kN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var AN={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},jN=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,MN=/-[a-z]/g,NN=/%c(?:([-+])(\d+))?/g,PN=/%x/g,FN={2:!0,1:!1,0:null},IN={};function LN(e,t){let n=t||IN,r=n.onerror,i=e instanceof TN?e:new TN(e),a=n.fragment?uN:lN,o=String(i);return XO(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=RN(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=AN[a],o=new Eu(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=FN[c],o.note=l(n.description),o.url=n.url===!1?void 0:jN+t,r(o)}function l(t){return t.replace(NN,n).replace(PN,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return BN(o.charAt(e.startOffset+i))}function r(){return VN(o.charCodeAt(e.startOffset))}}}}function RN(e){return e.replace(MN,zN)}function zN(e){return e.charAt(1).toUpperCase()}function BN(e){return e==="`"?"` ` `":e}function VN(e){return`0x`+e.toString(16).toUpperCase()}function HN(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return LN(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var UN=typeof self==`object`?self:globalThis,WN=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new UN[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new UN[a](o),i)};return r},GN=e=>WN(new Map,e)(0),KN=``,{toString:qN}={},{keys:JN}=Object,YN=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=qN.call(e).slice(8,-1);switch(n){case`Array`:return[1,KN];case`Object`:return[2,KN];case`Date`:return[3,KN];case`RegExp`:return[4,KN];case`Map`:return[5,KN];case`Set`:return[6,KN];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},XN=([e,t])=>e===0&&(t===`function`||t===`symbol`),ZN=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=YN(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of JN(r))(e||!XN(YN(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(XN(YN(n))||XN(YN(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!XN(YN(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},QN=(e,{json:t,lossy:n}={})=>{let r=[];return ZN(!(t||n),!!t,new Map,r)(e),r},$N=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?GN(QN(e,t)):structuredClone(e):(e,t)=>GN(QN(e,t)),eP=(function(e,t,n,r,i){let a=tP(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return oP(e)?a.call(i,e,n,r):!1}),tP=(function(e){if(e==null)return aP;if(typeof e==`string`)return rP(e);if(typeof e==`object`)return nP(e);if(typeof e==`function`)return iP(e);throw Error("Expected function, string, or array as `test`")});function nP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=tP(e[n]);return iP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function rP(e){return iP(t);function t(t){return t.tagName===e}}function iP(e){return t;function t(t,n,r){return!!(oP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function aP(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function oP(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var sP=tP(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),cP=/[ \t\n\f\r]/g;function lP(e){return typeof e==`object`?e.type===`text`?uP(e.value):!1:uP(e)}function uP(e){return e.replace(cP,``)===``}var dP=(function(e,t,n,r,i){let a=fP(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!dP(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return vP(e)?a.call(i,e,n,r):!1}),fP=(function(e){if(e==null)return _P;if(typeof e==`function`)return gP(e);if(typeof e==`object`)return Array.isArray(e)?pP(e):mP(e);if(typeof e==`string`)return hP(e);throw Error(`Expected function, string, or object as test`)});function pP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fP(e[n]);return gP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mP(e){let t=e;return gP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function hP(e){return gP(t);function t(t){return t&&t.type===e}}function gP(e){return t;function t(t,n,r){return!!(vP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function _P(){return!0}function vP(e){return typeof e==`object`&&!!e&&`type`in e}var yP=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),bP=[`button`,`input`,`select`,`textarea`],xP=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],SP={},CP=fP([`comment`,`doctype`]);function wP(e,t){TP(e,{collapse:IP((t||SP).newlines?PP:FP),whitespace:`normal`})}function TP(e,t){if(`children`in e){let n={...t};return(e.type===`root`||jP(e))&&(n.before=!0,n.after=!0),n.whitespace=LP(e,t),DP(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return EP(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:CP(e),stripAtStart:!1,remove:!1}}function EP(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&NP(n.charAt(0))&&i++,i!==a&&NP(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function DP(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=TP(i[o],{...t,after:OP(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),AP(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function OP(e,t,n){for(;++t<e.length;){let n=e[t],r=kP(n);if(r===void 0&&`children`in n&&!MP(n)&&(r=OP(n.children,-1)),typeof r==`boolean`)return r}return n}function kP(e){if(e.type===`element`){if(AP(e))return!1;if(jP(e))return!0}else if(e.type===`text`){if(!lP(e))return!1}else if(!CP(e))return!1}function AP(e){return sP(e)||eP(e,bP)}function jP(e){return eP(e,yP)}function MP(e){return!!(e.type===`element`&&e.properties.hidden)||CP(e)||eP(e,xP)}function NP(e){return e===` `||e===`
296
+ `}function PP(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function FP(){return` `}function IP(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function LP(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function RP(e){return function(t){wP(t,e)}}function zP(e){return e}var BP=[],VP=`skip`;function HP(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=fP(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+zP(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=BP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=UP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function UP(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?BP:[e]}function WP(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),HP(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var GP=qP(`end`),KP=qP(`start`);function qP(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function JP(e){let t=KP(e),n=GP(e);if(t&&n)return{start:t,end:n}}function YP(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function XP(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function ZP(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function QP(e,t){let n={type:`break`};return e.patch(t,n),n}var $P=(function(e,t,n){let r=fP(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),eF=/\n/g,tF=/[\t ]+/g,nF=tP(`br`),rF=tP(gF),iF=tP(`p`),aF=tP(`tr`),oF=tP([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,hF,_F]),sF=tP(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function cF(e,t){let n=t||{},r=`children`in e?e.children:[],i=sF(e),a=mF(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...dF(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...lF(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?nF(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
297
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function lF(e,t,n){return e.type===`element`?uF(e,t,n):e.type===`text`?n.whitespace===`normal`?dF(e,n):fF(e):[]}function uF(e,t,n){let r=mF(e,n),i=e.children||[],a=-1,o=[];if(oF(e))return o;let s,c;for(nF(e)||aF(e)&&$P(t,e,aF)?c=`
298
+ `:iF(e)?(s=2,c=2):sF(e)&&(s=1,c=1);++a<i.length;)o=o.concat(lF(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?nF(i[a+1]):c}));return rF(e)&&$P(t,e,rF)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function dF(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){eF.lastIndex=a;let e=eF.exec(n),i=e&&`index`in e?e.index:n.length;r.push(pF(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function fF(e){return[String(e.value)]}function pF(e,t,n){let r=[],i=0,a;for(;i<e.length;){tF.lastIndex=i;let n=tF.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function mF(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function hF(e){return!!(e.properties||{}).hidden}function gF(e){return e.tagName===`td`||e.tagName===`th`}function _F(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function vF(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var yF=`language-`;function bF(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===yF){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:vF(cF(t))};return e.patch(t,o),o}function xF(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function SF(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function CF(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function wF(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...TF(e,r[i].titles),...TF(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:CF(o),children:o};return e.patch(t,n),n}}function TF(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,EF);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:CF(r),children:r}]}function EF(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function DF(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function OF(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function kF(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:OF(e.all(t))};return e.patch(t,n),n}function AF(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function jF(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function MF(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function NF(e,t){let n={type:`inlineCode`,value:cF(t)};return e.patch(t,n),n}function PF(e,t){let n=[],r=[],i=t||e.properties||{},a=FF(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=cF(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function FF(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...FF(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var IF=`[x]`,LF=`[ ]`;function RF(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||IF:e.options.unchecked||LF};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=PF(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var zF={}.hasOwnProperty;function BF(e,t){let n=e.type===`element`&&zF.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var VF=new Set([`pingback`,`prefetch`,`stylesheet`]);function HF(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!VF.has(String(t[n])))return!1;return!0}var UF=tP(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),WF=tP(`meta`);function GF(e){return!!(e.type===`text`||UF(e)||sP(e)||HF(e)||WF(e)&&BF(e,`itemProp`))}function KF(e,t){let{rest:n,checkbox:r}=JF(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:qF(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function qF(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(GF(r))continue;if(r.tagName===`p`||n||qF(r))return!0;n=!0}}return!1}function JF(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=JF(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function YF(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),XF),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:CF(r),children:r};return e.patch(t,a),a}function XF(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var ZF={};function QF(e,t){let n=t||ZF;return $F(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function $F(e,t,n){if(tI(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return eI(e.children,t,n)}return Array.isArray(e)?eI(e,t,n):``}function eI(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=$F(e[i],t,n);return r.join(``)}function tI(e){return!!(e&&typeof e==`object`)}var nI=fP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function rI(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!cI(n)||`children`in n&&rI(n.children))return!0}return!1}function iI(e){return oI(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?lP(e.value):!1})?[]:[{type:`paragraph`,children:OF(e)}]}}function aI(e){return oI(e.children,t,n);function t(t){let n=lI(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=lI(e),r=lI(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function oI(e,t,n){let r=sI(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];cI(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function sI(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&rI(r.children)?t.push(...aI(r)):t.push(r)}return t}function cI(e){let t=e.data&&e.data.hName;return t?GF({type:`element`,tagName:t,properties:{},children:[]}):nI(e)}function lI(e){return $N({...e,children:[]})}function uI(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(WP({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||rI(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:QF(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function dI(e,t){let n=OF(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var fI=[`"`];function pI(e,t){let n=e.options.quotes||fI;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function mI(e,t){let n=e.all(t);(e.options.document||rI(n))&&(n=iI(n));let r={type:`root`,children:n};return e.patch(t,r),r}function hI(e,t){let n=PF(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function gI(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function _I(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function vI(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),yI)};return e.patch(t,n),n}function yI(){return{type:`tableCell`,children:[]}}function bI(e,t){if(e.inTable){let n={type:`text`,value:cF(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=xI(t),i=e.toSpecificContent(e.all(t),CI);r&&i.unshift(CI());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,SI)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function xI(e){let t={align:[null],headless:!0},n=0,r=0;return WP(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return VP;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function SI(){return{type:`tableCell`,children:[]}}function CI(){return{type:`tableRow`,children:[]}}function wI(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function TI(e,t){let n={type:`text`,value:cF(t)};return e.patch(t,n),n}function EI(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var DI={comment:xF,doctype:jI,root:mI,text:wI},OI={applet:jI,area:jI,basefont:jI,bgsound:jI,caption:jI,col:jI,colgroup:jI,command:jI,content:jI,datalist:jI,dialog:jI,element:jI,embed:jI,frame:jI,frameset:jI,isindex:jI,keygen:jI,link:jI,math:jI,menu:jI,menuitem:jI,meta:jI,nextid:jI,noembed:jI,noframes:jI,optgroup:jI,option:jI,param:jI,script:jI,shadow:jI,source:jI,spacer:jI,style:jI,svg:jI,template:jI,title:jI,track:jI,abbr:kI,acronym:kI,bdi:kI,bdo:kI,big:kI,blink:kI,button:kI,canvas:kI,cite:kI,data:kI,details:kI,dfn:kI,font:kI,ins:kI,label:kI,map:kI,marquee:kI,meter:kI,nobr:kI,noscript:kI,object:kI,output:kI,progress:kI,rb:kI,rbc:kI,rp:kI,rt:kI,rtc:kI,ruby:kI,slot:kI,small:kI,span:kI,sup:kI,sub:kI,tbody:kI,tfoot:kI,thead:kI,time:kI,address:AI,article:AI,aside:AI,body:AI,center:AI,div:AI,fieldset:AI,figcaption:AI,figure:AI,form:AI,footer:AI,header:AI,hgroup:AI,html:AI,legend:AI,main:AI,multicol:AI,nav:AI,picture:AI,section:AI,a:YP,audio:uI,b:gI,base:XP,blockquote:ZP,br:QP,code:NF,dir:YF,dl:wF,dt:KF,dd:KF,del:SF,em:DF,h1:kF,h2:kF,h3:kF,h4:kF,h5:kF,h6:kF,hr:AF,i:DF,iframe:jF,img:MF,image:MF,input:RF,kbd:NF,li:KF,listing:bF,mark:DF,ol:YF,p:dI,plaintext:bF,pre:bF,q:pI,s:SF,samp:NF,select:hI,strike:SF,strong:gI,summary:dI,table:bI,td:_I,textarea:TI,th:_I,tr:vI,tt:NF,u:DF,ul:YF,var:NF,video:uI,wbr:EI,xmp:bF};function kI(e,t){return e.all(t)}function AI(e,t){return e.toFlow(e.all(t))}function jI(){}var MI={}.hasOwnProperty;function NI(e){return{all:PI,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...OI,...e.handlers},inTable:!1,nodeHandlers:{...DI,...e.nodeHandlers},one:FI,options:e,patch:II,qNesting:0,resolve:LI,toFlow:RI,toSpecificContent:zI}}function PI(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function FI(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(MI.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(MI.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function II(e,t){e.position&&(t.position=JP(e))}function LI(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function RI(e){return iI(e)}function zI(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var BI={};function VI(e,t){let n=$N(e),r=t||BI,i=RP({newlines:r.newlines===!0}),a=NI(r),o;i(n),WP(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},WP(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var HI={document:!0};function UI(e,t){return e&&`run`in e?async function(n,r){let i=VI(n,{...HI,...t});await e.run(i,r)}:function(t){return VI(t,{...HI,...e})}}function WI(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var GI=tL(/[A-Za-z]/),KI=tL(/[\dA-Za-z]/),qI=tL(/[#-'*+\--9=?A-Z^-~]/);function JI(e){return e!==null&&(e<32||e===127)}var YI=tL(/\d/),XI=tL(/[\dA-Fa-f]/),ZI=tL(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function QI(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var $I=tL(/\p{P}|\p{S}/u),eL=tL(/\s/);function tL(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function nL(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function rL(e,t,n){let r=fP((n||{}).ignore||[]),i=iL(t),a=-1;for(;++a<i.length;)HP(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function iL(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([aL(e[0]),oL(e[1])])}return t}function aL(e){return typeof e==`string`?new RegExp(nL(e),`g`):e}function oL(e){return typeof e==`function`?e:function(){return e}}var sL=`phrasing`,cL=[`autolink`,`link`,`image`,`label`];function lL(){return{transforms:[_L],enter:{literalAutolink:dL,literalAutolinkEmail:fL,literalAutolinkHttp:fL,literalAutolinkWww:fL},exit:{literalAutolink:gL,literalAutolinkEmail:hL,literalAutolinkHttp:pL,literalAutolinkWww:mL}}}function uL(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:sL,notInConstruct:cL},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:sL,notInConstruct:cL},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:sL,notInConstruct:cL}]}}function dL(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function fL(e){this.config.enter.autolinkProtocol.call(this,e)}function pL(e){this.config.exit.autolinkProtocol.call(this,e)}function mL(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function hL(e){this.config.exit.autolinkEmail.call(this,e)}function gL(e){this.exit(e)}function _L(e){rL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vL],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,yL]],{ignore:[`link`,`linkReference`]})}function vL(e,t,n,r,i){let a=``;if(!SL(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!bL(n)))return!1;let o=xL(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function yL(e,t,n,r){return!SL(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function bL(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function xL(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=WI(e,`(`),a=WI(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function SL(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||eL(n)||$I(n))&&(!t||n!==47)}function CL(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}NL.peek=ML;function wL(){this.buffer()}function TL(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function EL(){this.buffer()}function DL(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function OL(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=CL(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kL(e){this.exit(e)}function AL(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=CL(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jL(e){this.exit(e)}function ML(){return`[`}function NL(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function PL(){return{enter:{gfmFootnoteCallString:wL,gfmFootnoteCall:TL,gfmFootnoteDefinitionLabelString:EL,gfmFootnoteDefinition:DL},exit:{gfmFootnoteCallString:OL,gfmFootnoteCall:kL,gfmFootnoteDefinitionLabelString:AL,gfmFootnoteDefinition:jL}}}function FL(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:NL},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
299
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?LL:IL))),s(),o}}function IL(e,t,n){return t===0?e:LL(e,t,n)}function LL(e,t,n){return(n?``:` `)+e}var RL=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];UL.peek=WL;function zL(){return{canContainEols:[`delete`],enter:{strikethrough:VL},exit:{strikethrough:HL}}}function BL(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:RL}],handlers:{delete:UL}}}function VL(e){this.enter({type:`delete`,children:[]},e)}function HL(e){this.exit(e)}function UL(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function WL(){return`~`}function GL(e){return e.length}function KL(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||GL,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=qL(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=JL(r[d]);else{let e=JL(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
300
+ `)}function qL(e){return e==null?``:String(e)}function JL(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var YL={}.hasOwnProperty;function XL(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&YL.call(t,e)){let n=String(t[e]);i=YL.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var ZL={}.hasOwnProperty;function QL(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)QL(e,t.extensions[n]);for(r in t)if(ZL.call(t,r))switch(r){case`extensions`:break;case`unsafe`:$L(e[r],t[r]);break;case`join`:$L(e[r],t[r]);break;case`handlers`:eR(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function $L(e,t){t&&e.push(...t)}function eR(e,t){t&&Object.assign(e,t)}function tR(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),nR);return i(),o}function nR(e,t,n){return`>`+(n?``:` `)+e}function rR(e,t){return iR(e,t.inConstruct,!0)&&!iR(e,t.notInConstruct,!1)}function iR(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function aR(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
301
+ `&&rR(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
302
+ `}function oR(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function sR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function cR(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lR(e,t,n,r){let i=cR(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(sR(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,uR);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(oR(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
303
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
304
+ `),a&&(u+=s.move(a+`
305
+ `)),u+=s.move(c),l(),u}function uR(e,t,n){return(n?``:` `)+e}function dR(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fR(e,t,n,r){let i=dR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
306
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function pR(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mR(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function hR(e){if(e===null||QI(e)||eL(e))return 1;if($I(e))return 2}function gR(e,t,n){let r=hR(e),i=hR(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_R.peek=vR;function _R(e,t,n,r){let i=pR(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=gR(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=mR(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gR(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+mR(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function vR(e,t,n){return n.options.emphasis||`*`}function yR(e,t){let n=!1;return WP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&QF(e)&&(t.options.setext||n))}function bR(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(yR(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
307
+ `,after:`
308
+ `});return r(),t(),o+`
309
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
310
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
311
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=mR(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}xR.peek=SR;function xR(e){return e.value||``}function SR(){return`<`}CR.peek=wR;function CR(e,t,n,r){let i=dR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function wR(){return`!`}TR.peek=ER;function TR(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ER(){return`!`}DR.peek=OR;function DR(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function OR(){return"`"}function kR(e,t){let n=QF(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}AR.peek=jR;function AR(e,t,n,r){let i=dR(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(kR(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function jR(e,t,n){return kR(e,n)?`<`:`[`}MR.peek=NR;function MR(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function NR(){return`[`}function PR(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function FR(e){let t=PR(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function IR(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function LR(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function RR(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?IR(n):PR(n),s=e.ordered?o===`.`?`)`:`.`:FR(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),LR(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function zR(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function BR(e,t,n,r){let i=zR(n),a=n.bulletCurrent||PR(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function VR(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function HR(e,t,n,r){return(e.children.some(function(e){return nI(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function UR(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}WR.peek=GR;function WR(e,t,n,r){let i=UR(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=gR(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=mR(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gR(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+mR(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function GR(e,t,n){return n.options.strong||`*`}function KR(e,t,n,r){return n.safe(e.value,r)}function qR(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JR(e,t,n){let r=(LR(n)+(n.options.ruleSpaces?` `:``)).repeat(qR(n));return n.options.ruleSpaces?r.slice(0,-1):r}var YR={blockquote:tR,break:aR,code:lR,definition:fR,emphasis:_R,hardBreak:aR,heading:bR,html:xR,image:CR,imageReference:TR,inlineCode:DR,link:AR,linkReference:MR,list:RR,listItem:BR,paragraph:VR,root:HR,strong:WR,text:KR,thematicBreak:JR},XR=[ZR];function ZR(e,t,n,r){if(t.type===`code`&&sR(t,r)&&(e.type===`list`||e.type===t.type&&sR(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&yR(t,r))?void 0:+!!n.spread}var QR=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],$R=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
312
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:QR},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
313
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:QR},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
314
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:QR},{atBreak:!0,character:`+`,after:`(?:[ \r
315
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
316
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
317
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:QR},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:QR},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:QR},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:QR},{atBreak:!0,character:`~`}],ez=document.createElement(`i`);function tz(e){let t=`&`+e+`;`;ez.innerHTML=t;let n=ez.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function nz(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var rz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iz(e){return e.replace(rz,az)}function az(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return nz(n.slice(t?2:1),t?16:10)}return tz(n)||e}function oz(e){return e.label||!e.identifier?e.label||``:iz(e.identifier)}function sz(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function cz(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
318
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=mR(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+mR(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function lz(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
319
+ `,after:`
320
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(uz(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function uz(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
321
+ `.repeat(1+a);if(a===!1)return`
322
+
323
+ <!---->
324
+
325
+ `}return`
326
+
327
+ `}var dz=/\r?\n|\r/g;function fz(e,t){let n=[],r=0,i=0,a;for(;a=dz.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function pz(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!rR(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(mz);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(hz(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(mR(r.charCodeAt(e))),c++))}return a.push(hz(r.slice(c,l),n.after)),a.join(``)}function mz(e,t){return e-t}function hz(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function gz(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function _z(e,t){let n=t||{},r={associationId:oz,containerPhrasing:xz,containerFlow:Sz,createTracker:gz,compilePattern:sz,enter:a,handlers:{...YR},handle:void 0,indentLines:fz,indexStack:[],join:[...XR],options:{},safe:Cz,stack:[],unsafe:[...$R]};QL(r,n),r.options.tightDefinitions&&r.join.push(bz),r.handle=XL(`type`,{invalid:vz,unknown:yz,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
328
+ `,after:`
329
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
330
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function vz(e){throw Error("Cannot handle value `"+e+"`, expected node")}function yz(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function bz(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function xz(e,t){return cz(e,this,t)}function Sz(e,t){return lz(e,this,t)}function Cz(e,t){return pz(this,e,t)}function wz(){return{enter:{table:Tz,tableData:kz,tableHeader:kz,tableRow:Dz},exit:{codeText:Az,table:Ez,tableData:Oz,tableHeader:Oz,tableRow:Oz}}}function Tz(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Ez(e){this.exit(e),this.data.inTable=void 0}function Dz(e){this.enter({type:`tableRow`,children:[]},e)}function Oz(e){this.exit(e)}function kz(e){this.enter({type:`tableCell`,children:[]},e)}function Az(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jz));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function jz(e,t){return t===`|`?t:e}function Mz(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
331
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
332
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return KL(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=YR.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Nz(){return{exit:{taskListCheckValueChecked:Fz,taskListCheckValueUnchecked:Fz,paragraph:Iz}}}function Pz(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Lz}}}function Fz(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Iz(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Lz(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=YR.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Rz(){return[lL(),PL(),zL(),wz(),Nz()]}function zz(e){return{extensions:[uL(),FL(e),BL(),Mz(e),Pz()]}}function Bz(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Vz(e,t){return e.length>0?(Bz(e,e.length,0,t),e):t}var Hz={}.hasOwnProperty;function Uz(e){let t={},n=-1;for(;++n<e.length;)Wz(t,e[n]);return t}function Wz(e,t){let n;for(n in t){let r=(Hz.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Hz.call(r,a)||(r[a]=[]);let e=i[a];Gz(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Gz(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Bz(e,0,0,r)}var Kz={tokenize:oB,partial:!0},qz={tokenize:sB,partial:!0},Jz={tokenize:cB,partial:!0},Yz={tokenize:lB,partial:!0},Xz={tokenize:uB,partial:!0},Zz={name:`wwwAutolink`,tokenize:iB,previous:dB},Qz={name:`protocolAutolink`,tokenize:aB,previous:fB},$z={name:`emailAutolink`,tokenize:rB,previous:pB},eB={};function tB(){return{text:eB}}for(var nB=48;nB<123;)eB[nB]=$z,nB++,nB===58?nB=65:nB===91&&(nB=97);eB[43]=$z,eB[45]=$z,eB[46]=$z,eB[95]=$z,eB[72]=[$z,Qz],eB[104]=[$z,Qz],eB[87]=[$z,Zz],eB[119]=[$z,Zz];function rB(e,t,n){let r=this,i,a;return o;function o(t){return!mB(t)||!pB.call(r,r.previous)||hB(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return mB(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Xz,u,l)(t):t===45||t===95||KI(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&GI(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function iB(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!dB.call(r,r.previous)||hB(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Kz,e.attempt(qz,e.attempt(Jz,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function aB(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&fB.call(r,r.previous)&&!hB(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(GI(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||JI(t)||QI(t)||eL(t)||$I(t)?n(t):e.attempt(qz,e.attempt(Jz,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function oB(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function sB(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Yz,c,s)(t):t===null||QI(t)||eL(t)||t!==45&&$I(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function cB(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Yz,t,a)(o):o===null||QI(o)||eL(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function lB(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||QI(o)||eL(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||QI(e)||eL(e)?t(e):r(e)}function a(e){return GI(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):GI(t)?(e.consume(t),o):n(t)}}function uB(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return KI(e)?n(e):t(e)}}function dB(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||QI(e)}function fB(e){return!GI(e)}function pB(e){return!(e===47||mB(e))}function mB(e){return e===43||e===45||e===46||e===95||KI(e)}function hB(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function gB(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&KI(e.charCodeAt(n+1))&&KI(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function _B(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var vB={name:`attention`,resolveAll:yB,tokenize:bB};function yB(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xB(d,-c),xB(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Vz(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Vz(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Vz(l,_B(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Vz(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Vz(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Bz(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function bB(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=hR(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=hR(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function xB(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var SB={name:`autolink`,tokenize:CB};function CB(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return GI(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||KI(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||KI(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||JI(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):qI(t)?(e.consume(t),l):n(t)}function u(e){return KI(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||KI(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function wB(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var TB={partial:!0,tokenize:EB};function EB(e,t,n){return r;function r(t){return $(t)?wB(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var DB={continuation:{tokenize:kB},exit:AB,name:`blockQuote`,tokenize:OB};function OB(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function kB(e,t,n){let r=this;return i;function i(t){return $(t)?wB(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(DB,t,n)(r)}}function AB(e){e.exit(`blockQuote`)}var jB={name:`characterEscape`,tokenize:MB};function MB(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ZI(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var NB={name:`characterReference`,tokenize:PB};function PB(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=KI,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=XI,u):(e.enter(`characterReferenceValue`),a=7,o=YI,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===KI&&!tz(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var FB={partial:!0,tokenize:RB},IB={concrete:!0,name:`codeFenced`,tokenize:LB};function LB(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),$(t)?wB(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(FB,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),wB(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&$(t)?wB(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(FB,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),$(t)?wB(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),$(t)?wB(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function RB(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var zB={name:`codeIndented`,tokenize:VB},BB={partial:!0,tokenize:HB};function VB(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),wB(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Q(t)?e.attempt(BB,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function HB(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):wB(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Q(e)?i(e):n(e)}}var UB={name:`codeText`,previous:GB,resolve:WB,tokenize:KB};function WB(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function GB(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function KB(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var qB=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&JB(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),JB(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),JB(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);JB(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);JB(this.left,t.reverse())}}};function JB(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function YB(e){let t={},n=-1,r,i,a,o,s,c,l,u=new qB(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,XB(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Bz(e,0,1/0,u.slice(0)),!l}function XB(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ZB={resolve:$B,tokenize:eV},QB={partial:!0,tokenize:tV};function $B(e){return YB(e),e}function eV(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(QB,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function tV(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),wB(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function nV(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||JI(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||QI(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||JI(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function rV(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function iV(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),wB(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function aV(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?wB(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var oV={name:`definition`,tokenize:cV},sV={partial:!0,tokenize:lV};function cV(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return rV.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=CL(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return QI(t)?aV(e,l)(t):l(t)}function l(t){return nV(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(sV,d,d)(t)}function d(t){return $(t)?wB(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function lV(e,t,n){return r;function r(t){return QI(t)?aV(e,i)(t):n(t)}function i(t){return iV(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?wB(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var uV={name:`hardBreakEscape`,tokenize:dV};function dV(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var fV={name:`headingAtx`,resolve:pV,tokenize:mV};function pV(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Bz(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function mV(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||QI(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?wB(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||QI(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var hV=`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.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),gV=[`pre`,`script`,`style`,`textarea`],_V={concrete:!0,name:`htmlFlow`,resolveTo:bV,tokenize:xV},vV={partial:!0,tokenize:CV},yV={partial:!0,tokenize:SV};function bV(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xV(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:O):GI(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):GI(a)?(e.consume(a),i=4,r.interrupt?t:O):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:O):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:te:m):n(i)}function h(t){return GI(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||QI(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&gV.includes(l)?(i=1,r.interrupt?t(s):te(s)):hV.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):te(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||KI(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:te):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||GI(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||KI(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||QI(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Q(t)?te(t):$(t)?(e.consume(t),ee):n(t)}function te(t){return t===45&&i===2?(e.consume(t),ae):t===60&&i===1?(e.consume(t),D):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),O):t===93&&i===5?(e.consume(t),se):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(vV,le,ne)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(t){return e.check(yV,re,le)(t)}function re(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return t===null||Q(t)?ne(t):(e.enter(`htmlFlowData`),te(t))}function ae(t){return t===45?(e.consume(t),O):te(t)}function D(t){return t===47?(e.consume(t),o=``,oe):te(t)}function oe(t){if(t===62){let n=o.toLowerCase();return gV.includes(n)?(e.consume(t),ce):te(t)}return GI(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):te(t)}function se(t){return t===93?(e.consume(t),O):te(t)}function O(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),O):te(t)}function ce(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function SV(e,t,n){let r=this;return i;function i(t){return Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function CV(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(TB,t,n)}}var wV={name:`htmlText`,tokenize:TV};function TV(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):GI(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):GI(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,D(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ae(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,D(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ae(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ae(t):Q(t)?(o=v,D(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,D(t)):(e.consume(t),y)}function b(e){return e===62?ae(e):y(e)}function x(t){return GI(t)?(e.consume(t),S):n(t)}function S(t){return t===45||KI(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,D(t)):$(t)?(e.consume(t),C):ae(t)}function w(t){return t===45||KI(t)?(e.consume(t),w):t===47||t===62||QI(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ae):t===58||t===95||GI(t)?(e.consume(t),E):Q(t)?(o=T,D(t)):$(t)?(e.consume(t),T):ae(t)}function E(t){return t===45||t===46||t===58||t===95||KI(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),te):Q(t)?(o=ee,D(t)):$(t)?(e.consume(t),ee):T(t)}function te(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):Q(t)?(o=te,D(t)):$(t)?(e.consume(t),te):(e.consume(t),re)}function ne(t){return t===i?(e.consume(t),i=void 0,ie):t===null?n(t):Q(t)?(o=ne,D(t)):(e.consume(t),ne)}function re(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||QI(t)?T(t):(e.consume(t),re)}function ie(e){return e===47||e===62||QI(e)?T(e):n(e)}function ae(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function D(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return $(t)?wB(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}var EV={name:`labelEnd`,resolveAll:AV,resolveTo:jV,tokenize:MV},DV={tokenize:NV},OV={tokenize:PV},kV={tokenize:FV};function AV(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Bz(e,0,e.length,n),e}function jV(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Vz(s,e.slice(a+1,a+r+3)),s=Vz(s,[[`enter`,u,t]]),s=Vz(s,_B(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Vz(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Vz(s,e.slice(o+1)),s=Vz(s,[[`exit`,c,t]]),Bz(e,a,e.length,s),e}function MV(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(CL(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(DV,u,o?u:d)(t):t===91?e.attempt(OV,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(kV,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function NV(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return QI(t)?aV(e,a)(t):a(t)}function a(t){return t===41?u(t):nV(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return QI(t)?aV(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?iV(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return QI(t)?aV(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function PV(e,t,n){let r=this;return i;function i(t){return rV.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(CL(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function FV(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var IV={name:`labelStartImage`,resolveAll:EV.resolveAll,tokenize:LV};function LV(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var RV={name:`labelStartLink`,resolveAll:EV.resolveAll,tokenize:zV};function zV(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var BV={name:`lineEnding`,tokenize:VV};function VV(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),wB(e,t,`linePrefix`)}}var HV={name:`thematicBreak`,tokenize:UV};function UV(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?wB(e,s,`whitespace`)(t):s(t))}}var WV={continuation:{tokenize:JV},exit:XV,name:`list`,tokenize:qV},GV={partial:!0,tokenize:ZV},KV={partial:!0,tokenize:YV};function qV(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:YI(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(HV,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return YI(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(TB,r.interrupt?n:u,e.attempt(GV,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function JV(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(TB,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wB(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(KV,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,wB(e,e.attempt(WV,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function YV(e,t,n){let r=this;return wB(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function XV(e){e.exit(this.containerState.type)}function ZV(e,t,n){let r=this;return wB(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var QV={name:`setextUnderline`,resolveTo:$V,tokenize:eH};function $V(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function eH(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),$(t)?wB(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var tH={tokenize:lH,partial:!0};function nH(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:oH,continuation:{tokenize:sH},exit:cH}},text:{91:{name:`gfmFootnoteCall`,tokenize:aH},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:rH,resolveTo:iH}}}}function rH(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=CL(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function iH(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function aH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||QI(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(CL(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return QI(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function oH(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||QI(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=CL(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return QI(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),wB(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function sH(e,t,n){return e.check(TB,t,e.attempt(tH,t,n))}function cH(e){e.exit(`gfmFootnoteDefinition`)}function lH(e,t,n){let r=this;return wB(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function uH(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Bz(o,o.length,0,_B(s,e.slice(r+1,n),t)),Bz(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Bz(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=hR(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=hR(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var dH=class{constructor(){this.map=[]}add(e,t,n){fH(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function fH(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function pH(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function mH(){return{flow:{null:{name:`table`,tokenize:hH,resolveAll:gH}}}}function hH(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?wB(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||QI(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?wB(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?wB(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?wB(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?wB(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||QI(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function gH(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new dH;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(vH(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=_H(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=_H(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=_H(f,t,o,i,n,d)):(o[0]=o[1],d=_H(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&vH(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=pH(t.events,n))}return e}function _H(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},yH(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=yH(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=yH(t.events,n[2]),a=yH(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},yH(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function vH(e,t,n,r,i){let a=[],o=yH(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function yH(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var bH={name:`tasklistCheck`,tokenize:SH};function xH(){return{text:{91:bH}}}function SH(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return QI(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:CH},t,n)(r):n(r)}}function CH(e,t,n){return wB(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function wH(e){return Uz([tB(),nH(),uH(e),mH(),xH()])}var TH={};function EH(e){let t=this,n=e||TH,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(wH(n)),a.push(Rz()),o.push(zz(n))}function DH(e){let t=this;t.compiler=n;function n(n){return _z(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function OH(e){if(e)throw e}var kH=e(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function AH(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jH(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?MH(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function MH(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var NH=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),PH={}.hasOwnProperty,FH=new class e extends NH{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jH()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,kH.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(RH(`data`,this.frozen),this.namespace[e]=t,this):PH.call(this.namespace,e)&&this.namespace[e]||void 0:e?(RH(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=VH(e),n=this.parser||this.Parser;return IH(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),IH(`process`,this.parser||this.Parser),LH(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=VH(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);UH(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),IH(`processSync`,this.parser||this.Parser),LH(`processSync`,this.compiler||this.Compiler),this.process(e,r),BH(`processSync`,`process`,t),n;function r(e,r){t=!0,OH(e),n=r}}run(e,t,n){zH(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=VH(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),BH(`runSync`,`run`,n),r;function i(e,t){OH(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=VH(t),r=this.compiler||this.Compiler;return LH(`stringify`,r),zH(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(RH(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,kH.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];AH(o)&&AH(r)&&(r=(0,kH.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function IH(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function LH(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function RH(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zH(e){if(!AH(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function BH(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function VH(e){return HH(e)?e:new TN(e)}function HH(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function UH(e){return typeof e==`string`||WH(e)}function WH(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var GH=9,KH=32;function qH(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(JH(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(JH(t.slice(i),i>0,!1)),a.join(``)}function JH(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===GH||t===KH;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===GH||t===KH;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function YH(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return WP(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return rU(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){if(i&&r[i-1]?.type===`break`&&(!Array.isArray(a)&&a.type===e.nodes.text&&(a=e.text($H(a.text))),!Array.isArray(a)&&a.type!==e.nodes.text)){let t=a.firstChild;t&&t.type===e.nodes.text&&(a=a.copy(F.from(a.content).replaceChild(0,e.text($H(t.text)))))}Array.isArray(a)?n.push(...a):n.push(a)}}}return n}}function XH(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function ZH(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(F.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(F.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function QH(e){throw Error(`unknown markdown node: ${e.type}`)}function $H(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eU(){}function tU(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function nU(e,t,n,r){return XL(`tagName`,{handlers:e})(t,n,r)}function rU(e,t,n,r,i,a){return XL(`type`,{invalid:tU,unknown:QH,handlers:{toml:eU,yaml:eU,definition:eU,footnoteDefinition:eU,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=LN(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?nU(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=XH(qH(String(t.value)));return n?e.text(/^\s+$/.test(n)?n.replace(/ /g,`\xA0`):n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return ZH(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function iU(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function aU(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var oU=function(e,t){let n=rU(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,YH(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},sU=function(e){this.compiler=function(t){return oU(t,e)}};function cU(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>dP(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function lU(e,t){return cU(t.nodeHandlers,t.markHandlers).one(e)}function uU(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function dU(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var fU=e(n(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),pU=Object.assign(mU(Error),{eval:mU(EvalError),range:mU(RangeError),reference:mU(ReferenceError),syntax:mU(SyntaxError),type:mU(TypeError),uri:mU(URIError)});function mU(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,fU.default)(t,...n))}}var hU={}.hasOwnProperty,gU={yaml:`-`,toml:`+`};function _U(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=vU(r[n]);return t}function vU(e){let t=e;if(typeof t==`string`){if(!hU.call(gU,t))throw pU("Missing matter definition for `%s`",t);t={type:t,marker:gU[t]}}else if(typeof t!=`object`)throw pU("Expected matter to be an object, not `%j`",t);if(!hU.call(t,`type`))throw pU("Missing `type` in matter `%j`",t);if(!hU.call(t,`fence`)&&!hU.call(t,`marker`))throw pU("Missing `marker` or `fence` in matter `%j`",t);return t}function yU(e){let t=_U(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=xU(e,`open`).charCodeAt(0),a=bU(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function bU(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=xU(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),$(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return $(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return Q(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=xU(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||Q(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||Q(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),$(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return $(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||Q(i)?(e.exit(r),t(i)):n(i)}}}function xU(e,t){return e.marker?SU(e.marker,t).repeat(3):SU(e.fence,t)}function SU(e,t){return typeof e==`string`?e:e[t]}function CU(e){let t=_U(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=wU(e),r[e.type]=TU,r[e.type+`Value`]=EU}return{enter:n,exit:r}}function wU(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function TU(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function EU(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function DU(e){let t=[],n={},r=_U(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=OU(e);let a=kU(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:nL(a.charAt(1))})}return{unsafe:t,handlers:n}}function OU(e){let t=kU(e,`open`),n=kU(e,`close`);return r;function r(e){return t+(e.value?`
333
+ `+e.value:``)+`
334
+ `+n}}function kU(e,t){return e.marker?AU(e.marker,t).repeat(3):AU(e.fence,t)}function AU(e,t){return typeof e==`string`?e:e[t]}var jU=`yaml`;function MU(e){let t=this,n=e||jU,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yU(n)),a.push(CU(n)),o.push(DU(n))}function NU(e){return e.charAt(0).toUpperCase()+e.slice(1)}var PU={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function FU(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}var IU=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=PU,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(WP(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??NU(u)),f=n[u],p=`data:image/svg+xml;utf8,${FU(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function LU(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function RU(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
335
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(oR(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
336
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
337
+ `),i&&(c+=a.move(i+`
338
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var zU={tokenize:VU,concrete:!0,name:`mathFlow`},BU={tokenize:HU,partial:!0};function VU(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),wB(e,l,`whitespace`)(t))}function l(t){return t===null||Q(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(BU,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?wB(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Q(t)?e.attempt(BU,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Q(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return wB(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),wB(e,c,`whitespace`)(t))}function c(r){return r===null||Q(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function HU(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function UU(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:WU,previous:GU,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Q(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function WU(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function GU(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function KU(e){return{flow:{36:zU},text:{36:UU(e)}}}var qU={};function JU(e){let t=this,n=e||qU,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(KU(n)),a.push(LU()),o.push(RU(n))}var YU={tokenize:XU};function XU(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),wB(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ZU={tokenize:$U},QU={tokenize:eW};function $U(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Bz(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QU,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(QU,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Bz(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eW(e,t,n){return wB(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var tW={tokenize:nW};function nW(e){let t=this,n=e.attempt(TB,r,e.attempt(this.parser.constructs.flowInitial,i,wB(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ZB,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var rW={resolveAll:sW()},iW=oW(`string`),aW=oW(`text`);function oW(e){return{resolveAll:sW(e===`text`?cW:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function sW(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function cW(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var lW=t({attentionMarkers:()=>_W,contentInitial:()=>dW,disable:()=>vW,document:()=>uW,flow:()=>pW,flowInitial:()=>fW,insideSpan:()=>gW,string:()=>mW,text:()=>hW}),uW={42:WV,43:WV,45:WV,48:WV,49:WV,50:WV,51:WV,52:WV,53:WV,54:WV,55:WV,56:WV,57:WV,62:DB},dW={91:oV},fW={[-2]:zB,[-1]:zB,32:zB},pW={35:fV,42:HV,45:[QV,HV],60:_V,61:QV,95:HV,96:IB,126:IB},mW={38:NB,92:jB},hW={[-5]:BV,[-4]:BV,[-3]:BV,33:IV,38:NB,42:vB,60:[SB,wV],91:RV,92:[uV,jB],93:EV,95:vB,96:UB},gW={null:[vB,rW]},_W={null:[42,95]},vW={null:[]};function yW(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Vz(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=_B(a,l.events,l),l.events):[]}function f(e,t){return xW(p(e),t)}function p(e){return bW(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Bz(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bW(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function xW(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
339
+ `;break;case-3:o=`\r
340
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function SW(e){let t={constructs:Uz([lW,...(e||{}).extensions||[]]),content:n(YU),defined:[],document:n(ZU),flow:n(tW),lazy:{},string:n(iW),text:n(aW)};return t;function n(e){return n;function n(n){return yW(t,e,n)}}}function CW(e){for(;!YB(e););return e}var wW=/[\0\t\n\r]/g;function TW(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(wW.lastIndex=u,c=wW.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var EW={}.hasOwnProperty;function DW(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),OW(n)(CW(SW(n).document().write(TW()(e,t,!0))))}function OW(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ee),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Te),label:o,link:a(Ee),listItem:a(Oe),listItemValue:f,listOrdered:a(De,d),listUnordered:a(De),paragraph:a(ke),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Ae),thematicBreak:a(k)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:pe,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ie),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(te),hardBreakTrailing:c(te),htmlFlow:c(ne),htmlFlowData:E,htmlText:c(re),htmlTextData:E,image:c(D),label:se,labelText:oe,lineEnding:ee,link:c(ae),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:O,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};AW(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];EW.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||MW).call(a,void 0,e[0])}for(r.position={start:kW(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:kW(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:kW(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||MW).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Su({start:e.start,end:e.end})+`): it’s not open`);n.position.end=kW(e.end)}function u(){return QF(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=CL(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=je(),n.position={start:kW(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=kW(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=kW(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function te(){this.data.atHardBreak=!0}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function D(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=iz(t),n.identifier=CL(t).toLowerCase()}function se(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=CL(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function fe(e){this.data.characterReferenceType=e.type}function pe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=nz(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=tz(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=kW(e.end)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Te(){return{type:`image`,title:null,url:``,alt:null}}function Ee(){return{type:`link`,title:null,url:``,children:[]}}function De(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Oe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ke(){return{type:`paragraph`,children:[]}}function Ae(){return{type:`strong`,children:[]}}function je(){return{type:`text`,value:``}}function k(){return{type:`thematicBreak`}}}function kW(e){return{line:e.line,column:e.column,offset:e.offset}}function AW(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?AW(e,r):jW(e,r)}}function jW(e,t){let n;for(n in t)if(EW.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function MW(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Su({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Su({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Su({start:t.start,end:t.end})+`) is still open`)}function NW(e){let t=this;t.parser=n;function n(n){return DW(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function PW(){return{enter:{mdxFlowExpression:IW,mdxTextExpression:LW},exit:{mdxFlowExpression:RW,mdxFlowExpressionChunk:zW,mdxTextExpression:RW,mdxTextExpressionChunk:zW}}}function FW(){return{handlers:{mdxFlowExpression:BW,mdxTextExpression:BW},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function IW(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function LW(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function RW(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function zW(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function BW(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var VW=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),HW={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function UW(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function WW(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function GW(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function KW(e){return GW(e)||UW(e)}var qW=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function JW(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?KW:u===`decimal`?UW:WW;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&VW.includes(y)&&(_=y,v=tz(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?tz(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):KW(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(YW(e))h(7,S),C=`�`;else if(e in HW)h(6,S),C=HW[e];else{let t=``;XW(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,qW[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function YW(e){return e>=55296&&e<=57343||e>1114111}function XW(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var ZW=/["&'<>`]/g,QW=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$W=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eG=/[|\\{}()[\]^$+*?.]/g,tG=new WeakMap;function nG(e,t){if(e=e.replace(t.subset?rG(t.subset):ZW,r),t.subset||t.escapeOnly)return e;return e.replace(QW,n).replace($W,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function rG(e){let t=tG.get(e);return t||(t=iG(e),tG.set(e,t)),t}function iG(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(eG,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var aG=/[\dA-Fa-f]/;function oG(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!aG.test(String.fromCharCode(t))?r:r+`;`}var sG=/\d/;function cG(e,t,n){let r=`&#`+String(e);return n&&t&&!sG.test(String.fromCharCode(t))?r:r+`;`}var lG={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},uG=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],dG={}.hasOwnProperty,fG={},pG;for(pG in lG)dG.call(lG,pG)&&(fG[lG[pG]]=pG);var mG=/[^\dA-Za-z]/;function hG(e,t,n,r){let i=String.fromCharCode(e);if(dG.call(fG,i)){let e=fG[i],a=`&`+e;return n&&VW.includes(e)&&!uG.includes(e)&&(!r||t&&t!==61&&mG.test(String.fromCharCode(t)))?a:a+`;`}return``}function gG(e,t,n){let r=oG(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=hG(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=cG(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function _G(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function vG(e,t){return nG(e,Object.assign({format:gG},t))}function yG(e,t){return nG(e,Object.assign({format:_G},t))}var bG=` `;function xG(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Eu("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Eu(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Eu("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=JW(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Eu("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+Su(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Eu("Expected a closing tag for `"+S(r)+"` ("+Su({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Eu("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+Su(t.end)+") or another opening tag after the start of `"+t.type+"` ("+Su(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function SG(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=EG,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=TG(wG(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&WI(e,n)>WI(e,o)?o:n;s=t+yG(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+bG+m[e];b+=y.move(`
341
+ `+m.join(`
342
+ `)+`
343
+ `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
344
+ `),b+=y.move(CG(e,s,y.current())),b+=y.move(`
345
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function CG(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=TG(wG(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
346
+ `,after:`
347
+ `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
348
+
349
+ `))}return r.pop(),s.join(``)}function wG(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function TG(e){return bG.repeat(e)}function EG(){return`<`}function DG(){return{enter:{mdxjsEsm:kG},exit:{mdxjsEsm:AG,mdxjsEsmData:jG}}}function OG(){return{handlers:{mdxjsEsm:MG}}}function kG(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function AG(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function jG(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function MG(e){return e.value||``}function NG(){return[PW(),xG(),DG()]}function PG(e){return{extensions:[FW(),SG(e),OG()]}}function FG(e){return e}var IG={}.hasOwnProperty,LG=Symbol(`continue`),RG=Symbol(`exit`),zG=Symbol(`skip`);function BG(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return HG(e)&&(s.displayName=`node (`+FG(e.type)+`)`),s;function s(){let s=n?VG(n(e,t,a,o)):[];if(s[0]===RG)return s;if(s[0]!==zG){let t;for(t in e)if(IG.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(HG(r)){let e=i(r,t,a,n)();if(e[0]===RG)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(HG(r)){let e=i(r,t,void 0,n)();if(e[0]===RG)return e}}}return r?VG(r(e,t,a,o)):s}}}function VG(e){return Array.isArray(e)?e:typeof e==`number`?[LG,e]:[e]}function HG(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function UG(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=GG(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&WG(m);if(g&&!t.allowEmpty)throw new Eu(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(WG(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,BG(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=KG(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function WG(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function GG(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=qG(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function KG(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function qG(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
350
+ `;break;case-3:a=`\r
351
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function JG(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=YG(n.start,r[0]||t.start),a=YG(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function YG(e,t){if(e&&typeof e==`object`){let n=`line`in e?XG(e.line):void 0,r=`column`in e?XG(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:XG(t)}}}function XG(e){return typeof e==`number`&&e>-1?e:void 0}var ZG=2,QG=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,$G=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,eK=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,tK=`#unexpected-type-in-code-expected-an-object-spread-spread`,nK=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,rK=`#could-not-parse-expression-with-acorn`;function iK(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Eu("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=QG+$G,e}if(Q(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?aK.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||Q(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Eu("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=QG+eK,e}return $(t)?wB(e,_,`linePrefix`,ZG+1)(t):_(t)}}function aK(e,t,n,r,i,a,o){let s=UG(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=JG(e),n=new Eu("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=QG+tK,n}if(e.expression.properties[1]){let t=new Eu(`Unexpected extra content in spread: only a single spread is supported`,{place:JG(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=QG+nK,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=JG(e.expression.properties[0]),n=new Eu("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=QG+tK,n}}if(s.error){let e=new Eu(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=QG+rK,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function oK(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return iK.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return $(t)?wB(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||Q(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return iK.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var sK=/[$_\p{ID_Start}]/u,cK=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,lK=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,uK={};function dK(e){return e?sK.test(String.fromCodePoint(e)):!1}function fK(e,t){let n=(t||uK).jsx?lK:cK;return e?n.test(String.fromCodePoint(e)):!1}var pK=`https://github.com/micromark/micromark-extension-mdx-jsx`;function mK(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,te,ne,re,ie){let ae=this,D,oe;return se;function se(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),O}function O(e){return QI(e)?n(e):(D=ce,je(e))}function ce(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),D=le,je;if(t===62)return Ae(t);if(t!==null&&t>=0&&dK(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function le(t){if(t===62)return Ae(t);if(t!==null&&t>=0&&dK(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ue(t){if(t!==null&&t>=0&&fK(t,{jsx:!0}))return e.consume(t),ue;if(t===46||t===47||t===58||t===62||t===123||QI(t)||eL(t))return e.exit(f),D=de,je(t);Ne(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function de(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),D=fe,je;if(t===58)return e.enter(h),e.consume(t),e.exit(h),D=he,je;if(t===47||t===62||t===123||t!==null&&t>=0&&dK(t))return e.exit(d),ve(t);Ne(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function fe(t){if(t!==null&&t>=0&&dK(t))return e.enter(m),e.consume(t),pe;Ne(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&fK(t,{jsx:!0}))return e.consume(t),pe;if(t===46||t===47||t===62||t===123||QI(t)||eL(t))return e.exit(m),D=me,je(t);Ne(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),D=fe,je;if(t===47||t===62||t===123||t!==null&&t>=0&&dK(t))return e.exit(d),ve(t);Ne(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&dK(t))return e.enter(g),e.consume(t),ge;Ne(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ge(t){if(t!==null&&t>=0&&fK(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===62||t===123||QI(t)||eL(t))return e.exit(g),D=_e,je(t);Ne(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t===47||t===62||t===123||t!==null&&t>=0&&dK(t))return e.exit(d),ve(t);Ne(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),D=ke,je;if(t===62)return Ae(t);if(t===123)return iK.call(ae,e,ye,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&dK(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),be;Ne(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ye(e){return D=ve,je(e)}function be(t){if(t!==null&&t>=0&&fK(t,{jsx:!0}))return e.consume(t),be;if(t===47||t===58||t===61||t===62||t===123||QI(t)||eL(t))return e.exit(S),D=xe,je(t);Ne(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function xe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),D=Se,je;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),D=Te,je;if(t===47||t===62||t===123||QI(t)||eL(t)||t!==null&&t>=0&&dK(t))return e.exit(x),e.exit(b),D=ve,je(t);Ne(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Se(t){if(t!==null&&t>=0&&dK(t))return e.enter(w),e.consume(t),Ce;Ne(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t!==null&&t>=0&&fK(t,{jsx:!0}))return e.consume(t),Ce;if(t===47||t===61||t===62||t===123||QI(t)||eL(t))return e.exit(w),e.exit(x),D=we,je(t);Ne(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),D=Te,je;if(t===47||t===62||t===123||t!==null&&t>=0&&dK(t))return e.exit(b),ve(t);Ne(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Te(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),oe=t,De;if(t===123)return iK.call(ae,e,Ee,ne,re,ie,r,i,a,!1,!1,o)(t);Ne(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Ee(t){return e.exit(b),D=ve,je(t)}function De(t){return t===null&&Ne(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(oe)+"`"),t===oe?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),oe=void 0,D=ve,je):Q(t)?(D=De,je(t)):(e.enter(te),Oe(t))}function Oe(t){return t===null||t===oe||Q(t)?(e.exit(te),De(t)):(e.consume(t),Oe)}function ke(e){if(e===62)return Ae(e);Ne(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ae(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function je(t){return Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Me):$(t)||eL(t)?(e.enter(`esWhitespace`),k(t)):D(t)}function k(t){return Q(t)?(e.exit(`esWhitespace`),je(t)):$(t)||eL(t)?(e.consume(t),k):(e.exit(`esWhitespace`),D(t))}function Me(e){if(!o&&ae.parser.lazy[ae.now().line]){let e=new Eu("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ae.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=pK+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return je(e)}function Ne(e,t,n){let r=new Eu(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+hK(e)+`)`)+` `+t+`, expected `+n,ae.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=pK+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function hK(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function gK(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return mK.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function _K(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return mK.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return $(e)?wB(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||Q(e)?r(e):i(e)}}}function vK(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:_K(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:gK(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function yK(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function bK(){return Uz([oK(),vK(),yK()])}var xK=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],SK=/^>|^->|<!--|-->|--!>|<!-$/g,CK=[`>`],wK=[`<`,`>`];function TK(e,t,n,r){return r.settings.bogusComments?`<?`+vG(e.value,Object.assign({},r.settings.characterReferences,{subset:CK}))+`>`:`<!--`+e.value.replace(SK,i)+`-->`;function i(e){return vG(e,Object.assign({},r.settings.characterReferences,{subset:wK}))}}function EK(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var DK=AK(1),OK=AK(-1),kK=[];function AK(e){return t;function t(t,n,r){let i=t?t.children:kK,a=(n||0)+e,o=i[a];if(!r)for(;o&&lP(o);)a+=e,o=i[a];return o}}var jK={}.hasOwnProperty;function MK(e){return t;function t(t,n,r){return jK.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var NK=MK({body:IK,caption:PK,colgroup:PK,dd:BK,dt:zK,head:PK,html:FK,li:RK,optgroup:HK,option:UK,p:LK,rp:VK,rt:VK,tbody:GK,td:JK,tfoot:KK,th:JK,thead:WK,tr:qK});function PK(e,t,n){let r=DK(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&lP(r.value.charAt(0)))}function FK(e,t,n){let r=DK(n,t);return!r||r.type!==`comment`}function IK(e,t,n){let r=DK(n,t);return!r||r.type!==`comment`}function LK(e,t,n){let r=DK(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function RK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&r.tagName===`li`}function zK(e,t,n){let r=DK(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function BK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function VK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function HK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function UK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function WK(e,t,n){let r=DK(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function GK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function KK(e,t,n){return!DK(n,t)}function qK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function JK(e,t,n){let r=DK(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var YK=MK({body:QK,colgroup:$K,head:ZK,html:XK,tbody:eq});function XK(e){let t=DK(e,-1);return!t||t.type!==`comment`}function ZK(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function QK(e){let t=DK(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&lP(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function $K(e,t,n){let r=OK(n,t),i=DK(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&NK(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function eq(e,t,n){let r=OK(n,t),i=DK(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&NK(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var tq={name:[[`
352
+ \f\r &/=>`.split(``),`
353
+ \f\r "&'/=>\``.split(``)],[`\0
354
+ \f\r "&'/<=>`.split(``),`\0
355
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
356
+ \f\r &>`.split(``),`\0
357
+ \f\r "&'<=>\``.split(``)],[`\0
358
+ \f\r "&'<=>\``.split(``),`\0
359
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function nq(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=LO);let l=rq(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!YK(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!NK(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function rq(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=iq(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function iq(e,t,n){let r=FO(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=vG(r.attribute,Object.assign({},e.settings.characterReferences,{subset:tq.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?tne:rne)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=vG(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:tq.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&WI(n,o)>WI(n,e.alternative)&&(o=e.alternative),s=o+vG(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?tq.single:tq.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var aq=[`<`,`&`];function oq(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:vG(e.value,Object.assign({},r.settings.characterReferences,{subset:aq}))}function sq(e,t,n,r){return r.settings.allowDangerousHtml?e.value:oq(e,t,n,r)}function cq(e,t,n,r){return r.all(e)}var lq=XL(`type`,{invalid:uq,unknown:dq,handlers:{comment:TK,doctype:EK,element:nq,raw:sq,root:cq,text:oq}});function uq(e){throw Error("Expected node, not `"+e+"`")}function dq(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var fq={},pq={},mq=[];function hq(e,t){let n=t||fq,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:gq,all:_q,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||xK,characterReferences:n.characterReferences||pq,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?LO:IO,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function gq(e,t,n){return lq(e,t,n,this)}function _q(e){let t=[],n=e&&e.children||mq,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function vq(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return hq(e,n)}}function yq(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function bq(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
360
+ `}]}function xq(e,t){let n=t.value?t.value+`
361
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Sq(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cq(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wq(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=gB(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Tq(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eq(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Dq(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Oq(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Dq(e,t);let i={src:gB(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function kq(e,t){let n={src:gB(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Aq(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function jq(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Dq(e,t);let i={href:gB(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Mq(e,t){let n={href:gB(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Nq(e,t,n){let r=e.all(t),i=n?Pq(n):Fq(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
362
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
363
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Pq(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Fq(n[r])}return t}function Fq(e){return e.spread??e.children.length>1}function Iq(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Lq(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rq(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zq(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bq(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=KP(t.children[1]),o=GP(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Vq(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Hq(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uq(e,t){let n={type:`text`,value:qH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Wq(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Gq={blockquote:yq,break:bq,code:xq,delete:Sq,emphasis:Cq,footnoteReference:wq,heading:Tq,html:Eq,imageReference:Oq,image:kq,inlineCode:Aq,linkReference:jq,link:Mq,listItem:Nq,list:Iq,paragraph:Lq,root:Rq,strong:zq,table:Bq,tableCell:Hq,tableRow:Vq,text:Uq,thematicBreak:Wq,toml:Kq,yaml:Kq,definition:Kq,footnoteDefinition:Kq};function Kq(){}function qq(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Jq(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Yq(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||qq,r=e.options.footnoteBackLabel||Jq,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=gB(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...$N(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
364
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
365
+ `}]}}var Xq={}.hasOwnProperty,Zq={};function Qq(e,t){let n=t||Zq,r=new Map,i=new Map,a={all:s,applyData:eJ,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Gq,...n.handlers},one:o,options:n,patch:$q,wrap:nJ};return WP(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Xq.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=$N(n);return r.children=a.all(e),r}return $N(e)}return(a.options.unknownHandler||tJ)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=rJ(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=rJ(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function $q(e,t){e.position&&(t.position=JP(e))}function eJ(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,$N(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function tJ(e,t){let n=t.data||{},r=`value`in t&&!(Xq.call(n,`hProperties`)||Xq.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nJ(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
366
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
367
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
368
+ `}),n}function rJ(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function iJ(e,t){let n=Qq(e,t),r=n.one(e,void 0),i=Yq(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
369
+ `},i)),a}function aJ(e,t){return e&&`run`in e?async function(n,r){let i=iJ(n,{file:r,...t});await e.run(i,r)}:function(n,r){return iJ(n,{file:r,...e||t})}}var oJ={arabic:`ar`,armenian:`am`,bulgarian:`bg`,czech:`cz`,danish:`dk`,dutch:`nl`,english:`en`,finnish:`fi`,french:`fr`,german:`de`,greek:`gr`,hungarian:`hu`,indian:`in`,indonesian:`id`,irish:`ie`,italian:`it`,lithuanian:`lt`,nepali:`np`,norwegian:`no`,portuguese:`pt`,romanian:`ro`,russian:`ru`,serbian:`rs`,slovenian:`ru`,spanish:`es`,swedish:`se`,tamil:`ta`,turkish:`tr`,ukrainian:`uk`,sanskrit:`sk`},sJ={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},cJ=Object.keys(oJ);function lJ(e){return e!==void 0&&cJ.includes(e)?oJ[e]:void 0}var uJ=Date.now().toString().slice(5),dJ=0,fJ=BigInt(1e3),pJ=BigInt(1e6),mJ=BigInt(1e9),hJ=65535;function gJ(e,t){if(t.length<65535)Array.prototype.push.apply(e,t);else{let n=t.length;for(let r=0;r<n;r+=hJ)Array.prototype.push.apply(e,t.slice(r,r+hJ))}}function _J(e,...t){return e.replace(/%(?:(?<position>\d+)\$)?(?<width>-?\d*\.?\d*)(?<type>[dfs])/g,function(...e){let{width:n,type:r,position:i}=e[e.length-1],a=i?t[Number.parseInt(i)-1]:t.shift(),o=n===``?0:Number.parseInt(n);switch(r){case`d`:return a.toString().padStart(o,`0`);case`f`:{let e=a,[t,r]=n.split(`.`).map(e=>Number.parseFloat(e));return typeof r==`number`&&r>=0&&(e=e.toFixed(r)),typeof t==`number`&&t>=0?e.toString().padStart(o,`0`):e.toString()}case`s`:return o<0?a.toString().padEnd(-o,` `):a.toString().padStart(o,` `);default:return a}})}function vJ(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function yJ(){return typeof process<`u`&&process.release&&process.release.name===`node`}function bJ(){return BigInt(Math.floor(performance.now()*1e6))}function xJ(e){return typeof e==`number`&&(e=BigInt(e)),e<fJ?`${e}ns`:e<pJ?`${e/fJ}μs`:e<mJ?`${e/pJ}ms`:`${e/mJ}s`}function SJ(){return vJ()?bJ():yJ()||typeof process<`u`&&typeof process?.hrtime?.bigint==`function`?process.hrtime.bigint():typeof performance<`u`?bJ():BigInt(0)}function CJ(){return`${uJ}-${dJ++}`}function wJ(e,t){return Object.hasOwn===void 0?Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0:Object.hasOwn(e,t)?e[t]:void 0}function TJ(e,t){return t[1]===e[1]?e[0]-t[0]:t[1]-e[1]}function EJ(e){if(e.length===0)return[];if(e.length===1)return e[0];for(let t=1;t<e.length;t++)if(e[t].length<e[0].length){let n=e[0];e[0]=e[t],e[t]=n}let t=new Map;for(let n of e[0])t.set(n,1);for(let n=1;n<e.length;n++){let r=0;for(let i of e[n]){let e=t.get(i);e===n&&(t.set(i,e+1),r++)}if(r===0)return[]}return e[0].filter(n=>{let r=t.get(n);return r!==void 0&&t.set(n,0),r===e.length})}function DJ(e,t){let n={},r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r.split(`.`),o=e,s=a.length;for(let e=0;e<s;e++)if(o=o[a[e]],typeof o==`object`){if(o!==null&&`lat`in o&&`lon`in o&&typeof o.lat==`number`&&typeof o.lon==`number`){o=n[r]=o;break}else if(!Array.isArray(o)&&o!==null&&e===s-1){o=void 0;break}}else if((typeof o!=`object`||!o)&&e<s-1){o=void 0;break}o!==void 0&&(n[r]=o)}return n}function OJ(e,t){return DJ(e,[t])[t]}var kJ={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344};function AJ(e,t){let n=kJ[t];if(n===void 0)throw Error(BJ(`INVALID_DISTANCE_SUFFIX`,e).message);return e*n}function jJ(e,t){e.hits=e.hits.map(e=>({...e,document:{...e.document,...t.reduce((e,t)=>{let n=t.split(`.`),r=n.pop(),i=e;for(let e of n)i[e]=i[e]??{},i=i[e];return i[r]=null,e},e.document)}}))}function MJ(e){return Array.isArray(e)?e.some(e=>MJ(e)):e?.constructor?.name===`AsyncFunction`}var NJ=`intersection`in new Set;function PJ(...e){if(e.length===0)return new Set;if(e.length===1)return e[0];if(e.length===2){let t=e[0],n=e[1];if(NJ)return t.intersection(n);let r=new Set,i=t.size<n.size?t:n,a=i===t?n:t;for(let e of i)a.has(e)&&r.add(e);return r}let t={index:0,size:e[0].size};for(let n=1;n<e.length;n++)e[n].size<t.size&&(t.index=n,t.size=e[n].size);if(NJ){let n=e[t.index];for(let r=0;r<e.length;r++)r!==t.index&&(n=n.intersection(e[r]));return n}let n=e[t.index];for(let r=0;r<e.length;r++){if(r===t.index)continue;let i=e[r];for(let e of n)i.has(e)||n.delete(e)}return n}var FJ=`union`in new Set;function IJ(e,t){return FJ?e?e.union(t):t:e?new Set([...e,...t]):new Set(t)}function LJ(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function RJ(e){if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let t=new Int32Array(new SharedArrayBuffer(4));if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(t,0,0,Number(e))}else{if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}}var zJ={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:`Do not pass the language option to create when using a custom tokenizer.`,LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported.\nSupported languages are:\n - ${cJ.join(`
370
+ - `)}`,INVALID_STEMMER_FUNCTION_TYPE:`config.stemmer property must be a function.`,MISSING_STEMMER:`As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/docs/orama-js/text-analysis/stemming for more information.`,CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:`Custom stop words array must only contain strings.`,UNSUPPORTED_COMPONENT:`Unsupported component "%s".`,COMPONENT_MUST_BE_FUNCTION:`The component "%s" must be a function.`,COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:`The component "%s" must be a function or an array of functions.`,INVALID_SCHEMA_TYPE:`Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.`,DOCUMENT_ID_MUST_BE_STRING:`Document id must be of type "string". Got "%s" instead.`,DOCUMENT_ALREADY_EXISTS:`A document with id "%s" already exists.`,DOCUMENT_DOES_NOT_EXIST:`A document with id "%s" does not exists.`,MISSING_DOCUMENT_PROPERTY:`Missing searchable property "%s".`,INVALID_DOCUMENT_PROPERTY:`Invalid document property "%s": expected "%s", got "%s"`,UNKNOWN_INDEX:`Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s`,INVALID_BOOST_VALUE:`Boost value must be a number greater than, or less than 0.`,INVALID_FILTER_OPERATION:`You can only use one operation per filter, you requested %d.`,SCHEMA_VALIDATION_FAILURE:`Cannot insert document due schema validation failure on "%s" property.`,INVALID_SORT_SCHEMA_TYPE:`Unsupported sort schema type "%s" at "%s". Expected "string" or "number".`,CANNOT_SORT_BY_ARRAY:`Cannot configure sort for "%s" because it is an array (%s).`,UNABLE_TO_SORT_ON_UNKNOWN_FIELD:`Unable to sort on unknown field "%s". Allowed fields: %s`,SORT_DISABLED:`Sort is disabled. Please read the documentation at https://docs.orama.com/docs/orama-js for more information.`,UNKNOWN_GROUP_BY_PROPERTY:`Unknown groupBy property "%s".`,INVALID_GROUP_BY_PROPERTY:`Invalid groupBy property "%s". Allowed types: "%s", but given "%s".`,UNKNOWN_FILTER_PROPERTY:`Unknown filter property "%s".`,UNKNOWN_VECTOR_PROPERTY:`Unknown vector property "%s". Make sure the property exists in the schema and is configured as a vector.`,INVALID_VECTOR_SIZE:`Vector size must be a number greater than 0. Got "%s" instead.`,INVALID_VECTOR_VALUE:`Vector value must be a number greater than 0. Got "%s" instead.`,INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead.
371
+ Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:`Property "%s" is not searchable. Only "string" properties are searchable.`,FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:`Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.`,INVALID_SEARCH_MODE:`Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".`,MISSING_VECTOR_AND_SECURE_PROXY:`No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.`,MISSING_TERM:`"term" is a required parameter when performing hybrid search. Please provide a search term.`,INVALID_VECTOR_INPUT:`Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.`,PLUGIN_CRASHED:`A plugin crashed during initialization. Please check the error message for more information:`,PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance.
372
+ Please install it before proceeding with creating an answer session.
373
+ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
374
+ `,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
375
+ Please provide a chat model before proceeding with creating an answer session.
376
+ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
377
+ `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function BJ(e,...t){let n=Error(_J(zJ[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function VJ(e){return{raw:Number(e),formatted:xJ(e)}}function HJ(e){if(e.id){if(typeof e.id!=`string`)throw BJ(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return CJ()}function UJ(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&!(r===`geopoint`&&typeof t==`object`&&typeof t.lon==`number`&&typeof t.lat==`number`)&&!(r===`enum`&&(typeof t==`string`||typeof t==`number`))){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(qJ(r)){let e=XJ(r);if(!Array.isArray(t)||t.length!==e)throw BJ(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(JJ(r)){if(!Array.isArray(t))return n;let e=YJ(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=UJ(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}var WJ={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},GJ={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function KJ(e){return e===`geopoint`}function qJ(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function JJ(e){return typeof e==`string`&&WJ[e]}function YJ(e){return GJ[e]}function XJ(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw BJ(`INVALID_VECTOR_VALUE`,e);case t<=0:throw BJ(`INVALID_VECTOR_SIZE`,e);default:return t}}function ZJ(){return{idToInternalId:new Map,internalIdToId:[],save:QJ,load:$J}}function QJ(e){return{internalIdToId:e.internalIdToId}}function $J(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function eY(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?eY(e,t.toString()):t}function tY(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function nY(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function rY(e,t){let n=eY(e.sharedInternalDocumentStore,t);return e.docs[n]}function iY(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=eY(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function aY(e){return e.docs}function oY(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function sY(e,t){let n=eY(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function cY(e){return e.count}function lY(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function uY(e){return{docs:e.docs,count:e.count}}function dY(){return{create:nY,get:rY,getMultiple:iY,getAll:aY,store:oY,remove:sY,count:cY,load:lY,save:uY}}var fY=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function pY(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),BJ(`PLUGIN_CRASHED`)}return n}var mY=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],hY=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function gY(e,t,n,r){if(e.some(MJ))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function _Y(e,t,n){if(e.some(MJ))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function vY(e,t,n,r,i){if(e.some(MJ))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function yY(e,t,n,r){if(e.some(MJ))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function bY(e,t){if(e.some(MJ))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var xY=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},SY=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new xY(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?xY.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new xY(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k)if(a.l===null){a.l=new xY(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new xY(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},CY=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function wY(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function TY(e,t,n){let r=wY(e,t,n);return{distance:r,isBounded:r>=0}}var EY=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(wJ(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&TY(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(wJ(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(TY(e,n,r).isBounded&&(i[n]=[]),wJ(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},DY=class e extends EY{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,EY.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},OY=2,kY=6371e3,AY=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},jY=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new AY(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%OY===0)if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=AY.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return kY*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),ee=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-ee)}},MY=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function NY(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var PY=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=FY(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),IY(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function FY(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function IY(e,t,n,r,i){let a=FY(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function LY(e,t,n,r,i){let a=eY(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function RY(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=eY(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function zY(e,t,n,r){let i=eY(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function BY(e,t,n){e.tokenOccurrences[t][n]--}function VY(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){VY(e,t,o,r,n);continue}if(qJ(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new PY(XJ(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new MY,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new SY(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new DY,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new CY,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new jY,isArray:e};break;default:throw BJ(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function HY(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function UY(e,t,n,r,i,a,o,s,c,l,u){if(qJ(o))return WY(t,n,a,r,i);let d=HY(e,t,n,i,s,c,l,u);if(!JJ(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function WY(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function GY(e,t,n,r,i,a,o,s,c,l){if(qJ(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function KY(e,t,n,r,i,a,o,s,c,l){if(!JJ(o))return GY(e,t,n,r,i,a,o,s,c,l);let u=YJ(o),d=a,f=d.length;for(let a=0;a<f;a++)GY(e,t,n,r,i,d[a],u,s,c,l);return!0}function qY(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=NY(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function JY(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw BJ(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw BJ(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];qY(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function YY(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:PJ(...i.map(n=>YY(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>YY(e,t,n,r)).reduce((e,t)=>IJ(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return LJ(a,YY(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw BJ(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=IJ(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=AJ(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=tX(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=tX(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=aX(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw BJ(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=IJ(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw BJ(`INVALID_FILTER_OPERATION`,e)}a[o]=IJ(a[o],n)}}return PJ(...Object.values(a))}function XY(e){return e.searchableProperties}function ZY(e){return e.searchablePropertiesWithTypes}function QY(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:DY.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:CY.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:SY.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:jY.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:MY.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:PY.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function $Y(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function eX(){return{create:VY,insert:UY,remove:KY,insertDocumentScoreParameters:LY,insertTokenScoreParameters:RY,removeDocumentScoreParameters:zY,removeTokenScoreParameters:BY,calculateResultScores:qY,search:JY,searchByWhereClause:YY,getSearchableProperties:XY,getSearchablePropertiesWithTypes:ZY,load:QY,save:$Y}}function tX(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function nX(e,t,n=!1){let r=n?jY.vincentyDistance:jY.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function rX(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function iX(e,t){let n=e,r=rX(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=AJ(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),nX(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=jY.calculatePolygonCentroid(e);return nX(s,r,n)}return null}function aX(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function oX(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=oX(e,t,s,r,n);gJ(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!qJ(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw BJ(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function sX(e,t,n,r){return r?.enabled===!1?{disabled:!0}:oX(e,t,n,(r||{}).unsortableProperties||[],``)}function cX(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=eY(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&hX(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function lX(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)pX(e,n);e.isSorted=!0}function uX(e,t,n){return t[1].localeCompare(n[1],lJ(e))}function dX(e,t){return e[1]-t[1]}function fX(e,t){return t[1]?-1:1}function pX(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=uX.bind(null,e.language);break;case`number`:r=dX.bind(null);break;case`boolean`:r=fX.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function mX(e){let t=Object.keys(e.sorts);for(let n of t)hX(e,n)}function hX(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function gX(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=eY(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function _X(e,t,n){if(!e.enabled)throw BJ(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw BJ(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return hX(e,r),lX(e),t.sort((t,n)=>{let r=a.docs.get(eY(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(eY(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function vX(e){return e.enabled?e.sortableProperties:[]}function yX(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function bX(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function xX(e){if(!e.enabled)return{enabled:!1};mX(e),lX(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function SX(){return{create:sX,insert:cX,remove:gX,save:xX,load:bX,sortBy:_X,getSortableProperties:vX,getSortablePropertiesWithTypes:yX}}var CX=192,wX=383,TX=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function EX(e){return e<CX||e>wX?e:TX[e-CX]||e}function DX(e){let t=[];for(let n=0;n<e.length;n++)t[n]=EX(e.charCodeAt(n));return String.fromCharCode(...t)}var OX={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},kX={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},AX=`[^aeiou]`,jX=`[aeiouy]`,MX=AX+`[^aeiouy]*`;jX+``;var NX=`^(`+MX+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,PX=`^(`+MX+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`,FX=`^(`+MX+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,IX=`^(`+MX+`)?[aeiouy]`;function LX(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(NX),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(IX),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+MX+jX+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(IX),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(NX),t&&r.test(t)&&(e=t+OX[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(NX),t&&r.test(t)&&(e=t+kX[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(FX),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(FX),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(FX),i=new RegExp(PX),a=RegExp(`^`+MX+jX+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(FX),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function RX(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=DX(t),n&&this.normalizationCache.set(r,t),t)}function zX(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function BX(e,t,n,r=!0){if(t&&t!==this.language)throw BJ(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=sJ[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=zX(a);return this.allowDuplicates?o:Array.from(new Set(o))}function VX(e={}){if(!e.language)e.language=`english`;else if(!cJ.includes(e.language))throw BJ(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw BJ(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=LX;else throw BJ(`MISSING_STEMMER`,e.language);let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw BJ(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw BJ(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw BJ(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:BX,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:RX,normalizationCache:new Map};return r.tokenize=BX.bind(r),r.normalizeToken=RX,r}function HX(e){return{sharedInternalDocumentStore:e,rules:new Map}}function UX(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function WX(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function GX(e,t){return e.rules.delete(t)}function KX(e,t){return e.rules.get(t)}function qX(e){return Array.from(e.rules.values())}function JX(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function YX(e,t){return e?t.conditions.every(t=>JX(e,t)):!1}function XX(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())YX(t,r)&&n.push(r);return n}function ZX(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function QX(e){return{rules:Array.from(e.rules.entries())}}function $X(){return{create:HX,addRule:UX,updateRule:WX,removeRule:GX,getRule:KX,getAllRules:qX,getMatchingRules:XX,load:ZX,save:QX}}function eZ(e){let t={formatElapsedTime:VJ,getDocumentIndexId:HJ,getDocumentProperties:DJ,validateSchema:UJ};for(let n of hY){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw BJ(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!mY.includes(t)&&!hY.includes(t))throw BJ(`UNSUPPORTED_COMPONENT`,t)}function tZ({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw BJ(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=CJ();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:VX(o):VX({language:n??`english`}),r.tokenizer&&n)throw BJ(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=ZJ();s||=eX(),l||=SX(),c||=dY(),u||=$X(),eZ(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:nZ()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of fY)g[e]=(g[e]??[]).concat(pY(g,e));let _=g.afterCreate;return _&&bY(_,g),g}function nZ(){return`{{VERSION}}`}function rZ(e){return e.documentsStore.count(e.data.docs)}function iZ(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw BJ(`SCHEMA_VALIDATION_FAILURE`,a);return MJ(e.beforeInsert)||MJ(e.afterInsert)||MJ(e.index.beforeInsert)||MJ(e.index.insert)||MJ(e.index.afterInsert)?sZ(e,t,n,r,i):cZ(e,t,n,r,i)}var aZ=new Set([`enum`,`enum[]`]),oZ=new Set([`string`,`number`]);async function sZ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw BJ(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=eY(e.internalDocumentIDStore,s);if(r||await gY(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw BJ(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];lZ(n,r,e,t)}return await uZ(e,s,u,f,l,n,t,i),r||await gY(e.afterInsert,e,s,t),s}function cZ(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw BJ(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=eY(e.internalDocumentIDStore,s);if(r||gY(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw BJ(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];lZ(n,r,e,t)}return dZ(e,s,u,f,l,n,t,i),r||gY(e.afterInsert,e,s,t),s}function lZ(e,t,n,r){if(!(KJ(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(qJ(t)&&Array.isArray(r))&&!(JJ(t)&&Array.isArray(r))&&!(aZ.has(t)&&oZ.has(e))&&e!==t)throw BJ(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function uZ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function dZ(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=eY(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function fZ(e,t,n,r,i,a){return MJ(e.afterInsertMultiple)||MJ(e.beforeInsertMultiple)||MJ(e.index.beforeInsert)||MJ(e.index.insert)||MJ(e.index.afterInsert)?pZ(e,t,n,r,i,a):mZ(e,t,n,r,i,a)}async function pZ(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await iZ(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&RJ(e)}}})(),i||await _Y(e.afterInsertMultiple,e,t),o}function mZ(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=iZ(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&RJ(e)}}}return l(),i||_Y(e.afterInsertMultiple,e,t),o}function hZ(e,t){return e[1]-t[1]}function gZ(e,t){return t[1]-e[1]}function _Z(e=`desc`){return e.toLowerCase()===`asc`?hZ:gZ}function vZ(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?OJ(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;yZ(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=yZ(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:bZ(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=bZ(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw BJ(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=_Z(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function yZ(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function bZ(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}var xZ={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},SZ=[`string`,`number`,`boolean`];function CZ(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw BJ(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!SZ.includes(a[t]))throw BJ(`INVALID_GROUP_BY_PROPERTY`,t,SZ.join(`, `),a[t])}let o=t.map(([t])=>tY(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=OJ(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=wZ(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=EJ(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||xZ,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function wZ(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=wZ(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];gJ(n,t),i.push(n)}return i}function TZ(e,t,n,r){let i=XX(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=eY(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function EZ(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw BJ(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=rZ(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},jZ(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=OZ(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${DZ(e)}\\b`).test(n)))return!0}return!1})}}else l=s?iX(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function DZ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function OZ(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function kZ(e,t,n){let r=SJ();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=EZ(e,t,n);if(t.sortBy)if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[eY(e.internalDocumentIDStore,t),n]);else d=d.sort(TJ);d=TZ(e,e.data.pinning,d,t.term);let f;u||(f=c?UZ(e,d,s,o,c):WZ(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||jJ(p,i)),a&&(p.facets=vZ(e,d,t.facets)),t.groupBy&&(p.groups=CZ(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(SJ()-r),p}async function a(){e.beforeSearch&&await yY(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await vY(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}var AZ={k:1.2,b:.75,d:.5};function jZ(e){let t=e??{};return t.k=t.k??AZ.k,t.b=t.b??AZ.b,t.d=t.d??AZ.d,t}function MZ(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw BJ(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw BJ(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?BJ(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):BJ(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function NZ(e,t,n=`english`){let r=SJ();function i(){let i=MZ(e,t,n).sort(TJ);i=TZ(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=vZ(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:tY(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=CZ(e,i,t.groupBy));let f=SJ()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:xJ(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await yY(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await vY(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function PZ(e,t,n){let r=LZ(EZ(e,t,n)),i=MZ(e,t,n),a=t.hybridWeights;return BZ(r,i,t.term??``,a)}function FZ(e,t,n){let r=SJ();function i(){let i=PZ(e,t,n);i=TZ(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=vZ(e,i,t.facets));let o;t.groupBy&&(o=CZ(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=WZ(e,i,s,c).filter(Boolean),u=SJ(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:xJ(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||jJ(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await yY(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await vY(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function IZ(e){return e[1]}function LZ(e){let t=Math.max.apply(Math,e.map(IZ));return e.map(([e,n])=>[e,n/t])}function RZ(e,t){return e/t}function zZ(e,t){return(n,r)=>n*e+r*t}function BZ(e,t,n,r){let i=Math.max.apply(Math,e.map(IZ)),a=Math.max.apply(Math,t.map(IZ)),{text:o,vector:s}=r&&r.text&&r.vector?r:VZ(n),c=new Map,l=e.length,u=zZ(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(RZ(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=RZ(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function VZ(e){return{text:.5,vector:.5}}function HZ(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return kZ(e,t,n);if(r===`vector`)return NZ(e,t);if(r===`hybrid`)return FZ(e,t);throw BJ(`INVALID_SEARCH_MODE`,r)}function UZ(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=OJ(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:tY(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function WZ(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:tY(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}new jv.default;var GZ=new jv.default;GZ.Diff_Timeout=.25;var KZ=N({path:M(La([A(),j()])),message:A(),issueCode:A()});za(`code`,[N({code:qa(`SCHEMA_INVALID`),issues:M(KZ)}),N({code:qa(`WRITE_ERROR`),detail:A()})]);function qZ(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function JZ(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}Ga([`text`,`number`,`boolean`,`date`,`list`]);var YZ=La([A(),j(),Ea(),M(La([A(),j(),Ea()]).transform(e=>String(e)))]),XZ=/^\d{4}-\d{2}-\d{2}$/;function ZZ(e){return typeof e==`string`&&XZ.test(e)}function QZ(e){return Array.isArray(e)?`list`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:ZZ(e)?`date`:`text`}var $Z=Ua(A(),YZ),eQ=Ua(A(),La([YZ,Oa()])),tQ=/^---\r?\n([\s\S]*?\r?\n)?---(\r?\n|$)/;function nQ(e){let t=e.match(tQ);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function rQ(e){if(e===``)return``;let t=e.match(tQ);return t?(t[1]??``).replace(/\r?\n$/,``):e}var iQ={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function aQ(e){return e===``?``:`---\n${e.endsWith(`
378
+ `)?e.slice(0,-1):e}\n---\n`}var oQ=65536;function sQ(e){let t=e.match(tQ);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function cQ(e){if(e.trim()===``)return{doc:new qc({}),map:{}};let t;try{t=ru(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new qc({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=$Z.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function lQ(e){return e===``?{doc:new qc({}),map:{}}:cQ(rQ(e))}function uQ(e){let{fenced:t}=sQ(e),{map:n,parseError:r}=lQ(t);return{map:n??{},parseError:r}}function dQ(e){let{fenced:t}=sQ(e);if(t===``)return[];let{doc:n,map:r}=lQ(t);return r===null?[]:hQ(n)}function fQ(e){return typeof e==`object`&&!!e&&`key`in e}function pQ(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function mQ(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function hQ(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!fQ(e))continue;let t=pQ(e);t!==null&&n.push(t)}return n}var gQ=`frontmatter`;function _Q(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function vQ(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:aQ(e.toString(iQ))}function yQ(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:oQ}:null}function bQ(e,t){if(Object.hasOwn(t,gQ))return{ok:!1,error:{kind:`reserved_key`,key:gQ}};let{doc:n,map:r}=lQ(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{_Q(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=YZ.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};if(Array.isArray(t.data)){let r=n.get(e,!0),i=Po(r)?r.flow:void 0,a=n.createNode(t.data);i!==void 0&&(a.flow=i),n.set(e,a);continue}n.set(e,t.data)}let e=vQ(n),r=yQ(e);return r?{ok:!1,error:r}:{ok:!0,nextFenced:e}}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function xQ(e,t,n,r={}){if(t===gQ||n===gQ)return{ok:!1,error:{kind:`reserved_key`,key:gQ}};let{doc:i,map:a}=lQ(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>fQ(e)&&pQ(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>fQ(e)&&e!==s&&pQ(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{mQ(s,n);let e=vQ(i),t=yQ(e);return t?{ok:!1,error:t}:{ok:!0,nextFenced:e}}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function SQ(e,t){let{doc:n,map:r}=lQ(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=hQ(n);if(a.length!==t.length||!CQ(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(fQ),r=[];for(let n of t){let i=e.findIndex(e=>pQ(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}i.items=r;let o=vQ(n),s=yQ(o);return s?{ok:!1,error:s}:{ok:!0,nextFenced:o}}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function CQ(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}var wQ=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})}),TQ=`frontmatter`;function EQ(e){return{ok:!1,error:e}}function DQ(e){return{ok:!0,...e}}function OQ(e){return{ok:!0,...e}}function kQ(e){return{ok:!0,...e}}function AQ(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${oQ}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`}}}function jQ(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!MQ(e.map[n],t.map[n]))return!1;return!0}function MQ(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var NQ=5;function PQ(e){let t=e.toString();return{snapshot:FQ(t),raw:t}}function FQ(e){let{map:t,parseError:n}=uQ(e);return{map:t,keys:dQ(e),parseError:n}}function IQ(e){return/^---\r?\n/.test(e)}function LQ(e){let t=e.document,n=t.getText(`source`),r=new Set,i=PQ(n),a=i.snapshot,o=sQ(i.raw).fenced,s=IQ(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=PQ(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&jQ(a,t)){s=IQ(i);return}a=t,o=sQ(i).fenced,s=IQ(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||RQ(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=sQ(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},wQ),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return EQ({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,TQ))return EQ({code:`SCHEMA_INVALID`,issues:[{path:[TQ],message:`'${TQ}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=eQ.safeParse(e);if(!t.success)return EQ({code:`SCHEMA_INVALID`,issues:t.error.issues.map(qZ)});let n=t.data,r=Object.keys(n),i=f(e=>bQ(e,n));return i.ok?DQ({appliedKeys:r}):EQ(AQ(i.error))}function m(e,t,n={}){if(c)return EQ({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>xQ(r,e,t,n));return r.ok?OQ({oldKey:e,newKey:t}):EQ(AQ(r.error))}function h(e){if(c)return EQ({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>SQ(t,e));return t.ok?kQ({orderedKeys:[...e]}):EQ(AQ(t.error))}return{current(){return PQ(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function RQ(e,t,n){if(t===0&&n)return!0;let r=t>0?t:NQ,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var zQ=new jv.default;zQ.Match_Threshold=.5;var BQ=`source`;function VQ(e){return{ok:!1,error:e}}function HQ(e){return{ok:!0,...e}}function UQ(){return uu.parse({})}function WQ(e,t){let n=e.toString();if(n.length===0)return UQ();let r=ru(n);if(r.errors.length>0)return console.warn(`[bindConfigDoc:${t}] Y.Text contains invalid YAML; returning schema defaults. Errors: ${r.errors.map(e=>e.message).join(`; `)}`),UQ();let i=r.toJSON()??{},a=uu.safeParse(i);return a.success?a.data:(console.warn(`[bindConfigDoc:${t}] Y.Text content fails schema validation; returning schema defaults. First issue: ${a.error.issues[0]?.message??`(unknown)`}`),UQ())}function GQ(e,t,n={}){return fu(`config.bind`,{"config.scope":t,"config.transport":`ytext`},()=>KQ(e,t,n))}function KQ(e,t,n){let{ytextKey:r=BQ}=n,i=e.document,a=i.getText(r),o=new Set,s=new Set,c=!1,l=!1;function u(){if(c)return;let e=WQ(a,t);for(let n of o)try{n(e)}catch(e){console.warn(`[bindConfigDoc:${t}] listener threw:`,e)}}function d(){if(c||(u(),l))return;l=!0;let e=[...s];s.clear();for(let n of e)try{n()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}a.observe(u),e.on(`synced`,d);function f(e){if(c)return VQ({code:`WRITE_ERROR`,detail:`ConfigBinding (${t}) has been disposed`});let n=vu(e,t);if(n!==null)return VQ(n);let r=ru(a.toString()),o=r.contents!==null&&!jo(r.contents);if(r.errors.length>0||o){pu(`config.corrupt-ytext-reset`,{"config.scope":t,"config.parse.errorCount":r.errors.length,"config.parse.topLevelNonMap":o});let e=r.errors.length>0?r.errors.map(e=>e.message).join(`; `):`top-level YAML is not a mapping`;console.warn(`[bindConfigDoc:${t}] dropping corrupt Y.Text and re-applying patch onto empty doc. Reason: ${e}`),r=ru(``)}r.contents===null&&(r.contents=r.createNode({}));let s=bu(r,e),l=r.toJSON()??{},u=fu(`config.validate`,{"config.scope":t,"config.validation.layer":`L1`},e=>{let t=uu.safeParse(l);if(e.setAttribute(`config.outcome`,t.success?`success`:`rejected`),!t.success)for(let e of t.error.issues)pu(`config.validation.issue`,{"issue.path":e.path.map(e=>String(e)).join(`.`),"issue.message":e.message});return t});if(!u.success)return VQ({code:`SCHEMA_INVALID`,issues:u.error.issues.map(xu)});let d=r.toString();return i.transact(()=>{a.length>0&&a.delete(0,a.length),a.insert(0,d)}),HQ({effective:u.data,appliedPaths:s})}return{current(){return WQ(a,t)},patch(e){return fu(`config.patch`,{"config.scope":t,"config.transport":`ytext`},t=>{let n=f(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})},subscribe(e){return o.add(e),()=>{o.delete(e)}},hasSynced(){return l},subscribeSynced(e){if(c)return()=>{};if(l){let n=!1;return queueMicrotask(()=>{if(!(n||c))try{e()}catch(e){console.warn(`[bindConfigDoc:${t}] synced listener threw:`,e)}}),()=>{n=!0}}return s.add(e),()=>{s.delete(e)}},dispose(){c||(c=!0,a.unobserve(u),e.off(`synced`,d),o.clear(),s.clear())}}}var qQ=`source`,JQ=800;function YQ(e){return{ok:!1,error:e}}function XQ(e){return{ok:!0,...e}}function ZQ(e,t={}){let{ytextKey:n=qQ,acceptanceDelayMs:r=JQ}=t,i=e.document,a=i.getText(n),o=new Set,s=new Set,c=new Set,l=!1,u=`idle`,d=null;function f(){d!==null&&(clearTimeout(d),d=null)}function p(e){if(!l&&u!==e){u=e;for(let t of c)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] status listener threw:`,e)}}}function m(){if(l)return;let e=a.toString();for(let t of o)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] text listener threw:`,e)}}function h(e){if(!l)for(let t of s)try{t(e)}catch(e){console.warn(`[bindOkignoreDoc] rejection listener threw:`,e)}}return a.observe(m),e.on(`synced`,m),{current(){return a.toString()},patch(e){return l?YQ({code:`WRITE_ERROR`,detail:`OkignoreBinding has been disposed`}):(i.transact(()=>{a.length>0&&a.delete(0,a.length),e.length>0&&a.insert(0,e)}),f(),p(`pending`),d=setTimeout(()=>{d=null,!l&&u===`pending`&&p(`accepted`)},r),XQ({text:e}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},subscribeRejection(e){return s.add(e),()=>{s.delete(e)}},subscribeStatus(e){return c.add(e),()=>{c.delete(e)}},status(){return u},notifyRejection(e){l||(f(),p(`rejected`),h({error:e,text:a.toString()}))},dispose(){l||(l=!0,f(),a.unobserve(m),e.off(`synced`,m),o.clear(),s.clear(),c.clear())}}}var QQ=N({file:A(),line:j().int().min(1),column:j().int().min(1),snippet:A().optional()}),$Q=N({path:M(La([A(),j()])),message:A(),issueCode:A(),params:Ua(A(),Aa()).optional(),source:QQ.optional()}),e$=Ga([`user`,`project`,`project-local`,`either`]),t$=Ga([`user`,`project`,`project-local`]),n$=za(`code`,[N({code:qa(`YAML_PARSE`),detail:A()}),N({code:qa(`SCHEMA_INVALID`),issues:M($Q)}),N({code:qa(`SCOPE_VIOLATION`),path:M(A()),expectedScope:e$,actualScope:t$}),N({code:qa(`NOT_AGENT_SETTABLE`),path:M(A())}),N({code:qa(`MIXED_SCOPE`),paths:M(N({path:M(A()),scope:t$}))}),N({code:qa(`REMOVED_KEY`),path:M(A()),redirect:A(),source:QQ.optional()}),N({code:qa(`WRITE_ERROR`),detail:A()}),N({code:qa(`OKIGNORE_INVALID`),detail:A(),lineNumber:j().int().min(1).optional()}),N({code:qa(`UNKNOWN`),message:A().optional()})]),r$=new Set(n$.options.map(e=>e.shape.code.value)),i$=La([n$,Fa({code:A(),message:A().optional()})]);function a$(e){return r$.has(e.code)}function o$(e){if(!a$(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
379
+ `))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
380
+ `)}case`SCOPE_VIOLATION`:return`Field ${e.path.join(`.`)} cannot be set at ${e.actualScope} scope (expected: ${e.expectedScope}).`;case`NOT_AGENT_SETTABLE`:return[`Field ${e.path.join(`.`)} is not agent-settable.`,`Edit via the Settings pane or by hand-editing config.yml.`].join(` `);case`MIXED_SCOPE`:return[`Patch contains fields targeting multiple scopes:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${t}`).join(`
381
+ `)].join(`
382
+ `);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
383
+ `))n.push(` ${t}`);return n.join(`
384
+ `)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function s$(e,t,n){return c$([e,t,n],[])}function c$(e,t){if(t.length>0){let n=gu(uu,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[1]??e[0]}let n=l$(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>u$(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=c$(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function l$(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function u$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var d$=2e3;function f$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function p$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var m$=`__system__`,h$=`__config__/project`,g$=`__user__/config.yml`,_$=`__local__/project`,v$=`__config__/okignore`;Object.freeze([h$,_$,g$,v$]);var y$=[`invalid-args`,`nested-project`,`target-not-empty`,`mkdir-failed`,`git-init-failed`,`init-failed`,`discovery-failed`],b$=[`claude`,`claude-desktop`,`cursor`,`codex`],x$={claude:`Claude Code`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`},S$=[`incoming`,`outgoing`,`both`];function C$(e){return S$.includes(e)}var w$=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],T$=[`video/mp4`,`video/webm`,`video/ogg`],E$=[`audio/mpeg`,`audio/wav`,`audio/ogg`],D$=[`application/pdf`],O$=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),k$=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),A$=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),j$=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),M$=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus`.split(`.`)),N$=`wikiembed`,P$=`toast`,F$=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),I$=[`png`,`jpg`,`jpeg`],L$=[`mp4`];function R$(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}R$(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,I$,O$),R$(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,L$,k$),R$(`FILE_ATTACHMENT_EXTENSIONS`,[...j$],F$);var z$=new Set(I$),B$=new Set(L$);R$(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...I$,...L$])],M$);function V$(e){let t=e.toLowerCase().replace(/^\./,``);return z$.has(t)?`image`:B$.has(t)?`video`:null}var H$=wS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`}}}}),U$=LS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Yx({find:MS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Yx({find:PS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),W$=jS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Yx({find:ES,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Yx({find:OS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),G$=wx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),K$=zS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),q$=VS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1}}}}),J$=_S.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),Y$=_S.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),X$=_S.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),Z$=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],Q$=Z$.map(e=>`${e}:`).join(`|`),$$=RegExp(`^(?:${Q$}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function e1(e){let t=e.trim();return t===``?!0:$$.test(t)}function t1(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var n1=new Set(Z$.map(e=>`${e}:`)),r1=`https://placeholder.invalid`;function i1(e){try{let t=new URL(e,r1);return n1.has(t.protocol.toLowerCase())}catch{return!1}}var a1=rT.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:i1,validate:i1,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),o1=_S.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function s1(e){return e.type.name===`list`&&!e.attrs.ordered}function c1(e){return e.type.name===`list`&&!!e.attrs.ordered}function l1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function u1(e,t,n,r,i,a,o){let s=Qy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?bm(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return _m(n,a)(e,void 0)?t?_m(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var d1=_S.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,cb(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:u1(e,t,n,r,e=>s1(e)&&!l1(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:u1(e,t,n,r,e=>c1(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:u1(e,t,n,r,e=>s1(e)&&l1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Qx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Qx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new gx({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ef(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),f1=_S.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,cb(t),0]:[`li`,cb(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(cb(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),p1=d1,m1=f1,h1=_S.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),g1=_S.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),_1=mD.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),v1=vD.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1}}}}),y1=_S.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),b1=wx.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),x1=_S.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),S1=_S.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),C1=_S.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function w1(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var T1=qte.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=cb(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=w1(t.src)),[`img`,t]}}),E1=wx.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function D1(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r?!0:O1(n)===r}function O1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var k1=dD.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null}}}}),A1=XE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),j1=ZE.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),M1=_S.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),N1=/^(?:---|—-|___\s|\*\*\*\s)$/;function P1(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var F1=xD.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Xx({find:N1,type:this.type,getAttributes:e=>({sourceRaw:P1(e)})})]}});function I1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function L1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var R1=_S.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:I1(e.getAttribute(`data-alias`)),anchor:I1(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:I1(e.getAttribute(`data-alias`)),anchor:I1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=I1(e.attrs.alias),i=I1(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},L1({target:n,alias:r,anchor:i})]}});function z1(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function B1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var V1=_S.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:I1(e.getAttribute(`data-alias`)),anchor:I1(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=I1(e.attrs.alias),i=I1(e.attrs.anchor),a=I1(e.attrs.resolvedSrc),o=z1(n);if(O$.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},B1({target:n,alias:r,anchor:i})]}}),H1=[Y$,g1,X$,h1,R1,V1,M1,p1,m1,U$,W$,v1,H$,_1,q$,F1,a1,J$,o1,K$,G$,E1,Gte.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),k1.configure({resizable:!0}),QE,j1,A1,T1.configure({inline:!0}),C1,oT,b1,y1,S1,x1],U1=/^[a-zA-Z][\w/-]*$/;function W1(e,t){let n=encodeURIComponent(t.prompt),r=encodeURIComponent(t.projectDir),i=encodeURIComponent(t.docPath);return`claude://${e.mode}/new?q=${n}&folder=${r}&file=${i}`}function G1(e){return`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${encodeURIComponent(e.projectDir)}`}function K1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function q1(e){return`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${encodeURIComponent(K1(e.projectDir))}&mode=agent`}function J1(e){return`Open Knowledge doc: ${e.relativePath}. Use the open-knowledge MCP tool for backlinks and related context.`}var Y1=A().refine(e=>!e.includes(`..`)&&!e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`\\`),{message:`docName contains unsafe path characters`}).optional(),X1={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},Z1=A().optional(),Q1=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$1=N({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:Ua(A().min(1),A().min(1)).optional()}).loose(),e0=N({id:A().min(1),display_name:A().min(1),display_email:A(),source:Ga([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),t0=Ga(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed`.split(`.`)),n0=N({type:t0,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(Q1,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose();N({parentDocName:A().min(1),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose();var r0=N({src:A().min(1),path:A().min(1).optional(),deduped:Ea().optional()}).loose();N({url:A().min(1),dir:A().min(1)}).loose(),N({type:qa(`error`),problem:n0}).loose();var i0={"ok:shell:spawn-cursor":{"urn:ok:error:cursor-not-installed":`not-installed`,"urn:ok:error:cursor-spawn-timeout":`timeout`,"urn:ok:error:cursor-spawn-failed":`spawn-error`,"urn:ok:error:invalid-request":`invalid-path`,"urn:ok:error:path-escape":`invalid-path`}},a0=new Set(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:method-not-allowed.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout`.split(`.`));function o0(e,t){let n=t0.safeParse(e);if(!n.success)return{kind:`unknown`,problemType:e};let r=n.data,i=i0[t][r];return i===void 0?a0.has(r)?{kind:`http-only`}:{kind:`unknown`,problemType:e}:{kind:`mapped`,channel:t,reason:i}}function s0(e){throw Error(`Unhandled UrnIpcLookup: ${JSON.stringify(e)}`)}function c0(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var l0=/notionvc:/i,u0=()=>e=>{d0(e)&&(f0(e),p0(e))};function d0(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(l0.test(e))return!0}if(t.type===`element`&&d0(t))return!0}return!1}function f0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&f0(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
385
+ `)){t.push(n);continue}let r=e.split(`
386
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function p0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!l0.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&p0(t)}}var m0=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),h0=()=>e=>{g0(e)};function g0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&g0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return _0(t)?[]:v0(t)?t.children:[t]})}}function _0(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function v0(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>m0.has(String(e))):!1}var y0=`docs-internal-guid-`;function b0(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var x0=()=>e=>{S0(e)};function S0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&S0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(C0(r)||w0(r)){b0(e,t);continue}t++}}function C0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(y0)}function w0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var T0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),E0=()=>e=>{D0(e)};function D0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&D0(t);for(let t of e.children)t.type===`element`&&O0(t)}}function O0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!T0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var k0=/^gmail_/,A0=()=>e=>{j0(e)};function j0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&j0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&M0(r,`gmail_quote`)&&(r.tagName=`blockquote`),N0(r),P0(r)){e.children.splice(t,1,...r.children);continue}t++}}function M0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function N0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!k0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function P0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var F0=()=>e=>{I0(e)};function I0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&I0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(L0(t),[t])})}}function L0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var R0=[`o:`,`w:`,`m:`,`v:`,`u1:`],z0=/^Mso[A-Z]/,B0=/^\s*\[if\s+[^\]]*\]/,V0=()=>e=>{H0(e)};function H0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&H0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return B0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return U0(t)?[]:(W0(t),[t])})}}function U0(e){return R0.some(t=>e.tagName.startsWith(t))}function W0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!z0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&z0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);R0.some(e=>e===`${n}:`)&&delete t[e]}}var G0=/^c-(message_kit__|message__|compose|timestamp)/,K0=()=>e=>{q0(e)};function q0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&q0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return J0(t)?[]:(Y0(t),[t])})}}function J0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function Y0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!G0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var X0=()=>e=>{Z0(e)};function Z0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&Z0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;Q0(r)&&(e.children[t]=e2(r))}}}function Q0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>$0(e))}function $0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||$0(e))return!0}return!1}function e2(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>t2(e)).join(`
387
+ `)}]}]}}function t2(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=t2(n));return t}var n2=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},r2=[x0,V0,h0,A0,u0,X0,F0,K0,E0];function i2(e){WP(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function a2(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new n2(e.length,n);let r=FH().use(HN,{fragment:!0});for(let e of r2)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(UI);let i=r.parse(e),a=r.runSync(i);return i2(a),a}function o2(e){return String(FH().use(EH).use(DH).stringify(e))}function s2(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}let o=c2(e,t);r>=0?n[r]=o:n.push(o)}return n}function c2(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function l2(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:s2(t,r),children:n.all(t),data:{}}}var u2=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],d2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:w$,autoFocus:!0},{name:`alt`,type:`string`,required:!1,defaultValue:``,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`}],f2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:T$,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`}],p2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:E$,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],m2=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],h2=[u2[0],u2[1],u2[4],u2[5],u2[6]],g2=[d2[0],d2[1],d2[7]],_2=[m2[0],m2[1],m2[4],m2[5]],v2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],y2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],b2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],x2=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],S2=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],C2=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],w2=[C2[0]],T2=[C2[0]],E2=[{name:`chart`,type:`string`,required:!0,autoFocus:!0,language:`mermaid`,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#system-arch-diagram`)"},{name:`theme`,type:`enum`,enumValues:[`default`,`dark`,`forest`,`neutral`],defaultValue:`default`,required:!1,advanced:!0,description:"Mermaid theme — default ships only `default` styling; alternates land alongside theme-switching infrastructure"}],D2=[E2[0]],O2=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],k2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],A2=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:D$,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}];function j2(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function M2(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function N2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var P2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:u2,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>l2(`Callout`,e,t,u2)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:d2,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>l2(`img`,e,t,d2)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:f2,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>l2(`video`,e,t,f2)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:p2,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>l2(`audio`,e,t,p2)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A2,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>l2(`Pdf`,e,t,A2)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k2,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>l2(`File`,e,t,k2)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:m2,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],serialize:(e,t)=>l2(`Accordion`,e,t,m2)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:x2,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],serialize:(e,t)=>l2(`Tabs`,e,t,x2)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:S2,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],serialize:(e,t)=>l2(`Tab`,e,t,S2)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:C2,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>l2(`Math`,e,t,C2)},{name:`Mermaid`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:E2,icon:`Workflow`,category:`content`,displayName:`Mermaid`,description:`Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie)`,searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:(e,t)=>l2(`Mermaid`,e,t,E2)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:h2,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:g2,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:v2,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:N2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:y2,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:N2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:b2,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:N2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:O2,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:N2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:_2,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${j2(n.name)}"`:``,a=n?.id?` id="${j2(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${M2(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:w2,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:T2,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})},{name:`MermaidFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:D2,icon:`Workflow`,category:`content`,displayName:`Mermaid Fence`,description:"Mermaid diagram via ` ```mermaid ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Mermaid block for the full prop surface (id, theme).",rendersAs:`Mermaid`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})}],F2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>l2(e.attrs.componentName||`*`,e,t)};function I2(){let e=new Map;e.set(`*`,F2);for(let t of P2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var L2={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function R2(){L2.parseFallback.blockLevel++}function z2(){L2.parseFallback.wholeDoc++}function B2(e){L2.jsxRenderFailure[e]=(L2.jsxRenderFailure[e]??0)+1}function V2(e){L2.jsxAutoConvertFailed[e]=(L2.jsxAutoConvertFailed[e]??0)+1}function H2(e){L2.jsxAutoConvertSucceeded[e]=(L2.jsxAutoConvertSucceeded[e]??0)+1}function U2(e){L2.jsxPropDropped[e]=(L2.jsxPropDropped[e]??0)+1}function W2(e){L2.jsxMoveFailed[e]=(L2.jsxMoveFailed[e]??0)+1}function G2(e){L2.jsxStuckCopyFailed[e]=(L2.jsxStuckCopyFailed[e]??0)+1}function K2(e){L2.jsxStuckDeleteFailed[e]=(L2.jsxStuckDeleteFailed[e]??0)+1}var q2=/^(`{3,}|~{3,})/gm;function J2(e){let t=[],n=null;for(let r of e.matchAll(q2)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function Y2(e,t){return t.some(([t,n])=>e>=t&&e<n)}var X2=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function Z2(e){let t=J2(e),n=[];for(let r of e.matchAll(X2))Y2(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
388
+ `)}\n\n`:``}var Q2=500,$2=1e3;function e4(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return i4(e,t.parse,0,n)}function t4(e){return e.calls>=$2?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=Q2}var n4=500;function r4(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,n4),stack:e.stack?.split(`
389
+ `).slice(0,4).join(`
390
+ `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,n4)}}function i4(e,t,n,r){if(n>20)return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),m4(e);if(r){if(t4(r))return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),m4(e);r.calls+=1}try{return t(e)}catch(i){let a=a4(i),o=r4(i);if(a===void 0){if(n===0){let n=p4(e,t,i,r);if(n)return n}return z2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),m4(e)}R2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=d4(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?i4(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?i4(Z2(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){z2();let n=r4(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),m4(e)}}}function a4(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function o4(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function s4(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var c4=32*1024;function l4(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(Y2(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+c4),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function u4(e){let t=l4(e,J2(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=s4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=s4(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function d4(e,t){let n=u4(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:o4(e,t)??0,end:s4(e,t)??e.length}}function f4(e){let t=J2(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;Y2(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function p4(e,t,n,r){let i=f4(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&t4(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=Z2(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){R2();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function m4(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var h4=``,g4=``,_4=``,v4=``,y4=``,b4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,x4=/<!--[\s\S]*?-->/g,S4=/<\/([a-z][a-z0-9]*)\s*>/g,C4=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,w4=new Set([`img`,`video`,`audio`]),T4=new Set([`mark`]),E4=/<\/([A-Z][A-Za-z0-9.]*)>/g;function D4(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function O4(e){let t=new Map,n=new RegExp(E4.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function k4(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function A4(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function j4(e){let t=e;t=t.replace(x4,e=>e.replace(/</g,h4).replace(/>/g,g4)),t=t.replace(b4,(e,t)=>`${h4}${t.replaceAll(`:`,_4).replaceAll(`@`,v4)}${g4}`),t=t.replace(S4,(e,t)=>T4.has(t)?e:e.replace(/</g,h4).replace(/>/g,g4)),t=t.replace(C4,(e,t)=>w4.has(t)&&e.endsWith(`/>`)||T4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,h4).replace(/>/g,g4):e),t=t.replace(/<>/g,`${h4}${g4}`);let n=O4(t),r=k4(t),i=A4(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:h4;let s=/^<([a-z][a-z0-9]*)([^>]*)\/>/.exec(o);if(s&&w4.has(s[1]))return e;let c=/^<([a-z][a-z0-9]*)([\s/>])/.exec(o);if(c&&T4.has(c[1])){let n=c[1];return o.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,a)!==-1?e:h4}let l=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!l)return h4;let u=l[1],d=D4(r,a),f=D4(i,d<r.length?r[d]:t.length);if(f>0){let n=i[f-1];if(n>a){let r=a+l[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let p=n.get(u);return p&&D4(p,a)<p.length?e:h4});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
391
+ `){let i=t[r+1];if(i===`
392
+ `||i===`>`){if(e.push(...n),n.length=0,i===`
393
+ `)for(;t[r+1]===`
394
+ `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=y4;t=n.join(``)}}return t}function M4(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function N4(){return e=>{WP(e,e=>{let t=e;typeof t.value==`string`&&M4(t.value)&&(t.value=P4(t.value)),typeof t.url==`string`&&M4(t.url)&&(t.url=P4(t.url)),typeof t.title==`string`&&M4(t.title)&&(t.title=P4(t.title)),typeof t.alt==`string`&&M4(t.alt)&&(t.alt=P4(t.alt))})}}function P4(e){return e.replaceAll(h4,`<`).replaceAll(g4,`>`).replaceAll(_4,`:`).replaceAll(v4,`@`).replaceAll(y4,`{`)}var F4=``,I4=``,L4=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function R4(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function z4(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||R4(e,r)%2==1?t:n(t))}function B4(e){return z4(e,L4,e=>`${F4}${e.slice(1,-1)}${I4}`)}var V4=RegExp(`${F4}([^${I4}]+)${I4}`,`g`);function H4(e){if(!e.includes(F4))return{value:e,spans:[]};let t=[],n=``,r=0;V4.lastIndex=0;let i=V4.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=V4.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function U4(){return e=>{WP(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(F4)){let{value:n,spans:r}=H4(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(F4)&&(t[e]=H4(n).value)}})}}var W4=``,G4=/\\</g;function K4(e){return z4(e,G4,e=>`${W4}${e.slice(1)}`)}function q4(){return e=>{WP(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(W4)&&(t.value=t.value.split(W4).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(W4)&&(t[e]=n.split(W4).join(``))}})}}var J4=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),Y4={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},X4=`ok-alert`,Z4=RegExp(`(?:^|\\s)${X4}-(\\w+)(?:\\s|$)`),Q4=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function $4(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
395
+ `,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Q4);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function e3(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Z4);return n?n[1].toLowerCase():null}function t3(e){return Y4[e.toLowerCase()]??null}function n3(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&r3(o[0],s)?o.slice(1):o,position:e.position}}function r3(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function i3(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${X4}-title`)}function a3(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;WP(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=e3(e);if(!i)return;let a=t3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=$4(n,e.position.start.offset),s&&(o=s.title,a||=t3(s.rawType)));let c=a??`note`,l=s&&J4.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=$4(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!i3(e.children[0]))return;let f=n3(e,c,o,l,d);r.children[t]=f})}}var o3=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,s3={markers:`*`,classPrefix:X4,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>o3})},c3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,l3=/<!--([\s\S]*?)-->/g;function u3(){return e=>{f3(e),WP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`%%`)===-1&&r.indexOf(`<!--`)===-1)return;let i=d3(r);if(i.length===0)return;let a=[],o=0;for(let e of i){e.start>o&&a.push({type:`text`,value:r.slice(o,e.start)});let t={type:`comment`,children:[{type:`text`,value:e.body}],data:{sourceForm:e.sourceForm}};a.push(t),o=e.end}return o<r.length&&a.push({type:`text`,value:r.slice(o)}),n.children.splice(t,1,...a),[VP,t+a.length]})}}function d3(e){let t=[];c3.lastIndex=0;let n;for(;(n=c3.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});l3.lastIndex=0;let r;for(;(r=l3.exec(e))!==null;){let e=r[1].trim();e!==``&&t.push({start:r.index,end:r.index+r[0].length,body:e,sourceForm:`html`})}t.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of t)e.start<a||(i.push(e),a=e.end);return i}function f3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=p3(e);if(r!==null){let e=m3(r);if(e!==null){let r={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:e}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,1,r),n+=1;continue}let i=h3(r);if(i!==null){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:i}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}let i=g3(e);if(i!==null){let e={type:`commentBlock`,children:[i],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}let a=_3(e);if(a!==null){let e={type:`commentBlock`,children:[a],data:{sourceForm:`percent`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}if(e.type===`paragraph`&&y3(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&y3(n))break;e+=1}if(e<t.length&&e>n+1){let r={type:`commentBlock`,children:t.slice(n+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,e-n+1,r),n+=1;continue}}n+=1}}function p3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function m3(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function h3(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function g3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(v3(r,`<!--`)>1||v3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(v3(r,`<!--`)>0||v3(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function _3(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function v3(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function y3(e){let t=p3(e);return t===null?!1:t.trim()===`%%`}var b3=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,x3=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,S3=/^\s*<\/details>\s*$/;function C3(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function w3(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function T3(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function E3(e){return e.children[0].value??``}function D3(e){if(!T3(e))return null;let t=E3(e).match(b3);if(!t)return null;let{defaultOpen:n,name:r,id:i}=C3(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:w3({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function O3(e,t){let n=e[t];if(!T3(n))return null;let r=E3(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(x3);if(!i)return null;let{defaultOpen:a,name:o,id:s}=C3(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!T3(t))continue;let r=E3(t);if(S3.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function k3(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(T3(e)){let r=D3(e);if(r){t[n]=r,n++;continue}let i=O3(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:w3(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function A3(){return e=>{WP(e,e=>{`children`in e&&Array.isArray(e.children)&&k3(e)})}}var j3=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function M3(){return e=>{WP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`==`)===-1)return;j3.lastIndex=0;let i=[],a;for(;(a=j3.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`mark`,children:[{type:`text`,value:e[1]}]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[VP,t+o.length]}),WP(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function N3(){return e=>{WP(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=P3(r,e);n.children[t]=i})}}function P3(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];e.alt&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var F3=/^( {4}|\t)/;function I3(e){let t=e.split(`
396
+ `),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!F3.test(e)))return!1;return n}function L3(e){return e.split(`
397
+ `).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
398
+ `)}function R3(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
399
+ `;)a--;if(a===r)return null;let o=t.slice(a,r);if(!F3.test(o))return null;let s=t.slice(a,i);if(!I3(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:L3(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var z3=function(){return(e,t)=>{let n=String(t.value??``);n&&WP(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=R3(e,n);a&&(r.children[t]=a)})}};function B3(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function V3(){return e=>{WP(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=B3(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),WP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=B3(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var H3=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function U3(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;H3.lastIndex=0;let i=[],a=0;for(;;){let t=H3.exec(e);if(t===null)break;let r=t[0],o=t[1],s=t.index;s>a&&i.push({type:`text`,value:e.slice(a,s)});let c={type:`link`,url:o,title:null,children:[{type:`text`,value:o}],data:{sourceStyle:`autolink`}};i.push(c),a=s+r.length,n=!0}i.length===0?t.push(r):(a<e.length&&i.push({type:`text`,value:e.slice(a)}),t.push(...i))}n&&(e.children=t)}function W3(e,t){if(e.children.length===0)return;let n=e.children[0];if(n.type!==`yaml`||(n.value??``).trim()!==``)return;let r=n.position?.start?.offset;if(r!==0)return;let i=n.position?.end?.offset;if(typeof i!=`number`)return;let a=typeof t.value==`string`?t.value:``;if(!a)return;let o=a.slice(r,i).split(`
400
+ `),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}var G3=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function K3(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function q3(e,t,n=!1){if(!t)return;let r=e.position;if(!r||typeof r.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let i=r.start.offset,a=r.end?.offset??i;if(i<0||a>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${i} end=${a} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(i,a),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&G3.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[i];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(i,i+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[i],r=t.slice(i,a);if(n===`#`){e.data.sourceStyle=`atx`;let t=/^.*?[ \t](#+)[ \t]*$/.exec(r);t&&(e.data.sourceTrailingHashes=t[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(r),n=/\n(-+)[ \t]*$/.exec(r),i=t??n;i?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=i[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=i;for(;n>0&&t[n-1]!==`
401
+ `;)n--;let r=!1;for(let e=n;e<i;e++)if(t[e]===`>`){r=!0;break}let o=t.slice(i,a).split(`
402
+ `),s=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`||n.slice(1).trimEnd()===``)continue;let i=n[1];i===` `||i===` `?s.push(`single`):s.push(`none`)}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`code`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceStyle=`fenced`,e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=3&&(e.data.sourceFenceLength=r)}else e.data.sourceStyle=`indented`;break}case`inlineCode`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r)}break}case`thematicBreak`:e.data.sourceRaw=t.slice(i,a);break;case`table`:{let n=t.slice(i,a),r=n.indexOf(`
403
+ `);if(r===-1)break;let o=n.slice(r+1),s=o.indexOf(`
404
+ `),c=(s===-1?o:o.slice(0,s)).trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),l=[];for(let e of c){let t=e.match(/-/g);l.push(t?t.length:0)}l.length>0&&l.some(e=>e>0)&&(e.data.sourceDashCounts=l);for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
405
+ `);a!==-1&&(i=i.slice(0,a));let o=K3(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(i,a)),e.type===`link`){let n=t[i];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(i,a),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
406
+ `);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(i,a);if(e.data.sourceLayout=n.includes(`
407
+ `)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var J3=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function Y3(){return new RegExp(J3,`g`)}var X3=Y3();function Z3(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function Q3(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;X3.lastIndex=0;let o=[],s=0;for(;;){let n=X3.exec(e);if(n===null)break;let i=n[1]??``,c=n[2]??``,l=n.index+i.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=l&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===l){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&Z3(t,i))continue}l>s&&o.push({type:`text`,value:e.slice(s,l)});let u={type:`tag`,value:c};o.push(u),s=l+1+c.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push({type:`text`,value:e.slice(s)}),n.push(...o))}r&&(e.children=n)}var $3=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function e6(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function t6(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;W3(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;WP(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!$3.has(e.type)){let r=e6(e,n);return i.children[t]=r,VP}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(U3(t),Q3(t,n))}if(q3(e,n,r),e.type===`heading`&&i!==void 0&&typeof t==`number`&&e.data?.sourceStyle===`setext`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function n6(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function r6(){return e=>{WP(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=n6(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function i6(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var a6=(e,t)=>{if(i6(e,t))return 0;let n=e.position,r=t.position;if(!n||!r)return;let i=r.start.line-n.end.line-1;return i>=1?i:void 0},o6=bK(),s6=NG(),c6=PG();function l6(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===o6)||t.push(o6);let n=e.fromMarkdownExtensions;n.some(e=>e===s6)||n.push(s6);let r=e.toMarkdownExtensions;r.some(e=>e===c6)||r.push(c6)}var u6=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function d6(){return e=>{WP(e,`text`,(e,t,n)=>{if(n===void 0||t==null)return;let r=e.value;if(r.indexOf(`$`)===-1)return;u6.lastIndex=0;let i=[],a;for(;(a=u6.exec(r))!==null;)i.push(a);if(i.length===0)return;let o=[],s=0;for(let e of i){let t=e.index,n=t+e[0].length;if(t>s){let e={type:`text`,value:r.slice(s,t)};o.push(e)}let i={type:`inlineMath`,value:e[1]};o.push(i),s=n}if(s<r.length){let e={type:`text`,value:r.slice(s)};o.push(e)}return n.children.splice(t,1,...o),[VP,t+o.length]})}}var f6={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function p6(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===f6)||e.toMarkdownExtensions.push(f6)}var m6=33,h6=91,g6=93,_6=124,v6=35,y6={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===h6?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===h6?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===v6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===_6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===_6?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===g6?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===g6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},b6={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===m6?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===h6?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===h6?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===v6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===_6?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===_6?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===h6?n(t):t===g6?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===g6?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===g6?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function x6(){return{text:{[h6]:y6,[m6]:b6}}}function S6(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function C6(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function w6(e){return e.stack[e.stack.length-1]}function T6(e){let t=w6(this);t.data.target=this.sliceSerialize(e).trim()}function E6(e){let t=w6(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function D6(e){let t=w6(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function O6(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function k6(e){O6(w6(this)),this.exit(e)}function A6(e){O6(w6(this)),this.exit(e)}var j6={enter:{wikiLink:S6,wikiLinkEmbed:C6},exit:{wikiLinkTarget:T6,wikiLinkAnchor:E6,wikiLinkAlias:D6,wikiLink:k6,wikiLinkEmbed:A6}},M6={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},N6=x6();function P6(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===N6)||e.micromarkExtensions.push(N6),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===j6)||e.fromMarkdownExtensions.push(j6),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===M6)||e.toMarkdownExtensions.push(M6)}function F6(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var I6=[{name:`remark-parse`,plugin:NW},{name:`remark-frontmatter`,plugin:MU,options:[`yaml`]},{name:`remark-mdx-agnostic`,plugin:l6},{name:`remark-gfm`,plugin:EH},{name:`remark-math`,plugin:JU,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:P6},{name:`remark-github-alerts`,plugin:IU,options:s3},{name:`callout-transformer`,plugin:a3},{name:`restore-from-mdx`,plugin:N4},{name:`restore-entity-refs`,plugin:U4},{name:`restore-backslash-escapes`,plugin:q4},{name:`details-accordion-promoter`,plugin:A3},{name:`image-promoter`,plugin:N3},{name:`indented-code-promoter`,plugin:z3},{name:`math-promoter`,plugin:V3},{name:`single-dollar-math-promoter`,plugin:d6},{name:`highlight-promoter`,plugin:M3},{name:`mermaid-promoter`,plugin:r6},{name:`comment-promoter`,plugin:u3},{name:`merged-post-parse-walker`,plugin:t6},{name:`ensure-non-empty-doc`,plugin:()=>F6}];function L6(e){let t=FH();for(let e of I6)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(sU,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function R6(e){let t=FH().use(MU,[`yaml`]).use(EH,{tablePipeAlign:!1}).use(JU,{singleDollarTextMath:!1}).use(l6).use(P6).use(p6).use(DH,{bullet:`-`,fences:!0,rule:`-`,join:[a6],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function z6(e,t){let n=new TN(B4(j4(K4(e)))),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function B6(e,t){let n=new TN(B4(j4(K4(e)))),r=t.parse(n);return n.value=e,t.runSync(r,n)}function V6(e,t,n){let r=lU(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}function H6(){return!1}function U6(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function W6(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function G6(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!t1(e))return e;let n=W6(U6(t),e);return n===``||n===`..`||n.startsWith(`../`)?(H6()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var K6={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&D1(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=Z6(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=Z6(n,t.slice(o),r)),a}return Z6(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:Y6(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(J6(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(Y6(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
408
+ `:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(Y6(d)),e()}if(e.title){let t=i===`multiline`?`
409
+ `:` `;l+=s.move(J6(e.title,a,t))}return o(),l},thematicBreak(e,t,n){let r=e.data?.sourceRaw;return Array.isArray(n?.indexStack)&&n.indexStack.length===1&&n.indexStack[0]===0&&(!r||/^-[-\s]*-\s*$/.test(r))?`***`:r??`---`},break(e){return e.data?.sourceStyle===`backslash`?`\\
410
+ `:`
411
+ `},code(e){let t=e.value??``;if(e.data?.sourceStyle===`indented`)return t.split(`
412
+ `).map(e=>e.length>0?` ${e}`:e).join(`
413
+ `);let n=e.data?.sourceFenceChar===`~`?`~`:"`",r=Math.max(3,e.data?.sourceFenceLength??3),i=n.repeat(r);return`${i}${e.lang??``}${e.meta?` ${e.meta}`:``}\n${t}\n${i}`},inlineCode(e){let t=e.value??``,n=e.data?.sourceFenceChar===`~`?`~`:"`",r=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,i=n==="`"?"`":`~`,a=r;for(;RegExp(`(^|[^${i}])${i.repeat(a)}([^${i}]|$)`).test(t);)a+=1;let o=n.repeat(a);return/[^ \r\n]/.test(t)&&(/^[ \r\n]/.test(t)&&/[ \r\n]$/.test(t)||t.startsWith(n)||t.endsWith(n))&&(t=` ${t} `),`${o}${t}${o}`},heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
414
+ `,after:`
415
+ `}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=`#`.repeat(a),s=n.containerPhrasing(e,{...r,before:`${o} `,after:`
416
+ `}),c=e.data?.sourceTrailingHashes;if(typeof c==`number`&&c>0){let e=`#`.repeat(c);return s?`${o} ${s} ${e}`:`${o} ${e}`}return s?`${o} ${s}`:o},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=a?`${d+t}${u}`:e.data?.bulletMarker??i,f=s;o.checked===!0?f+=` [x]`:o.checked===!1&&(f+=` [ ]`);let p=` `.repeat(s.length+1),m=n.containerFlow(o,r).split(`
417
+ `).map((e,t)=>t===0?`${f} ${e}`:e&&`${p}${e}`).join(`
418
+ `);l.push(m)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
419
+
420
+ `:`
421
+ `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}return`|${n.join(`|`)}|`},h=Array.from({length:f},()=>null);if(a.length===0)return m(p,h);let g=[];g.push(m(a[0],o[0]??[])),g.push(m(p,h));for(let e=1;e<a.length;e++)g.push(m(a[e],o[e]??[]));return g.join(`
422
+ `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=q6(i.attributes??[]);if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let l=c?`<${s} ${c}>`:`<${s}>`,u=`</${s}>`;return`${l}\n\n${n.containerFlow({type:`root`,children:i.children},r)}\n\n${u}`},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=q6(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>n?`>`:s?.[c++]===`none`?`>${e}`:`> ${e}`)}};function q6(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){if(n.value.includes(`"`)){let r=n.value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);t.push(`${e}={"${r}"}`)}else t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function J6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function Y6(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function X6(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function Z6(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return X6(i)}function Q6(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var $6=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=vb(e.extensions),this.handlers=l8(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=u8(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=L6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=R6({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:K6})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return z6(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?B6(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?e4(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return V6(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},e8=I2();function t8(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function n8(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function r8(e){return e.attrs.sourceDirty||n8(e)}function i8(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function a8(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),Object.keys(n).length===0?e:{...e,data:n}}function o8(e,t){if(e.length===0)return a8({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return a8({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[o8(n.children,t)]}}return a8({type:`inlineCode`,value:s8(e)},t)}function s8(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=s8(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var c8=O$;function l8(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=iU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=iU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null;return n.table.createAndFill({sourceDashCounts:s},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=G6(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[],l=0;for(let t of s){if(t.offset>l){let r=n.slice(l,t.offset).replaceAll(`\xA0`,` `);r&&c.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);i&&(t.kind===`escape`?c.push(e.text(i,[r.escapeMark.create()])):r.sourceLiteral?c.push(e.text(i,[r.sourceLiteral.create({sourceRaw:t.raw})])):c.push(e.text(i))),l=t.offset+t.length}}if(l<n.length){let t=n.slice(l).replaceAll(`\xA0`,` `);t&&c.push(e.text(t))}return c.length===1?c[0]:c}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1})]));let a=r.strike??r.delete;if(a&&(i.delete=aU(a)),r.highlight&&(i.mark=aU(r.highlight)),r.comment&&(i.comment=aU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=iU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=aU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=aU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=iU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=iU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=iU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=e8.getOrWildcard(o),c=t8(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=G6(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=z1(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&c8.has(l)&&n.jsxComponent&&e8.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&k$.has(l)&&n.jsxComponent&&e8.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&A$.has(l)&&n.jsxComponent&&e8.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&j$.has(l)&&n.jsxComponent&&e8.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:Q6(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(F$.has(l)&&r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}if(r.link){let t=r.link.create({href:o,title:null,linkStyle:`inline`,refLabel:null});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")});let s=t=>{let r=t.value??t.type;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},c=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``})),i.math||=s,i.inlineMath||=c,n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=c,n.footnoteDefinition&&(i.footnoteDefinition=iU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}})),i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function u8(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=uU(`paragraph`)),r.blockquote&&(t.blockquote=uU(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=uU(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=uU(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&i8(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c=Array.isArray(s)&&s.length>0?{sourceDashCounts:s}:void 0,l={type:`table`,align:i,children:o};return c&&(l.data=c),l}),r.tableRow&&(t.tableRow=uU(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=uU(`tableCell`,a)),r.tableHeader&&(t.tableHeader=uU(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!r8(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:e8.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:e8,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;return typeof n==`string`&&n.length>0?{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]}:{type:`inlineMath`,value:t}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=dU(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=dU(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return o8(n,{sourceFenceChar:r,sourceFenceLength:i})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=dU(`delete`)}return i.highlight&&(n.highlight=dU(`mark`)),i.comment&&(n.comment=dU(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=uU(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=uU(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,n=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,r=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return D1(t,e.value)&&(e.data=e.data??{},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var d8=/\p{M}+/gu,f8=/[^\p{L}\p{N}]+/gu,p8=/^-+|-+$/g;function m8(e){return e.trim().normalize(`NFKD`).replace(d8,``).toLowerCase().replace(f8,`-`).replace(p8,``)}function h8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function g8(e,t){let n=m8(e);return n?h8(n,t):``}function _8(e,t){let n=m8(e);return t?`#${n}-${m8(t)}`:`#${n}`}var v8=new Set([`img`,`video`,`audio`,`mark`]);function y8(e){let t=e.name;if(!t||!v8.has(t))return null;let n={};for(let t of e.attributes){if(t.type!==`mdxJsxAttribute`)return null;let e=t.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(t.value===null)n[t.name]=!0;else if(typeof t.value==`string`)n[t.name]=t.value;else return null}return{type:`element`,tagName:t,properties:n,children:[]}}var b8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:_8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},x8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:_8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},S8=(e,t)=>{let n=t,r=y8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,i),e.applyData(t,i)},C8=(e,t)=>{let n=t,r=y8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,i),e.applyData(t,i)},w8=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},T8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function E8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(E8).join(``):``}var D8={wikiLink:b8,wikiLinkEmbed:x8,mdxJsxFlowElement:S8,mdxJsxTextElement:C8,rawMdxFallback:w8,mark:T8,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:E8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:E8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},O8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,k8=/\bexpression\s*\(/i,A8=1e4;function j8(e){return!(e.length>A8||O8.test(e)||k8.test(e))}function M8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!e1(e.split(/\s+/)[0]??``))return!1}return!0}var N8=()=>e=>{WP(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!e1(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!e1(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!e1(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!M8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!M8(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!e1(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!j8(r)&&delete n.style})};function P8(e){let t=FH().use(NW).use(MU,[`yaml`]).use(l6).use(EH).use(P6).use(aJ,{handlers:D8}).use(N8).use(vq);return String(t.processSync(e))}N({docName:Y1,summary:Z1,content:A().optional(),...X1}).loose(),N({docName:Y1,summary:Z1,markdown:A().min(1),position:Ga([`append`,`prepend`,`replace`]).optional(),...X1}).loose(),N({docName:Y1,summary:Z1,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...X1}).loose(),N({docName:Y1,connectionId:A().min(1),scope:Ga([`last`,`session`,`file`]).optional(),...X1}).loose();var F8=N({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),I8=N({type:qa(`orphan`),parentCandidates:M(A()),message:A()}).loose();N({timestamp:A().min(1),summary:F8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:M(I8).optional(),summary:F8.optional()}).loose(),N({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:F8.optional()}).loose(),N({docName:A().min(1),scope:Ga([`last`,`session`]),undone:Ea()}).loose(),N({docName:A().min(1),content:A()}).loose();var L8=N({documents:M(N({kind:Ga([`document`,`asset`,`folder`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:Ea().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:Ga([`image`,`video`]).nullable().optional(),referencedBy:M(A().min(1)).optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0,{message:`document/asset/folder kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName)`}))}).loose(),R8=N({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),z8=N({docName:A().min(1),backlinks:M(R8)}).loose();N({counts:Ua(A().min(1),j().int().nonnegative())}).loose();var B8=za(`kind`,[N({kind:qa(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),N({kind:qa(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),V8=N({docName:A().min(1),forwardLinks:M(B8)}).loose(),H8=za(`kind`,[N({id:A().min(1),kind:qa(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:M(A()).nullable()}).loose(),N({id:A().min(1),kind:qa(`external`),url:A().min(1),label:A()}).loose()]),U8=N({source:A().min(1),target:A().min(1)}).loose(),W8=N({nodes:M(H8),links:M(U8)}).loose(),G8=N({id:A().min(1),name:A().optional(),email:A().optional()}).loose(),K8=N({name:A().optional(),email:A().optional()}).loose();N({message:A().optional(),writers:M(G8).optional(),principal:K8.optional(),...X1}).loose(),N({checkpointRef:A().min(1),versionTag:A().min(1).optional()}).loose();var q8=N({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:M(A()),summaries:M(A()).optional()}).loose();N({entries:M(N({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:Ga([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:M(q8),checkpoint:Aa().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:Ea().optional()}).loose(),N({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),N({lines:M(N({type:Ga([`added`,`removed`,`unchanged`]),text:A()}).loose()),additions:j().int().nonnegative(),deletions:j().int().nonnegative()}).loose();var J8=N({contentDir:A().min(1),pathSeparator:Ga([`/`,`\\`]),symlinkResolved:Ea()}).loose();M(za(`source`,[N({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:qa(`flat`)}).loose(),N({docName:A().min(1),timestamp:A().min(1),source:qa(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var Y8=N({orphans:M(N({docName:A().min(1),title:A()}).loose())}).loose(),X8=N({hubs:M(N({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),Z8=N({source:A().min(1),title:A(),snippet:A().nullable()}).loose();N({deadLinks:M(N({target:A().min(1),sources:M(Z8)}).loose())}).loose(),N({target:N({docName:A().min(1),title:A(),aliases:M(A())}).loose(),mentions:M(N({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:Ea()}).loose(),N({dir:A().min(1)}).loose(),N({port:j().int().positive()}).loose(),N({host:A().min(1).optional()}).loose(),N({pat:A().min(1),host:A().min(1).optional()}).loose(),N({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),N({identity:N({name:A().min(1),email:A().min(1)}).loose().nullable()}).loose(),N({authenticated:Ea()}).loose(),N({type:qa(`complete`).optional(),login:A().min(1).optional()}).loose(),N({}).loose();var Q8=N({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),$8=N({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:M(Q8)}).loose(),e5=N({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),t5=N({sessionAlive:Ea(),agent:e5.nullable(),files:M($8)}).loose(),n5=N({diff:A(),generatedAt:j().int().min(0)}).loose();N({}).loose(),N({}).loose(),N({}).loose(),N({}).loose();var r5=N({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:Ga([`idle`,`writing`]),ts:j().int().min(0)}).loose();N({presence:Ua(A().min(1),r5)}).loose(),Ua(A().min(1),Ea()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),N({path:A().min(1,`path must be non-empty`)}).loose(),N({}).loose();var i5=N({fromDocName:A().min(1),toDocName:A().min(1)}).loose();N({}).loose(),N({path:A().min(1),...X1,summary:Z1}).loose();var a5=N({docName:A().min(1)}).loose();N({path:A().min(1),...X1,summary:Z1}).loose();var o5=N({path:A().min(1)}).loose(),s5=N({pages:M(N({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1)}).loose())}).loose(),c5=N({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),l5=N({docName:A().min(1),headings:M(c5)}).loose();N({docName:A().min(1),newDocName:A().min(1),summary:Z1,...X1}).loose();var u5=N({docName:A().min(1),rewrites:j().int().nonnegative()}).loose();N({renamed:M(i5),rewrittenDocs:M(u5),summary:F8.optional()}).loose(),N({kind:Ga([`file`,`folder`]),fromPath:A().min(1),toPath:A().min(1),...X1,summary:Z1}).loose();var d5=N({renamed:M(i5),rewrittenDocs:M(u5).optional(),summary:F8.optional()}).loose();N({kind:Ga([`file`,`folder`]),path:A().min(1),...X1}).loose();var f5=N({deletedDocNames:M(A().min(1))}).loose();N({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),versionTag:A().optional(),summary:Z1,...X1}).loose(),N({restoredFrom:A().min(1),timestamp:A().min(1),summary:F8.optional()}).loose(),N({state:Ga([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:Ea(),syncEnabled:Ea(),identityUnresolved:Ea(),error:A().optional(),pausedReason:A().optional()}).loose(),N({op:Ga([`sync`,`push`,`pull`]).optional()}).loose(),N({op:Ga([`sync`,`push`,`pull`])}).loose(),N({conflicts:M(N({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),N({file:A().min(1),strategy:Ga([`mine`,`theirs`,`content`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content is required when strategy is 'content'`,path:[`content`]}),N({}).loose(),N({file:A().min(1),base:A(),ours:A(),theirs:A()}).loose(),N({}).loose(),N({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),N({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),N({result:go(e=>e!==void 0,{message:`result is required`})}).loose();var p5=N({path:A().min(1),summary:A().min(1)}).loose();N({packs:M(N({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:M(p5)}).loose())}).loose(),N({noOpen:Ea().optional(),out:A().min(1).optional()}).loose();var m5=N({reason:Ga([`unsupported-platform`,`spawn-error`]),message:A()}).loose();za(`status`,[N({status:qa(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),N({status:qa(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:m5.optional()}).loose(),N({status:qa(`failed`),buildError:A()}).loose(),N({status:qa(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),N({tags:M(N({name:A().min(1),count:j().int().nonnegative(),isLeaf:Ea()}).loose())}).loose();var h5=N({docName:A().min(1),title:A(),matchingTags:M(A().min(1)),snippet:A().nullable()}).loose();N({name:A().min(1),docs:M(h5)}).loose(),N({folder:Aa(),frontmatter_local:Ua(A(),Aa()).nullable()}).loose(),N({path:A(),frontmatter:Ua(A(),Aa()).optional()}).loose(),N({applied:Aa()}).loose();var g5=Ua(A(),Aa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});N({template:N({name:A().min(1),folder:A(),scope:Ga([`local`,`inherited`,`user`]),path:A().min(1),frontmatter:g5,body:A()}).loose()}).loose(),N({folder:A(),name:A(),body:A().optional(),frontmatter:g5.optional()}).loose(),N({path:A().min(1),created:Ea(),warnings:M(A())}).loose(),N({existed:Ea(),path:A().min(1)}).loose(),N({query:A().optional(),intent:Ga([`autocomplete`,`full_text`,`omnibar`]).optional(),scopes:M(Ga([`page`,`folder`,`content`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional()}).loose();var _5=N({kind:Ga([`page`,`folder`,`content`]),path:A().min(1),title:A(),score:j(),signals:Ua(A(),Aa()),snippet:A().optional()}).loose();N({query:A(),intent:Ga([`autocomplete`,`full_text`,`omnibar`]),results:M(_5),elapsedMs:j().nonnegative()}).loose();var v5=N({version:A().min(1),recordedAt:A().min(1)}).loose();N({currentVersion:A().min(1),targets:Ua(A(),v5.nullable())}).loose();var y5=`server-info`,b5=`branch-switched`,x5=`disk-ack`,S5=`config-validation-rejected`,C5=`config-ignore-nested-error`,w5=Ga([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),T5=N({v:qa(1),ch:qa(y5),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),E5=N({v:qa(1),ch:qa(b5),seq:j(),branch:A().min(1)}).loose(),D5=N({v:qa(1),ch:w5,seq:j()}).loose(),O5=N({v:qa(1),ch:qa(x5),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),k5=N({v:qa(1),ch:qa(S5),seq:j(),docName:A().min(1),error:i$}).loose(),A5=N({v:qa(1),ch:qa(C5),seq:j(),path:A().min(1),error:A().min(1)}).loose(),j5={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},M5=new WeakMap;function N5(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function P5(e){return e.trim().toLowerCase()}function F5(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function I5(e){return e.split(`/`).filter(Boolean).join(` `)}function L5(e){let t=F5(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0;return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:I5(e.path),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function R5(e){let t=tZ({schema:j5});return e.length>0&&fZ(t,e),t}function z5(e){let t={documents:e};return M5.set(t,R5(e)),t}function B5(e){let t=M5.get(e);if(t)return t;let n=R5(e.documents);return M5.set(e,n),n}function V5(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`]:[`page`,`folder`]}function H5(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function U5(e,t){let n=P5(t);if(!n)return 0;let r=P5(e.title),i=P5(e.name),a=P5(e.path),o=a.split(`/`);return r===n||i===n?700:a===n?650:r.startsWith(n)||i.startsWith(n)?600:o.some(e=>e.startsWith(n))?550:r.includes(n)||i.includes(n)?500:a.includes(n)?450:-1}function W5(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function une(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function dne(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function fne(e,t){return P5(t).length<4?0:+(e===`full_text`)}function pne(e,t,n={}){let r=n.intent??`omnibar`,i=N5(n.limit),a=new Set(n.scopes??V5(r)),o=e.documents.filter(e=>H5(e,a)),s=P5(t);if(!s)return o.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,i).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let c=HZ(B5(e),{term:s,properties:une(r),boost:dne(r),tolerance:fne(r,s),limit:Math.max(i*4,40)}),l=new Map(c.hits.filter(e=>H5(e.document,a)).map(e=>[e.document.id,e.score])),u=W5(o),d=new Map;for(let e of o)U5(e,s)>=0&&d.set(e.id,e);for(let e of c.hits)H5(e.document,a)&&d.set(e.document.id,e.document);return[...d.values()].map(e=>{let t=Math.max(0,U5(e,s)),n=l.get(e.id)??0,r=u.get(e.id)??0;return{document:e,score:t+n*20+r,signals:{lexical:t,fullText:n,recency:r}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score).slice(0,i)}var G5=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),K5=globalThis;K5[G5]===void 0&&(K5[G5]=_r());var q5=K5[G5],J5=Fa({version:A().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(q5,{description:`Recorded skill version for this target.`}),recordedAt:Mi().register(q5,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:Ga([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`]).register(q5,{description:`Install-source surface that recorded this entry.`}).optional()});Fa({schema:qa(1).register(q5,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Fa({"claude-cowork":J5.optional(),"cli-hosts":J5.optional()}).register(q5,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var Y5=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function mne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??hne,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new Y5(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function hne(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function gne(){let e=!1,t=``,n=0;return r=>{let i=_ne(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function _ne(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var vne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],yne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},bne={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},X5=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function xne(e,t=vne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Sne(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Cne(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var wne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function Tne(e){return e?wne[e]??`bot`:`bot`}function Ene(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Dne(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function One(e){let[t]=Ene(e);return Dne(t,45,32)}var kne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Ane=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],Z5=`ok-user-name-v3`,Q5=`ok-user-color-v3`;function $5(e){return e[Math.floor(Math.random()*e.length)]}function jne(){return`${$5(kne)} ${$5(Ane)}`}function Mne(){return $5(X5)}function e7(e){try{return localStorage.getItem(e)}catch{return null}}function t7(e,t){try{localStorage.setItem(e,t)}catch{}}function Nne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=e7(Z5),r=e7(Q5);return n||(n=jne(),t7(Z5,n)),r||(r=Mne(),t7(Q5,r)),{name:n,color:r,coeditor:e,tabId:t}}function Pne(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of l.split(`/`))if(e===`..`){if(u.length===0)return null;u.pop()}else e!==`.`&&e!==``&&u.push(e);return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function Fne(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var n7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function r7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function i7(e){return e.split(`/`).filter(Boolean)}function a7(e){let t=e.trim();return n7.test(t)||t.startsWith(`//`)}function Ine(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=Pne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};if(a7(n)||n.startsWith(`/`))return{kind:`external`,url:n};let i=r7(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Lne(e,t){let n=e.trim();if(!n)return null;if(a7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=r7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Rne(e,t){let n=e.trim();if(!n||n7.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function zne(e,t,n=null){let r=i7(e);r.pop();let i=i7(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function Bne(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Vne(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}var o7=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Hne=`VisuallyHidden`,s7=y.forwardRef((e,t)=>(0,yo.jsx)(c.span,{...e,ref:t,style:{...o7,...e.style}}));s7.displayName=Hne;var Une=s7;function Wne(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=y.useRef(null),a=y.useRef(new Map).current;return(0,yo.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=d(s),u=y.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,yo.jsx)(c,{ref:p(t,a(s,n).collectionRef),children:r})});u.displayName=s;let f=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=d(f),g=y.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=y.useRef(null),s=p(t,o),c=a(f,n);return y.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,yo.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return y.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},_,r]}var Gne=y.createContext(void 0);function Kne(e){let t=y.useContext(Gne);return e||t||`ltr`}var c7=[`top`,`right`,`bottom`,`left`],l7=[`start`,`end`],u7=c7.reduce((e,t)=>e.concat(t,t+`-`+l7[0],t+`-`+l7[1]),[]),d7=Math.min,f7=Math.max,p7=Math.round,m7=Math.floor,h7=e=>({x:e,y:e}),qne={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function g7(e,t,n){return f7(e,d7(t,n))}function _7(e,t){return typeof e==`function`?e(t):e}function v7(e){return e.split(`-`)[0]}function y7(e){return e.split(`-`)[1]}function b7(e){return e===`x`?`y`:`x`}function x7(e){return e===`y`?`height`:`width`}function S7(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function C7(e){return b7(S7(e))}function w7(e,t,n){n===void 0&&(n=!1);let r=y7(e),i=C7(e),a=x7(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=O7(o)),[o,O7(o)]}function Jne(e){let t=O7(e);return[T7(e),t,T7(t)]}function T7(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var E7=[`left`,`right`],D7=[`right`,`left`],Yne=[`top`,`bottom`],Xne=[`bottom`,`top`];function Zne(e,t,n){switch(e){case`top`:case`bottom`:return n?t?D7:E7:t?E7:D7;case`left`:case`right`:return t?Yne:Xne;default:return[]}}function Qne(e,t,n,r){let i=y7(e),a=Zne(v7(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(T7)))),a}function O7(e){let t=v7(e);return qne[t]+e.slice(t.length)}function $ne(e){return{top:0,right:0,bottom:0,left:0,...e}}function k7(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:$ne(e)}function A7(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function j7(e,t,n){let{reference:r,floating:i}=e,a=S7(t),o=C7(t),s=x7(o),c=v7(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(y7(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ere(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=_7(t,e),p=k7(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=A7(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=A7(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var tre=50,nre=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ere},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=j7(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<tre&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=j7(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rre=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=_7(e,t)||{};if(l==null)return{};let d=k7(u),f={x:n,y:r},p=C7(i),m=x7(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=d7(d[_],T),ee=d7(d[v],T),te=E,ne=C-h[m]-ee,re=C/2-h[m]/2+w,ie=g7(te,re,ne),ae=!c.arrow&&y7(i)!=null&&re!==ie&&a.reference[m]/2-(re<te?E:ee)-h[m]/2<0,D=ae?re<te?re-te:re-ne:0;return{[p]:f[p]+D,data:{[p]:ie,centerOffset:re-ie-D,...ae&&{alignmentOffset:D}},reset:ae}}});function ire(e,t,n){return(e?[...n.filter(t=>y7(t)===e),...n.filter(t=>y7(t)!==e)]:n.filter(e=>v7(e)===e)).filter(n=>e?y7(n)===e||(t?T7(n)!==n:!1):!0)}var are=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=u7,autoAlignment:u=!0,...d}=_7(e,t),f=c!==void 0||l===u7?ire(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=w7(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[v7(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=y7(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,y7(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},ore=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=_7(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=v7(r),_=S7(o),v=v7(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[O7(o)]:Jne(o)),x=p!==`none`;!d&&x&&b.push(...Qne(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=w7(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==S7(t))||T.every(e=>S7(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=S7(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function M7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function N7(e){return c7.some(t=>e[t]>=0)}var sre=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=_7(e,t);switch(i){case`referenceHidden`:{let e=M7(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:N7(e)}}}case`escaped`:{let e=M7(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:N7(e)}}}default:return{}}}}};function P7(e){let t=d7(...e.map(e=>e.left)),n=d7(...e.map(e=>e.top)),r=f7(...e.map(e=>e.right)),i=f7(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function cre(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>A7(P7(e)))}var lre=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=_7(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=cre(u),f=A7(P7(u)),p=k7(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(S7(n)===`y`){let e=d[0],t=d[d.length-1],r=v7(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=v7(n)===`left`,t=f7(...d.map(e=>e.right)),r=d7(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},F7=new Set([`left`,`top`]);async function ure(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=v7(n),s=y7(n),c=S7(n)===`y`,l=F7.has(o)?-1:1,u=a&&c?-1:1,d=_7(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var dre=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ure(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fre=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=_7(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=S7(v7(i)),p=b7(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=g7(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=g7(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pre=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=_7(e,t),u={x:n,y:r},d=S7(i),f=b7(d),p=u[f],m=u[d],h=_7(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=F7.has(v7(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mre=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=_7(e,t),u=await o.detectOverflow(t,l),d=v7(i),f=y7(i),p=S7(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=d7(h-u[g],v),x=d7(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=f7(u.left,0),t=f7(u.right,0),n=f7(u.top,0),r=f7(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:f7(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:f7(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function I7(){return typeof window<`u`}function L7(e){return B7(e)?(e.nodeName||``).toLowerCase():`#document`}function R7(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function z7(e){return((B7(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function B7(e){return I7()?e instanceof Node||e instanceof R7(e).Node:!1}function V7(e){return I7()?e instanceof Element||e instanceof R7(e).Element:!1}function H7(e){return I7()?e instanceof HTMLElement||e instanceof R7(e).HTMLElement:!1}function U7(e){return!I7()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof R7(e).ShadowRoot}function W7(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z7(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hre(e){return/^(table|td|th)$/.test(L7(e))}function G7(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gre=/transform|translate|scale|rotate|perspective|filter/,_re=/paint|layout|strict|content/,K7=e=>!!e&&e!==`none`,q7;function J7(e){let t=V7(e)?Z7(e):e;return K7(t.transform)||K7(t.translate)||K7(t.scale)||K7(t.rotate)||K7(t.perspective)||!Y7()&&(K7(t.backdropFilter)||K7(t.filter))||gre.test(t.willChange||``)||_re.test(t.contain||``)}function vre(e){let t=$7(e);for(;H7(t)&&!X7(t);){if(J7(t))return t;if(G7(t))return null;t=$7(t)}return null}function Y7(){return q7??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),q7}function X7(e){return/^(html|body|#document)$/.test(L7(e))}function Z7(e){return R7(e).getComputedStyle(e)}function Q7(e){return V7(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $7(e){if(L7(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||U7(e)&&e.host||z7(e);return U7(t)?t.host:t}function e9(e){let t=$7(e);return X7(t)?e.ownerDocument?e.ownerDocument.body:e.body:H7(t)&&W7(t)?t:e9(t)}function t9(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=e9(e),i=r===e.ownerDocument?.body,a=R7(r);if(i){let e=n9(a);return t.concat(a,a.visualViewport||[],W7(r)?r:[],e&&n?t9(e):[])}else return t.concat(r,t9(r,[],n))}function n9(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r9(e){let t=Z7(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=H7(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p7(n)!==a||p7(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function i9(e){return V7(e)?e:e.contextElement}function a9(e){let t=i9(e);if(!H7(t))return h7(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=r9(t),o=(a?p7(n.width):n.width)/r,s=(a?p7(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yre=h7(0);function o9(e){let t=R7(e);return!Y7()||!t.visualViewport?yre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bre(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==R7(e)?!1:t}function s9(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=i9(e),o=h7(1);t&&(r?V7(r)&&(o=a9(r)):o=a9(e));let s=bre(a,n,r)?o9(a):h7(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=R7(a),t=r&&V7(r)?R7(r):r,n=e,i=n9(n);for(;i&&r&&t!==n;){let e=a9(i),t=i.getBoundingClientRect(),r=Z7(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=R7(i),i=n9(n)}}return A7({width:u,height:d,x:c,y:l})}function c9(e,t){let n=Q7(e).scrollLeft;return t?t.left+n:s9(z7(e)).left+n}function l9(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-c9(e,n),y:n.top+t.scrollTop}}function xre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=z7(r),s=t?G7(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h7(1),u=h7(0),d=H7(r);if((d||!d&&!a)&&((L7(r)!==`body`||W7(o))&&(c=Q7(r)),d)){let e=s9(r);l=a9(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?l9(o,c):h7(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sre(e){return Array.from(e.getClientRects())}function Cre(e){let t=z7(e),n=Q7(e),r=e.ownerDocument.body,i=f7(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f7(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+c9(e),s=-n.scrollTop;return Z7(r).direction===`rtl`&&(o+=f7(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var u9=25;function wre(e,t){let n=R7(e),r=z7(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Y7();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=c9(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=u9&&(a-=o)}else l<=u9&&(a+=l);return{width:a,height:o,x:s,y:c}}function Tre(e,t){let n=s9(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=H7(e)?a9(e):h7(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function d9(e,t,n){let r;if(t===`viewport`)r=wre(e,n);else if(t===`document`)r=Cre(z7(e));else if(V7(t))r=Tre(t,n);else{let n=o9(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return A7(r)}function f9(e,t){let n=$7(e);return n===t||!V7(n)||X7(n)?!1:Z7(n).position===`fixed`||f9(n,t)}function Ere(e,t){let n=t.get(e);if(n)return n;let r=t9(e,[],!1).filter(e=>V7(e)&&L7(e)!==`body`),i=null,a=Z7(e).position===`fixed`,o=a?$7(e):e;for(;V7(o)&&!X7(o);){let t=Z7(o),n=J7(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||W7(o)&&!n&&f9(e,o))?r=r.filter(e=>e!==o):i=t,o=$7(o)}return t.set(e,r),r}function Dre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?G7(t)?[]:Ere(t,this._c):[].concat(n),r],o=d9(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=d9(t,a[e],i);s=f7(n.top,s),c=d7(n.right,c),l=d7(n.bottom,l),u=f7(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ore(e){let{width:t,height:n}=r9(e);return{width:t,height:n}}function kre(e,t,n){let r=H7(t),i=z7(t),a=n===`fixed`,o=s9(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h7(0);function l(){c.x=c9(i)}if(r||!r&&!a)if((L7(t)!==`body`||W7(i))&&(s=Q7(t)),r){let e=s9(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?l9(i,s):h7(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function p9(e){return Z7(e).position===`static`}function m9(e,t){if(!H7(e)||Z7(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return z7(e)===n&&(n=n.ownerDocument.body),n}function h9(e,t){let n=R7(e);if(G7(e))return n;if(!H7(e)){let t=$7(e);for(;t&&!X7(t);){if(V7(t)&&!p9(t))return t;t=$7(t)}return n}let r=m9(e,t);for(;r&&hre(r)&&p9(r);)r=m9(r,t);return r&&X7(r)&&p9(r)&&!J7(r)?n:r||vre(e)||n}var Are=async function(e){let t=this.getOffsetParent||h9,n=this.getDimensions,r=await n(e.floating);return{reference:kre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jre(e){return Z7(e).direction===`rtl`}var Mre={convertOffsetParentRelativeRectToViewportRelativeRect:xre,getDocumentElement:z7,getClippingRect:Dre,getOffsetParent:h9,getElementRects:Are,getClientRects:Sre,getDimensions:Ore,getScale:a9,isElement:V7,isRTL:jre};function g9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nre(e,t){let n=null,r,i=z7(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=m7(d),h=m7(i.clientWidth-(u+f)),g=m7(i.clientHeight-(d+p)),_=m7(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:f7(0,d7(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!g9(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function _9(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=i9(e),u=i||a?[...l?t9(l):[],...t?t9(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nre(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?s9(e):null;c&&g();function g(){let t=s9(e);h&&!g9(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var v9=dre,Pre=are,y9=fre,b9=ore,x9=mre,S9=sre,C9=rre,Fre=lre,Ire=pre,w9=(e,t,n)=>{let r=new Map,i={platform:Mre,...n},a={...i.platform,_c:r};return nre(e,t,{...i,platform:a})},T9=typeof document<`u`?y.useLayoutEffect:function(){};function E9(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!E9(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!E9(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function D9(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O9(e,t){let n=D9(e);return Math.round(t*n)/n}function k9(e){let t=y.useRef(e);return T9(()=>{t.current=e}),t}function Lre(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);E9(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,ee=k9(c),te=k9(i),ne=k9(l),re=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),w9(C.current,w.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!E9(T.current,t)&&(T.current=t,bo.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);T9(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=y.useRef(!1);T9(()=>(ie.current=!0,()=>{ie.current=!1}),[]),T9(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,re);re()}},[x,S,re,ee,E]);let ae=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),D=y.useMemo(()=>({reference:x,floating:S}),[x,S]),oe=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=O9(D.floating,u.x),r=O9(D.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...D9(D.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,D.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:re,refs:ae,elements:D,floatingStyles:oe}),[u,re,ae,D,oe])}var Rre=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:C9({element:r.current,padding:i}).fn(n):r?C9({element:r,padding:i}).fn(n):{}}}},zre=(e,t)=>{let n=v9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bre=(e,t)=>{let n=y9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vre=(e,t)=>({fn:Ire(e).fn,options:[e,t]}),Hre=(e,t)=>{let n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ure=(e,t)=>{let n=x9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wre=(e,t)=>{let n=S9(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gre=(e,t)=>{let n=Rre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kre=`Arrow`,A9=y.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,yo.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,yo.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});A9.displayName=Kre;var qre=A9,j9=`Popper`,[M9,Jre]=l(j9),[Yre,N9]=M9(j9),P9=e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return(0,yo.jsx)(Yre,{scope:t,anchor:r,onAnchorChange:i,children:n})};P9.displayName=j9;var F9=`PopperAnchor`,I9=y.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=N9(F9,n),o=y.useRef(null),s=p(t,o),l=y.useRef(null);return y.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,yo.jsx)(c.div,{...i,ref:s})});I9.displayName=F9;var L9=`PopperContent`,[Xre,Zre]=M9(L9),R9=y.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h=`partial`,hideWhenDetached:g=!1,updatePositionStrategy:_=`optimized`,onPlaced:b,...x}=e,S=N9(L9,n),[C,w]=y.useState(null),T=p(t,e=>w(e)),[E,ee]=y.useState(null),te=v(E),ne=te?.width??0,re=te?.height??0,ie=r+(a===`center`?``:`-`+a),ae=typeof m==`number`?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],oe=D.length>0,se={padding:ae,boundary:D.filter($re),altBoundary:oe},{refs:O,floatingStyles:ce,placement:le,isPositioned:ue,middlewareData:de}=Lre({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>_9(...e,{animationFrame:_===`always`}),elements:{reference:S.anchor},middleware:[zre({mainAxis:i+re,alignmentAxis:o}),d&&Bre({mainAxis:!0,crossAxis:!1,limiter:h===`partial`?Vre():void 0,...se}),d&&Hre({...se}),Ure({...se,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Gre({element:E,padding:l}),eie({arrowWidth:ne,arrowHeight:re}),g&&Wre({strategy:`referenceHidden`,...se})]}),[fe,pe]=V9(le),me=u(b);s(()=>{ue&&me?.()},[ue,me]);let he=de.arrow?.x,ge=de.arrow?.y,_e=de.arrow?.centerOffset!==0,[ve,ye]=y.useState();return s(()=>{C&&ye(window.getComputedStyle(C).zIndex)},[C]),(0,yo.jsx)(`div`,{ref:O.setFloating,"data-radix-popper-content-wrapper":``,style:{...ce,transform:ue?ce.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ve,"--radix-popper-transform-origin":[de.transformOrigin?.x,de.transformOrigin?.y].join(` `),...de.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,yo.jsx)(Xre,{scope:n,placedSide:fe,onArrowChange:ee,arrowX:he,arrowY:ge,shouldHideArrow:_e,children:(0,yo.jsx)(c.div,{"data-side":fe,"data-align":pe,...x,ref:T,style:{...x.style,animation:ue?void 0:`none`}})})})});R9.displayName=L9;var z9=`PopperArrow`,Qre={top:`bottom`,right:`left`,bottom:`top`,left:`right`},B9=y.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Zre(z9,n),a=Qre[i.placedSide];return(0,yo.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,yo.jsx)(qre,{...r,ref:t,style:{...r.style,display:`block`}})})});B9.displayName=z9;function $re(e){return e!==null}var eie=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=V9(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function V9(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var tie=P9,nie=I9,rie=R9,iie=B9;function H9(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.title==`string`&&t.title.length>0)return t.title}function aie(e){return e.kind===`asset`}function oie(e){return e.kind===`document`}function sie(e){return e.kind===`folder`}function cie(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function lie(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}var U9=null,W9=new Set;function G9(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function K9(e,t){return e===null?!1:e===t?!0:G9(e.pages,t.pages)&&G9(e.folderPaths,t.folderPaths)&&G9(e.assetPaths??new Set,t.assetPaths??new Set)}function uie(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function die(){return U9}function fie(e){if(!K9(U9,e)){U9=e;for(let t of[...W9])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function pie(e){if(W9.add(e),U9!==null)try{e(U9)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{W9.delete(e)}}var q9=`open-knowledge:documents-changed`,mie=new Set(w5.options);function J9(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>mie.has(e)))]}function hie(e=[`files`]){window.dispatchEvent(new CustomEvent(q9,{detail:{channels:J9(e)}}))}function Y9(e){let t=t=>{e(J9(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(q9,t),()=>window.removeEventListener(q9,t)}function X9(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function gie(e){let t=X9(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function _ie(e){let t=e.trim();return{normalizedTarget:X9(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Z9(e){let t=new Set;for(let n of e)for(let e of cie(n))t.add(e);return t}function vie(e,t){if(!t)return;let n=m8(e);if(n)return t.get(n)}function yie(e,t){let{normalizedTarget:n,expectsFolder:r}=_ie(e);if(!n)return{kind:`missing`,target:n};if(!r&&t.pages.has(n))return{kind:`doc`,target:n,docName:n};if(!r){let e=vie(n,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let i=`${n}/index`;if(t.pages.has(i))return{kind:`folder-index`,target:n,folderPath:n,docName:i,noteKind:`canonical-index`};let a=n.split(`/`).pop(),o=a?`${n}/${a}`:null;return o&&t.pages.has(o)?{kind:`folder-index`,target:n,folderPath:n,docName:o,noteKind:`legacy-folder-note`}:(t.folderPaths??Z9(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function bie(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`asset`:case`folder`:return null}}var Q9=(0,y.createContext)(null);function xie(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function Sie(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Cie(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function wie(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function Tie(){let e=await fetch(`/api/documents`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(H9(t)??`/api/documents responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.documents)?{assetPaths:t.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:t.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[]}}function Eie(e){console.error(`[PageListContext] Failed to load pages:`,e)}function Die(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function Oie(e){let t=(0,xo.c)(43),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,y.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,y.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,y.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,y.useState)(f),h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[4]=h):h=t[4];let[g,_]=(0,y.useState)(h),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[5]=v):v=t[5];let[b,x]=(0,y.useState)(v),[S,C]=(0,y.useState)(!0),[w,T]=(0,y.useState)(null),E=(0,y.useRef)(0),ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(){let e=E.current+=1;C(!0),Promise.all([wie(),Tie().catch(Mie)]).then(t=>{let[n,r]=t;if(e!==E.current)return;let i=new Set(n.map(jie));a(i),c(new Map(n.map(Aie))),d(new Map(n.map(kie))),m(new Set(r.assetPaths)),_(new Set(r.folderPaths)),x(e=>Sie(e,i)),T(null)}).catch(t=>{e===E.current&&(Eie(t),T(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===E.current&&C(!1)})},t[6]=ee):ee=t[6];let te=ee,ne;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(e){x(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),T(null)},t[7]=ne):ne=t[7];let re=ne,ie,ae;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{te();let e=()=>{document.visibilityState===`visible`&&te()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=Y9(e=>{e.includes(`files`)&&te()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},ie=[],t[8]=ie,t[9]=ae):(ie=t[8],ae=t[9]),(0,y.useEffect)(ae,ie);let D,oe,se,O,ce,le;if(t[10]!==b||t[11]!==p||t[12]!==g||t[13]!==u||t[14]!==s||t[15]!==i){ce=xie(i,b);let e;t[22]!==b||t[23]!==s?(e=Cie(s,b),t[22]=b,t[23]=s,t[24]=e):e=t[24],O=e,se=u,D=p,oe=new Set([...Z9(ce),...g]),le=uie(ce,m8),t[10]=b,t[11]=p,t[12]=g,t[13]=u,t[14]=s,t[15]=i,t[16]=D,t[17]=oe,t[18]=se,t[19]=O,t[20]=ce,t[21]=le}else D=t[16],oe=t[17],se=t[18],O=t[19],ce=t[20],le=t[21];let ue=le,de,fe;t[25]!==D||t[26]!==oe||t[27]!==ce||t[28]!==ue?(de=()=>{fie({pages:ce,folderPaths:oe,pagesBySlug:ue,assetPaths:D})},fe=[ce,oe,ue,D],t[25]=D,t[26]=oe,t[27]=ce,t[28]=ue,t[29]=de,t[30]=fe):(de=t[29],fe=t[30]),(0,y.useEffect)(de,fe);let pe;t[31]!==D||t[32]!==w||t[33]!==oe||t[34]!==S||t[35]!==se||t[36]!==O||t[37]!==ce||t[38]!==ue?(pe={pages:ce,pagesBySlug:ue,pageTitles:O,pageMeta:se,folderPaths:oe,assetPaths:D,loading:S,error:w,refetch:te,addPage:re},t[31]=D,t[32]=w,t[33]=oe,t[34]=S,t[35]=se,t[36]=O,t[37]=ce,t[38]=ue,t[39]=pe):pe=t[39];let me;return t[40]!==n||t[41]!==pe?(me=(0,yo.jsx)(Q9,{value:pe,children:n}),t[40]=n,t[41]=pe,t[42]=me):me=t[42],me}function kie(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt}]}function Aie(e){return[e.docName,e.title]}function jie(e){return e.docName}function Mie(e){return Die(e),{assetPaths:[],folderPaths:[]}}function Nie(){let e=(0,y.use)(Q9);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function Pie(e){if(e.startsWith($9)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function Fie(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}function Iie(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}?anchor=${encodeURIComponent(t)}`:r}var $9=`#/__asset__/`;function Lie(e){if(!e.startsWith($9))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function Rie(e){return`${$9}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}export{v$ as $,F5 as $n,zne as $t,b9 as A,K2 as An,F as Ar,n0 as At,yne as B,s$ as Bn,oe as Br,F$ as Bt,rie as C,Tne as Cn,Ap as Cr,$6 as Ct,Pre as D,U2 as Dn,R as Dr,l5 as Dt,C9 as E,W2 as En,dp as Er,Y8 as Et,x9 as F,t1 as Fn,hu as Fr,m$ as Ft,n5 as G,Rne as Gn,s0 as Gt,b$ as H,Bne as Hn,E as Hr,V1 as Ht,Kne as I,o0 as In,qa as Ir,$1 as It,A5 as J,H1 as Jn,ZQ as Jt,z8 as K,Vne as Kn,GQ as Kt,Wne as L,P8 as Ln,N as Lr,M1 as Lt,Fre as M,a7 as Mn,I as Mr,d5 as Mt,v9 as N,a$ as Nn,uu as Nr,Z$ as Nt,_9 as O,B2 as On,cf as Or,s5 as Ot,y9 as P,C$ as Pn,su as Pr,$$ as Pt,T5 as Q,_8 as Qn,q1 as Qt,Une as R,o2 as Rn,A as Rr,r0 as Rt,iie as S,o$ as Sn,z as Sr,W8 as St,Jre as T,H2 as Tn,L as Tr,S$ as Tt,A$ as U,dQ as Un,J8 as Ut,bne as V,I1 as Vn,ee as Vr,R1 as Vt,t5 as W,uQ as Wn,Fne as Wt,D5 as X,w1 as Xn,W1 as Xt,k5 as Y,nQ as Yn,c0 as Yt,O5 as Z,m8 as Zn,G1 as Zt,aie as _,g8 as _n,mS as _r,n2 as _t,Iie as a,Sne as an,vS as ar,o5 as at,H9 as b,p$ as bn,gv as br,Y$ as bt,bie as c,z5 as cn,lb as cr,N$ as ct,X9 as d,f$ as dn,xb as dr,x$ as dt,mne as en,Hte as er,h$ as et,hie as f,z1 as fn,Vb as fr,j$ as ft,lie as g,Cne as gn,Ub as gr,X5 as gt,pie as h,Q6 as hn,cb as hr,V8 as ht,Fie as i,J1 as in,Bb as ir,Y5 as it,S9 as j,QZ as jn,Qu as jr,g1 as jt,w9 as k,G2 as kn,Ud as kr,e0 as kt,yie as l,L5 as ln,vb as lr,f5 as lt,die as m,JZ as mn,iy as mr,U1 as mt,Pie as n,Lne as nn,Jx as nr,g$ as nt,Oie as o,gne as on,hS as or,a5 as ot,Y9 as p,r7 as pn,rS as pr,d$ as pt,E5 as q,pne as qn,LQ as qt,Rie as r,xne as rn,Nx as rr,y$ as rt,Nie as s,I2 as sn,nS as sr,P$ as st,Lie as t,Ine as tn,OT as tr,_$ as tt,gie as u,One as un,bb as ur,L8 as ut,oie as v,Nne as vn,N_ as vr,X8 as vt,tie as w,V2 as wn,Np as wr,h1 as wt,nie as x,a2 as xn,gp as xr,a1 as xt,sie as y,L1 as yn,I_ as yr,O$ as yt,o7 as z,V$ as zn,se as zr,k$ as zt};