@xwiki/cristal-electron-renderer 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/package.json +19 -19
  2. package/dist/AttachmentPreview-DNQ6Ebkw.css +0 -1
  3. package/dist/AttachmentPreview-Ecn8Pmvf.js +0 -2
  4. package/dist/AttachmentPreview-Ecn8Pmvf.js.map +0 -1
  5. package/dist/AuthServiceBanner-7KaHK0Au.js +0 -2
  6. package/dist/AuthServiceBanner-7KaHK0Au.js.map +0 -1
  7. package/dist/AuthServiceBanner-BArubXdu.css +0 -1
  8. package/dist/DeletePage-DA6E5XYv.js +0 -2
  9. package/dist/DeletePage-DA6E5XYv.js.map +0 -1
  10. package/dist/GitHubLoginMenu-Crh899SM.js +0 -2
  11. package/dist/GitHubLoginMenu-Crh899SM.js.map +0 -1
  12. package/dist/LoggedInMenu-kH3kWMGK.js +0 -2
  13. package/dist/LoggedInMenu-kH3kWMGK.js.map +0 -1
  14. package/dist/LoginMenu-D_c21AxX.js +0 -2
  15. package/dist/LoginMenu-D_c21AxX.js.map +0 -1
  16. package/dist/MovePage-BHS998Jm.css +0 -1
  17. package/dist/MovePage-Du2Z2i7H.js +0 -2
  18. package/dist/MovePage-Du2Z2i7H.js.map +0 -1
  19. package/dist/NextcloudLoginMenu-BTVdL-FM.js +0 -2
  20. package/dist/NextcloudLoginMenu-BTVdL-FM.js.map +0 -1
  21. package/dist/NextcloudLoginMenu-DGCgMCya.css +0 -1
  22. package/dist/RenamePage-CQF0H3Kh.js +0 -2
  23. package/dist/RenamePage-CQF0H3Kh.js.map +0 -1
  24. package/dist/SettingsConfigurations-B9GWI5mw.css +0 -1
  25. package/dist/SettingsConfigurations-Cy7Cfmm4.js +0 -2
  26. package/dist/SettingsConfigurations-Cy7Cfmm4.js.map +0 -1
  27. package/dist/c-config-menu-BGV5XXU8.css +0 -1
  28. package/dist/c-config-menu-C99poXWy.js +0 -2
  29. package/dist/c-config-menu-C99poXWy.js.map +0 -1
  30. package/dist/c-edit-blocknote-ByH5aYGe.js +0 -257
  31. package/dist/c-edit-blocknote-ByH5aYGe.js.map +0 -1
  32. package/dist/c-edit-blocknote-gIdUYHeV.css +0 -1
  33. package/dist/chunk.24ZZSBUF-BmQPh48m.js +0 -89
  34. package/dist/chunk.24ZZSBUF-BmQPh48m.js.map +0 -1
  35. package/dist/chunk.36O46B5H-Cv2poSyf.js +0 -64
  36. package/dist/chunk.36O46B5H-Cv2poSyf.js.map +0 -1
  37. package/dist/chunk.3LWOA5DF-D8Va5Pmw.js +0 -77
  38. package/dist/chunk.3LWOA5DF-D8Va5Pmw.js.map +0 -1
  39. package/dist/chunk.3RPBFEDE-DI7eSlIl.js +0 -2
  40. package/dist/chunk.3RPBFEDE-DI7eSlIl.js.map +0 -1
  41. package/dist/chunk.4TUIT776-BvlNwMXD.js +0 -18
  42. package/dist/chunk.4TUIT776-BvlNwMXD.js.map +0 -1
  43. package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js +0 -2
  44. package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js.map +0 -1
  45. package/dist/chunk.7E4JTYWU-Ci99jpyG.js +0 -75
  46. package/dist/chunk.7E4JTYWU-Ci99jpyG.js.map +0 -1
  47. package/dist/chunk.AJ3ENQ5C-zot94vv9.js +0 -2
  48. package/dist/chunk.AJ3ENQ5C-zot94vv9.js.map +0 -1
  49. package/dist/chunk.B4BZKR24-B0iVuGLD.js +0 -2
  50. package/dist/chunk.B4BZKR24-B0iVuGLD.js.map +0 -1
  51. package/dist/chunk.D5YQDJ7X-_UyNui_V.js +0 -2
  52. package/dist/chunk.D5YQDJ7X-_UyNui_V.js.map +0 -1
  53. package/dist/chunk.DFHYNK3F-bS0lNIuO.js +0 -86
  54. package/dist/chunk.DFHYNK3F-bS0lNIuO.js.map +0 -1
  55. package/dist/chunk.GMYPQTFK-BT1AAYXJ.js +0 -2
  56. package/dist/chunk.GMYPQTFK-BT1AAYXJ.js.map +0 -1
  57. package/dist/chunk.J5ZM7LIC-n6gjp3-L.js +0 -244
  58. package/dist/chunk.J5ZM7LIC-n6gjp3-L.js.map +0 -1
  59. package/dist/chunk.JCXLDPQF-BOaK9AtU.js +0 -622
  60. package/dist/chunk.JCXLDPQF-BOaK9AtU.js.map +0 -1
  61. package/dist/chunk.JHOXTQXA-CWkZ1weQ.js +0 -24
  62. package/dist/chunk.JHOXTQXA-CWkZ1weQ.js.map +0 -1
  63. package/dist/chunk.JQBT7BOV-BKSO0Hfn.js +0 -3378
  64. package/dist/chunk.JQBT7BOV-BKSO0Hfn.js.map +0 -1
  65. package/dist/chunk.JXOKFADN-DpK3Q_uU.js +0 -785
  66. package/dist/chunk.JXOKFADN-DpK3Q_uU.js.map +0 -1
  67. package/dist/chunk.KPLQLAWP-DUYDfZ7-.js +0 -163
  68. package/dist/chunk.KPLQLAWP-DUYDfZ7-.js.map +0 -1
  69. package/dist/chunk.LD4M4QGE-cX1_6HT7.js +0 -2
  70. package/dist/chunk.LD4M4QGE-cX1_6HT7.js.map +0 -1
  71. package/dist/chunk.NYIIDP5N-AHr3eTN0.js +0 -2
  72. package/dist/chunk.NYIIDP5N-AHr3eTN0.js.map +0 -1
  73. package/dist/chunk.R45OWEVP-WMyXo-Fn.js +0 -181
  74. package/dist/chunk.R45OWEVP-WMyXo-Fn.js.map +0 -1
  75. package/dist/chunk.RWUUFNUL-BJhNq5wM.js +0 -2
  76. package/dist/chunk.RWUUFNUL-BJhNq5wM.js.map +0 -1
  77. package/dist/chunk.RY756JLP-BUknFjxa.js +0 -22
  78. package/dist/chunk.RY756JLP-BUknFjxa.js.map +0 -1
  79. package/dist/chunk.SI4ACBFK-BB831ml8.js +0 -58
  80. package/dist/chunk.SI4ACBFK-BB831ml8.js.map +0 -1
  81. package/dist/chunk.TRHSUYII-DFnBKJNh.js +0 -140
  82. package/dist/chunk.TRHSUYII-DFnBKJNh.js.map +0 -1
  83. package/dist/chunk.XA43ZQPC-maNlqVLX.js +0 -395
  84. package/dist/chunk.XA43ZQPC-maNlqVLX.js.map +0 -1
  85. package/dist/chunk.XSFJLY2D-ldEKWtxN.js +0 -178
  86. package/dist/chunk.XSFJLY2D-ldEKWtxN.js.map +0 -1
  87. package/dist/chunk.YHLNUJ7P-BGNuPG1R.js +0 -109
  88. package/dist/chunk.YHLNUJ7P-BGNuPG1R.js.map +0 -1
  89. package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js +0 -2
  90. package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js.map +0 -1
  91. package/dist/chunk.ZH2AND3P-CzagA8cz.js +0 -288
  92. package/dist/chunk.ZH2AND3P-CzagA8cz.js.map +0 -1
  93. package/dist/class-map-DmaCJs8c.js +0 -2
  94. package/dist/class-map-DmaCJs8c.js.map +0 -1
  95. package/dist/filesystem-internal-link-serializer-BmtbMUwV.js +0 -2
  96. package/dist/filesystem-internal-link-serializer-BmtbMUwV.js.map +0 -1
  97. package/dist/floating-ui.dom-1S43Ew4Q.js +0 -2
  98. package/dist/floating-ui.dom-1S43Ew4Q.js.map +0 -1
  99. package/dist/github-CRi3Ye_z.js +0 -3
  100. package/dist/github-CRi3Ye_z.js.map +0 -1
  101. package/dist/github-internal-link-serializer-ChUBU16v.js +0 -2
  102. package/dist/github-internal-link-serializer-ChUBU16v.js.map +0 -1
  103. package/dist/hocuspocus-provider.esm-DpwNtHpL.js +0 -2
  104. package/dist/hocuspocus-provider.esm-DpwNtHpL.js.map +0 -1
  105. package/dist/if-defined-O-hFrvt0.js +0 -2
  106. package/dist/if-defined-O-hFrvt0.js.map +0 -1
  107. package/dist/index-B1WxkRNy.js +0 -254
  108. package/dist/index-B1WxkRNy.js.map +0 -1
  109. package/dist/index-BgL5UHSB.css +0 -1
  110. package/dist/index-DWPjg9z3.js +0 -2
  111. package/dist/index-DWPjg9z3.js.map +0 -1
  112. package/dist/index-qhuTooVL.js +0 -3
  113. package/dist/index-qhuTooVL.js.map +0 -1
  114. package/dist/index.html +0 -13
  115. package/dist/live-z5w0O4st.js +0 -2
  116. package/dist/live-z5w0O4st.js.map +0 -1
  117. package/dist/module-RjUF93sV.js +0 -717
  118. package/dist/module-RjUF93sV.js.map +0 -1
  119. package/dist/native-48B9X9Wg.js +0 -2
  120. package/dist/native-48B9X9Wg.js.map +0 -1
  121. package/dist/nextcloud-B3M7otLC.js +0 -31
  122. package/dist/nextcloud-B3M7otLC.js.map +0 -1
  123. package/dist/nextcloud-internal-link-serializer-6Syv5TEU.js +0 -7
  124. package/dist/nextcloud-internal-link-serializer-6Syv5TEU.js.map +0 -1
  125. package/dist/offline-3x82kJQp.js +0 -4
  126. package/dist/offline-3x82kJQp.js.map +0 -1
  127. package/dist/query-x48B6FB_.js +0 -2
  128. package/dist/query-x48B6FB_.js.map +0 -1
  129. package/dist/shoelace-ZF5apisL.js +0 -3
  130. package/dist/shoelace-ZF5apisL.js.map +0 -1
  131. package/dist/static-Dm20cmTz.js +0 -3
  132. package/dist/static-Dm20cmTz.js.map +0 -1
  133. package/dist/staticBuild-BOgweg16.js +0 -2
  134. package/dist/staticBuild-BOgweg16.js.map +0 -1
  135. package/dist/translations-D5nOIu3x.js +0 -2
  136. package/dist/translations-D5nOIu3x.js.map +0 -1
  137. package/dist/translations-Ds9OkLNv.js +0 -2
  138. package/dist/translations-Ds9OkLNv.js.map +0 -1
  139. package/dist/vuetify-BxGNBe1U.js +0 -19
  140. package/dist/vuetify-BxGNBe1U.js.map +0 -1
  141. package/dist/vuetify-DJa-zcj7.css +0 -1
  142. package/dist/worker-BgcG6AhJ.js +0 -202
  143. package/dist/worker-BgcG6AhJ.js.map +0 -1
  144. package/dist/x-alert-BeYgGEHw.js +0 -2
  145. package/dist/x-alert-BeYgGEHw.js.map +0 -1
  146. package/dist/x-alert-BhErtBtU.css +0 -1
  147. package/dist/x-alert-DfYpLdml.css +0 -1
  148. package/dist/x-alert-Dy2REhpp.js +0 -2
  149. package/dist/x-alert-Dy2REhpp.js.map +0 -1
  150. package/dist/x-avatar-2efH4gNX.css +0 -1
  151. package/dist/x-avatar-C4CTlSRd.js +0 -2
  152. package/dist/x-avatar-C4CTlSRd.js.map +0 -1
  153. package/dist/x-avatar-DzYlPdwz.js +0 -2
  154. package/dist/x-avatar-DzYlPdwz.js.map +0 -1
  155. package/dist/x-breadcrumb-3U5TzpgN.js +0 -2
  156. package/dist/x-breadcrumb-3U5TzpgN.js.map +0 -1
  157. package/dist/x-breadcrumb-BMSNlvvi.css +0 -1
  158. package/dist/x-breadcrumb-BYgHeSE3.js +0 -2
  159. package/dist/x-breadcrumb-BYgHeSE3.js.map +0 -1
  160. package/dist/x-btn-9AKb7ryY.js +0 -2
  161. package/dist/x-btn-9AKb7ryY.js.map +0 -1
  162. package/dist/x-btn-CWfGjEgy.js +0 -2
  163. package/dist/x-btn-CWfGjEgy.js.map +0 -1
  164. package/dist/x-btn-DPGq6Sd-.css +0 -1
  165. package/dist/x-btn.vue_vue_type_script_setup_true_lang-D3pg_1oq.js +0 -2
  166. package/dist/x-btn.vue_vue_type_script_setup_true_lang-D3pg_1oq.js.map +0 -1
  167. package/dist/x-card-BiFAsKLZ.js +0 -2
  168. package/dist/x-card-BiFAsKLZ.js.map +0 -1
  169. package/dist/x-card-blonMcP4.js +0 -2
  170. package/dist/x-card-blonMcP4.js.map +0 -1
  171. package/dist/x-checkbox-BoqoQxdA.css +0 -1
  172. package/dist/x-checkbox-CfFCxOCr.js +0 -2
  173. package/dist/x-checkbox-CfFCxOCr.js.map +0 -1
  174. package/dist/x-checkbox-VDSX4CX7.js +0 -2
  175. package/dist/x-checkbox-VDSX4CX7.js.map +0 -1
  176. package/dist/x-col-DsUQg5Gm.js +0 -2
  177. package/dist/x-col-DsUQg5Gm.js.map +0 -1
  178. package/dist/x-container-B1osS5wH.js +0 -2
  179. package/dist/x-container-B1osS5wH.js.map +0 -1
  180. package/dist/x-dialog-Bk9LE0HR.css +0 -1
  181. package/dist/x-dialog-Cwb1fieH.js +0 -2
  182. package/dist/x-dialog-Cwb1fieH.js.map +0 -1
  183. package/dist/x-dialog-VzzVz38L.css +0 -1
  184. package/dist/x-dialog-eOwazoAI.js +0 -2
  185. package/dist/x-dialog-eOwazoAI.js.map +0 -1
  186. package/dist/x-divider-Bf6b5P6D.js +0 -2
  187. package/dist/x-divider-Bf6b5P6D.js.map +0 -1
  188. package/dist/x-divider-D36BIsQM.js +0 -2
  189. package/dist/x-divider-D36BIsQM.js.map +0 -1
  190. package/dist/x-dropdown-CxWpPIwn.css +0 -1
  191. package/dist/x-dropdown-DfwjES9w.js +0 -2
  192. package/dist/x-dropdown-DfwjES9w.js.map +0 -1
  193. package/dist/x-dropdown-GNs7ILlc.css +0 -1
  194. package/dist/x-dropdown-ds5_iBZ4.js +0 -2
  195. package/dist/x-dropdown-ds5_iBZ4.js.map +0 -1
  196. package/dist/x-file-input-B9mfyR4z.js +0 -2
  197. package/dist/x-file-input-B9mfyR4z.js.map +0 -1
  198. package/dist/x-file-input-BSstA5LD.css +0 -1
  199. package/dist/x-file-input-DftepgSQ.js +0 -2
  200. package/dist/x-file-input-DftepgSQ.js.map +0 -1
  201. package/dist/x-form-C5eClK9q.js +0 -2
  202. package/dist/x-form-C5eClK9q.js.map +0 -1
  203. package/dist/x-form-CK24VrXN.css +0 -1
  204. package/dist/x-form-DGUS5Veh.css +0 -1
  205. package/dist/x-form-etxLXE0R.js +0 -2
  206. package/dist/x-form-etxLXE0R.js.map +0 -1
  207. package/dist/x-img-CNPL9bZj.js +0 -2
  208. package/dist/x-img-CNPL9bZj.js.map +0 -1
  209. package/dist/x-img-DYWmHySi.js +0 -2
  210. package/dist/x-img-DYWmHySi.js.map +0 -1
  211. package/dist/x-load-BlPeW_ej.css +0 -1
  212. package/dist/x-load-CM4p-BU2.css +0 -1
  213. package/dist/x-load-CatWwBSt.js +0 -2
  214. package/dist/x-load-CatWwBSt.js.map +0 -1
  215. package/dist/x-load-pklPPw3d.js +0 -2
  216. package/dist/x-load-pklPPw3d.js.map +0 -1
  217. package/dist/x-menu-BmuGyRjl.css +0 -1
  218. package/dist/x-menu-C0JNNHR2.js +0 -2
  219. package/dist/x-menu-C0JNNHR2.js.map +0 -1
  220. package/dist/x-menu-CKBWYMym.js +0 -2
  221. package/dist/x-menu-CKBWYMym.js.map +0 -1
  222. package/dist/x-menu-item-9k48D3Mw.js +0 -2
  223. package/dist/x-menu-item-9k48D3Mw.js.map +0 -1
  224. package/dist/x-menu-item-fSf-cD7q.js +0 -2
  225. package/dist/x-menu-item-fSf-cD7q.js.map +0 -1
  226. package/dist/x-menu-label-BDlCFsFH.js +0 -2
  227. package/dist/x-menu-label-BDlCFsFH.js.map +0 -1
  228. package/dist/x-menu-label-C8o6TwqC.js +0 -2
  229. package/dist/x-menu-label-C8o6TwqC.js.map +0 -1
  230. package/dist/x-menu-label-DhRAj-fk.css +0 -1
  231. package/dist/x-row-DsUQg5Gm.js +0 -2
  232. package/dist/x-row-DsUQg5Gm.js.map +0 -1
  233. package/dist/x-search-C6XAaOXg.js +0 -2
  234. package/dist/x-search-C6XAaOXg.js.map +0 -1
  235. package/dist/x-search-CmWnWxsP.js +0 -2
  236. package/dist/x-search-CmWnWxsP.js.map +0 -1
  237. package/dist/x-select-C8GSGs-Z.js +0 -2
  238. package/dist/x-select-C8GSGs-Z.js.map +0 -1
  239. package/dist/x-select-Da6f14h4.js +0 -2
  240. package/dist/x-select-Da6f14h4.js.map +0 -1
  241. package/dist/x-tab-BDpZS53n.js +0 -2
  242. package/dist/x-tab-BDpZS53n.js.map +0 -1
  243. package/dist/x-tab-DV937RB-.js +0 -2
  244. package/dist/x-tab-DV937RB-.js.map +0 -1
  245. package/dist/x-tab-group-C3YcH4jU.js +0 -2
  246. package/dist/x-tab-group-C3YcH4jU.js.map +0 -1
  247. package/dist/x-tab-group-CT7pAQGH.js +0 -2
  248. package/dist/x-tab-group-CT7pAQGH.js.map +0 -1
  249. package/dist/x-tab-panel--wEPqeL9.js +0 -2
  250. package/dist/x-tab-panel--wEPqeL9.js.map +0 -1
  251. package/dist/x-tab-panel-BV2Axw5I.js +0 -2
  252. package/dist/x-tab-panel-BV2Axw5I.js.map +0 -1
  253. package/dist/x-text-field-B0juKwq0.js +0 -2
  254. package/dist/x-text-field-B0juKwq0.js.map +0 -1
  255. package/dist/x-text-field-CNuOWA3c.js +0 -2
  256. package/dist/x-text-field-CNuOWA3c.js.map +0 -1
  257. package/dist/x-tree-Aj-ivC70.js +0 -2
  258. package/dist/x-tree-Aj-ivC70.js.map +0 -1
  259. package/dist/x-tree-CUnE9yj-.js +0 -2
  260. package/dist/x-tree-CUnE9yj-.js.map +0 -1
  261. package/dist/x-tree-D0WG-8EM.css +0 -1
  262. package/dist/x-tree-OLo4IKf9.css +0 -1
  263. package/dist/xwiki-BeDAdEBl.js +0 -4
  264. package/dist/xwiki-BeDAdEBl.js.map +0 -1
  265. package/dist/xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js +0 -2
  266. package/dist/xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js.map +0 -1
  267. package/dist/xwiki-logo-color-DZ9bdNW4.svg +0 -18
  268. package/dist/yjs-VtUl3AlT.js +0 -6
  269. package/dist/yjs-VtUl3AlT.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"mappings":";iKA8BA,SAASA,EAAQC,EAAOC,EAAO,CAC7B,OAAOC,EAAYF,EAAOC,CAAK,CACjC,sKCaA,IAAME,EAAN,KAAkE,CAChE,YACqCC,EACIC,EAEtBC,EAEAC,EAEAC,EAGAC,EAGAC,EACjB,CAdmC,YAAAN,EACI,gBAAAC,EAEtB,8BAAAC,EAEA,mCAAAC,EAEA,qBAAAC,EAGA,eAAAC,EAGA,yBAAAC,EAEjB,KAAK,OAAO,UAAU,+CAA+C,CACvE,CAIA,MAAM,iBACJC,EACAC,EAA2B,GACQ,CACnC,IAAIC,EAAa,KAAK,oBAAoB,UAAUF,CAAI,EACpDA,EAAK,MAAQG,EAAW,QAC1BD,GAAc,YAGhB,MAAME,EAAaC,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AGF,EAAGI,EAAGD,CAAC,CACrB,CAAC,EAAE,UAAUH,CAAC,CAChB,CACA,SAASM,GAAEJ,EAAGF,EAAGG,EAAGC,EAAG,CACrB,OAAOF,EAAE,QAAQ,0BAA2B,CAAE,KAAMF,CAAC,CAAE,GAAKE,EAAE,KAAK,yBAAyB,EAAE,GAAGC,CAAC,EAAE,UAAUH,CAAC,EAAGI,EAAE,IAAI,0BAA2B,CACjJ,KAAMJ,CACV,CAAG,CACH,CCaO,SAASO,GAAKhH,EAAsB,CACzC,IAAIiH,GAA8BjH,CAAS,EAC3C,IAAIkH,EAAgClH,CAAS,EAC7C,IAAImH,GAAiCnH,CAAS,EAC9C,IAAIoH,EAA8BpH,CAAS,EAC3C,IAAIqH,GAAiCrH,CAAS,EAC9C,IAAIsH,GAAiCtH,CAAS,EAC9C,IAAIuH,GAAyBvH,CAAS,EACtC,IAAIwH,GAAqBxH,CAAS,EAClC,IAAIyH,GAAiCzH,CAAS,CAChD","names":["isEqual","value","other","baseIsEqual","XWikiPageHierarchyResolver","logger","cristalApp","defaultHierarchyResolver","authenticationManagerProvider","storageProvider","urlParser","referenceSerializer","page","includeHomePage","documentId","EntityType","restApiUrl","getRestSpacesApiUrl","authorization","headers","jsonResponse","hierarchy","hierarchyItem","wikiItem","error","__decorateClass","injectable","__decorateParam","ComponentInit$7","container","name","XWikiPageRevisionManager","alertsService","pageData","limit","offset","restApiSearchParams","usersCache","resolve","revision","userId","firstName","p","lastName","fullName","user","ComponentInit$6","PageRevisionManagerName","XWikiLinkSuggestService","remoteURLSerializerProvider","modelReferenceParserProvider","query","type","mimetype","it","baseURL","params","getParams","fqs","LinkType","link","expectedType","result","reference","xwikiURL","label","authorizationHeader","ComponentInit$5","XWikiModelReferenceHandler","space","newSpace","SpaceReference","DocumentReference","XWikiModelReferenceParser","documentService","options","splits","noWiki","strings","doc","AttachmentReference","segments","currentDocumentReference","XWikiModelReferenceSerializer","segment","SPACE","ATTACHMENT","DOCUMENT","WIKI","spaceReference","wiki","spaces","documentReference","attachmentReference","document","ComponentInit$4","XWikiRemoteURLParser","urlStr","baseURLstr","url","bin","action","pageName","attachmentName","XWikiRemoteURLSerializer","ComponentInit$3","XWikiNavigationTreeSource","id","currentId","navigationTree","includeTerminal","includeRootNode","currentParent","parent","nodes","baseXWikiURL","navigationTreeRequestUrl","treeNode","ComponentInit$2","NavigationTreeSourceName","macroParams","XWikiHtmlBlockMacro","html","XWikiInlineHtmlMacro","ComponentInit$1","eraseParamsTypeForMacroClass","AuthServiceBannerUIExtension","authenticationManager","cristal","__vitePreload","__vite_default__","response","ComponentInit","o","n","e","i","r","t","XWikiInternalLinkSerializer","a","load","XWikiLinkSuggestComponentInit","XWikiPageHierarchyComponentInit","XWikiNavigationTreeComponentInit","XWikiPageHistoryComponentInit","ModelRemoteURLXWikiComponentInit","ModelReferenceXWikiComponentInit","XWikiMacrosComponentInit","XWikiUIComponentInit","UniastMarkdownXWikiComponentInit"],"ignoreList":[0,18],"sources":["../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js","../../../core/hierarchy/hierarchy-xwiki/src/components/componentsInit.ts","../../../core/history/history-xwiki/src/components/componentsInit.ts","../../../core/history/history-xwiki/src/index.ts","../../../core/link-suggest/link-suggest-xwiki/src/components/componentsInit.ts","../../../core/model/model-reference/model-reference-xwiki/src/xWikiModelReferenceHandler.ts","../../../core/model/model-reference/model-reference-xwiki/src/xWikiModelReferenceParser.ts","../../../core/model/model-reference/model-reference-xwiki/src/xWikiModelReferenceSerializer.ts","../../../core/model/model-reference/model-reference-xwiki/src/componentInit.ts","../../../core/model/model-remote-url/model-remote-url-xwiki/src/xWikiRemoteURLParser.ts","../../../core/model/model-remote-url/model-remote-url-xwiki/src/xWikiRemoteURLSerializer.ts","../../../core/model/model-remote-url/model-remote-url-xwiki/src/componentInit.ts","../../../core/navigation-tree/navigation-tree-xwiki/src/components/componentsInit.ts","../../../core/xwiki/xwiki-macros/src/macros/blockMacro.ts","../../../core/xwiki/xwiki-macros/src/macros/inlineMacro.ts","../../../core/xwiki/xwiki-macros/src/componentInit.ts","../../../core/xwiki/xwiki-ui/src/AuthServiceBannerUIExtension.ts","../../../core/xwiki/xwiki-ui/src/index.ts","../../../node_modules/.pnpm/@xwiki+platform-uniast-markdown-xwiki@18.2.0_inversify@7.11.0_reflect-metadata@0.2.2__r_75d39af4a42b67a3b2e8ca1bd49854bd/node_modules/@xwiki/platform-uniast-markdown-xwiki/dist/index.es.js","../../../lib/src/default/xwiki.ts"],"sourcesContent":["import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { name } from \"@xwiki/cristal-hierarchy-api\";\nimport { getRestSpacesApiUrl } from \"@xwiki/cristal-xwiki-utils\";\nimport { EntityType } from \"@xwiki/platform-model-api\";\nimport { Container, inject, injectable, named } from \"inversify\";\nimport type {\n PageHierarchyItem,\n PageHierarchyResolver,\n} from \"@xwiki/cristal-hierarchy-api\";\nimport type { CristalApp, Logger } from \"@xwiki/platform-api\";\nimport type { AuthenticationManagerProvider } from \"@xwiki/platform-authentication-api\";\nimport type { StorageProvider } from \"@xwiki/platform-backend-api\";\nimport type {\n DocumentReference,\n SpaceReference,\n} from \"@xwiki/platform-model-api\";\nimport type { ModelReferenceSerializer } from \"@xwiki/platform-model-reference-api\";\nimport type { RemoteURLParser } from \"@xwiki/platform-model-remote-url-api\";\n\n/**\n * Implementation of PageHierarchyResolver for the XWiki backend.\n *\n * @since 0.9\n * @beta\n **/\n@injectable()\nclass XWikiPageHierarchyResolver implements PageHierarchyResolver {\n constructor(\n @inject(\"Logger\") private readonly logger: Logger,\n @inject(\"CristalApp\") private readonly cristalApp: CristalApp,\n @inject(\"PageHierarchyResolver\")\n private readonly defaultHierarchyResolver: PageHierarchyResolver,\n @inject(\"AuthenticationManagerProvider\")\n private readonly authenticationManagerProvider: AuthenticationManagerProvider,\n @inject(\"StorageProvider\")\n private readonly storageProvider: StorageProvider,\n @inject(\"RemoteURLParser\")\n @named(\"XWiki\")\n private readonly urlParser: RemoteURLParser,\n @inject(\"ModelReferenceSerializer\")\n @named(\"XWiki\")\n private readonly referenceSerializer: ModelReferenceSerializer,\n ) {\n this.logger.setModule(\"storage.components.XWikiPageHierarchyResolver\");\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n async getPageHierarchy(\n page: DocumentReference | SpaceReference,\n includeHomePage: boolean = true,\n ): Promise<Array<PageHierarchyItem>> {\n let documentId = this.referenceSerializer.serialize(page)!;\n if (page.type == EntityType.SPACE) {\n documentId += \".WebHome\";\n }\n // TODO: support subwikis.\n const restApiUrl = getRestSpacesApiUrl(\n this.cristalApp.getWikiConfig(),\n documentId,\n );\n\n try {\n const authorization = await this.authenticationManagerProvider\n .get()\n ?.getAuthorizationHeader();\n const headers: { Accept: string; Authorization?: string } = {\n Accept: \"application/json\",\n };\n\n if (authorization) {\n headers.Authorization = authorization;\n }\n const response = await fetch(`${restApiUrl}?prettyNames=true`, {\n headers,\n });\n const jsonResponse = await response.json();\n const hierarchy: Array<PageHierarchyItem> = [];\n jsonResponse.hierarchy.items.forEach(\n (hierarchyItem: { label: string; url: string; type: string }) => {\n // Terminal pages and spaces only\n if (\n (hierarchyItem.type == \"document\" &&\n !new URL(hierarchyItem.url).pathname.endsWith(\"/\")) ||\n hierarchyItem.type == \"space\"\n ) {\n hierarchy.push({\n label: hierarchyItem.label,\n pageId: this.storageProvider\n .get()\n .getPageFromViewURL(hierarchyItem.url)!,\n url: this.cristalApp.getRouter().resolve({\n name: \"view\",\n params: {\n page: this.referenceSerializer.serialize(\n this.urlParser.parse(\n hierarchyItem.url,\n )! as DocumentReference,\n ),\n },\n }).href,\n });\n }\n },\n );\n if (includeHomePage) {\n const wikiItem = jsonResponse.hierarchy.items[0];\n hierarchy.unshift({\n label: wikiItem.label,\n pageId: this.storageProvider.get().getPageFromViewURL(wikiItem.url)!,\n url: this.cristalApp.getRouter().resolve({\n name: \"view\",\n params: {\n page: this.referenceSerializer.serialize(\n this.urlParser.parse(wikiItem.url)! as DocumentReference,\n ),\n },\n }).href,\n });\n }\n return hierarchy;\n } catch (error) {\n this.logger.error(error);\n this.logger.debug(\n `Could not load hierarchy for page ${documentId}, falling back to default hierarchy resolver.`,\n );\n return this.defaultHierarchyResolver.getPageHierarchy(page);\n }\n }\n}\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<PageHierarchyResolver>(name)\n .to(XWikiPageHierarchyResolver)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { getRestSpacesApiUrl } from \"@xwiki/cristal-xwiki-utils\";\nimport { inject, injectable } from \"inversify\";\nimport type { AlertsService } from \"@xwiki/cristal-alerts-api\";\nimport type {\n PageRevision,\n PageRevisionManager,\n} from \"@xwiki/cristal-history-api\";\nimport type { CristalApp, Logger, PageData } from \"@xwiki/platform-api\";\nimport type {\n AuthenticationManagerProvider,\n UserDetails,\n} from \"@xwiki/platform-authentication-api\";\n\n/**\n * Implementation of PageRevisionManager for the XWiki backend.\n *\n * @since 0.12\n * @beta\n **/\n@injectable()\nclass XWikiPageRevisionManager implements PageRevisionManager {\n constructor(\n @inject(\"Logger\") private readonly logger: Logger,\n @inject(\"CristalApp\") private readonly cristalApp: CristalApp,\n @inject(\"AuthenticationManagerProvider\")\n private readonly authenticationManagerProvider: AuthenticationManagerProvider,\n @inject(\"AlertsService\")\n private readonly alertsService: AlertsService,\n ) {\n this.logger.setModule(\"history.xwiki.XWikiPageRevisionManager\");\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n async getRevisions(\n pageData: PageData,\n limit?: number,\n offset?: number,\n ): Promise<Array<PageRevision>> {\n const documentId = pageData.document.getIdentifier();\n if (documentId == null) {\n this.alertsService.error(\n `Could not load page history for ${pageData.name}.`,\n );\n return [];\n }\n\n const restApiSearchParams = new URLSearchParams();\n if (limit) {\n restApiSearchParams.append(\"number\", limit.toString());\n }\n if (offset) {\n restApiSearchParams.append(\"start\", offset.toString());\n }\n const restApiUrl =\n getRestSpacesApiUrl(this.cristalApp.getWikiConfig(), documentId) +\n \"/history\";\n\n const usersCache: Map<string, Promise<UserDetails>> = new Map([\n [\n \"XWiki.superadmin\",\n new Promise<UserDetails>((resolve) => {\n resolve({ name: \"superadmin\", profile: \"\" });\n }),\n ],\n ]);\n\n try {\n const authorization = await this.authenticationManagerProvider\n .get()\n ?.getAuthorizationHeader();\n const headers: { Accept: string; Authorization?: string } = {\n Accept: \"application/json\",\n };\n\n if (authorization) {\n headers.Authorization = authorization;\n }\n const response = await fetch(restApiUrl, { headers });\n const jsonResponse = await response.json();\n const revisions: Array<PageRevision> = await Promise.all(\n jsonResponse.historySummaries.map(\n async (revision: {\n version: string;\n modified: string;\n modifier: string;\n comment: string;\n }) => {\n if (!usersCache.has(revision.modifier)) {\n usersCache.set(\n revision.modifier,\n this.getUserName(revision.modifier),\n );\n }\n return {\n version: revision.version,\n date: new Date(revision.modified),\n user: await usersCache.get(revision.modifier),\n comment: revision.comment,\n url: this.cristalApp.getRouter().resolve({\n name: \"view\",\n params: {\n page: documentId,\n revision: revision.version,\n },\n }).href,\n };\n },\n ),\n );\n return revisions;\n } catch (error) {\n this.logger.error(error);\n this.alertsService.error(\n `Could not load page history for ${pageData.name}.`,\n );\n return [];\n }\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n private async getUserName(userId: string): Promise<UserDetails> {\n const restApiUrl =\n getRestSpacesApiUrl(this.cristalApp.getWikiConfig(), userId) +\n \"/objects/XWiki.XWikiUsers/0\";\n\n try {\n const authorization = await this.authenticationManagerProvider\n .get()\n ?.getAuthorizationHeader();\n const headers: { Accept: string; Authorization?: string } = {\n Accept: \"application/json\",\n };\n\n if (authorization) {\n headers.Authorization = authorization;\n }\n const response = await fetch(restApiUrl, { headers });\n const jsonResponse: {\n properties: { name: string; value: string }[];\n pageName: string;\n } = await response.json();\n\n const firstName =\n jsonResponse.properties\n .filter((p) => p.name == \"first_name\")\n .map((p) => p.value) ?? \"\";\n const lastName =\n jsonResponse.properties\n .filter((p) => p.name == \"last_name\")\n .map((p) => p.value) ?? \"\";\n const fullName = `${firstName} ${lastName}`.trim();\n let user: string;\n // If at least one of first or last name is not empty, the full name is not empty and the fullname is used.\n // Otherwise, we fallback to the user id.\n if (fullName != \"\") {\n user = fullName;\n } else {\n user = jsonResponse.pageName;\n }\n\n return {\n name: user,\n username: jsonResponse.pageName,\n profile: this.cristalApp.getRouter().resolve({\n name: \"view\",\n params: {\n page: userId,\n },\n }).href,\n };\n } catch (error) {\n this.logger.error(error);\n this.logger.debug(`Could not load user details for page ${userId}.`);\n return { name: userId, profile: \"\" };\n }\n }\n}\n\nexport { XWikiPageRevisionManager };\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { XWikiPageRevisionManager } from \"./components/componentsInit\";\nimport { name as PageRevisionManagerName } from \"@xwiki/cristal-history-api\";\nimport type { PageRevisionManager } from \"@xwiki/cristal-history-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nclass ComponentInit {\n constructor(container: Container) {\n container\n .bind<PageRevisionManager>(PageRevisionManagerName)\n .to(XWikiPageRevisionManager)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n\nexport { ComponentInit };\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { LinkType, name } from \"@xwiki/platform-link-suggest-api\";\nimport { Container, inject, injectable } from \"inversify\";\nimport type { CristalApp } from \"@xwiki/platform-api\";\nimport type { AuthenticationManagerProvider } from \"@xwiki/platform-authentication-api\";\nimport type {\n Link,\n LinkSuggestService,\n} from \"@xwiki/platform-link-suggest-api\";\nimport type { ModelReferenceParserProvider } from \"@xwiki/platform-model-reference-api\";\nimport type { RemoteURLSerializerProvider } from \"@xwiki/platform-model-remote-url-api\";\n\n/**\n * Default implementation of the link suggestion service, for XWiki.\n * Currently limited to guests, and to XWiki instances that have explicitly\n * allowed CORS, see https://cristal.xwiki.org/xwiki/bin/view/Backends/XWiki/\n * @since 0.8\n * @beta\n */\n@injectable()\nclass XWikiLinkSuggestService implements LinkSuggestService {\n constructor(\n @inject(\"CristalApp\") private readonly cristalApp: CristalApp,\n @inject(\"RemoteURLSerializerProvider\")\n private readonly remoteURLSerializerProvider: RemoteURLSerializerProvider,\n @inject(\"ModelReferenceParserProvider\")\n private readonly modelReferenceParserProvider: ModelReferenceParserProvider,\n @inject(\"AuthenticationManagerProvider\")\n private authenticationManagerProvider: AuthenticationManagerProvider,\n ) {}\n\n async getLinks(\n query: string,\n type?: LinkType,\n mimetype?: string,\n ): Promise<Link[]> {\n const json = await this.executeQuery(type, mimetype, query);\n\n return json\n .map(this.mapToLink.bind(this))\n .filter((it: unknown) => it !== undefined)\n .filter(this.filterLinks(type, mimetype));\n }\n\n private async executeQuery(\n type: LinkType | undefined | LinkType.PAGE | LinkType.ATTACHMENT,\n mimetype: string | undefined,\n query: string,\n ) {\n const baseURL = this.cristalApp.getWikiConfig().baseURL;\n const fqs = this.initializeSolrQueryParameters(type, mimetype);\n const params: Record<string, string> = {\n query: fqs.map((it) => `fq=${it}`).join(\"\\n\"),\n nb: \"20\",\n media: \"json\",\n input: `*${query}*`,\n };\n\n const getParams = new URLSearchParams(params).toString();\n const response = await fetch(\n `${baseURL}/bin/get/XWiki/SuggestSolrService?${getParams}`,\n {\n headers: {\n ...(await this.getCredentials()),\n },\n },\n );\n\n return await response.json();\n }\n\n private initializeSolrQueryParameters(\n type: LinkType | LinkType.PAGE | LinkType.ATTACHMENT | undefined,\n mimetype: string | undefined,\n ) {\n const fqs = [\"locale:*\", \"wiki:xwiki\"];\n\n if (type) {\n if (type == LinkType.ATTACHMENT) {\n fqs.push(\"type:ATTACHMENT\");\n } else {\n fqs.push(\"type:PAGE\");\n }\n }\n\n if (mimetype) {\n fqs.push(`mimetype:((${mimetype}))`);\n }\n return fqs;\n }\n\n private filterLinks(\n type: LinkType | undefined | LinkType.PAGE | LinkType.ATTACHMENT,\n mimetype: string | undefined,\n ) {\n return (link: Link) => {\n if (type == undefined) {\n return true;\n } else {\n const expectedType = link.type == type;\n if (!expectedType) {\n return false;\n }\n if (mimetype) {\n // TODO...\n return expectedType;\n } else {\n return true;\n }\n }\n };\n }\n\n private mapToLink(result: {\n id: string;\n filename: string[];\n type: string;\n title_: string;\n name: string;\n reference: string;\n }) {\n const reference = result.reference;\n const type = result.type;\n const xwikiURL =\n this.remoteURLSerializerProvider\n .get()\n ?.serialize(\n this.modelReferenceParserProvider.get()?.parse(reference),\n ) ?? \"\";\n\n if (type == \"ATTACHMENT\") {\n return {\n type: LinkType.ATTACHMENT,\n id: result.id,\n url: xwikiURL,\n reference,\n label: result.filename[0],\n hint: result.filename[0],\n };\n } else if (type == \"DOCUMENT\") {\n const label = result.title_;\n return {\n type: LinkType.PAGE,\n id: result.id,\n url: xwikiURL,\n reference,\n label,\n hint: label,\n };\n }\n }\n\n private async getCredentials(): Promise<{ Authorization?: string }> {\n const authorizationHeader = await this.authenticationManagerProvider\n .get()\n ?.getAuthorizationHeader();\n const headers: { Authorization?: string } = {};\n if (authorizationHeader) {\n headers[\"Authorization\"] = authorizationHeader;\n }\n return headers;\n }\n}\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<LinkSuggestService>(name)\n .to(XWikiLinkSuggestService)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport {\n AttachmentReference,\n DocumentReference,\n EntityType,\n SpaceReference,\n} from \"@xwiki/platform-model-api\";\nimport { injectable } from \"inversify\";\nimport type { EntityReference, WikiReference } from \"@xwiki/platform-model-api\";\nimport type { ModelReferenceHandler } from \"@xwiki/platform-model-reference-api\";\n\n/**\n * Implementation of {@link ModelReferenceHandler} for the XWiki backend.\n *\n * @since 0.13\n * @beta\n */\n@injectable()\nexport class XWikiModelReferenceHandler implements ModelReferenceHandler {\n createDocumentReference(\n name: string,\n space: SpaceReference,\n ): DocumentReference {\n const newSpace = new SpaceReference(space.wiki, ...space.names, name);\n return new DocumentReference(\"WebHome\", newSpace);\n }\n\n getTitle(reference: EntityReference): string {\n switch (reference.type) {\n case EntityType.WIKI:\n return (reference as WikiReference).name;\n case EntityType.SPACE:\n return [...(reference as SpaceReference).names].pop()!;\n case EntityType.DOCUMENT: {\n const name = (reference as DocumentReference).name;\n if (name === \"WebHome\" && (reference as DocumentReference).space) {\n return this.getTitle((reference as DocumentReference).space!);\n } else {\n return name;\n }\n }\n case EntityType.ATTACHMENT:\n return (reference as AttachmentReference).name;\n }\n return \"\";\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport {\n AttachmentReference,\n DocumentReference,\n EntityType,\n SpaceReference,\n} from \"@xwiki/platform-model-api\";\nimport { inject, injectable } from \"inversify\";\nimport { isEqual } from \"lodash-es\";\nimport type { DocumentService } from \"@xwiki/platform-document-api\";\nimport type { EntityReference } from \"@xwiki/platform-model-api\";\nimport type {\n ModelReferenceParser,\n ModelReferenceParserOptions,\n} from \"@xwiki/platform-model-reference-api\";\n\n@injectable()\nexport class XWikiModelReferenceParser implements ModelReferenceParser {\n constructor(\n @inject(\"DocumentService\")\n private readonly documentService: DocumentService,\n ) {}\n\n parse(\n reference: string,\n options?: ModelReferenceParserOptions,\n ): EntityReference {\n if (/^https?:\\/\\//.test(reference)) {\n throw new Error(`[${reference}] is not a valid entity reference`);\n }\n return this.innerParse(reference, options?.type);\n }\n\n async parseAsync(\n reference: string,\n options?: ModelReferenceParserOptions,\n ): Promise<EntityReference> {\n return this.parse(reference, options);\n }\n\n private innerParse(reference: string, type: EntityType | undefined) {\n const splits = reference.split(\":\");\n const noWiki = splits[splits.length - 1];\n if (\n noWiki.includes(\"@\") ||\n splits.includes(\"attach\") ||\n type == EntityType.ATTACHMENT\n ) {\n const strings = noWiki.split(\"@\");\n if (strings.length == 1) {\n const doc = this.getCurrentDocumentReference();\n return new AttachmentReference(strings[0], doc);\n } else {\n const doc = this.parseDocumentReference(strings[0]);\n return new AttachmentReference(strings[1], doc);\n }\n } else {\n return this.parseDocumentReference(noWiki);\n }\n }\n\n private parseDocumentReference(noWiki: string) {\n const segments = noWiki.split(\".\");\n if (isEqual(segments, [\"WebHome\"])) {\n const currentDocumentReference = this.getCurrentDocumentReference();\n return new DocumentReference(segments[0], currentDocumentReference.space);\n } else {\n return new DocumentReference(\n segments[segments.length - 1],\n new SpaceReference(\n undefined,\n ...segments.slice(0, segments.length - 1),\n ),\n );\n }\n }\n\n private getCurrentDocumentReference() {\n return this.documentService.getCurrentDocumentReference().value!;\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport {\n AttachmentReference,\n DocumentReference,\n EntityType,\n SpaceReference,\n WikiReference,\n} from \"@xwiki/platform-model-api\";\nimport { injectable } from \"inversify\";\nimport type { EntityReference } from \"@xwiki/platform-model-api\";\nimport type { ModelReferenceSerializer } from \"@xwiki/platform-model-reference-api\";\n\n@injectable()\nexport class XWikiModelReferenceSerializer implements ModelReferenceSerializer {\n private escapeSegment(segment: string): string {\n // Dots in XWiki references separate segments, so when inside a segment\n // they need to be escaped with a '\\'. At the same time, using '\\' as an\n // escape character means it needs to be escaped as well.\n return segment.replace(/(\\.|\\\\)/g, \"\\\\$1\");\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n serialize(reference?: EntityReference): string | undefined {\n if (!reference) {\n return undefined;\n }\n const type = reference.type;\n const { SPACE, ATTACHMENT, DOCUMENT, WIKI } = EntityType;\n switch (type) {\n case WIKI:\n return (reference as WikiReference).name;\n case SPACE: {\n const spaceReference = reference as SpaceReference;\n const wiki = this.serialize(spaceReference.wiki);\n const spaces = spaceReference.names.map(this.escapeSegment).join(\".\");\n if (wiki === undefined) {\n return spaces;\n } else {\n return `${wiki}:${spaces}`;\n }\n }\n case DOCUMENT: {\n const documentReference = reference as DocumentReference;\n const spaces = this.serialize(documentReference.space);\n const name = this.escapeSegment(documentReference.name);\n if (spaces === undefined || spaces == \"\") {\n return name;\n } else {\n return `${spaces}.${name}`;\n }\n }\n case ATTACHMENT: {\n const attachmentReference = reference as AttachmentReference;\n const document = this.serialize(attachmentReference.document);\n const name = attachmentReference.name;\n return `attach:${document}@${name}`;\n }\n default:\n throw new Error(`Unknown reference type [${type}]`);\n }\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { XWikiModelReferenceHandler } from \"./xWikiModelReferenceHandler\";\nimport { XWikiModelReferenceParser } from \"./xWikiModelReferenceParser\";\nimport { XWikiModelReferenceSerializer } from \"./xWikiModelReferenceSerializer\";\nimport type {\n ModelReferenceHandler,\n ModelReferenceParser,\n ModelReferenceSerializer,\n} from \"@xwiki/platform-model-reference-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<ModelReferenceHandler>(\"ModelReferenceHandler\")\n .to(XWikiModelReferenceHandler)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n container\n .bind<ModelReferenceParser>(\"ModelReferenceParser\")\n .to(XWikiModelReferenceParser)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n container\n .bind<ModelReferenceSerializer>(\"ModelReferenceSerializer\")\n .to(XWikiModelReferenceSerializer)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport {\n AttachmentReference,\n DocumentReference,\n SpaceReference,\n} from \"@xwiki/platform-model-api\";\nimport { inject, injectable } from \"inversify\";\nimport type { CristalApp } from \"@xwiki/platform-api\";\nimport type { EntityReference } from \"@xwiki/platform-model-api\";\nimport type { RemoteURLParser } from \"@xwiki/platform-model-remote-url-api\";\n\n@injectable()\nclass XWikiRemoteURLParser implements RemoteURLParser {\n constructor(@inject(\"CristalApp\") private readonly cristalApp: CristalApp) {}\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n parse(urlStr: string): EntityReference {\n const baseURLstr = this.cristalApp.getWikiConfig().baseURL;\n if (!urlStr.startsWith(baseURLstr)) {\n throw new Error(\n `[${urlStr}] does not start with base url [${baseURLstr}]`,\n );\n }\n const baseURL = new URL(baseURLstr);\n const url = new URL(urlStr);\n\n const endPath = decodeURI(url.pathname.replace(baseURL.pathname, \"\"));\n // Using decodeURI will not decode '/' characters inside a segment, so we\n // do it manually.\n let segments = endPath\n .split(\"/\")\n .map((segment) => segment.replace(/%2F/g, \"/\"));\n if (segments[0] === \"\") {\n segments = segments.slice(1);\n }\n if (segments[segments.length - 1] === \"\") {\n segments[segments.length - 1] = \"WebHome\";\n }\n const [bin, action] = segments;\n // TODO: the current approach is easy but does not work if some url rewriting is done in front of XWiki.\n if (bin == \"bin\" && (action == \"view\" || action == \"create\")) {\n segments = segments.slice(2);\n const pageName = segments[segments.length - 1];\n const spaces = segments.slice(0, segments.length - 1);\n return new DocumentReference(\n pageName,\n new SpaceReference(undefined, ...spaces),\n );\n } else if (bin == \"bin\" && action == \"download\") {\n segments = segments.slice(2);\n const attachmentName = segments[segments.length - 1];\n const pageName = segments[segments.length - 2];\n const spaces = segments.slice(0, segments.length - 2);\n return new AttachmentReference(\n attachmentName,\n new DocumentReference(\n pageName,\n new SpaceReference(undefined, ...spaces),\n ),\n );\n } else {\n throw new Error(`Impossible to resolve [${urlStr}] to an entity`);\n }\n }\n}\n\nexport { XWikiRemoteURLParser };\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport {\n AttachmentReference,\n DocumentReference,\n EntityType,\n} from \"@xwiki/platform-model-api\";\nimport { inject, injectable } from \"inversify\";\nimport type { CristalApp } from \"@xwiki/platform-api\";\nimport type { EntityReference } from \"@xwiki/platform-model-api\";\nimport type { RemoteURLSerializer } from \"@xwiki/platform-model-remote-url-api\";\n\n@injectable()\nclass XWikiRemoteURLSerializer implements RemoteURLSerializer {\n constructor(@inject(\"CristalApp\") private readonly cristalApp: CristalApp) {}\n\n serialize(reference?: EntityReference): string | undefined {\n if (!reference) {\n return undefined;\n }\n switch (reference.type) {\n case EntityType.WIKI:\n throw new Error(\"Not implemented\");\n case EntityType.SPACE:\n throw new Error(\"Not implemented\");\n case EntityType.DOCUMENT: {\n return this.serializeDocument(reference);\n }\n case EntityType.ATTACHMENT: {\n return this.serializeAttachment(reference);\n }\n }\n }\n\n private serializeAttachment(reference: EntityReference) {\n const baseURL = this.cristalApp.getWikiConfig().baseURL;\n const attachmentReference = reference as AttachmentReference;\n const documentReference = attachmentReference.document;\n const spaces = documentReference.space?.names.map(encodeURI).join(\"/\");\n return `${baseURL}/bin/download/${spaces}/${encodeURI(documentReference.name)}/${encodeURI(\n attachmentReference.name,\n )}`;\n }\n\n private serializeDocument(reference: EntityReference) {\n const baseURL = this.cristalApp.getWikiConfig().baseURL;\n const documentReference = reference as DocumentReference;\n const spaces = documentReference.space?.names.map(encodeURI).join(\"/\");\n if (documentReference.name == \"WebHome\") {\n return `${baseURL}/bin/view/${spaces}/`;\n } else {\n return `${baseURL}/bin/view/${spaces}/${encodeURI(documentReference.name)}`;\n }\n }\n}\n\nexport { XWikiRemoteURLSerializer };\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { XWikiRemoteURLParser } from \"./xWikiRemoteURLParser\";\nimport { XWikiRemoteURLSerializer } from \"./xWikiRemoteURLSerializer\";\nimport { Container } from \"inversify\";\nimport type {\n RemoteURLParser,\n RemoteURLSerializer,\n} from \"@xwiki/platform-model-remote-url-api\";\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<RemoteURLParser>(\"RemoteURLParser\")\n .to(XWikiRemoteURLParser)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n container\n .bind<RemoteURLSerializer>(\"RemoteURLSerializer\")\n .to(XWikiRemoteURLSerializer)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { name as NavigationTreeSourceName } from \"@xwiki/platform-navigation-tree-api\";\nimport { Container, inject, injectable, named } from \"inversify\";\nimport type { CristalApp, Logger } from \"@xwiki/platform-api\";\nimport type { AuthenticationManagerProvider } from \"@xwiki/platform-authentication-api\";\nimport type { DocumentReference } from \"@xwiki/platform-model-api\";\nimport type { ModelReferenceSerializer } from \"@xwiki/platform-model-reference-api\";\nimport type { RemoteURLParser } from \"@xwiki/platform-model-remote-url-api\";\nimport type {\n NavigationTreeNode,\n NavigationTreeSource,\n} from \"@xwiki/platform-navigation-tree-api\";\n\n/**\n * Implementation of NavigationTreeSource for the XWiki backend.\n *\n * @since 0.10\n * @beta\n **/\n@injectable()\nclass XWikiNavigationTreeSource implements NavigationTreeSource {\n constructor(\n @inject(\"Logger\") private readonly logger: Logger,\n @inject(\"CristalApp\") private readonly cristalApp: CristalApp,\n @inject(\"AuthenticationManagerProvider\")\n private authenticationManagerProvider: AuthenticationManagerProvider,\n @inject(\"RemoteURLParser\")\n @named(\"XWiki\")\n private readonly urlParser: RemoteURLParser,\n @inject(\"ModelReferenceSerializer\")\n @named(\"XWiki\")\n private readonly referenceSerializer: ModelReferenceSerializer,\n ) {\n this.logger.setModule(\n \"navigation-tree-xwiki.components.XWikiNavigationTreeSource\",\n );\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n async getChildNodes(id?: string): Promise<Array<NavigationTreeNode>> {\n const currentId = id ? id : \"#\";\n const navigationTree: Array<NavigationTreeNode> = [];\n\n try {\n const authorization = await this.authenticationManagerProvider\n .get()\n ?.getAuthorizationHeader();\n const headers: { Accept: string; Authorization?: string } = {\n Accept: \"application/json\",\n };\n\n if (authorization) {\n headers.Authorization = authorization;\n }\n\n navigationTree.push(...(await this.fetchNodes(currentId, headers, 0)));\n } catch (error) {\n this.logger.error(error);\n this.logger.debug(\"Could not load navigation tree.\");\n }\n return navigationTree;\n }\n\n getParentNodesId(\n page: DocumentReference,\n includeTerminal: boolean = true,\n includeRootNode?: boolean,\n ): Array<string> {\n const result = includeRootNode ? [\"\"] : [];\n if (page.space) {\n let currentParent = \"\";\n for (const parent of page.space!.names) {\n currentParent += parent;\n // TODO: Support subwikis.\n result.push(`document:xwiki:${currentParent}.WebHome`);\n currentParent += \".\";\n }\n if (page.name != \"WebHome\" && includeTerminal) {\n result.push(\n `document:xwiki:${this.referenceSerializer.serialize(page)}`,\n );\n }\n }\n return result;\n }\n\n // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n // eslint-disable-next-line max-statements\n private async fetchNodes(\n currentId: string,\n headers: { Accept: string; Authorization?: string },\n offset: number,\n ): Promise<Array<NavigationTreeNode>> {\n const nodes: Array<NavigationTreeNode> = [];\n const baseXWikiURL = this.cristalApp\n .getWikiConfig()\n .baseURL.replace(/\\/[^/]*$/, \"\");\n // The DocumentTree sheet sets a default limit of 15 items par page.\n // We use a greater one to reduce the number of requests to fetch them all.\n const limit = 100;\n\n const navigationTreeRequestUrl = new URL(\n `${this.cristalApp.getWikiConfig().baseURL}/bin/get`,\n );\n navigationTreeRequestUrl.search = new URLSearchParams([\n [\"id\", currentId],\n [\"outputSyntax\", \"plain\"],\n [\"sheet\", \"XWiki.DocumentTree\"],\n [\"data\", \"children\"],\n [\"compact\", \"true\"],\n [\"offset\", offset.toString()],\n [\"limit\", limit.toString()],\n [\"showTranslations\", \"false\"],\n [\"showAttachments\", \"false\"],\n ]).toString();\n\n const response = await fetch(navigationTreeRequestUrl, { headers });\n const jsonResponse: [\n {\n id: string;\n text: string;\n children: boolean;\n data: { type: string; offset: number };\n a_attr?: { href: string };\n },\n ] = await response.json();\n for (const treeNode of jsonResponse) {\n if (treeNode.id == \"pagination:wiki:xwiki\") {\n nodes.push(\n ...(await this.fetchNodes(currentId, headers, treeNode.data.offset)),\n );\n } else if (\n ![\"attachments\", \"translations\"].includes(treeNode.data.type) &&\n treeNode.a_attr\n ) {\n const documentReference = this.urlParser.parse(\n `${baseXWikiURL}${treeNode.a_attr.href}`,\n )! as DocumentReference;\n nodes.push({\n id: treeNode.id,\n label: treeNode.text,\n location: documentReference.space!,\n url: this.cristalApp.getRouter().resolve({\n name: \"view\",\n params: {\n page: this.referenceSerializer.serialize(documentReference),\n },\n }).href,\n has_children: treeNode.children,\n is_terminal: !treeNode.id.endsWith(\".WebHome\"),\n });\n }\n }\n\n // Handle paging if necessary.\n if (jsonResponse.length >= limit) {\n nodes.push(\n ...(await this.fetchNodes(currentId, headers, offset + limit)),\n );\n }\n\n return nodes;\n }\n}\n\n/**\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<NavigationTreeSource>(NavigationTreeSourceName)\n .to(XWikiNavigationTreeSource)\n .inSingletonScope()\n .whenNamed(\"XWiki\");\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { injectable } from \"inversify\";\nimport type {\n BlockMacro,\n GetConcreteMacroParametersType,\n MacroBlock,\n MacroInfos,\n} from \"@xwiki/platform-macros-api\";\n\nconst macroParams = {\n html: { type: \"string\" },\n metadata: { type: \"string\" },\n} as const;\n\ntype MacroParams = typeof macroParams;\n\n@injectable()\nexport class XWikiHtmlBlockMacro implements BlockMacro<MacroParams> {\n readonly infos: MacroInfos<MacroParams> = {\n id: \"xwikiHtmlBlock\",\n name: \"XWiki HTML Block Content\",\n description: \"HTML rendering of an XWiki macro block content\",\n params: macroParams,\n paramsDescription: {\n html: \"Server-rendered HTML content\",\n metadata: \"Metadata used to generate the XWiki macro\",\n },\n defaultParameters: false,\n bodyType: \"none\",\n };\n\n renderAs = \"block\" as const;\n\n render({ html }: GetConcreteMacroParametersType<MacroParams>): MacroBlock[] {\n return [{ type: \"rawHtml\", html }];\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { injectable } from \"inversify\";\nimport type {\n GetConcreteMacroParametersType,\n InlineMacro,\n MacroInfos,\n MacroInlineContent,\n} from \"@xwiki/platform-macros-api\";\n\nconst macroParams = {\n html: { type: \"string\" },\n metadata: { type: \"string\" },\n} as const;\n\ntype MacroParams = typeof macroParams;\n\n@injectable()\nexport class XWikiInlineHtmlMacro implements InlineMacro<MacroParams> {\n readonly infos: MacroInfos<MacroParams> = {\n id: \"xwikiInlineHtml\",\n name: \"XWiki HTML Inline Content\",\n description: \"HTML rendering of an XWiki macro inline content\",\n params: macroParams,\n paramsDescription: {\n html: \"Server-rendered HTML content\",\n metadata: \"Metadata used to generate the XWiki macro\",\n },\n defaultParameters: false,\n bodyType: \"none\",\n };\n\n renderAs = \"inline\" as const;\n\n render({\n html,\n }: GetConcreteMacroParametersType<MacroParams>): MacroInlineContent[] {\n return [{ type: \"rawHtml\", html }];\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { XWikiHtmlBlockMacro } from \"./macros/blockMacro\";\nimport { XWikiInlineHtmlMacro } from \"./macros/inlineMacro\";\nimport { eraseParamsTypeForMacroClass } from \"@xwiki/platform-macros-api\";\nimport type { MacroWithUnknownParamsType } from \"@xwiki/platform-macros-api\";\nimport type { Container } from \"inversify\";\n\n/**\n * @since 0.23\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<MacroWithUnknownParamsType>(\"Macro\")\n .to(eraseParamsTypeForMacroClass(XWikiHtmlBlockMacro));\n\n container\n .bind<MacroWithUnknownParamsType>(\"Macro\")\n .to(eraseParamsTypeForMacroClass(XWikiInlineHtmlMacro));\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { inject, injectable } from \"inversify\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\nimport type { CristalApp } from \"@xwiki/platform-api\";\nimport type { AuthenticationManagerProvider } from \"@xwiki/platform-authentication-api\";\nimport type { Component } from \"vue\";\n\n/**\n * Banner to notify of improper XWiki instance configuration for Cristal auth.\n *\n * @since 0.24-rc-1\n * @beta\n */\n@injectable()\nexport class AuthServiceBannerUIExtension implements UIExtension {\n id = \"main.banner.authServiceBanner\";\n uixpName = \"main.banner\";\n order = 1000;\n parameters = {};\n\n constructor(\n @inject(\"AuthenticationManagerProvider\")\n private readonly authenticationManager: AuthenticationManagerProvider,\n @inject(\"CristalApp\") private readonly cristal: CristalApp,\n ) {}\n\n async component(): Promise<Component> {\n return (await import(\"./vue/AuthServiceBanner.vue\")).default;\n }\n\n async enabled(): Promise<boolean> {\n if (await this.authenticationManager.get()?.isAuthenticated()) {\n // We check that the current authantication service can be fetched,\n // and we display the banner if it is not \"oidc-provider-bridge\".\n const response = await fetch(\n `${this.cristal.getWikiConfig().baseURL}/rest/cristal/auth`,\n );\n return response.ok && (await response.text()) != \"oidc-provider-bridge\";\n } else {\n return false;\n }\n }\n}\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { AuthServiceBannerUIExtension } from \"./AuthServiceBannerUIExtension\";\nimport { Container } from \"inversify\";\nimport type { UIExtension } from \"@xwiki/cristal-uiextension-api\";\n\n/**\n * @since 0.24-rc-1\n * @beta\n */\nexport class ComponentInit {\n constructor(container: Container) {\n container\n .bind<UIExtension>(\"UIExtension\")\n .to(AuthServiceBannerUIExtension)\n .inSingletonScope();\n }\n}\n","class o {\n constructor(n) {\n e(n);\n }\n}\nfunction e(i) {\n const n = \"XWiki\";\n i.bind(\n \"Factory<InternalLinksSerializer>\"\n ).toFactory((r) => async () => {\n const t = (await import(\"./xwiki-internal-link-serializer-Cd8xorru.js\")).XWikiInternalLinkSerializer;\n return a(i, n, t, r);\n }).whenNamed(n);\n}\nfunction a(i, n, r, t) {\n return i.isBound(\"InternalLinksSerializer\", { name: n }) || i.bind(\"InternalLinksSerializer\").to(r).whenNamed(n), t.get(\"InternalLinksSerializer\", {\n name: n\n });\n}\nexport {\n o as ComponentInit\n};\n//# sourceMappingURL=index.es.js.map\n","/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport { ComponentInit as XWikiPageHierarchyComponentInit } from \"@xwiki/cristal-hierarchy-xwiki\";\nimport { ComponentInit as XWikiPageHistoryComponentInit } from \"@xwiki/cristal-history-xwiki\";\nimport { ComponentInit as XWikiLinkSuggestComponentInit } from \"@xwiki/cristal-link-suggest-xwiki\";\nimport { ComponentInit as ModelReferenceXWikiComponentInit } from \"@xwiki/cristal-model-reference-xwiki\";\nimport { ComponentInit as ModelRemoteURLXWikiComponentInit } from \"@xwiki/cristal-model-remote-url-xwiki\";\nimport { ComponentInit as XWikiNavigationTreeComponentInit } from \"@xwiki/cristal-navigation-tree-xwiki\";\nimport { ComponentInit as XWikiMacrosComponentInit } from \"@xwiki/cristal-xwiki-macros\";\nimport { ComponentInit as XWikiUIComponentInit } from \"@xwiki/cristal-xwiki-ui\";\nimport { ComponentInit as UniastMarkdownXWikiComponentInit } from \"@xwiki/platform-uniast-markdown-xwiki\";\nimport type { Container } from \"inversify\";\n\nexport function load(container: Container) {\n new XWikiLinkSuggestComponentInit(container);\n new XWikiPageHierarchyComponentInit(container);\n new XWikiNavigationTreeComponentInit(container);\n new XWikiPageHistoryComponentInit(container);\n new ModelRemoteURLXWikiComponentInit(container);\n new ModelReferenceXWikiComponentInit(container);\n new XWikiMacrosComponentInit(container);\n new XWikiUIComponentInit(container);\n new UniastMarkdownXWikiComponentInit(container);\n}\n"],"file":"xwiki-BeDAdEBl.js"}
@@ -1,2 +0,0 @@
1
- import{a8 as s}from"./index-B1WxkRNy.js";var c=(e,r,n,o)=>{for(var a=r,i=e.length-1,t;i>=0;i--)(t=e[i])&&(a=t(a)||a);return a};let l=class{async serialize(e,r,n){return`[[${await n.convertInlineContents(e)}|${r.rawReference}]]`}async serializeImage(e,r){return`![[${r??""}${r?"|":""}${e.rawReference}]]`}};l=c([s()],l);export{l as XWikiInternalLinkSerializer};
2
- //# sourceMappingURL=xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js","sources":["../../../node_modules/.pnpm/@xwiki+platform-uniast-markdown-xwiki@18.2.0_inversify@7.11.0_reflect-metadata@0.2.2__r_75d39af4a42b67a3b2e8ca1bd49854bd/node_modules/@xwiki/platform-uniast-markdown-xwiki/dist/xwiki-internal-link-serializer-Cd8xorru.js"],"sourcesContent":["import { injectable as c } from \"inversify\";\nvar o = Object.getOwnPropertyDescriptor, v = (r, e, a, i) => {\n for (var n = i > 1 ? void 0 : i ? o(e, a) : e, t = r.length - 1, s; t >= 0; t--)\n (s = r[t]) && (n = s(n) || n);\n return n;\n};\nlet l = class {\n async serialize(r, e, a) {\n return `[[${await a.convertInlineContents(\n r\n )}|${e.rawReference}]]`;\n }\n async serializeImage(r, e) {\n return `![[${e ?? \"\"}${e ? \"|\" : \"\"}${r.rawReference}]]`;\n }\n};\nl = v([\n c()\n], l);\nexport {\n l as XWikiInternalLinkSerializer\n};\n//# sourceMappingURL=xwiki-internal-link-serializer-Cd8xorru.js.map\n"],"names":["v","r","e","a","i","n","t","s","c"],"mappings":"yCACG,IAAsCA,EAAI,CAACC,EAAGC,EAAGC,EAAGC,IAAM,CAC3D,QAASC,EAAmCH,EAAGI,EAAIL,EAAE,OAAS,EAAGM,EAAGD,GAAK,EAAGA,KACzEC,EAAIN,EAAEK,CAAC,KAAOD,EAAIE,EAAEF,CAAC,GAAKA,GAC7B,OAAOA,CACT,EACG,IAAC,EAAI,KAAM,CACZ,MAAM,UAAUJ,EAAGC,EAAGC,EAAG,CACvB,MAAO,KAAK,MAAMA,EAAE,sBAClBF,CACN,CAAK,IAAIC,EAAE,YAAY,IACrB,CACA,MAAM,eAAeD,EAAGC,EAAG,CACzB,MAAO,MAAMA,GAAK,EAAE,GAAGA,EAAI,IAAM,EAAE,GAAGD,EAAE,YAAY,IACtD,CACF,EACA,EAAID,EAAE,CACJQ,EAAC,CACH,EAAG,CAAC","x_google_ignoreList":[0]}
@@ -1,18 +0,0 @@
1
- <svg width="72" height="22" viewBox="0 0 72 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_643_24486)">
3
- <path d="M31.5832 2.77717C31.8169 2.11297 32.2545 1.91589 32.8959 1.91589C33.5374 1.91589 33.9749 2.11297 34.2076 2.77717L38.99 16.9278H39.0486L41.7605 2.92524C41.9067 2.21098 42.3731 1.91589 43.1597 1.91589C43.8897 1.91589 44.3273 2.35905 44.3273 2.90021C44.3212 3.27383 44.2721 3.64546 44.1811 4.00757L41.0316 18.3063C40.8566 19.0695 40.4777 19.7337 39.1949 19.7337C38.2034 19.7337 37.5908 19.5127 37.182 18.3063L32.9248 5.46007H32.8671L28.6098 18.3063C28.198 19.5127 27.5885 19.7337 26.597 19.7337C25.3142 19.7337 24.9353 19.0695 24.7603 18.3063L21.6108 4.00757C21.5198 3.64546 21.4707 3.27383 21.4646 2.90021C21.4646 2.35905 21.9022 1.91589 22.6311 1.91589C23.4187 1.91589 23.8851 2.21098 24.0313 2.92524L26.7432 16.9278H26.8009L31.5832 2.77717Z" fill="#F78D1E"/>
4
- <path d="M49.3164 18.5753C49.3164 19.2885 48.8201 19.7316 48.0335 19.7316C47.2469 19.7316 46.7424 19.2906 46.7424 18.5753V3.07226C46.7424 2.35905 47.2387 1.91589 48.0263 1.91589C48.8139 1.91589 49.3164 2.35905 49.3164 3.07226V18.5753Z" fill="#F78D1E"/>
5
- <path d="M55.2623 18.5753C55.2623 19.2885 54.766 19.7316 53.9784 19.7316C53.1908 19.7316 52.6956 19.2885 52.6956 18.5753V3.07226C52.6956 2.35905 53.1918 1.91589 53.9784 1.91589C54.765 1.91589 55.2623 2.35905 55.2623 3.07226V9.47137L64.1557 2.60513C64.6221 2.23601 65.0309 1.91589 65.5559 1.91589C66.1974 1.91589 66.6638 2.28501 66.6638 2.85433C66.6638 3.42365 66.43 3.61655 66.1387 3.83865L57.6241 10.3108L66.9222 17.8881C67.334 18.2082 67.4473 18.4543 67.4473 18.7734C67.4473 19.2947 66.8923 19.7337 66.1932 19.7337C65.8144 19.7337 65.4633 19.6847 64.9392 19.2666L55.2612 11.2429L55.2623 18.5753Z" fill="#F78D1E"/>
6
- <path d="M72.0001 18.5753C72.0001 19.2885 71.5038 19.7316 70.7162 19.7316C69.9286 19.7316 69.4333 19.2885 69.4333 18.5753V3.07226C69.4333 2.35905 69.9296 1.91589 70.7162 1.91589C71.5028 1.91589 72.0001 2.35905 72.0001 3.07226V18.5753Z" fill="#F78D1E"/>
7
- <path d="M3.71675 11.7038C3.90089 11.7035 4.07739 11.6292 4.2075 11.4973C4.33761 11.3653 4.41069 11.1865 4.41068 11C4.41069 10.8135 4.33761 10.6346 4.2075 10.5027C4.07739 10.3707 3.90089 10.2964 3.71675 10.2961H0.694961C0.510646 10.2961 0.33388 10.3703 0.203549 10.5023C0.0732189 10.6343 0 10.8133 0 11C0 11.1866 0.0732189 11.3657 0.203549 11.4977C0.33388 11.6296 0.510646 11.7038 0.694961 11.7038H3.71675Z" fill="#008FD4"/>
8
- <path d="M9.22485 17.2834C9.22485 17.0968 9.29807 16.9177 9.4284 16.7857C9.55873 16.6537 9.7355 16.5796 9.91981 16.5796C10.1041 16.5796 10.2809 16.6537 10.4112 16.7857C10.5416 16.9177 10.6148 17.0968 10.6148 17.2834V20.3479C10.6148 20.5346 10.5416 20.7136 10.4112 20.8456C10.2809 20.9776 10.1041 21.0518 9.91981 21.0518C9.7355 21.0518 9.55873 20.9776 9.4284 20.8456C9.29807 20.7136 9.22485 20.5346 9.22485 20.3479V17.2834Z" fill="#ED1C24"/>
9
- <path d="M9.22485 1.65628C9.22513 1.46979 9.29847 1.29104 9.42877 1.15927C9.55907 1.0275 9.73568 0.953491 9.91981 0.953491C10.104 0.953491 10.2806 1.0275 10.4109 1.15927C10.5412 1.29104 10.6145 1.46979 10.6148 1.65628V4.71663C10.6148 4.9033 10.5416 5.08232 10.4112 5.21431C10.2809 5.34631 10.1041 5.42046 9.91981 5.42046C9.7355 5.42046 9.55873 5.34631 9.4284 5.21431C9.29807 5.08232 9.22485 4.9033 9.22485 4.71663V1.65628Z" fill="#8CC63F"/>
10
- <path d="M11.5683 10.9635L17.408 4.09103C17.5142 3.96601 17.5951 3.82103 17.646 3.66437C17.6969 3.5077 17.7168 3.34243 17.7046 3.17797C17.6924 3.01351 17.6483 2.8531 17.5749 2.70588C17.5015 2.55867 17.4002 2.42754 17.2768 2.31998C17.1533 2.21242 17.0102 2.13054 16.8555 2.07901C16.7008 2.02748 16.5376 2.00731 16.3752 2.01966C16.2128 2.03201 16.0544 2.07662 15.9091 2.15096C15.7637 2.2253 15.6342 2.32791 15.528 2.45293L9.93232 9.03451L4.3366 2.44876C4.12211 2.19627 3.81737 2.04042 3.48942 2.01549C3.16147 1.99056 2.83718 2.09859 2.58787 2.31581C2.33857 2.53304 2.18468 2.84166 2.16006 3.1738C2.13545 3.50593 2.24211 3.83437 2.4566 4.08685L8.29633 10.9635L2.4566 17.8319C2.35033 17.9569 2.26941 18.1019 2.21847 18.2586C2.16753 18.4152 2.14756 18.5806 2.1597 18.7451C2.17184 18.9096 2.21586 19.07 2.28924 19.2173C2.36261 19.3646 2.46392 19.4958 2.58736 19.6034C2.83666 19.8208 3.16101 19.9289 3.48906 19.9041C3.81711 19.8793 4.12198 19.7235 4.3366 19.471L9.93232 12.8852L15.528 19.471C15.7427 19.7235 16.0475 19.8793 16.3756 19.9041C16.7036 19.9289 17.028 19.8208 17.2773 19.6034C17.5266 19.3861 17.6804 19.0773 17.7049 18.7451C17.7295 18.4128 17.6227 18.0843 17.408 17.8319L11.5683 10.9635Z" fill="#626366"/>
11
- <path d="M19.0647 11.7194C19.2488 11.7192 19.4253 11.6449 19.5554 11.5129C19.6855 11.3809 19.7586 11.2021 19.7586 11.0156C19.7586 10.8291 19.6855 10.6502 19.5554 10.5183C19.4253 10.3863 19.2488 10.312 19.0647 10.3118H16.0429C15.8585 10.3118 15.6818 10.3859 15.5514 10.5179C15.4211 10.6499 15.3479 10.8289 15.3479 11.0156C15.3479 11.2023 15.4211 11.3813 15.5514 11.5133C15.6818 11.6453 15.8585 11.7194 16.0429 11.7194H19.0647Z" fill="#F78D1E"/>
12
- </g>
13
- <defs>
14
- <clipPath id="clip0_643_24486">
15
- <rect width="72" height="20.093" fill="white" transform="translate(0 0.953491)"/>
16
- </clipPath>
17
- </defs>
18
- </svg>
@@ -1,6 +0,0 @@
1
- const F=()=>new Map,Be=e=>{const t=F();return e.forEach((n,s)=>{t.set(s,n)}),t},Q=(e,t,n)=>{let s=e.get(t);return s===void 0&&e.set(t,s=n()),s},wr=(e,t)=>{const n=[];for(const[s,r]of e)n.push(t(r,s));return n},kr=(e,t)=>{for(const[n,s]of e)if(t(s,n))return!0;return!1},pt=()=>new Set,Oe=e=>e[e.length-1],mr=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},P=Array.from,Ze=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Pe=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},yr=(e,t)=>{const n=new Array(e);for(let s=0;s<e;s++)n[s]=t(s,n);return n},wt=Array.isArray;class Pn{constructor(){this._observers=F()}on(t,n){return Q(this._observers,t,pt).add(n),n}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return P((this._observers.get(t)||F()).values()).forEach(s=>s(...n))}destroy(){this._observers=F()}}const j=Math.floor,Qt=Math.abs,Qn=(e,t)=>e<t?e:t,it=(e,t)=>e>t?e:t,ts=e=>e!==0?e<0:1/e<0,Dn=1,An=2,Le=4,Ue=8,Rt=32,X=64,N=128,Rl=1<<29,ke=31,je=63,et=127,_r=2147483647,re=Number.MAX_SAFE_INTEGER,In=Number.MIN_SAFE_INTEGER,Sr=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&j(e)===e),es=String.fromCharCode,br=e=>e.toLowerCase(),Cr=/^\s*/g,Er=e=>e.replace(Cr,""),Dr=/([A-Z])/g,Tn=(e,t)=>Er(e.replace(Dr,n=>`${t}${br(n)}`)),Ar=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=t.codePointAt(r);return s},Nt=typeof TextEncoder<"u"?new TextEncoder:null,Ir=e=>Nt.encode(e),Tr=Nt?Ir:Ar;let Ut=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ut&&Ut.decode(new Uint8Array).length===1&&(Ut=null);const xr=(e,t)=>yr(t,()=>e).join("");class Jt{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Gt=()=>new Jt,Or=e=>{const t=Gt();return e(t),V(t)},Lr=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},V=e=>{const t=new Uint8Array(Lr(e));let n=0;for(let s=0;s<e.bufs.length;s++){const r=e.bufs[s];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Ur=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(it(n,t)*2),e.cpos=0)},A=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Je=A,m=(e,t)=>{for(;t>et;)A(e,N|et&t),t=j(t/128);A(e,et&t)},Qe=(e,t)=>{const n=ts(t);for(n&&(t=-t),A(e,(t>je?N:0)|(n?X:0)|je&t),t=j(t/64);t>0;)A(e,(t>et?N:0)|et&t),t=j(t/128)},Ge=new Uint8Array(3e4),Rr=Ge.length/3,Nr=(e,t)=>{if(t.length<Rr){const n=Nt.encodeInto(t,Ge).written||0;m(e,n);for(let s=0;s<n;s++)A(e,Ge[s])}else U(e,Tr(t))},Mr=(e,t)=>{const n=unescape(encodeURIComponent(t)),s=n.length;m(e,s);for(let r=0;r<s;r++)A(e,n.codePointAt(r))},ht=Nt&&Nt.encodeInto?Nr:Mr,me=(e,t)=>{const n=e.cbuf.length,s=e.cpos,r=Qn(n-s,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),s),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(it(n*2,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},U=(e,t)=>{m(e,t.byteLength),me(e,t)},tn=(e,t)=>{Ur(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},$r=(e,t)=>tn(e,4).setFloat32(0,t,!1),vr=(e,t)=>tn(e,8).setFloat64(0,t,!1),Vr=(e,t)=>tn(e,8).setBigInt64(0,t,!1),xn=new DataView(new ArrayBuffer(4)),Fr=e=>(xn.setFloat32(0,e),xn.getFloat32(0)===e),kt=(e,t)=>{switch(typeof t){case"string":A(e,119),ht(e,t);break;case"number":Sr(t)&&Qt(t)<=_r?(A(e,125),Qe(e,t)):Fr(t)?(A(e,124),$r(e,t)):(A(e,123),vr(e,t));break;case"bigint":A(e,122),Vr(e,t);break;case"object":if(t===null)A(e,126);else if(wt(t)){A(e,117),m(e,t.length);for(let n=0;n<t.length;n++)kt(e,t[n])}else if(t instanceof Uint8Array)A(e,116),U(e,t);else{A(e,118);const n=Object.keys(t);m(e,n.length);for(let s=0;s<n.length;s++){const r=n[s];ht(e,r),kt(e,t[r])}}break;case"boolean":A(e,t?120:121);break;default:A(e,127)}};class On extends Jt{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&m(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Ln=e=>{e.count>0&&(Qe(e.encoder,e.count===1?e.s:-e.s),e.count>1&&m(e.encoder,e.count-2))};class te{constructor(){this.encoder=new Jt,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Ln(this),this.count=1,this.s=t)}toUint8Array(){return Ln(this),V(this.encoder)}}const Un=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Qe(e.encoder,t),e.count>1&&m(e.encoder,e.count-2)}};class Re{constructor(){this.encoder=new Jt,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Un(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Un(this),V(this.encoder)}}class Br{constructor(){this.sarr=[],this.s="",this.lensE=new te}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new Jt;return this.sarr.push(this.s),this.s="",ht(t,this.sarr.join("")),me(t,this.lensE.toUint8Array()),V(t)}}const G=e=>new Error(e),B=()=>{throw G("Method unimplemented")},M=()=>{throw G("Unexpected case")},ns=G("Unexpected end of array"),ss=G("Integer out of Range");class ye{constructor(t){this.arr=t,this.pos=0}}const At=e=>new ye(e),jr=e=>e.pos!==e.arr.length,Jr=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},R=e=>Jr(e,k(e)),mt=e=>e.arr[e.pos++],k=e=>{let t=0,n=1;const s=e.arr.length;for(;e.pos<s;){const r=e.arr[e.pos++];if(t=t+(r&et)*n,n*=128,r<N)return t;if(t>re)throw ss}throw ns},en=e=>{let t=e.arr[e.pos++],n=t&je,s=64;const r=(t&X)>0?-1:1;if((t&N)===0)return r*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&et)*s,s*=128,t<N)return r*n;if(n>re)throw ss}throw ns},Gr=e=>{let t=k(e);if(t===0)return"";{let n=String.fromCodePoint(mt(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(mt(e));else for(;t>0;){const s=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+s);e.pos+=s,n+=String.fromCodePoint.apply(null,r),t-=s}return decodeURIComponent(escape(n))}},Hr=e=>Ut.decode(R(e)),at=Ut?Hr:Gr,nn=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Yr=e=>nn(e,4).getFloat32(0,!1),zr=e=>nn(e,8).getFloat64(0,!1),Kr=e=>nn(e,8).getBigInt64(0,!1),Xr=[e=>{},e=>null,en,Yr,zr,Kr,e=>!1,e=>!0,at,e=>{const t=k(e),n={};for(let s=0;s<t;s++){const r=at(e);n[r]=Mt(e)}return n},e=>{const t=k(e),n=[];for(let s=0;s<t;s++)n.push(Mt(e));return n},R],Mt=e=>Xr[127-mt(e)](e);class Rn extends ye{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),jr(this)?this.count=k(this)+1:this.count=-1),this.count--,this.s}}class ee extends ye{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=en(this);const t=ts(this.s);this.count=1,t&&(this.s=-this.s,this.count=k(this)+2)}return this.count--,this.s}}class Ne extends ye{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=en(this),n=t&1;this.diff=j(t/2),this.count=1,n&&(this.count=k(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Wr{constructor(t){this.decoder=new ee(t),this.str=at(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const qr=crypto.getRandomValues.bind(crypto),Zr=Math.random,rs=()=>qr(new Uint32Array(1))[0],Nl=e=>e[j(Zr()*e.length)],Pr="10000000-1000-4000-8000"+-1e11,Qr=()=>Pr.replace(/[018]/g,e=>(e^rs()&15>>e/4).toString(16)),ti=Date.now,Nn=e=>new Promise(e);Promise.all.bind(Promise);const Mn=e=>e===void 0?null:e;class ei{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let is=new ei,ni=!0;try{typeof localStorage<"u"&&localStorage&&(is=localStorage,ni=!1)}catch{}const si=is,$t=Symbol("Equality"),os=(e,t)=>e===t||!!e?.[$t]?.(t)||!1,ri=e=>typeof e=="object",ii=Object.assign,oi=Object.keys,li=(e,t)=>{for(const n in e)t(e[n],n)},ie=e=>oi(e).length,ci=e=>{for(const t in e)return!1;return!0},Ht=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},sn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),hi=(e,t)=>e===t||ie(e)===ie(t)&&Ht(e,(n,s)=>(n!==void 0||sn(t,s))&&os(t[s],n)),ai=Object.freeze,ls=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&ls(e[t])}return ai(e)},rn=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&rn(e,t,n+1)}},ui=e=>e,ne=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[$t]!=null)return e[$t](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!ne(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(ie(e)!==ie(t))return!1;for(const n in e)if(!sn(e,n)||!ne(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ne(e[n],t[n]))return!1;break;default:return!1}return!0},di=(e,t)=>t.includes(e);var cs={};const yt=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",fi=typeof window<"u"&&typeof document<"u"&&!yt;let J;const gi=()=>{if(J===void 0)if(yt){J=F();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const s=e[n];s[0]==="-"?(t!==null&&J.set(t,""),t=s):t!==null&&(J.set(t,s),t=null)}t!==null&&J.set(t,"")}else typeof location=="object"?(J=F(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");J.set(`--${Tn(t,"-")}`,n),J.set(`-${Tn(t,"-")}`,n)}})):J=F();return J},He=e=>gi().has(e),oe=e=>Mn(yt?cs[e.toUpperCase().replaceAll("-","_")]:si.getItem(e)),hs=e=>He("--"+e)||oe(e)!==null,pi=hs("production"),wi=yt&&di(cs.FORCE_COLOR,["true","1","2"]),ki=wi||!He("--no-colors")&&!hs("no-color")&&(!yt||process.stdout.isTTY)&&(!yt||He("--color")||oe("COLORTERM")!==null||(oe("TERM")||"").includes("color")),mi=e=>new Uint8Array(e),yi=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=es(e[n]);return btoa(t)},_i=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ml=fi?yi:_i,Si=e=>{const t=mi(e.byteLength);return t.set(e),t},$l=e=>Or(t=>kt(t,e));class bi{constructor(t,n){this.left=t,this.right=n}}const K=(e,t)=>new bi(e,t),$n=e=>e.next()>=.5,Me=(e,t,n)=>j(e.next()*(n+1-t)+t),as=(e,t,n)=>j(e.next()*(n+1-t)+t),on=(e,t,n)=>as(e,t,n),Ci=e=>es(on(e,97,122)),Ei=(e,t=0,n=20)=>{const s=on(e,t,n);let r="";for(let i=0;i<s;i++)r+=Ci(e);return r},$e=(e,t)=>t[on(e,0,t.length-1)],Di=Symbol("0schema");class Ai{constructor(){this._rerrs=[]}extend(t,n,s,r=null){this._rerrs.push({path:t,expected:n,has:s,message:r})}toString(){const t=[];for(let n=this._rerrs.length-1;n>0;n--){const s=this._rerrs[n];t.push(xr(" ",(this._rerrs.length-n)*2)+`${s.path!=null?`[${s.path}] `:""}${s.has} doesn't match ${s.expected}. ${s.message}`)}return t.join(`
2
- `)}}const Ye=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[$t]?os(e,t):wt(e)?Ze(e,n=>Pe(t,s=>Ye(n,s))):ri(e)?Ht(e,(n,s)=>Ye(n,t[s])):!1;class O{static _dilutes=!1;extends(t){let[n,s]=[this.shape,t.shape];return this.constructor._dilutes&&([s,n]=[n,s]),Ye(n,s)}equals(t){return this.constructor===t.constructor&&ne(this.shape,t.shape)}[Di](){return!0}[$t](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){B()}get nullable(){return It(this,Ee)}get optional(){return new fs(this)}cast(t){return vn(t,this),t}expect(t){return vn(t,this),t}}class ln extends O{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){const s=t?.constructor===this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),s}}const E=(e,t=null)=>new ln(e,t);E(ln);class cn extends O{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape(t);return!s&&n?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),s}}const T=e=>new cn(e);E(cn);class _e extends O{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape.some(r=>r===t);return!s&&n?.extend(null,this.shape.join(" | "),t.toString()),s}}const Se=(...e)=>new _e(e),us=E(_e),Ii=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),ds=e=>{if(_t.check(e))return[Ii(e)];if(us.check(e))return e.shape.map(t=>t+"");if(bs.check(e))return["[+-]?\\d+.?\\d*"];if(Cs.check(e))return[".*"];if(le.check(e))return e.shape.map(ds).flat(1);M()};class Ti extends O{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(ds).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){const s=this._r.exec(t)!=null;return!s&&n?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),s}}E(Ti);const xi=Symbol("optional");class fs extends O{constructor(t){super(),this.shape=t}check(t,n){const s=t===void 0||this.shape.check(t);return!s&&n?.extend(null,"undefined (optional)","()"),s}get[xi](){return!0}}const Oi=E(fs);class Li extends O{check(t,n){return n?.extend(null,"never",typeof t),!1}}E(Li);class be extends O{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}static _dilutes=!0;get partial(){return new be(this.shape,!0)}check(t,n){return t==null?(n?.extend(null,"object","null"),!1):Ht(this.shape,(s,r)=>{const i=this._isPartial&&!sn(t,r)||s.check(t[r],n);return!i&&n?.extend(r.toString(),s.toString(),typeof t[r],"Object property does not match"),i})}}const Ui=e=>new be(e),Ri=E(be),Ni=T(e=>e!=null&&(e.constructor===Object||e.constructor==null));class gs extends O{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&Ht(t,(s,r)=>{const i=this.shape.keys.check(r,n);return!i&&n?.extend(r+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(s,n)})}}const ps=(e,t)=>new gs(e,t),Mi=E(gs);class ws extends O{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&Ht(this.shape,(s,r)=>{const i=s.check(t[r],n);return!i&&n?.extend(r.toString(),"Tuple",typeof s),i})}}const $i=(...e)=>new ws(e);E(ws);class ks extends O{constructor(t){super(),this.shape=t.length===1?t[0]:new hn(t)}check(t,n){const s=wt(t)&&Ze(t,r=>this.shape.check(r));return!s&&n?.extend(null,"Array",""),s}}const ms=(...e)=>new ks(e),vi=E(ks),Vi=T(e=>wt(e));class ys extends O{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){const s=t instanceof this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name),s}}const Fi=(e,t=null)=>new ys(e,t);E(ys);const Bi=Fi(O);class ji extends O{constructor(t){super(),this.len=t.length-1,this.args=$i(...t.slice(-1)),this.res=t[this.len]}check(t,n){const s=t.constructor===Function&&t.length<=this.len;return!s&&n?.extend(null,"function",typeof t),s}}const Ji=E(ji),Gi=T(e=>typeof e=="function");class Hi extends O{constructor(t){super(),this.shape=t}check(t,n){const s=Ze(this.shape,r=>r.check(t,n));return!s&&n?.extend(null,"Intersectinon",typeof t),s}}E(Hi,e=>e.shape.length>0);class hn extends O{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,n){const s=Pe(this.shape,r=>r.check(t,n));return n?.extend(null,"Union",typeof t),s}}const It=(...e)=>e.findIndex(t=>le.check(t))>=0?It(...e.map(t=>vt(t)).map(t=>le.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new hn(e),le=E(hn),_s=()=>!0,ce=T(_s),Yi=E(cn,e=>e.shape===_s),an=T(e=>typeof e=="bigint"),zi=T(e=>e===an),Ss=T(e=>typeof e=="symbol");T(e=>e===Ss);const ut=T(e=>typeof e=="number"),bs=T(e=>e===ut),_t=T(e=>typeof e=="string"),Cs=T(e=>e===_t),Ce=T(e=>typeof e=="boolean"),Ki=T(e=>e===Ce),Es=Se(void 0);E(_e,e=>e.shape.length===1&&e.shape[0]===void 0);Se(void 0);const Ee=Se(null),Xi=E(_e,e=>e.shape.length===1&&e.shape[0]===null);E(Uint8Array);E(ln,e=>e.shape===Uint8Array);const Wi=It(ut,_t,Ee,Es,an,Ce,Ss);(()=>{const e=ms(ce),t=ps(_t,ce),n=It(ut,_t,Ee,Ce,e,t);return e.shape=n,t.shape.values=n,n})();const vt=e=>{if(Bi.check(e))return e;if(Ni.check(e)){const t={};for(const n in e)t[n]=vt(e[n]);return Ui(t)}else{if(Vi.check(e))return It(...e.map(vt));if(Wi.check(e))return Se(e);if(Gi.check(e))return E(e)}M()},vn=pi?()=>{}:(e,t)=>{const n=new Ai;if(!t.check(e,n))throw G(`Expected value to be of type ${t.constructor.name}.
3
- ${n.toString()}`)};class qi{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:vt(t),h:n}),this}else(t){return this.if(ce,t)}done(){return(t,n)=>{for(let s=0;s<this.patterns.length;s++){const r=this.patterns[s];if(r.if.check(t))return r.h(t,n)}throw G("Unhandled pattern")}}}const Zi=e=>new qi(e),Ds=Zi(ce).if(bs,(e,t)=>Me(t,In,re)).if(Cs,(e,t)=>Ei(t)).if(Ki,(e,t)=>$n(t)).if(zi,(e,t)=>BigInt(Me(t,In,re))).if(le,(e,t)=>lt(t,$e(t,e.shape))).if(Ri,(e,t)=>{const n={};for(const s in e.shape){let r=e.shape[s];if(Oi.check(r)){if($n(t))continue;r=r.shape}n[s]=Ds(r,t)}return n}).if(vi,(e,t)=>{const n=[],s=as(t,0,42);for(let r=0;r<s;r++)n.push(lt(t,e.shape));return n}).if(us,(e,t)=>$e(t,e.shape)).if(Xi,(e,t)=>null).if(Ji,(e,t)=>{const n=lt(t,e.res);return()=>n}).if(Yi,(e,t)=>lt(t,$e(t,[ut,_t,Ee,Es,an,Ce,ms(ut),ps(It("a","b","c"),ut)]))).if(Mi,(e,t)=>{const n={},s=Me(t,0,3);for(let r=0;r<s;r++){const i=lt(t,e.shape.keys),o=lt(t,e.shape.values);n[i]=o}return n}).done(),lt=(e,t)=>Ds(vt(t),e),De=typeof document<"u"?document:{};T(e=>e.nodeType===no);typeof DOMParser<"u"&&new DOMParser;T(e=>e.nodeType===Qi);T(e=>e.nodeType===to);const Pi=e=>wr(e,(t,n)=>`${n}:${t};`).join(""),Qi=De.ELEMENT_NODE,to=De.TEXT_NODE,eo=De.DOCUMENT_NODE,no=De.DOCUMENT_FRAGMENT_NODE;T(e=>e.nodeType===eo);const W=Symbol,As=W(),Is=W(),so=W(),ro=W(),io=W(),Ts=W(),oo=W(),un=W(),lo=W(),co=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let s=0;for(;s<e.length;s++){const r=e[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)t.push(r);else if(r.constructor===Object)break}for(s>0&&n.push(t.join(""));s<e.length;s++){const r=e[s];r instanceof Symbol||n.push(r)}return n},ho={[As]:K("font-weight","bold"),[Is]:K("font-weight","normal"),[so]:K("color","blue"),[io]:K("color","green"),[ro]:K("color","grey"),[Ts]:K("color","red"),[oo]:K("color","purple"),[un]:K("color","orange"),[lo]:K("color","black")},ao=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],s=F();let r=[],i=0;for(;i<e.length;i++){const o=e[i],l=ho[o];if(l!==void 0)s.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const c=Pi(s);i>0||c.length>0?(t.push("%c"+o),n.push(c)):t.push(o)}else break}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const o=e[i];o instanceof Symbol||r.push(o)}return r},xs=ki?ao:co,uo=(...e)=>{console.log(...xs(e)),Ls.forEach(t=>t.print(e))},Os=(...e)=>{console.warn(...xs(e)),e.unshift(un),Ls.forEach(t=>t.print(e))},Ls=pt(),Us=e=>({[Symbol.iterator](){return this},next:e}),fo=(e,t)=>Us(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),ve=(e,t)=>Us(()=>{const{done:n,value:s}=e.next();return{done:n,value:n?void 0:t(s)}});class Ae{constructor(t,n){this.clock=t,this.len=n}}class Tt{constructor(){this.clients=new Map}}const St=(e,t,n)=>t.clients.forEach((s,r)=>{const i=e.doc.store.clients.get(r);if(i!=null){const o=i[i.length-1],l=o.id.clock+o.length;for(let c=0,a=s[c];c<s.length&&a.clock<l;a=s[++c])Ks(e,i,a.clock,a.len,n)}}),go=(e,t)=>{let n=0,s=e.length-1;for(;n<=s;){const r=j((n+s)/2),i=e[r],o=i.clock;if(o<=t){if(t<o+i.len)return r;n=r+1}else s=r-1}return null},Yt=(e,t)=>{const n=e.clients.get(t.client);return n!==void 0&&go(n,t.clock)!==null},dn=e=>{e.clients.forEach(t=>{t.sort((r,i)=>r.clock-i.clock);let n,s;for(n=1,s=1;n<t.length;n++){const r=t[s-1],i=t[n];r.clock+r.len>=i.clock?t[s-1]=new Ae(r.clock,it(r.len,i.clock+i.len-r.clock)):(s<n&&(t[s]=i),s++)}t.length=s})},ze=e=>{const t=new Tt;for(let n=0;n<e.length;n++)e[n].clients.forEach((s,r)=>{if(!t.clients.has(r)){const i=s.slice();for(let o=n+1;o<e.length;o++)mr(i,e[o].clients.get(r)||[]);t.clients.set(r,i)}});return dn(t),t},Vt=(e,t,n,s)=>{Q(e.clients,t,()=>[]).push(new Ae(n,s))},po=()=>new Tt,Rs=e=>{const t=po();return e.clients.forEach((n,s)=>{const r=[];for(let i=0;i<n.length;i++){const o=n[i];if(o.deleted){const l=o.id.clock;let c=o.length;if(i+1<n.length)for(let a=n[i+1];i+1<n.length&&a.deleted;a=n[++i+1])c+=a.length;r.push(new Ae(l,c))}}r.length>0&&t.clients.set(s,r)}),t},xt=(e,t)=>{m(e.restEncoder,t.clients.size),P(t.clients.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{e.resetDsCurVal(),m(e.restEncoder,n);const r=s.length;m(e.restEncoder,r);for(let i=0;i<r;i++){const o=s[i];e.writeDsClock(o.clock),e.writeDsLen(o.len)}})},fn=e=>{const t=new Tt,n=k(e.restDecoder);for(let s=0;s<n;s++){e.resetDsCurVal();const r=k(e.restDecoder),i=k(e.restDecoder);if(i>0){const o=Q(t.clients,r,()=>[]);for(let l=0;l<i;l++)o.push(new Ae(e.readDsClock(),e.readDsLen()))}}return t},Vn=(e,t,n)=>{const s=new Tt,r=k(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const o=k(e.restDecoder),l=k(e.restDecoder),c=n.clients.get(o)||[],a=C(n,o);for(let h=0;h<l;h++){const u=e.readDsClock(),d=u+e.readDsLen();if(u<a){a<d&&Vt(s,o,a,d-a);let f=H(c,u),g=c[f];for(!g.deleted&&g.id.clock<u&&(c.splice(f+1,0,we(t,g,u-g.id.clock)),f++);f<c.length&&(g=c[f++],g.id.clock<d);)g.deleted||(d<g.id.clock+g.length&&c.splice(f,0,we(t,g,d-g.id.clock)),g.delete(t))}else Vt(s,o,u,d-u)}}if(s.clients.size>0){const i=new nt;return m(i.restEncoder,0),xt(i,s),i.toUint8Array()}return null},Ns=rs;class Ot extends Pn{constructor({guid:t=Qr(),collectionid:n=null,gc:s=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=Ns(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new Ys,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Nn(a=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});const c=()=>Nn(a=>{const h=u=>{(u===void 0||u===!0)&&(this.off("sync",h),a())};this.on("sync",h)});this.on("sync",a=>{a===!1&&this.isSynced&&(this.whenSynced=c()),this.isSynced=a===void 0||a===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=c()}load(){const t=this._item;t!==null&&!this.shouldLoad&&y(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(P(this.subdocs).map(t=>t.guid))}transact(t,n=null){return y(this,t,n)}get(t,n=I){const s=Q(this.share,t,()=>{const i=new n;return i._integrate(this,null),i}),r=s.constructor;if(n!==I&&r!==n)if(r===I){const i=new n;i._map=s._map,s._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=s._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=s._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return s}getArray(t=""){return this.get(t,gt)}getText(t=""){return this.get(t,Et)}getMap(t=""){return this.get(t,Ct)}getXmlElement(t=""){return this.get(t,Dt)}getXmlFragment(t=""){return this.get(t,st)}toJSON(){const t={};return this.share.forEach((n,s)=>{t[s]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,P(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new Ot({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,y(t.parent.doc,s=>{const r=n.doc;t.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ms{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return k(this.restDecoder)}readDsLen(){return k(this.restDecoder)}}class $s extends Ms{readLeftID(){return p(k(this.restDecoder),k(this.restDecoder))}readRightID(){return p(k(this.restDecoder),k(this.restDecoder))}readClient(){return k(this.restDecoder)}readInfo(){return mt(this.restDecoder)}readString(){return at(this.restDecoder)}readParentInfo(){return k(this.restDecoder)===1}readTypeRef(){return k(this.restDecoder)}readLen(){return k(this.restDecoder)}readAny(){return Mt(this.restDecoder)}readBuf(){return Si(R(this.restDecoder))}readJSON(){return JSON.parse(at(this.restDecoder))}readKey(){return at(this.restDecoder)}}class wo{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=k(this.restDecoder),this.dsCurrVal}readDsLen(){const t=k(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class bt extends wo{constructor(t){super(t),this.keys=[],k(t),this.keyClockDecoder=new Ne(R(t)),this.clientDecoder=new ee(R(t)),this.leftClockDecoder=new Ne(R(t)),this.rightClockDecoder=new Ne(R(t)),this.infoDecoder=new Rn(R(t),mt),this.stringDecoder=new Wr(R(t)),this.parentInfoDecoder=new Rn(R(t),mt),this.typeRefDecoder=new ee(R(t)),this.lenDecoder=new ee(R(t))}readLeftID(){return new dt(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new dt(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Mt(this.restDecoder)}readBuf(){return R(this.restDecoder)}readJSON(){return Mt(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class vs{constructor(){this.restEncoder=Gt()}toUint8Array(){return V(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){m(this.restEncoder,t)}writeDsLen(t){m(this.restEncoder,t)}}class zt extends vs{writeLeftID(t){m(this.restEncoder,t.client),m(this.restEncoder,t.clock)}writeRightID(t){m(this.restEncoder,t.client),m(this.restEncoder,t.clock)}writeClient(t){m(this.restEncoder,t)}writeInfo(t){Je(this.restEncoder,t)}writeString(t){ht(this.restEncoder,t)}writeParentInfo(t){m(this.restEncoder,t?1:0)}writeTypeRef(t){m(this.restEncoder,t)}writeLen(t){m(this.restEncoder,t)}writeAny(t){kt(this.restEncoder,t)}writeBuf(t){U(this.restEncoder,t)}writeJSON(t){ht(this.restEncoder,JSON.stringify(t))}writeKey(t){ht(this.restEncoder,t)}}class Vs{constructor(){this.restEncoder=Gt(),this.dsCurrVal=0}toUint8Array(){return V(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const n=t-this.dsCurrVal;this.dsCurrVal=t,m(this.restEncoder,n)}writeDsLen(t){t===0&&M(),m(this.restEncoder,t-1),this.dsCurrVal+=t}}class nt extends Vs{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Re,this.clientEncoder=new te,this.leftClockEncoder=new Re,this.rightClockEncoder=new Re,this.infoEncoder=new On(Je),this.stringEncoder=new Br,this.parentInfoEncoder=new On(Je),this.typeRefEncoder=new te,this.lenEncoder=new te}toUint8Array(){const t=Gt();return m(t,0),U(t,this.keyClockEncoder.toUint8Array()),U(t,this.clientEncoder.toUint8Array()),U(t,this.leftClockEncoder.toUint8Array()),U(t,this.rightClockEncoder.toUint8Array()),U(t,V(this.infoEncoder)),U(t,this.stringEncoder.toUint8Array()),U(t,V(this.parentInfoEncoder)),U(t,this.typeRefEncoder.toUint8Array()),U(t,this.lenEncoder.toUint8Array()),me(t,V(this.restEncoder)),V(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){kt(this.restEncoder,t)}writeBuf(t){U(this.restEncoder,t)}writeJSON(t){kt(this.restEncoder,t)}writeKey(t){const n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}}const ko=(e,t,n,s)=>{s=it(s,t[0].id.clock);const r=H(t,s);m(e.restEncoder,t.length-r),e.writeClient(n),m(e.restEncoder,s);const i=t[r];i.write(e,s-i.id.clock);for(let o=r+1;o<t.length;o++)t[o].write(e,0)},gn=(e,t,n)=>{const s=new Map;n.forEach((r,i)=>{C(t,i)>r&&s.set(i,r)}),Kt(t).forEach((r,i)=>{n.has(i)||s.set(i,0)}),m(e.restEncoder,s.size),P(s.entries()).sort((r,i)=>i[0]-r[0]).forEach(([r,i])=>{ko(e,t.clients.get(r),r,i)})},mo=(e,t)=>{const n=F(),s=k(e.restDecoder);for(let r=0;r<s;r++){const i=k(e.restDecoder),o=new Array(i),l=e.readClient();let c=k(e.restDecoder);n.set(l,{i:0,refs:o});for(let a=0;a<i;a++){const h=e.readInfo();switch(ke&h){case 0:{const u=e.readLen();o[a]=new $(p(l,c),u),c+=u;break}case 10:{const u=k(e.restDecoder);o[a]=new v(p(l,c),u),c+=u;break}default:{const u=(h&(X|N))===0,d=new _(p(l,c),null,(h&N)===N?e.readLeftID():null,null,(h&X)===X?e.readRightID():null,u?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u&&(h&Rt)===Rt?e.readString():null,fr(e,h));o[a]=d,c+=d.length}}}}return n},yo=(e,t,n)=>{const s=[];let r=P(n.keys()).sort((f,g)=>f-g);if(r.length===0)return null;const i=()=>{if(r.length===0)return null;let f=n.get(r[r.length-1]);for(;f.refs.length===f.i;)if(r.pop(),r.length>0)f=n.get(r[r.length-1]);else return null;return f};let o=i();if(o===null)return null;const l=new Ys,c=new Map,a=(f,g)=>{const w=c.get(f);(w==null||w>g)&&c.set(f,g)};let h=o.refs[o.i++];const u=new Map,d=()=>{for(const f of s){const g=f.id.client,w=n.get(g);w?(w.i--,l.clients.set(g,w.refs.slice(w.i)),n.delete(g),w.i=0,w.refs=[]):l.clients.set(g,[f]),r=r.filter(S=>S!==g)}s.length=0};for(;;){if(h.constructor!==v){const g=Q(u,h.id.client,()=>C(t,h.id.client))-h.id.clock;if(g<0)s.push(h),a(h.id.client,h.id.clock-1),d();else{const w=h.getMissing(e,t);if(w!==null){s.push(h);const S=n.get(w)||{refs:[],i:0};if(S.refs.length===S.i)a(w,C(t,w)),d();else{h=S.refs[S.i++];continue}}else(g===0||g<h.length)&&(h.integrate(e,g),u.set(h.id.client,h.id.clock+h.length))}}if(s.length>0)h=s.pop();else if(o!==null&&o.i<o.refs.length)h=o.refs[o.i++];else{if(o=i(),o===null)break;h=o.refs[o.i++]}}if(l.clients.size>0){const f=new nt;return gn(f,l,new Map),m(f.restEncoder,0),{missing:c,update:f.toUint8Array()}}return null},_o=(e,t)=>gn(e,t.doc.store,t.beforeState),So=(e,t,n,s=new bt(e))=>y(t,r=>{r.local=!1;let i=!1;const o=r.doc,l=o.store,c=mo(s,o),a=yo(r,l,c),h=l.pendingStructs;if(h){for(const[d,f]of h.missing)if(f<C(l,d)){i=!0;break}if(a){for(const[d,f]of a.missing){const g=h.missing.get(d);(g==null||g>f)&&h.missing.set(d,f)}h.update=ae([h.update,a.update])}}else l.pendingStructs=a;const u=Vn(s,r,l);if(l.pendingDs){const d=new bt(At(l.pendingDs));k(d.restDecoder);const f=Vn(d,r,l);u&&f?l.pendingDs=ae([u,f]):l.pendingDs=u||f}else l.pendingDs=u;if(i){const d=l.pendingStructs.update;l.pendingStructs=null,Fs(r.doc,d)}},n,!1),Fs=(e,t,n,s=bt)=>{const r=At(t);So(r,e,n,new s(r))},vl=(e,t,n)=>Fs(e,t,n,$s),bo=(e,t,n=new Map)=>{gn(e,t.store,n),xt(e,Rs(t.store))},Co=(e,t=new Uint8Array([0]),n=new nt)=>{const s=Bs(t);bo(n,e,s);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Jo(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===zt)return Bo(r.map((i,o)=>o===0?i:Ho(i)));if(n.constructor===nt)return ae(r)}return r[0]},Vl=(e,t)=>Co(e,t,new zt),Eo=e=>{const t=new Map,n=k(e.restDecoder);for(let s=0;s<n;s++){const r=k(e.restDecoder),i=k(e.restDecoder);t.set(r,i)}return t},Bs=e=>Eo(new Ms(At(e))),js=(e,t)=>(m(e.restEncoder,t.size),P(t.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{m(e.restEncoder,n),m(e.restEncoder,s)}),e),Do=(e,t)=>js(e,Kt(t.store)),Ao=(e,t=new Vs)=>(e instanceof Map?js(t,e):Do(t,e),t.toUint8Array()),Fl=e=>Ao(e,new vs);class Io{constructor(){this.l=[]}}const Fn=()=>new Io,Bn=(e,t)=>e.l.push(t),jn=(e,t)=>{const n=e.l,s=n.length;e.l=n.filter(r=>t!==r),s===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Js=(e,t,n)=>rn(e.l,[t,n]);class dt{constructor(t,n){this.client=t,this.clock=n}}const ct=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,p=(e,t)=>new dt(e,t),Gs=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw M()},he=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1};class Hs{constructor(t,n,s,r=0){this.type=t,this.tname=n,this.item=s,this.assoc=r}}const Bl=e=>new Hs(e.type==null?null:p(e.type.client,e.type.clock),e.tname??null,e.item==null?null:p(e.item.client,e.item.clock),e.assoc==null?0:e.assoc);class To{constructor(t,n,s=0){this.type=t,this.index=n,this.assoc=s}}const xo=(e,t,n=0)=>new To(e,t,n),qt=(e,t,n)=>{let s=null,r=null;return e._item===null?r=Gs(e):s=p(e._item.id.client,e._item.id.clock),new Hs(s,r,t,n)},jl=(e,t,n=0)=>{let s=e._start;if(n<0){if(t===0)return qt(e,null,n);t--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>t)return qt(e,p(s.id.client,s.id.clock+t),n);t-=s.length}if(s.right===null&&n<0)return qt(e,s.lastId,n);s=s.right}return qt(e,null,n)},Oo=(e,t)=>{const n=ft(e,t),s=t.clock-n.id.clock;return{item:n,diff:s}},Jl=(e,t,n=!0)=>{const s=t.store,r=e.item,i=e.type,o=e.tname,l=e.assoc;let c=null,a=0;if(r!==null){if(C(s,r.client)<=r.clock)return null;const h=n?qe(s,r):Oo(s,r),u=h.item;if(!(u instanceof _))return null;if(c=u.parent,c._item===null||!c._item.deleted){a=u.deleted||!u.countable?0:h.diff+(l>=0?0:1);let d=u.left;for(;d!==null;)!d.deleted&&d.countable&&(a+=d.length),d=d.left}}else{if(o!==null)c=t.get(o);else if(i!==null){if(C(s,i.client)<=i.clock)return null;const{item:h}=n?qe(s,i):{item:ft(s,i)};if(h instanceof _&&h.content instanceof z)c=h.content.type;else return null}else throw M();l>=0?a=c._length:a=0}return xo(c,a,e.assoc)},Gl=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&ct(e.item,t.item)&&ct(e.type,t.type)&&e.assoc===t.assoc;class Lo{constructor(t,n){this.ds=t,this.sv=n}}const Uo=(e,t)=>new Lo(e,t),Hl=e=>Uo(Rs(e.store),Kt(e.store)),tt=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Yt(t.ds,e.id),Ke=(e,t)=>{const n=Q(e.meta,Ke,pt),s=e.doc.store;n.has(t)||(t.sv.forEach((r,i)=>{r<C(s,i)&&L(e,p(i,r))}),St(e,t.ds,r=>{}),n.add(t))};class Ys{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Kt=e=>{const t=new Map;return e.clients.forEach((n,s)=>{const r=n[n.length-1];t.set(s,r.id.clock+r.length)}),t},C=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const s=n[n.length-1];return s.id.clock+s.length},zs=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const s=n[n.length-1];if(s.id.clock+s.length!==t.id.clock)throw M()}n.push(t)},H=(e,t)=>{let n=0,s=e.length-1,r=e[s],i=r.id.clock;if(i===t)return s;let o=j(t/(i+r.length-1)*s);for(;n<=s;){if(r=e[o],i=r.id.clock,i<=t){if(t<i+r.length)return o;n=o+1}else s=o-1;o=j((n+s)/2)}throw M()},Ro=(e,t)=>{const n=e.clients.get(t.client);return n[H(n,t.clock)]},ft=Ro,Xe=(e,t,n)=>{const s=H(t,n),r=t[s];return r.id.clock<n&&r instanceof _?(t.splice(s+1,0,we(e,r,n-r.id.clock)),s+1):s},L=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[Xe(e,n,t.clock)]},Jn=(e,t,n)=>{const s=t.clients.get(n.client),r=H(s,n.clock),i=s[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==$&&s.splice(r+1,0,we(e,i,n.clock-i.id.clock+1)),i},No=(e,t,n)=>{const s=e.clients.get(t.id.client);s[H(s,t.id.clock)]=n},Ks=(e,t,n,s,r)=>{if(s===0)return;const i=n+s;let o=Xe(e,t,n),l;do l=t[o++],i<l.id.clock+l.length&&Xe(e,t,i),r(l);while(o<t.length&&t[o].id.clock<i)};class Mo{constructor(t,n,s){this.doc=t,this.deleteSet=new Tt,this.beforeState=Kt(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const Gn=(e,t)=>t.deleteSet.clients.size===0&&!kr(t.afterState,(n,s)=>t.beforeState.get(s)!==n)?!1:(dn(t.deleteSet),_o(e,t),xt(e,t.deleteSet),!0),Hn=(e,t,n)=>{const s=t._item;(s===null||s.id.clock<(e.beforeState.get(s.id.client)||0)&&!s.deleted)&&Q(e.changed,t,pt).add(n)},se=(e,t)=>{let n=e[t],s=e[t-1],r=t;for(;r>0;n=s,s=e[--r-1]){if(s.deleted===n.deleted&&s.constructor===n.constructor&&s.mergeWith(n)){n instanceof _&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,s);continue}break}const i=t-r;return i&&e.splice(t+1-i,i),i},$o=(e,t,n)=>{for(const[s,r]of e.clients.entries()){const i=t.clients.get(s);for(let o=r.length-1;o>=0;o--){const l=r[o],c=l.clock+l.len;for(let a=H(i,l.clock),h=i[a];a<i.length&&h.id.clock<c;h=i[++a]){const u=i[a];if(l.clock+l.len<=u.id.clock)break;u instanceof _&&u.deleted&&!u.keep&&n(u)&&u.gc(t,!1)}}}},vo=(e,t)=>{e.clients.forEach((n,s)=>{const r=t.clients.get(s);for(let i=n.length-1;i>=0;i--){const o=n[i],l=Qn(r.length-1,1+H(r,o.clock+o.len-1));for(let c=l,a=r[c];c>0&&a.id.clock>=o.clock;a=r[c])c-=1+se(r,c)}})},Xs=(e,t)=>{if(t<e.length){const n=e[t],s=n.doc,r=s.store,i=n.deleteSet,o=n._mergeStructs;try{dn(i),n.afterState=Kt(n.doc.store),s.emit("beforeObserverCalls",[n,s]);const l=[];n.changed.forEach((c,a)=>l.push(()=>{(a._item===null||!a._item.deleted)&&a._callObserver(n,c)})),l.push(()=>{n.changedParentTypes.forEach((c,a)=>{a._dEH.l.length>0&&(a._item===null||!a._item.deleted)&&(c=c.filter(h=>h.target._item===null||!h.target._item.deleted),c.forEach(h=>{h.currentTarget=a,h._path=null}),c.sort((h,u)=>h.path.length-u.path.length),l.push(()=>{Js(a._dEH,c,n)}))}),l.push(()=>s.emit("afterTransaction",[n,s])),l.push(()=>{n._needFormattingCleanup&&rl(n)})}),rn(l,[])}finally{s.gc&&$o(i,r,s.gcFilter),vo(i,r),n.afterState.forEach((h,u)=>{const d=n.beforeState.get(u)||0;if(d!==h){const f=r.clients.get(u),g=it(H(f,d),1);for(let w=f.length-1;w>=g;)w-=1+se(f,w)}});for(let h=o.length-1;h>=0;h--){const{client:u,clock:d}=o[h].id,f=r.clients.get(u),g=H(f,d);g+1<f.length&&se(f,g+1)>1||g>0&&se(f,g)}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)&&(uo(un,As,"[yjs] ",Is,Ts,"Changed the client-id because another client seems to be using it."),s.clientID=Ns()),s.emit("afterTransactionCleanup",[n,s]),s._observers.has("update")){const h=new zt;Gn(h,n)&&s.emit("update",[h.toUint8Array(),n.origin,s,n])}if(s._observers.has("updateV2")){const h=new nt;Gn(h,n)&&s.emit("updateV2",[h.toUint8Array(),n.origin,s,n])}const{subdocsAdded:l,subdocsLoaded:c,subdocsRemoved:a}=n;(l.size>0||a.size>0||c.size>0)&&(l.forEach(h=>{h.clientID=s.clientID,h.collectionid==null&&(h.collectionid=s.collectionid),s.subdocs.add(h)}),a.forEach(h=>s.subdocs.delete(h)),s.emit("subdocs",[{loaded:c,added:l,removed:a},s,n]),a.forEach(h=>h.destroy())),e.length<=t+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,e])):Xs(e,t+1)}}},y=(e,t,n=null,s=!0)=>{const r=e._transactionCleanups;let i=!1,o=null;e._transaction===null&&(i=!0,e._transaction=new Mo(e,n,s),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(i){const l=e._transaction===r[0];e._transaction=null,l&&Xs(r,0)}}return o};class Vo{constructor(t,n){this.insertions=n,this.deletions=t,this.meta=new Map}}const Yn=(e,t,n)=>{St(e,n.deletions,s=>{s instanceof _&&t.scope.some(r=>r===e.doc||he(r,s))&&bn(s,!1)})},zn=(e,t,n)=>{let s=null;const r=e.doc,i=e.scope;y(r,l=>{for(;t.length>0&&e.currStackItem===null;){const c=r.store,a=t.pop(),h=new Set,u=[];let d=!1;St(l,a.insertions,f=>{if(f instanceof _){if(f.redone!==null){let{item:g,diff:w}=qe(c,f.id);w>0&&(g=L(l,p(g.id.client,g.id.clock+w))),f=g}!f.deleted&&i.some(g=>g===l.doc||he(g,f))&&u.push(f)}}),St(l,a.deletions,f=>{f instanceof _&&i.some(g=>g===l.doc||he(g,f))&&!Yt(a.insertions,f.id)&&h.add(f)}),h.forEach(f=>{d=dr(l,f,h,a.insertions,e.ignoreRemoteMapChanges,e)!==null||d});for(let f=u.length-1;f>=0;f--){const g=u[f];e.deleteFilter(g)&&(g.delete(l),d=!0)}e.currStackItem=d?a:null}l.changed.forEach((c,a)=>{c.has(null)&&a._searchMarker&&(a._searchMarker.length=0)}),s=l},e);const o=e.currStackItem;if(o!=null){const l=s.changedParentTypes;e.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:l,origin:e},e]),e.currStackItem=null}return o};class Yl extends Pn{constructor(t,{captureTimeout:n=500,captureTransaction:s=c=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:l=wt(t)?t[0].doc:t instanceof Ot?t:t.doc}={}){super(),this.scope=[],this.doc=l,this.addToScope(t),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=c=>{if(!this.captureTransaction(c)||!this.scope.some(S=>c.changedParentTypes.has(S)||S===this.doc)||!this.trackedOrigins.has(c.origin)&&(!c.origin||!this.trackedOrigins.has(c.origin.constructor)))return;const a=this.undoing,h=this.redoing,u=a?this.redoStack:this.undoStack;a?this.stopCapturing():h||this.clear(!1,!0);const d=new Tt;c.afterState.forEach((S,b)=>{const Cn=c.beforeState.get(b)||0,En=S-Cn;En>0&&Vt(d,b,Cn,En)});const f=ti();let g=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&u.length>0&&!a&&!h){const S=u[u.length-1];S.deletions=ze([S.deletions,c.deleteSet]),S.insertions=ze([S.insertions,d])}else u.push(new Vo(c.deleteSet,d)),g=!0;!a&&!h&&(this.lastChange=f),St(c,c.deleteSet,S=>{S instanceof _&&this.scope.some(b=>b===c.doc||he(b,S))&&bn(S,!0)});const w=[{stackItem:u[u.length-1],origin:c.origin,type:a?"redo":"undo",changedParentTypes:c.changedParentTypes},this];g?this.emit("stack-item-added",w):this.emit("stack-item-updated",w)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const n=new Set(this.scope);t=wt(t)?t:[t],t.forEach(s=>{n.has(s)||(n.add(s),(s instanceof I?s.doc!==this.doc:s!==this.doc)&&Os("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,n=!0){(t&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(s=>{t&&(this.undoStack.forEach(r=>Yn(s,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>Yn(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=zn(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=zn(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*Fo(e){const t=k(e.restDecoder);for(let n=0;n<t;n++){const s=k(e.restDecoder),r=e.readClient();let i=k(e.restDecoder);for(let o=0;o<s;o++){const l=e.readInfo();if(l===10){const c=k(e.restDecoder);yield new v(p(r,i),c),i+=c}else if((ke&l)!==0){const c=(l&(X|N))===0,a=new _(p(r,i),null,(l&N)===N?e.readLeftID():null,null,(l&X)===X?e.readRightID():null,c?e.readParentInfo()?e.readString():e.readLeftID():null,c&&(l&Rt)===Rt?e.readString():null,fr(e,l));yield a,i+=a.length}else{const c=e.readLen();yield new $(p(r,i),c),i+=c}}}}class pn{constructor(t,n){this.gen=Fo(t),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===v);return this.curr}}class wn{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const Bo=e=>ae(e,$s,zt),jo=(e,t)=>{if(e.constructor===$){const{client:n,clock:s}=e.id;return new $(p(n,s+t),e.length-t)}else if(e.constructor===v){const{client:n,clock:s}=e.id;return new v(p(n,s+t),e.length-t)}else{const n=e,{client:s,clock:r}=n.id;return new _(p(s,r+t),null,p(s,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},ae=(e,t=bt,n=nt)=>{if(e.length===1)return e[0];const s=e.map(h=>new t(At(h)));let r=s.map(h=>new pn(h,!0)),i=null;const o=new n,l=new wn(o);for(;r=r.filter(d=>d.curr!==null),r.sort((d,f)=>{if(d.curr.id.client===f.curr.id.client){const g=d.curr.id.clock-f.curr.id.clock;return g===0?d.curr.constructor===f.curr.constructor?0:d.curr.constructor===v?1:-1:g}else return f.curr.id.client-d.curr.id.client}),r.length!==0;){const h=r[0],u=h.curr.id.client;if(i!==null){let d=h.curr,f=!1;for(;d!==null&&d.id.clock+d.length<=i.struct.id.clock+i.struct.length&&d.id.client>=i.struct.id.client;)d=h.next(),f=!0;if(d===null||d.id.client!==u||f&&d.id.clock>i.struct.id.clock+i.struct.length)continue;if(u!==i.struct.id.client)q(l,i.struct,i.offset),i={struct:d,offset:0},h.next();else if(i.struct.id.clock+i.struct.length<d.id.clock)if(i.struct.constructor===v)i.struct.length=d.id.clock+d.length-i.struct.id.clock;else{q(l,i.struct,i.offset);const g=d.id.clock-i.struct.id.clock-i.struct.length;i={struct:new v(p(u,i.struct.id.clock+i.struct.length),g),offset:0}}else{const g=i.struct.id.clock+i.struct.length-d.id.clock;g>0&&(i.struct.constructor===v?i.struct.length-=g:d=jo(d,g)),i.struct.mergeWith(d)||(q(l,i.struct,i.offset),i={struct:d,offset:0},h.next())}}else i={struct:h.curr,offset:0},h.next();for(let d=h.curr;d!==null&&d.id.client===u&&d.id.clock===i.struct.id.clock+i.struct.length&&d.constructor!==v;d=h.next())q(l,i.struct,i.offset),i={struct:d,offset:0}}i!==null&&(q(l,i.struct,i.offset),i=null),kn(l);const c=s.map(h=>fn(h)),a=ze(c);return xt(o,a),o.toUint8Array()},Jo=(e,t,n=bt,s=nt)=>{const r=Bs(t),i=new s,o=new wn(i),l=new n(At(e)),c=new pn(l,!1);for(;c.curr;){const h=c.curr,u=h.id.client,d=r.get(u)||0;if(c.curr.constructor===v){c.next();continue}if(h.id.clock+h.length>d)for(q(o,h,it(d-h.id.clock,0)),c.next();c.curr&&c.curr.id.client===u;)q(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===u&&c.curr.id.clock+c.curr.length<=d;)c.next()}kn(o);const a=fn(l);return xt(i,a),i.toUint8Array()},Ws=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:V(e.encoder.restEncoder)}),e.encoder.restEncoder=Gt(),e.written=0)},q=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Ws(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),m(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},kn=e=>{Ws(e);const t=e.encoder.restEncoder;m(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const s=e.clientStructs[n];m(t,s.written),me(t,s.restEncoder)}},Go=(e,t,n,s)=>{const r=new n(At(e)),i=new pn(r,!1),o=new s,l=new wn(o);for(let a=i.curr;a!==null;a=i.next())q(l,t(a),0);kn(l);const c=fn(r);return xt(o,c),o.toUint8Array()},Ho=e=>Go(e,ui,bt,zt),Kn="You must not compute changes after the event-handler fired.";class Ie{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Yo(this.currentTarget,this.target))}deletes(t){return Yt(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw G(Kn);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const i=n._map.get(r);let o,l;if(this.adds(i)){let c=i.left;for(;c!==null&&this.adds(c);)c=c.left;if(this.deletes(i))if(c!==null&&this.deletes(c))o="delete",l=Oe(c.content.getContent());else return;else c!==null&&this.deletes(c)?(o="update",l=Oe(c.content.getContent())):(o="add",l=void 0)}else if(this.deletes(i))o="delete",l=Oe(i.content.getContent());else return;t.set(r,{action:o,oldValue:l})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw G(Kn);const n=this.target,s=pt(),r=pt(),i=[];if(t={added:s,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const c=()=>{l&&i.push(l)};for(let a=n._start;a!==null;a=a.right)a.deleted?this.deletes(a)&&!this.adds(a)&&((l===null||l.delete===void 0)&&(c(),l={delete:0}),l.delete+=a.length,r.add(a)):this.adds(a)?((l===null||l.insert===void 0)&&(c(),l={insert:[]}),l.insert=l.insert.concat(a.content.getContent()),s.add(a)):((l===null||l.retain===void 0)&&(c(),l={retain:0}),l.retain+=a.length);l!==null&&l.retain===void 0&&c()}this._changes=t}return t}}const Yo=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let s=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;n.unshift(s)}t=t._item.parent}return n},x=()=>{Os("Invalid access: Add Yjs type to a document before reading data.")},qs=80;let mn=0;class zo{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=mn++}}const Ko=e=>{e.timestamp=mn++},Zs=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=mn++},Xo=(e,t,n)=>{if(e.length>=qs){const s=e.reduce((r,i)=>r.timestamp<i.timestamp?r:i);return Zs(s,t,n),s}else{const s=new zo(t,n);return e.push(s),s}},Te=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((i,o)=>Qt(t-i.index)<Qt(t-o.index)?i:o);let s=e._start,r=0;for(n!==null&&(s=n.p,r=n.index,Ko(n));s.right!==null&&r<t;){if(!s.deleted&&s.countable){if(t<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>t;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return n!==null&&Qt(n.index-r)<s.parent.length/qs?(Zs(n,s,r),n):Xo(e._searchMarker,s,r)},Ft=(e,t,n)=>{for(let s=e.length-1;s>=0;s--){const r=e[s];if(n>0){let i=r.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(r.index-=i.length);if(i===null||i.marker===!0){e.splice(s,1);continue}r.p=i,i.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=it(t,r.index+n))}},xe=(e,t,n)=>{const s=e,r=t.changedParentTypes;for(;Q(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;Js(s._eH,n,t)};class I{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Fn(),this._dEH=Fn(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw B()}clone(){throw B()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Bn(this._eH,t)}observeDeep(t){Bn(this._dEH,t)}unobserve(t){jn(this._eH,t)}unobserveDeep(t){jn(this._dEH,t)}toJSON(){}}const Ps=(e,t,n)=>{e.doc??x(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let s=n-t;const r=[];let i=e._start;for(;i!==null&&s>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let l=t;l<o.length&&s>0;l++)r.push(o[l]),s--;t=0}}i=i.right}return r},Qs=e=>{e.doc??x();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const s=n.content.getContent();for(let r=0;r<s.length;r++)t.push(s[r])}n=n.right}return t},zl=(e,t)=>{const n=[];let s=e._start;for(;s!==null;){if(s.countable&&tt(s,t)){const r=s.content.getContent();for(let i=0;i<r.length;i++)n.push(r[i])}s=s.right}return n},Bt=(e,t)=>{let n=0,s=e._start;for(e.doc??x();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let i=0;i<r.length;i++)t(r[i],n++,e)}s=s.right}},tr=(e,t)=>{const n=[];return Bt(e,(s,r)=>{n.push(t(s,r,e))}),n},Wo=e=>{let t=e._start,n=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),s=0,t=t.right}const r=n[s++];return n.length<=s&&(n=null),{done:!1,value:r}}}},er=(e,t)=>{e.doc??x();const n=Te(e,t);let s=e._start;for(n!==null&&(s=n.p,t-=n.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(t<s.length)return s.content.getContent()[t];t-=s.length}},ue=(e,t,n,s)=>{let r=n;const i=e.doc,o=i.clientID,l=i.store,c=n===null?t._start:n.right;let a=[];const h=()=>{a.length>0&&(r=new _(p(o,C(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new rt(a)),r.integrate(e,0),a=[])};s.forEach(u=>{if(u===null)a.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:a.push(u);break;default:switch(h(),u.constructor){case Uint8Array:case ArrayBuffer:r=new _(p(o,C(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new Xt(new Uint8Array(u))),r.integrate(e,0);break;case Ot:r=new _(p(o,C(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new Wt(u)),r.integrate(e,0);break;default:if(u instanceof I)r=new _(p(o,C(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new z(u)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},nr=()=>G("Length exceeded!"),sr=(e,t,n,s)=>{if(n>t._length)throw nr();if(n===0)return t._searchMarker&&Ft(t._searchMarker,n,s.length),ue(e,t,null,s);const r=n,i=Te(t,n);let o=t._start;for(i!==null&&(o=i.p,n-=i.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&L(e,p(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&Ft(t._searchMarker,r,s.length),ue(e,t,o,s)},qo=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return ue(e,t,r,n)},rr=(e,t,n,s)=>{if(s===0)return;const r=n,i=s,o=Te(t,n);let l=t._start;for(o!==null&&(l=o.p,n-=o.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&L(e,p(l.id.client,l.id.clock+n)),n-=l.length);for(;s>0&&l!==null;)l.deleted||(s<l.length&&L(e,p(l.id.client,l.id.clock+s)),l.delete(e),s-=l.length),l=l.right;if(s>0)throw nr();t._searchMarker&&Ft(t._searchMarker,r,-i+s)},de=(e,t,n)=>{const s=t._map.get(n);s!==void 0&&s.delete(e)},yn=(e,t,n,s)=>{const r=t._map.get(n)||null,i=e.doc,o=i.clientID;let l;if(s==null)l=new rt([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new rt([s]);break;case Uint8Array:l=new Xt(s);break;case Ot:l=new Wt(s);break;default:if(s instanceof I)l=new z(s);else throw new Error("Unexpected content type")}new _(p(o,C(i.store,o)),r,r&&r.lastId,null,null,t,n,l).integrate(e,0)},_n=(e,t)=>{e.doc??x();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},ir=e=>{const t={};return e.doc??x(),e._map.forEach((n,s)=>{n.deleted||(t[s]=n.content.getContent()[n.length-1])}),t},or=(e,t)=>{e.doc??x();const n=e._map.get(t);return n!==void 0&&!n.deleted},Zo=(e,t)=>{const n={};return e._map.forEach((s,r)=>{let i=s;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&tt(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},Zt=e=>(e.doc??x(),fo(e._map.entries(),t=>!t[1].deleted));class Po extends Ie{}class gt extends I{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new gt;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new gt}clone(){const t=new gt;return t.insert(0,this.toArray().map(n=>n instanceof I?n.clone():n)),t}get length(){return this.doc??x(),this._length}_callObserver(t,n){super._callObserver(t,n),xe(this,t,new Po(this,t))}insert(t,n){this.doc!==null?y(this.doc,s=>{sr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?y(this.doc,n=>{qo(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?y(this.doc,s=>{rr(s,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return er(this,t)}toArray(){return Qs(this)}slice(t=0,n=this.length){return Ps(this,t,n)}toJSON(){return this.map(t=>t instanceof I?t.toJSON():t)}map(t){return tr(this,t)}forEach(t){Bt(this,t)}[Symbol.iterator](){return Wo(this)}_write(t){t.writeTypeRef(Cl)}}const Qo=e=>new gt;class tl extends Ie{constructor(t,n,s){super(t,n),this.keysChanged=s}}class Ct extends I{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new Ct}clone(){const t=new Ct;return this.forEach((n,s)=>{t.set(s,n instanceof I?n.clone():n)}),t}_callObserver(t,n){xe(this,t,new tl(this,t,n))}toJSON(){this.doc??x();const t={};return this._map.forEach((n,s)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[s]=r instanceof I?r.toJSON():r}}),t}get size(){return[...Zt(this)].length}keys(){return ve(Zt(this),t=>t[0])}values(){return ve(Zt(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return ve(Zt(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??x(),this._map.forEach((n,s)=>{n.deleted||t(n.content.getContent()[n.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?y(this.doc,n=>{de(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?y(this.doc,s=>{yn(s,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return _n(this,t)}has(t){return or(this,t)}clear(){this.doc!==null?y(this.doc,t=>{this.forEach(function(n,s,r){de(t,r,s)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(El)}}const el=e=>new Ct,Z=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&hi(e,t);class We{constructor(t,n,s,r){this.left=t,this.right=n,this.index=s,this.currentAttributes=r}forward(){this.right===null&&M(),this.right.content.constructor===D?this.right.deleted||Lt(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const Xn=(e,t,n)=>{for(;t.right!==null&&n>0;)t.right.content.constructor===D?t.right.deleted||Lt(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&L(e,p(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},Pt=(e,t,n,s)=>{const r=new Map,i=s?Te(t,n):null;if(i){const o=new We(i.p.left,i.p,i.index,r);return Xn(e,o,n-i.index)}else{const o=new We(null,t._start,0,r);return Xn(e,o,n)}},lr=(e,t,n,s)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===D&&Z(s.get(n.right.content.key),n.right.content.value));)n.right.deleted||s.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;s.forEach((o,l)=>{const c=n.left,a=n.right,h=new _(p(i,C(r.store,i)),c,c&&c.lastId,a,a&&a.id,t,null,new D(l,o));h.integrate(e,0),n.right=h,n.forward()})},Lt=(e,t)=>{const{key:n,value:s}=t;s===null?e.delete(n):e.set(n,s)},cr=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===D&&Z(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},hr=(e,t,n,s)=>{const r=e.doc,i=r.clientID,o=new Map;for(const l in s){const c=s[l],a=n.currentAttributes.get(l)??null;if(!Z(a,c)){o.set(l,a);const{left:h,right:u}=n;n.right=new _(p(i,C(r.store,i)),h,h&&h.lastId,u,u&&u.id,t,null,new D(l,c)),n.right.integrate(e,0),n.forward()}}return o},Ve=(e,t,n,s,r)=>{n.currentAttributes.forEach((d,f)=>{r[f]===void 0&&(r[f]=null)});const i=e.doc,o=i.clientID;cr(n,r);const l=hr(e,t,n,r),c=s.constructor===String?new Y(s):s instanceof I?new z(s):new ot(s);let{left:a,right:h,index:u}=n;t._searchMarker&&Ft(t._searchMarker,n.index,c.getLength()),h=new _(p(o,C(i.store,o)),a,a&&a.lastId,h,h&&h.id,t,null,c),h.integrate(e,0),n.right=h,n.index=u,n.forward(),lr(e,t,n,l)},Wn=(e,t,n,s,r)=>{const i=e.doc,o=i.clientID;cr(n,r);const l=hr(e,t,n,r);t:for(;n.right!==null&&(s>0||l.size>0&&(n.right.deleted||n.right.content.constructor===D));){if(!n.right.deleted)switch(n.right.content.constructor){case D:{const{key:c,value:a}=n.right.content,h=r[c];if(h!==void 0){if(Z(h,a))l.delete(c);else{if(s===0)break t;l.set(c,a)}n.right.delete(e)}else n.currentAttributes.set(c,a);break}default:s<n.right.length&&L(e,p(n.right.id.client,n.right.id.clock+s)),s-=n.right.length;break}n.forward()}if(s>0){let c="";for(;s>0;s--)c+=`
4
- `;n.right=new _(p(o,C(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Y(c)),n.right.integrate(e,0),n.forward()}lr(e,t,n,l)},ar=(e,t,n,s,r)=>{let i=t;const o=F();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===D){const a=i.content;o.set(a.key,a)}i=i.right}let l=0,c=!1;for(;t!==i;){if(n===t&&(c=!0),!t.deleted){const a=t.content;if(a.constructor===D){const{key:h,value:u}=a,d=s.get(h)??null;(o.get(h)!==a||d===u)&&(t.delete(e),l++,!c&&(r.get(h)??null)===u&&d!==u&&(d===null?r.delete(h):r.set(h,d))),!c&&!t.deleted&&Lt(r,a)}}t=t.right}return l},nl=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===D){const s=t.content.key;n.has(s)?t.delete(e):n.add(s)}t=t.left}},sl=e=>{let t=0;return y(e.doc,n=>{let s=e._start,r=e._start,i=F();const o=Be(i);for(;r;)r.deleted===!1&&(r.content.constructor===D?Lt(o,r.content):(t+=ar(n,s,r,i,o),i=Be(o),s=r)),r=r.right}),t},rl=e=>{const t=new Set,n=e.doc;for(const[s,r]of e.afterState.entries()){const i=e.beforeState.get(s)||0;r!==i&&Ks(e,n.store.clients.get(s),i,r,o=>{!o.deleted&&o.content.constructor===D&&o.constructor!==$&&t.add(o.parent)})}y(n,s=>{St(e,e.deleteSet,r=>{if(r instanceof $||!r.parent._hasFormatting||t.has(r.parent))return;const i=r.parent;r.content.constructor===D?t.add(i):nl(s,r)});for(const r of t)sl(r)})},qn=(e,t,n)=>{const s=n,r=Be(t.currentAttributes),i=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case z:case ot:case Y:n<t.right.length&&L(e,p(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&ar(e,i,t.right,r,t.currentAttributes);const o=(t.left||t.right).parent;return o._searchMarker&&Ft(o._searchMarker,t.index,-s+n),t};class il extends Ie{constructor(t,n,s){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];y(t,s=>{const r=new Map,i=new Map;let o=this.target._start,l=null;const c={};let a="",h=0,u=0;const d=()=>{if(l!==null){let f=null;switch(l){case"delete":u>0&&(f={delete:u}),u=0;break;case"insert":(typeof a=="object"||a.length>0)&&(f={insert:a},r.size>0&&(f.attributes={},r.forEach((g,w)=>{g!==null&&(f.attributes[w]=g)}))),a="";break;case"retain":h>0&&(f={retain:h},ci(c)||(f.attributes=ii({},c))),h=0;break}f&&n.push(f),l=null}};for(;o!==null;){switch(o.content.constructor){case z:case ot:this.adds(o)?this.deletes(o)||(d(),l="insert",a=o.content.getContent()[0],d()):this.deletes(o)?(l!=="delete"&&(d(),l="delete"),u+=1):o.deleted||(l!=="retain"&&(d(),l="retain"),h+=1);break;case Y:this.adds(o)?this.deletes(o)||(l!=="insert"&&(d(),l="insert"),a+=o.content.str):this.deletes(o)?(l!=="delete"&&(d(),l="delete"),u+=o.length):o.deleted||(l!=="retain"&&(d(),l="retain"),h+=o.length);break;case D:{const{key:f,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const w=r.get(f)??null;Z(w,g)?g!==null&&o.delete(s):(l==="retain"&&d(),Z(g,i.get(f)??null)?delete c[f]:c[f]=g)}}else if(this.deletes(o)){i.set(f,g);const w=r.get(f)??null;Z(w,g)||(l==="retain"&&d(),c[f]=w)}else if(!o.deleted){i.set(f,g);const w=c[f];w!==void 0&&(Z(w,g)?w!==null&&o.delete(s):(l==="retain"&&d(),g===null?delete c[f]:c[f]=g))}o.deleted||(l==="insert"&&d(),Lt(r,o.content));break}}o=o.right}for(d();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Et extends I{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??x(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new Et}clone(){const t=new Et;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const s=new il(this,t,n);xe(this,t,s),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??x();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Y&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?y(this.doc,s=>{const r=new We(null,this._start,0,new Map);for(let i=0;i<t.length;i++){const o=t[i];if(o.insert!==void 0){const l=!n&&typeof o.insert=="string"&&i===t.length-1&&r.right===null&&o.insert.slice(-1)===`
5
- `?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Ve(s,this,r,l,o.attributes||{})}else o.retain!==void 0?Wn(s,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&qn(s,r,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,s){this.doc??x();const r=[],i=new Map,o=this.doc;let l="",c=this._start;function a(){if(l.length>0){const u={};let d=!1;i.forEach((g,w)=>{d=!0,u[w]=g});const f={insert:l};d&&(f.attributes=u),r.push(f),l=""}}const h=()=>{for(;c!==null;){if(tt(c,t)||n!==void 0&&tt(c,n))switch(c.content.constructor){case Y:{const u=i.get("ychange");t!==void 0&&!tt(c,t)?(u===void 0||u.user!==c.id.client||u.type!=="removed")&&(a(),i.set("ychange",s?s("removed",c.id):{type:"removed"})):n!==void 0&&!tt(c,n)?(u===void 0||u.user!==c.id.client||u.type!=="added")&&(a(),i.set("ychange",s?s("added",c.id):{type:"added"})):u!==void 0&&(a(),i.delete("ychange")),l+=c.content.str;break}case z:case ot:{a();const u={insert:c.content.getContent()[0]};if(i.size>0){const d={};u.attributes=d,i.forEach((f,g)=>{d[g]=f})}r.push(u);break}case D:tt(c,t)&&(a(),Lt(i,c.content));break}c=c.right}a()};return t||n?y(o,u=>{t&&Ke(u,t),n&&Ke(u,n),h()},"cleanup"):h(),r}insert(t,n,s){if(n.length<=0)return;const r=this.doc;r!==null?y(r,i=>{const o=Pt(i,this,t,!s);s||(s={},o.currentAttributes.forEach((l,c)=>{s[c]=l})),Ve(i,this,o,n,s)}):this._pending.push(()=>this.insert(t,n,s))}insertEmbed(t,n,s){const r=this.doc;r!==null?y(r,i=>{const o=Pt(i,this,t,!s);Ve(i,this,o,n,s||{})}):this._pending.push(()=>this.insertEmbed(t,n,s||{}))}delete(t,n){if(n===0)return;const s=this.doc;s!==null?y(s,r=>{qn(r,Pt(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,s){if(n===0)return;const r=this.doc;r!==null?y(r,i=>{const o=Pt(i,this,t,!1);o.right!==null&&Wn(i,this,o,n,s)}):this._pending.push(()=>this.format(t,n,s))}removeAttribute(t){this.doc!==null?y(this.doc,n=>{de(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?y(this.doc,s=>{yn(s,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return _n(this,t)}getAttributes(){return ir(this)}_write(t){t.writeTypeRef(Dl)}}const ol=e=>new Et;class Fe{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??x()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===Dt||n.constructor===st)&&n._start!==null)t=n._start;else for(;t!==null;){const s=t.next;if(s!==null){t=s;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class st extends I{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new st}clone(){const t=new st;return t.insert(0,this.toArray().map(n=>n instanceof I?n.clone():n)),t}get length(){return this.doc??x(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new Fe(this,t)}querySelector(t){t=t.toUpperCase();const s=new Fe(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return s.done?null:s.value}querySelectorAll(t){return t=t.toUpperCase(),P(new Fe(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){xe(this,t,new hl(this,n,t))}toString(){return tr(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},s){const r=t.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),Bt(this,i=>{r.insertBefore(i.toDOM(t,n,s),null)}),r}insert(t,n){this.doc!==null?y(this.doc,s=>{sr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)y(this.doc,s=>{const r=t&&t instanceof I?t._item:t;ue(s,this,r,n)});else{const s=this._prelimContent,r=t===null?0:s.findIndex(i=>i===t)+1;if(r===0&&t!==null)throw G("Reference item not found");s.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?y(this.doc,s=>{rr(s,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return Qs(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return er(this,t)}slice(t=0,n=this.length){return Ps(this,t,n)}forEach(t){Bt(this,t)}_write(t){t.writeTypeRef(Il)}}const ll=e=>new st;class Dt extends st{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new Dt(this.nodeName)}clone(){const t=new Dt(this.nodeName),n=this.getAttributes();return li(n,(s,r)=>{t.setAttribute(r,s)}),t.insert(0,this.toArray().map(s=>s instanceof I?s.clone():s)),t}toString(){const t=this.getAttributes(),n=[],s=[];for(const l in t)s.push(l);s.sort();const r=s.length;for(let l=0;l<r;l++){const c=s[l];n.push(c+'="'+t[c]+'"')}const i=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?y(this.doc,n=>{de(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?y(this.doc,s=>{yn(s,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return _n(this,t)}hasAttribute(t){return or(this,t)}getAttributes(t){return t?Zo(this,t):ir(this)}toDOM(t=document,n={},s){const r=t.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const l=i[o];typeof l=="string"&&r.setAttribute(o,l)}return Bt(this,o=>{r.appendChild(o.toDOM(t,n,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(t){t.writeTypeRef(Al),t.writeKey(this.nodeName)}}const cl=e=>new Dt(e.readKey());class hl extends Ie{constructor(t,n,s){super(t,s),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class fe extends Ct{constructor(t){super(),this.hookName=t}_copy(){return new fe(this.hookName)}clone(){const t=new fe(this.hookName);return this.forEach((n,s)=>{t.set(s,n)}),t}toDOM(t=document,n={},s){const r=n[this.hookName];let i;return r!==void 0?i=r.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(i,this),i}_write(t){t.writeTypeRef(Tl),t.writeKey(this.hookName)}}const al=e=>new fe(e.readKey());class ge extends Et{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new ge}clone(){const t=new ge;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,s){const r=t.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const i=[];for(const o in t.attributes[r])i.push({key:o,value:t.attributes[r][o]});i.sort((o,l)=>o.key<l.key?-1:1),n.push({nodeName:r,attrs:i})}n.sort((r,i)=>r.nodeName<i.nodeName?-1:1);let s="";for(let r=0;r<n.length;r++){const i=n[r];s+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){const l=i.attrs[o];s+=` ${l.key}="${l.value}"`}s+=">"}s+=t.insert;for(let r=n.length-1;r>=0;r--)s+=`</${n[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(xl)}}const ul=e=>new ge;class Sn{constructor(t,n){this.id=t,this.length=n}get deleted(){throw B()}mergeWith(t){return!1}write(t,n,s){throw B()}integrate(t,n){throw B()}}const dl=0;class $ extends Sn{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),zs(t.doc.store,this)}write(t,n){t.writeInfo(dl),t.writeLen(this.length-n)}getMissing(t,n){return null}}class Xt{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Xt(this.content)}splice(t){throw B()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const fl=e=>new Xt(e.readBuf());class jt{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new jt(this.len)}splice(t){const n=new jt(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){Vt(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const gl=e=>new jt(e.readLen()),ur=(e,t)=>new Ot({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Wt{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Wt(ur(this.doc.guid,this.opts))}splice(t){throw B()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const pl=e=>new Wt(ur(e.readString(),e.readAny()));class ot{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ot(this.embed)}splice(t){throw B()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const wl=e=>new ot(e.readJSON());class D{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new D(this.key,this.value)}splice(t){throw B()}mergeWith(t){return!1}integrate(t,n){const s=n.parent;s._searchMarker=null,s._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const kl=e=>new D(e.readKey(),e.readJSON());class pe{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new pe(this.arr)}splice(t){const n=new pe(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}const ml=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++){const r=e.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new pe(n)},yl=oe("node_env")==="development";class rt{constructor(t){this.arr=t,yl&&ls(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new rt(this.arr)}splice(t){const n=new rt(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeAny(i)}}getRef(){return 8}}const _l=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++)n.push(e.readAny());return new rt(n)};class Y{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Y(this.str)}splice(t){const n=new Y(this.str.slice(t));this.str=this.str.slice(0,t);const s=this.str.charCodeAt(t-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const Sl=e=>new Y(e.readString()),bl=[Qo,el,ol,cl,ll,al,ul],Cl=0,El=1,Dl=2,Al=3,Il=4,Tl=5,xl=6;class z{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new z(this.type._copy())}splice(t){throw B()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(t.beforeState.get(s.id.client)||0)&&t._mergeStructs.push(s):s.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(t,!0),s=s.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const Ol=e=>new z(bl[e.readTypeRef()](e)),qe=(e,t)=>{let n=t,s=0,r;do s>0&&(n=p(n.client,n.clock+s)),r=ft(e,n),s=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof _);return{item:r,diff:s}},bn=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},we=(e,t,n)=>{const{client:s,clock:r}=t.id,i=new _(p(s,r+n),t,p(s,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=p(t.redone.client,t.redone.clock+n)),t.right=i,i.right!==null&&(i.right.left=i),e._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=n,i},Zn=(e,t)=>Pe(e,n=>Yt(n.deletions,t)),dr=(e,t,n,s,r,i)=>{const o=e.doc,l=o.store,c=o.clientID,a=t.redone;if(a!==null)return L(e,a);let h=t.parent._item,u=null,d;if(h!==null&&h.deleted===!0){if(h.redone===null&&(!n.has(h)||dr(e,h,n,s,r,i)===null))return null;for(;h.redone!==null;)h=L(e,h.redone)}const f=h===null?t.parent:h.content.type;if(t.parentSub===null){for(u=t.left,d=t;u!==null;){let b=u;for(;b!==null&&b.parent._item!==h;)b=b.redone===null?null:L(e,b.redone);if(b!==null&&b.parent._item===h){u=b;break}u=u.left}for(;d!==null;){let b=d;for(;b!==null&&b.parent._item!==h;)b=b.redone===null?null:L(e,b.redone);if(b!==null&&b.parent._item===h){d=b;break}d=d.right}}else if(d=null,t.right&&!r){for(u=t;u!==null&&u.right!==null&&(u.right.redone||Yt(s,u.right.id)||Zn(i.undoStack,u.right.id)||Zn(i.redoStack,u.right.id));)for(u=u.right;u.redone;)u=L(e,u.redone);if(u&&u.right!==null)return null}else u=f._map.get(t.parentSub)||null;const g=C(l,c),w=p(c,g),S=new _(w,u,u&&u.lastId,d,d&&d.id,f,t.parentSub,t.content.copy());return t.redone=w,bn(S,!0),S.integrate(e,0),S};class _ extends Sn{constructor(t,n,s,r,i,o,l,c){super(t,c.getLength()),this.origin=s,this.left=n,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=l,this.redone=null,this.content=c,this.info=this.content.isCountable()?An:0}set marker(t){(this.info&Ue)>0!==t&&(this.info^=Ue)}get marker(){return(this.info&Ue)>0}get keep(){return(this.info&Dn)>0}set keep(t){this.keep!==t&&(this.info^=Dn)}get countable(){return(this.info&An)>0}get deleted(){return(this.info&Le)>0}set deleted(t){this.deleted!==t&&(this.info^=Le)}markDeleted(){this.info|=Le}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=C(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=C(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===dt&&this.id.client!==this.parent.client&&this.parent.clock>=C(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Jn(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=L(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===$||this.right&&this.right.constructor===$)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===_?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===_&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===dt){const s=ft(n,this.parent);s.constructor===$?this.parent=null:this.parent=s.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=Jn(t,t.doc.store,p(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const i=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),i.add(r),ct(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,i.clear();else if(ct(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(ft(t.doc.store,r.origin)))i.has(ft(t.doc.store,r.origin))||(s=r,i.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),zs(t.doc.store,this),this.content.integrate(t,this),Hn(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new $(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:p(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&ct(t.origin,this.lastId)&&this.right===t&&ct(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const n=this.parent._searchMarker;return n&&n.forEach(s=>{s.p===t&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Vt(t.deleteSet,this.id.client,this.id.clock,this.length),Hn(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw M();this.content.gc(t),n?No(t,this,new $(this.id,this.length)):this.content=new jt(this.length)}write(t,n){const s=n>0?p(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&ke|(s===null?0:N)|(r===null?0:X)|(i===null?0:Rt);if(t.writeInfo(o),s!==null&&t.writeLeftID(s),r!==null&&t.writeRightID(r),s===null&&r===null){const l=this.parent;if(l._item!==void 0){const c=l._item;if(c===null){const a=Gs(l);t.writeParentInfo(!0),t.writeString(a)}else t.writeParentInfo(!1),t.writeLeftID(c.id)}else l.constructor===String?(t.writeParentInfo(!0),t.writeString(l)):l.constructor===dt?(t.writeParentInfo(!1),t.writeLeftID(l)):M();i!==null&&t.writeString(i)}this.content.write(t,n)}}const fr=(e,t)=>Ll[t&ke](e),Ll=[()=>{M()},gl,ml,fl,Sl,wl,kl,Ol,_l,pl,()=>{M()}],Ul=10;class v extends Sn{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){M()}write(t,n){t.writeInfo(Ul),m(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},pr="__ $YJS$ __";gr[pr]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");gr[pr]=!0;export{pt as A,N as B,Y as C,Ot as D,po as E,F,jl as G,Gs as H,_ as I,Jl as J,he as K,p as L,Gl as M,Bl as N,z as O,Hs as R,Lo as S,Yl as U,Dt as Y,Vl as a,vl as b,Rl as c,$l as d,Fl as e,De as f,it as g,Fs as h,fi as i,H as j,St as k,zl as l,Qn as m,Uo as n,Yt as o,B as p,ge as q,Et as r,Hl as s,Ml as t,M as u,oi as v,Ht as w,Nl as x,D as y,Q as z};
6
- //# sourceMappingURL=yjs-VtUl3AlT.js.map