zt-react-milkdown 0.1.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 (174) hide show
  1. package/README.md +149 -0
  2. package/dist/commands-CDrea4WB.cjs +1 -0
  3. package/dist/commands-DoqeX5uJ.js +36 -0
  4. package/dist/debounce-Bqj_3iJs.cjs +1 -0
  5. package/dist/debounce-Cuk3VGPr.js +118 -0
  6. package/dist/dist-BCCSKc3M.cjs +5 -0
  7. package/dist/dist-C0PSMrs7.cjs +37 -0
  8. package/dist/dist-CPVooDwj.cjs +2 -0
  9. package/dist/dist-CxZn1qUo.js +1584 -0
  10. package/dist/dist-Cxaq2crg.js +409 -0
  11. package/dist/dist-DaM7GJv6.js +3499 -0
  12. package/dist/dist-Dhukmh4L.js +7562 -0
  13. package/dist/dist-mOpTMw1E.cjs +1 -0
  14. package/dist/floating-ui.dom-CKbcbmJV.js +883 -0
  15. package/dist/floating-ui.dom-VaZZ2gzS.cjs +1 -0
  16. package/dist/index.browser-5LtNN9G9.cjs +1 -0
  17. package/dist/index.browser-D2DmEB8o.js +26 -0
  18. package/dist/index.cjs +393 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.mjs +43325 -0
  21. package/dist/lib-38nxOnTd.cjs +4 -0
  22. package/dist/lib-8Tr6mAln.cjs +1 -0
  23. package/dist/lib-B0rHJ9lJ.js +28 -0
  24. package/dist/lib-BJgvZywM.cjs +3 -0
  25. package/dist/lib-BNOSyYeU.cjs +3 -0
  26. package/dist/lib-C5AzmhNY.cjs +5 -0
  27. package/dist/lib-C8xOD1Bp.cjs +1 -0
  28. package/dist/lib-CCUU16r8.js +1081 -0
  29. package/dist/lib-CK9MEMX-.js +73 -0
  30. package/dist/lib-D4HMdvmK.cjs +1 -0
  31. package/dist/lib-DWZA8C0h.cjs +1 -0
  32. package/dist/lib-Dbe-cVjv.js +367 -0
  33. package/dist/lib-DkE7Uq2b.js +1886 -0
  34. package/dist/lib-DzK_kn7a.js +21 -0
  35. package/dist/lib-IahjxPWM.cjs +3 -0
  36. package/dist/lib-m8lKZKxK.js +80 -0
  37. package/dist/lib-r5eNG0sa.js +754 -0
  38. package/dist/lib-wmHesNI0.js +2223 -0
  39. package/dist/rolldown-runtime-CerMd-t8.cjs +1 -0
  40. package/dist/rolldown-runtime-DnwLefa7.js +23 -0
  41. package/dist/schema-list-DSdBEAWW.js +171 -0
  42. package/dist/schema-list-bL8FNes5.cjs +1 -0
  43. package/dist/src/components/ui/button.d.ts +16 -0
  44. package/dist/src/components/ui/button.d.ts.map +1 -0
  45. package/dist/src/components/ui/dialog.d.ts +36 -0
  46. package/dist/src/components/ui/dialog.d.ts.map +1 -0
  47. package/dist/src/components/ui/popover.d.ts +14 -0
  48. package/dist/src/components/ui/popover.d.ts.map +1 -0
  49. package/dist/src/core/commands.d.ts +7 -0
  50. package/dist/src/core/commands.d.ts.map +1 -0
  51. package/dist/src/core/createEditor.d.ts +6 -0
  52. package/dist/src/core/createEditor.d.ts.map +1 -0
  53. package/dist/src/core/schema.d.ts +8 -0
  54. package/dist/src/core/schema.d.ts.map +1 -0
  55. package/dist/src/index.d.ts +4 -0
  56. package/dist/src/index.d.ts.map +1 -0
  57. package/dist/src/lib/editor-overlay-position.d.ts +83 -0
  58. package/dist/src/lib/editor-overlay-position.d.ts.map +1 -0
  59. package/dist/src/lib/global-scroll-listener.d.ts +9 -0
  60. package/dist/src/lib/global-scroll-listener.d.ts.map +1 -0
  61. package/dist/src/lib/utils.d.ts +6 -0
  62. package/dist/src/lib/utils.d.ts.map +1 -0
  63. package/dist/src/local/en-US.d.ts +6 -0
  64. package/dist/src/local/en-US.d.ts.map +1 -0
  65. package/dist/src/local/i18n.d.ts +10 -0
  66. package/dist/src/local/i18n.d.ts.map +1 -0
  67. package/dist/src/local/zh-CN.d.ts +6 -0
  68. package/dist/src/local/zh-CN.d.ts.map +1 -0
  69. package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts +5 -0
  70. package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts.map +1 -0
  71. package/dist/src/plugins/custom/blockquote/index.d.ts +3 -0
  72. package/dist/src/plugins/custom/blockquote/index.d.ts.map +1 -0
  73. package/dist/src/plugins/custom/code-block/code-block-editable.d.ts +7 -0
  74. package/dist/src/plugins/custom/code-block/code-block-editable.d.ts.map +1 -0
  75. package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts +7 -0
  76. package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -0
  77. package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts +5 -0
  78. package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts.map +1 -0
  79. package/dist/src/plugins/custom/code-block/code-block-prism.d.ts +5 -0
  80. package/dist/src/plugins/custom/code-block/code-block-prism.d.ts.map +1 -0
  81. package/dist/src/plugins/custom/code-block/index.d.ts +9 -0
  82. package/dist/src/plugins/custom/code-block/index.d.ts.map +1 -0
  83. package/dist/src/plugins/custom/cursor/drop-cursor.d.ts +5 -0
  84. package/dist/src/plugins/custom/cursor/drop-cursor.d.ts.map +1 -0
  85. package/dist/src/plugins/custom/cursor/gap-cursor.d.ts +5 -0
  86. package/dist/src/plugins/custom/cursor/gap-cursor.d.ts.map +1 -0
  87. package/dist/src/plugins/custom/cursor/index.d.ts +5 -0
  88. package/dist/src/plugins/custom/cursor/index.d.ts.map +1 -0
  89. package/dist/src/plugins/custom/image/image-editable.d.ts +7 -0
  90. package/dist/src/plugins/custom/image/image-editable.d.ts.map +1 -0
  91. package/dist/src/plugins/custom/image/image-resizable-schema.d.ts +41 -0
  92. package/dist/src/plugins/custom/image/image-resizable-schema.d.ts.map +1 -0
  93. package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts +31 -0
  94. package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts.map +1 -0
  95. package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts +20 -0
  96. package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -0
  97. package/dist/src/plugins/custom/image/index.d.ts +7 -0
  98. package/dist/src/plugins/custom/image/index.d.ts.map +1 -0
  99. package/dist/src/plugins/custom/indent/index.d.ts +3 -0
  100. package/dist/src/plugins/custom/indent/index.d.ts.map +1 -0
  101. package/dist/src/plugins/custom/indent/tab-space-indent.d.ts +5 -0
  102. package/dist/src/plugins/custom/indent/tab-space-indent.d.ts.map +1 -0
  103. package/dist/src/plugins/custom/list/index.d.ts +3 -0
  104. package/dist/src/plugins/custom/list/index.d.ts.map +1 -0
  105. package/dist/src/plugins/custom/list/task-list-toggle.d.ts +5 -0
  106. package/dist/src/plugins/custom/list/task-list-toggle.d.ts.map +1 -0
  107. package/dist/src/plugins/custom/math/index.d.ts +7 -0
  108. package/dist/src/plugins/custom/math/index.d.ts.map +1 -0
  109. package/dist/src/plugins/custom/math/math-backspace-entry.d.ts +5 -0
  110. package/dist/src/plugins/custom/math/math-backspace-entry.d.ts.map +1 -0
  111. package/dist/src/plugins/custom/math/math-block-editable.d.ts +7 -0
  112. package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -0
  113. package/dist/src/plugins/custom/math/math-plugin.d.ts +47 -0
  114. package/dist/src/plugins/custom/math/math-plugin.d.ts.map +1 -0
  115. package/dist/src/plugins/custom/selection-tooltip/constants.d.ts +7 -0
  116. package/dist/src/plugins/custom/selection-tooltip/constants.d.ts.map +1 -0
  117. package/dist/src/plugins/custom/selection-tooltip/index.d.ts +7 -0
  118. package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -0
  119. package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts +25 -0
  120. package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts.map +1 -0
  121. package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +21 -0
  122. package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -0
  123. package/dist/src/plugins/custom/selection-tooltip/types.d.ts +58 -0
  124. package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -0
  125. package/dist/src/plugins/custom/slash-menu/index.d.ts +9 -0
  126. package/dist/src/plugins/custom/slash-menu/index.d.ts.map +1 -0
  127. package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts +6 -0
  128. package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -0
  129. package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts +23 -0
  130. package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts.map +1 -0
  131. package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts +50 -0
  132. package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts.map +1 -0
  133. package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +15 -0
  134. package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -0
  135. package/dist/src/plugins/custom/table/index.d.ts +13 -0
  136. package/dist/src/plugins/custom/table/index.d.ts.map +1 -0
  137. package/dist/src/plugins/custom/table/table-arrow-entry.d.ts +5 -0
  138. package/dist/src/plugins/custom/table/table-arrow-entry.d.ts.map +1 -0
  139. package/dist/src/plugins/custom/table/table-deletion-actions.d.ts +10 -0
  140. package/dist/src/plugins/custom/table/table-deletion-actions.d.ts.map +1 -0
  141. package/dist/src/plugins/custom/table/table-focus-actions.d.ts +7 -0
  142. package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -0
  143. package/dist/src/plugins/custom/table/table-more-actions.d.ts +37 -0
  144. package/dist/src/plugins/custom/table/table-more-actions.d.ts.map +1 -0
  145. package/dist/src/plugins/custom/table/table-row-insertion.d.ts +35 -0
  146. package/dist/src/plugins/custom/table/table-row-insertion.d.ts.map +1 -0
  147. package/dist/src/plugins/custom/table/table-selection.d.ts +30 -0
  148. package/dist/src/plugins/custom/table/table-selection.d.ts.map +1 -0
  149. package/dist/src/plugins/preset-common.d.ts +56 -0
  150. package/dist/src/plugins/preset-common.d.ts.map +1 -0
  151. package/dist/src/react/components/MilkdownEditor.d.ts +7 -0
  152. package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -0
  153. package/dist/src/react/components/index.d.ts +2 -0
  154. package/dist/src/react/components/index.d.ts.map +1 -0
  155. package/dist/src/react/context/EditorContext.d.ts +16 -0
  156. package/dist/src/react/context/EditorContext.d.ts.map +1 -0
  157. package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts +5 -0
  158. package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts.map +1 -0
  159. package/dist/src/react/hooks/useControlledState.d.ts +9 -0
  160. package/dist/src/react/hooks/useControlledState.d.ts.map +1 -0
  161. package/dist/src/react/hooks/useMilkdownEditor.d.ts +35 -0
  162. package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -0
  163. package/dist/src/types/editor.d.ts +233 -0
  164. package/dist/src/types/editor.d.ts.map +1 -0
  165. package/dist/src/types/plugin.d.ts +10 -0
  166. package/dist/src/types/plugin.d.ts.map +1 -0
  167. package/dist/src/utils/guard.d.ts +5 -0
  168. package/dist/src/utils/guard.d.ts.map +1 -0
  169. package/dist/src/utils/markdown.d.ts +9 -0
  170. package/dist/src/utils/markdown.d.ts.map +1 -0
  171. package/dist/state-CHAiIqOA.cjs +1 -0
  172. package/dist/state-DNxqltZl.js +16 -0
  173. package/dist/style.css +3 -0
  174. package/package.json +89 -0
@@ -0,0 +1,37 @@
1
+ const e=require(`./rolldown-runtime-CerMd-t8.cjs`),t=require(`./dist-BCCSKc3M.cjs`);var n={};function r(e,t){let r=t||n;return i(e,typeof r.includeImageAlt==`boolean`?r.includeImageAlt:!0,typeof r.includeHtml==`boolean`?r.includeHtml:!0)}function i(e,t,n){if(o(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return a(e.children,t,n)}return Array.isArray(e)?a(e,t,n):``}function a(e,t,n){let r=[],a=-1;for(;++a<e.length;)r[a]=i(e[a],t,n);return r.join(``)}function o(e){return!!(e&&typeof e==`object`)}var s=document.createElement(`i`);function c(e){let t=`&`+e+`;`;s.innerHTML=t;let n=s.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function l(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function u(e,t){return e.length>0?(l(e,e.length,0,t),e):t}var d={}.hasOwnProperty;function f(e){let t={},n=-1;for(;++n<e.length;)p(t,e[n]);return t}function p(e,t){let n;for(n in t){let r=(d.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){d.call(r,a)||(r[a]=[]);let e=i[a];m(r[a],Array.isArray(e)?e:e?[e]:[])}}}function m(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);l(e,0,0,r)}function h(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function g(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var _=D(/[A-Za-z]/),v=D(/[\dA-Za-z]/),y=D(/[#-'*+\--9=?A-Z^-~]/);function b(e){return e!==null&&(e<32||e===127)}var x=D(/\d/),S=D(/[\dA-Fa-f]/),C=D(/[!-/:-@[-`{-~]/);function w(e){return e!==null&&e<-2}function T(e){return e!==null&&(e<0||e===32)}function E(e){return e===-2||e===-1||e===32}var ee=D(/\p{P}|\p{S}/u),te=D(/\s/);function D(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function O(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return E(r)?(e.enter(n),s(r)):t(r)}function s(r){return E(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var k={tokenize:ne};function ne(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),O(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return w(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var A={tokenize:re},j={tokenize:ie};function re(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,u)(i)}return u(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}v(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return l(t.events,a+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(a){if(r===n.length){if(!i)return p(a);if(i.currentConstruct&&i.currentConstruct.concrete)return h(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j,d,f)(a)}function d(e){return i&&y(),v(r),p(e)}function f(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(j,m,h)(n)}function m(e){return r++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){if(n===null){i&&y(),v(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),g(n)}function g(n){if(n===null){_(e.exit(`chunkFlow`),!0),v(0),e.consume(n);return}return w(n)?(e.consume(n),_(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),g)}function _(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(v(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;l(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ie(e,t,n){return O(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function ae(e){if(e===null||T(e)||te(e))return 1;if(ee(e))return 2}function M(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var N={name:`attention`,resolveAll:oe,tokenize:P};function oe(e,t){let n=-1,r,i,a,o,s,c,d,f;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let p={...e[r][1].end},m={...e[n][1].start};se(p,-c),se(m,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:p,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:m},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=u(d,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),d=u(d,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),d=u(d,M(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=u(d,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=u(d,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):f=0,l(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function P(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ae(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ae(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function se(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ce={name:`autolink`,tokenize:le};function le(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return _(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||v(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||v(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||b(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):y(t)?(e.consume(t),l):n(t)}function u(e){return v(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||v(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ue={partial:!0,tokenize:de};function de(e,t,n){return r;function r(t){return E(t)?O(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||w(e)?t(e):n(e)}}var fe={continuation:{tokenize:me},exit:he,name:`blockQuote`,tokenize:pe};function pe(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return E(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function me(e,t,n){let r=this;return i;function i(t){return E(t)?O(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fe,t,n)(r)}}function he(e){e.exit(`blockQuote`)}var ge={name:`characterEscape`,tokenize:_e};function _e(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return C(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ve={name:`characterReference`,tokenize:ye};function ye(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),l}function l(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),u):(e.enter(`characterReferenceValue`),a=31,o=v,d(t))}function u(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=S,d):(e.enter(`characterReferenceValue`),a=7,o=x,d(t))}function d(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===v&&!c(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),d):n(s)}}var be={partial:!0,tokenize:Ce},xe={concrete:!0,name:`codeFenced`,tokenize:Se};function Se(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),E(t)?O(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||w(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(be,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||w(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):E(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),O(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||w(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||w(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&E(t)?O(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||w(t)?e.check(be,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||w(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),E(t)?O(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),E(t)?O(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||w(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ce(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var we={name:`codeIndented`,tokenize:Ee},Te={partial:!0,tokenize:De};function Ee(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),O(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):w(t)?e.attempt(Te,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||w(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function De(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):w(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):O(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):w(e)?i(e):n(e)}}var Oe={name:`codeText`,previous:Ae,resolve:ke,tokenize:je};function ke(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ae(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function je(e,t,n){this;let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):w(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||w(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Me=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ne(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ne(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ne(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Ne(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ne(this.left,t.reverse())}}};function Ne(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Pe(e){let t={},n=-1,r,i,a,o,s,c,u,d=new Me(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type===`chunkFlow`&&d.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fe(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=d.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(d.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...d.get(i)[1].start},s=d.slice(i,n),s.unshift(r),d.splice(i,n-i+1,s))}}return l(e,0,1/0,d.slice(0)),!u}function Fe(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ie={resolve:Re,tokenize:ze},Le={partial:!0,tokenize:Be};function Re(e){return Pe(e),e}function ze(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):w(t)?e.check(Le,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Be(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),O(e,a,`linePrefix`)}function a(i){if(i===null||w(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ve(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||b(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||w(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||T(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||b(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function He(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):w(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||w(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!E(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ue(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):w(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),O(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||w(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function We(e,t){let n;return r;function r(i){return w(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):E(i)?O(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ge={name:`definition`,tokenize:qe},Ke={partial:!0,tokenize:Je};function qe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return He.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=g(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return T(t)?We(e,l)(t):l(t)}function l(t){return Ve(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ke,d,d)(t)}function d(t){return E(t)?O(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||w(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Je(e,t,n){return r;function r(t){return T(t)?We(e,i)(t):n(t)}function i(t){return Ue(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return E(t)?O(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||w(e)?t(e):n(e)}}var Ye={name:`hardBreakEscape`,tokenize:Xe};function Xe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return w(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ze={name:`headingAtx`,resolve:Qe,tokenize:$e};function Qe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},l(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function $e(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||T(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||w(n)?(e.exit(`atxHeading`),t(n)):E(n)?O(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||T(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var et=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),tt=[`pre`,`script`,`style`,`textarea`],nt={concrete:!0,name:`htmlFlow`,resolveTo:at,tokenize:ot},rt={partial:!0,tokenize:ct},it={partial:!0,tokenize:st};function at(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ot(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):_(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):_(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:A:m):n(i)}function h(t){return _(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||T(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&tt.includes(l)?(i=1,r.interrupt?t(s):A(s)):et.includes(o.toLowerCase())?(i=6,c?(e.consume(s),y):r.interrupt?t(s):A(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?b(s):x(s))}return s===45||v(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function y(i){return i===62?(e.consume(i),r.interrupt?t:A):n(i)}function b(t){return E(t)?(e.consume(t),b):k(t)}function x(t){return t===47?(e.consume(t),k):t===58||t===95||_(t)?(e.consume(t),S):E(t)?(e.consume(t),x):k(t)}function S(t){return t===45||t===46||t===58||t===95||v(t)?(e.consume(t),S):C(t)}function C(t){return t===61?(e.consume(t),ee):E(t)?(e.consume(t),C):x(t)}function ee(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,te):E(t)?(e.consume(t),ee):D(t)}function te(t){return t===c?(e.consume(t),c=null,O):t===null||w(t)?n(t):(e.consume(t),te)}function D(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||T(t)?C(t):(e.consume(t),D)}function O(e){return e===47||e===62||E(e)?x(e):n(e)}function k(t){return t===62?(e.consume(t),ne):n(t)}function ne(t){return t===null||w(t)?A(t):E(t)?(e.consume(t),ne):n(t)}function A(t){return t===45&&i===2?(e.consume(t),ae):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),oe):w(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(rt,ce,j)(t)):t===null||w(t)?(e.exit(`htmlFlowData`),j(t)):(e.consume(t),A)}function j(t){return e.check(it,re,ce)(t)}function re(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return t===null||w(t)?j(t):(e.enter(`htmlFlowData`),A(t))}function ae(t){return t===45?(e.consume(t),P):A(t)}function M(t){return t===47?(e.consume(t),o=``,N):A(t)}function N(t){if(t===62){let n=o.toLowerCase();return tt.includes(n)?(e.consume(t),se):A(t)}return _(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):A(t)}function oe(t){return t===93?(e.consume(t),P):A(t)}function P(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),P):A(t)}function se(t){return t===null||w(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function st(e,t,n){let r=this;return i;function i(t){return w(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ct(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ue,t,n)}}var lt={name:`htmlText`,tokenize:ut};function ut(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),C):t===63?(e.consume(t),x):_(t)?(e.consume(t),D):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):_(t)?(e.consume(t),b):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):w(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):w(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),y):h(t)}function y(t){return t===62?M(t):t===93?(e.consume(t),y):h(t)}function b(t){return t===null||t===62?M(t):w(t)?(o=b,N(t)):(e.consume(t),b)}function x(t){return t===null?n(t):t===63?(e.consume(t),S):w(t)?(o=x,N(t)):(e.consume(t),x)}function S(e){return e===62?M(e):x(e)}function C(t){return _(t)?(e.consume(t),ee):n(t)}function ee(t){return t===45||v(t)?(e.consume(t),ee):te(t)}function te(t){return w(t)?(o=te,N(t)):E(t)?(e.consume(t),te):M(t)}function D(t){return t===45||v(t)?(e.consume(t),D):t===47||t===62||T(t)?k(t):n(t)}function k(t){return t===47?(e.consume(t),M):t===58||t===95||_(t)?(e.consume(t),ne):w(t)?(o=k,N(t)):E(t)?(e.consume(t),k):M(t)}function ne(t){return t===45||t===46||t===58||t===95||v(t)?(e.consume(t),ne):A(t)}function A(t){return t===61?(e.consume(t),j):w(t)?(o=A,N(t)):E(t)?(e.consume(t),A):k(t)}function j(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,re):w(t)?(o=j,N(t)):E(t)?(e.consume(t),j):(e.consume(t),ie)}function re(t){return t===i?(e.consume(t),i=void 0,ae):t===null?n(t):w(t)?(o=re,N(t)):(e.consume(t),re)}function ie(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||T(t)?k(t):(e.consume(t),ie)}function ae(e){return e===47||e===62||T(e)?k(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return E(t)?O(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var dt={name:`labelEnd`,resolveAll:ht,resolveTo:gt,tokenize:_t},ft={tokenize:vt},pt={tokenize:yt},mt={tokenize:bt};function ht(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&l(e,0,e.length,n),e}function gt(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},f={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,d,t]],s=u(s,e.slice(a+1,a+r+3)),s=u(s,[[`enter`,f,t]]),s=u(s,M(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=u(s,[[`exit`,f,t],e[o-2],e[o-1],[`exit`,d,t]]),s=u(s,e.slice(o+1)),s=u(s,[[`exit`,c,t]]),l(e,a,e.length,s),e}function _t(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(g(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ft,u,o?u:d)(t):t===91?e.attempt(pt,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(mt,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function vt(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return T(t)?We(e,a)(t):a(t)}function a(t){return t===41?u(t):Ve(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return T(t)?We(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ue(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return T(t)?We(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function yt(e,t,n){let r=this;return i;function i(t){return He.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(g(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function bt(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var xt={name:`labelStartImage`,resolveAll:dt.resolveAll,tokenize:St};function St(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ct={name:`labelStartLink`,resolveAll:dt.resolveAll,tokenize:wt};function wt(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Tt={name:`lineEnding`,tokenize:Et};function Et(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),O(e,t,`linePrefix`)}}var Dt={name:`thematicBreak`,tokenize:Ot};function Ot(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||w(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),E(t)?O(e,s,`whitespace`)(t):s(t))}}var F={continuation:{tokenize:Mt},exit:Pt,name:`list`,tokenize:jt},kt={partial:!0,tokenize:Ft},At={partial:!0,tokenize:Nt};function jt(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:x(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Dt,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return x(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ue,r.interrupt?n:u,e.attempt(kt,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return E(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Mt(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ue,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!E(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(At,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(F,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Nt(e,t,n){let r=this;return O(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Pt(e){e.exit(this.containerState.type)}function Ft(e,t,n){let r=this;return O(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!E(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var It={name:`setextUnderline`,resolveTo:Lt,tokenize:Rt};function Lt(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Rt(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),E(t)?O(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||w(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var zt={tokenize:Bt};function Bt(e){let t=this,n=e.attempt(ue,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ie,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Vt={resolveAll:Gt()},Ht=Wt(`string`),Ut=Wt(`text`);function Wt(e){return{resolveAll:Gt(e===`text`?Kt:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Gt(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Kt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var qt=e.n({attentionMarkers:()=>tn,contentInitial:()=>Yt,disable:()=>nn,document:()=>Jt,flow:()=>Zt,flowInitial:()=>Xt,insideSpan:()=>en,string:()=>Qt,text:()=>$t}),Jt={42:F,43:F,45:F,48:F,49:F,50:F,51:F,52:F,53:F,54:F,55:F,56:F,57:F,62:fe},Yt={91:Ge},Xt={[-2]:we,[-1]:we,32:we},Zt={35:Ze,42:Dt,45:[It,Dt],60:nt,61:It,95:Dt,96:xe,126:xe},Qt={38:ve,92:ge},$t={[-5]:Tt,[-4]:Tt,[-3]:Tt,33:xt,38:ve,42:N,60:[ce,lt],91:Ct,92:[Ye,ge],93:dt,95:N,96:Oe},en={null:[N,Vt]},tn={null:[42,95]},nn={null:[]};function rn(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:E(C),check:E(T),consume:b,enter:x,exit:S,interrupt:E(T,{interrupt:!0})},d={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:h,write:p},f=t.tokenize.call(d,c);return t.resolveAll&&a.push(t),d;function p(e){return o=u(o,e),v(),o[o.length-1]===null?(ee(t,0),d.events=M(a,d.events,d),d.events):[]}function m(e,t){return on(h(e),t)}function h(e){return an(o,e)}function g(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function _(e){i[e.line]=e.column,D()}function v(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)y(t.charCodeAt(r._bufferIndex));else y(t)}}function y(e){f=f(e)}function b(e){w(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,D()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=e}function x(e,t){let n=t||{};return n.type=e,n.start=g(),d.events.push([`enter`,n,d]),s.push(n),n}function S(e){let t=s.pop();return t.end=g(),d.events.push([`exit`,t,d]),t}function C(e,t){ee(e,t.from)}function T(e,t){t.restore()}function E(e,t){return n;function n(n,r,i){let a,o,s,l;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):u(n);function u(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return l=te(),s=e,e.partial||(d.currentConstruct=e),e.name&&d.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(d),t):d,c,m,h)(n)}}function m(t){return e(s,l),r}function h(e){return l.restore(),++o<a.length?p(a[o]):i}}}function ee(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&l(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function te(){let e=g(),t=d.previous,n=d.currentConstruct,i=d.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,d.previous=t,d.currentConstruct=n,d.events.length=i,s=a,D()}}function D(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function an(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function on(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
2
+ `;break;case-3:o=`\r
3
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function sn(e){let t={constructs:f([qt,...(e||{}).extensions||[]]),content:n(k),defined:[],document:n(A),flow:n(zt),lazy:{},string:n(Ht),text:n(Ut)};return t;function n(e){return n;function n(n){return rn(t,e,n)}}}function cn(e){for(;!Pe(e););return e}var ln=/[\0\t\n\r]/g;function un(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(ln.lastIndex=u,c=ln.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var dn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fn(e){return e.replace(dn,pn)}function pn(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return h(n.slice(t?2:1),t?16:10)}return c(n)||e}function mn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?gn(e.position):`start`in e||`end`in e?gn(e):`line`in e||`column`in e?hn(e):``}function hn(e){return _n(e&&e.line)+`:`+_n(e&&e.column)}function gn(e){return hn(e&&e.start)+`-`+hn(e&&e.end)}function _n(e){return e&&typeof e==`number`?e:1}var vn={}.hasOwnProperty;function yn(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),bn(n)(cn(sn(n).document().write(un()(e,t,!0))))}function bn(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(we),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(be),blockQuote:o(he),characterEscape:D,characterReference:D,codeFenced:o(ge),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ge,s),codeText:o(_e,s),codeTextData:D,data:D,codeFlowValue:D,definition:o(ve),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ye),hardBreakEscape:o(xe),hardBreakTrailing:o(xe),htmlFlow:o(Se,s),htmlFlowData:D,htmlText:o(Se,s),htmlTextData:D,image:o(Ce),label:s,link:o(we),listItem:o(Ee),listItemValue:m,listOrdered:o(Te,p),listUnordered:o(Te),paragraph:o(De),reference:ce,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(be),strong:o(Oe),thematicBreak:o(Ae)},exit:{atxHeading:u(),atxHeadingSequence:T,autolink:u(),autolinkEmail:me,autolinkProtocol:pe,blockQuote:u(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:fe,codeFenced:u(b),codeFencedFence:y,codeFencedFenceInfo:_,codeFencedFenceMeta:v,codeFlowValue:O,codeIndented:u(x),codeText:u(re),codeTextData:O,data:O,definition:u(),definitionDestinationString:w,definitionLabelString:S,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(ne),hardBreakTrailing:u(ne),htmlFlow:u(A),htmlFlowData:O,htmlText:u(j),htmlTextData:O,image:u(ae),label:N,labelText:M,lineEnding:k,link:u(ie),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:le,resourceDestinationString:oe,resourceTitleString:P,resource:se,setextHeading:u(te),setextHeadingLineSequence:ee,setextHeadingText:E,strong:u(),thematicBreak:u()}};Sn(t,(e||{}).mdastExtensions||[]);let n={};return i;function i(e){let r={type:`root`,children:[]},i={stack:[r],tokenStack:[],config:t,enter:l,exit:d,buffer:s,resume:f,data:n},o=[],c=-1;for(;++c<e.length;)(e[c][1].type===`listOrdered`||e[c][1].type===`listUnordered`)&&(e[c][0]===`enter`?o.push(c):c=a(e,o.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];vn.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},i),e[c][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||wn).call(i,void 0,e[0])}for(r.position={start:xn(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:xn(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r}function a(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function o(e,t){return n;function n(n){l.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function l(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:xn(t.start),end:void 0}}function u(e){return t;function t(t){e&&e.call(this,t),d.call(this,t)}}function d(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||wn).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+mn({start:e.start,end:e.end})+`): it’s not open`);n.position.end=xn(e.end)}function f(){return r(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function S(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=g(this.sliceSerialize(e)).toLowerCase()}function C(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function w(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function T(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function E(){this.data.setextHeadingSlurpLineEnding=!0}function ee(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function te(){this.data.setextHeadingSlurpLineEnding=void 0}function D(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ke(),n.position={start:xn(e.start),end:void 0},t.push(n)),this.stack.push(n)}function O(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=xn(e.end)}function k(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=xn(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(D.call(this,e),O.call(this,e))}function ne(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=fn(t),n.identifier=g(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function se(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function le(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=g(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=h(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=c(t);let i=this.stack[this.stack.length-1];i.value+=r}function fe(e){let t=this.stack.pop();t.position.end=xn(e.end)}function pe(e){O.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function me(e){O.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function he(){return{type:`blockquote`,children:[]}}function ge(){return{type:`code`,lang:null,meta:null,value:``}}function _e(){return{type:`inlineCode`,value:``}}function ve(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ye(){return{type:`emphasis`,children:[]}}function be(){return{type:`heading`,depth:0,children:[]}}function xe(){return{type:`break`}}function Se(){return{type:`html`,value:``}}function Ce(){return{type:`image`,title:null,url:``,alt:null}}function we(){return{type:`link`,title:null,url:``,children:[]}}function Te(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ee(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function De(){return{type:`paragraph`,children:[]}}function Oe(){return{type:`strong`,children:[]}}function ke(){return{type:`text`,value:``}}function Ae(){return{type:`thematicBreak`}}}function xn(e){return{line:e.line,column:e.column,offset:e.offset}}function Sn(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Sn(e,r):Cn(e,r)}}function Cn(e,t){let n;for(n in t)if(vn.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function wn(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+mn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mn({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+mn({start:t.start,end:t.end})+`) is still open`)}function Tn(e){let t=this;t.parser=n;function n(n){return yn(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var En={}.hasOwnProperty;function Dn(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&En.call(t,e)){let n=String(t[e]);i=En.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var On={}.hasOwnProperty;function kn(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)kn(e,t.extensions[n]);for(r in t)if(On.call(t,r))switch(r){case`extensions`:break;case`unsafe`:An(e[r],t[r]);break;case`join`:An(e[r],t[r]);break;case`handlers`:jn(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function An(e,t){t&&e.push(...t)}function jn(e,t){t&&Object.assign(e,t)}function Mn(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Nn);return i(),o}function Nn(e,t,n){return`>`+(n?``:` `)+e}function Pn(e,t){return Fn(e,t.inConstruct,!0)&&!Fn(e,t.notInConstruct,!1)}function Fn(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function In(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
4
+ `&&Pn(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
5
+ `}function Ln(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Rn(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zn(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Bn(e,t,n,r){let i=zn(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Rn(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Vn);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Ln(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
6
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
7
+ `),a&&(u+=s.move(a+`
8
+ `)),u+=s.move(c),l(),u}function Vn(e,t,n){return(n?``:` `)+e}function Hn(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Un(e,t,n,r){let i=Hn(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
9
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Wn(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Gn(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Kn(e,t,n){let r=ae(e),i=ae(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qn.peek=Jn;function qn(e,t,n,r){let i=Wn(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Kn(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Gn(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Kn(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Gn(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Jn(e,t,n){return n.options.emphasis||`*`}var Yn=(function(e){if(e==null)return er;if(typeof e==`function`)return $n(e);if(typeof e==`object`)return Array.isArray(e)?Xn(e):Zn(e);if(typeof e==`string`)return Qn(e);throw Error(`Expected function, string, or object as test`)});function Xn(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Yn(e[n]);return $n(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Zn(e){let t=e;return $n(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Qn(e){return $n(t);function t(t){return t&&t.type===e}}function $n(e){return t;function t(t,n,r){return!!(tr(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function er(){return!0}function tr(e){return typeof e==`object`&&!!e&&`type`in e}function nr(e){return e}var rr=[],ir=`skip`;function ar(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Yn(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+nr(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=rr,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=or(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function or(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?rr:[e]}function sr(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ar(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function cr(e,t){let n=!1;return sr(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&r(e)&&(t.options.setext||n))}function lr(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(cr(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
10
+ `,after:`
11
+ `});return r(),t(),o+`
12
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
13
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
14
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Gn(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ur.peek=dr;function ur(e){return e.value||``}function dr(){return`<`}fr.peek=pr;function fr(e,t,n,r){let i=Hn(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function pr(){return`!`}mr.peek=hr;function mr(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hr(){return`!`}gr.peek=_r;function gr(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function _r(){return"`"}function vr(e,t){let n=r(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yr.peek=br;function yr(e,t,n,r){let i=Hn(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(vr(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function br(e,t,n){return vr(e,n)?`<`:`[`}xr.peek=Sr;function xr(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Sr(){return`[`}function Cr(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wr(e){let t=Cr(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Tr(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Er(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Dr(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Tr(n):Cr(n),s=e.ordered?o===`.`?`)`:`.`:wr(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Er(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Or(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kr(e,t,n,r){let i=Or(n),a=n.bulletCurrent||Cr(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ar(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var jr=Yn([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Mr(e,t,n,r){return(e.children.some(function(e){return jr(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Nr(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Pr.peek=Fr;function Pr(e,t,n,r){let i=Nr(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Kn(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Gn(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Kn(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Gn(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Fr(e,t,n){return n.options.strong||`*`}function Ir(e,t,n,r){return n.safe(e.value,r)}function Lr(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Rr(e,t,n){let r=(Er(n)+(n.options.ruleSpaces?` `:``)).repeat(Lr(n));return n.options.ruleSpaces?r.slice(0,-1):r}var zr={blockquote:Mn,break:In,code:Bn,definition:Un,emphasis:qn,hardBreak:In,heading:lr,html:ur,image:fr,imageReference:mr,inlineCode:gr,link:yr,linkReference:xr,list:Dr,listItem:kr,paragraph:Ar,root:Mr,strong:Pr,text:Ir,thematicBreak:Rr},Br=[Vr];function Vr(e,t,n,r){if(t.type===`code`&&Rn(t,r)&&(e.type===`list`||e.type===t.type&&Rn(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&cr(t,r))?void 0:+!!n.spread}var Hr=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ur=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
15
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:Hr},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
16
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:Hr},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
17
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:Hr},{atBreak:!0,character:`+`,after:`(?:[ \r
18
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
19
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
20
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:Hr},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:Hr},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:Hr},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:Hr},{atBreak:!0,character:`~`}];function Wr(e){return e.label||!e.identifier?e.label||``:fn(e.identifier)}function Gr(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function Kr(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
21
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Gn(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Gn(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function qr(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
22
+ `,after:`
23
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(Jr(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function Jr(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
24
+ `.repeat(1+a);if(a===!1)return`
25
+
26
+ <!---->
27
+
28
+ `}return`
29
+
30
+ `}var Yr=/\r?\n|\r/g;function Xr(e,t){let n=[],r=0,i=0,a;for(;a=Yr.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function Zr(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Pn(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(Qr);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push($r(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Gn(r.charCodeAt(e))),c++))}return a.push($r(r.slice(c,l),n.after)),a.join(``)}function Qr(e,t){return e-t}function $r(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function ei(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function ti(e,t){let n=t||{},r={associationId:Wr,containerPhrasing:ai,containerFlow:oi,createTracker:ei,compilePattern:Gr,enter:a,handlers:{...zr},handle:void 0,indentLines:Xr,indexStack:[],join:[...Br],options:{},safe:si,stack:[],unsafe:[...Ur]};kn(r,n),r.options.tightDefinitions&&r.join.push(ii),r.handle=Dn(`type`,{invalid:ni,unknown:ri,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
31
+ `,after:`
32
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
33
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function ni(e){throw Error("Cannot handle value `"+e+"`, expected node")}function ri(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function ii(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function ai(e,t){return Kr(e,this,t)}function oi(e,t){return qr(e,this,t)}function si(e,t){return Zr(this,e,t)}function ci(e){let t=this;t.compiler=n;function n(n){return ti(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function li(e){if(e)throw e}var ui=e.t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),di=e.r(ui(),1);function fi(){}function pi(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function mi(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?hi(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function hi(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var I=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=mn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};I.prototype.file=``,I.prototype.name=``,I.prototype.reason=``,I.prototype.message=``,I.prototype.stack=``,I.prototype.column=void 0,I.prototype.line=void 0,I.prototype.ancestors=void 0,I.prototype.cause=void 0,I.prototype.fatal=void 0,I.prototype.place=void 0,I.prototype.ruleId=void 0,I.prototype.source=void 0;var L={basename:gi,dirname:_i,extname:vi,join:yi,sep:`/`};function gi(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Si(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _i(e){if(Si(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function vi(e){Si(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function yi(...e){let t=-1,n;for(;++t<e.length;)Si(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:bi(n)}function bi(e){Si(e);let t=e.codePointAt(0)===47,n=xi(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function xi(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Si(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Ci={cwd:wi};function wi(){return`/`}function Ti(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ei(e){if(typeof e==`string`)e=new URL(e);else if(!Ti(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Di(e)}function Di(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Oi=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],ki=class{constructor(e){let t;t=e?Ti(e)?{path:e}:typeof e==`string`||Ni(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Ci.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Oi.length;){let e=Oi[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Oi.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?L.basename(this.path):void 0}set basename(e){ji(e,`basename`),Ai(e,`basename`),this.path=L.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?L.dirname(this.path):void 0}set dirname(e){Mi(this.basename,`dirname`),this.path=L.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?L.extname(this.path):void 0}set extname(e){if(Ai(e,`extname`),Mi(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=L.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ti(e)&&(e=Ei(e)),ji(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?L.basename(this.path,this.extname):void 0}set stem(e){ji(e,`stem`),Ai(e,`stem`),this.path=L.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new I(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Ai(e,t){if(e&&e.includes(L.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+L.sep+"`")}function ji(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Mi(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ni(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Pi=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Fi={}.hasOwnProperty,Ii=new class e extends Pi{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=mi()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,di.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(zi(`data`,this.frozen),this.namespace[e]=t,this):Fi.call(this.namespace,e)&&this.namespace[e]||void 0:e?(zi(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Hi(e),n=this.parser||this.Parser;return Li(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Li(`process`,this.parser||this.Parser),Ri(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Hi(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Wi(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Li(`processSync`,this.parser||this.Parser),Ri(`processSync`,this.compiler||this.Compiler),this.process(e,r),Vi(`processSync`,`process`,t),n;function r(e,r){t=!0,li(e),n=r}}run(e,t,n){Bi(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Hi(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Vi(`runSync`,`run`,n),r;function i(e,t){li(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Hi(t),r=this.compiler||this.Compiler;return Ri(`stringify`,r),Bi(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(zi(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,di.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];pi(o)&&pi(r)&&(r=(0,di.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Li(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ri(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function zi(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bi(e){if(!pi(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Vi(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hi(e){return Ui(e)?e:new ki(e)}function Ui(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Wi(e){return typeof e==`string`||Gi(e)}function Gi(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var R=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?Ki(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Ki(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var qi=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let n=e.tr,r=a.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(a.text){let t=n.doc.resolve(a.from).marks();n.replaceWith(a.from,a.to,e.schema.text(a.text,t))}else n.delete(a.from,a.to);t(n)}return!0}}return!1};new R(/--$/,`—`,{inCodeMark:!1}),new R(/\.\.\.$/,`…`,{inCodeMark:!1}),new R(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new R(/"$/,`”`,{inCodeMark:!1}),new R(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new R(/'$/,`’`,{inCodeMark:!1});function Ji(e,n,r=null,i){return new R(e,(e,a,o,s)=>{let c=r instanceof Function?r(a):r,l=e.tr.delete(o,s),u=l.doc.resolve(o).blockRange(),d=u&&t._(u,n,c);if(!d)return null;l.wrap(u,d);let f=l.doc.resolve(o-1).nodeBefore;return f&&f.type==n&&t.m(l.doc,o-1)&&(!i||i(a,f))&&l.join(o-1),l})}function Yi(e,t,n=null){return new R(e,(e,r,i,a)=>{let o=e.doc.resolve(i),s=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,a).setBlockType(i,i,t,s):null})}for(var Xi={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Zi={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Qi=typeof navigator<`u`&&/Mac/.test(navigator.platform),$i=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),z=0;z<10;z++)Xi[48+z]=Xi[96+z]=String(z);for(var z=1;z<=24;z++)Xi[z+111]=`F`+z;for(var z=65;z<=90;z++)Xi[z]=String.fromCharCode(z+32),Zi[z]=String.fromCharCode(z);for(var ea in Xi)Zi.hasOwnProperty(ea)||(Zi[ea]=Xi[ea]);function ta(e){var t=!(Qi&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||$i&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Zi:Xi)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var na=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ra=typeof navigator<`u`&&/Win/.test(navigator.platform);function ia(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))na?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function aa(e){let t=Object.create(null);for(let n in e)t[ia(n)]=e[n];return t}function oa(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function sa(e){return new t.i({props:{handleKeyDown:ca(e)}})}function ca(e){let t=aa(e);return function(e,n){let r=ta(n),i,a=t[oa(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[oa(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(ra&&n.ctrlKey&&n.altKey)&&(i=Xi[n.keyCode])&&i!=r){let r=t[oa(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var B=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},la=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},ua=null,da=function(e,t,n){let r=ua||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},fa=function(){ua=null},pa=function(e,t,n,r){return n&&(ha(e,t,n,r,-1)||ha(e,t,n,r,1))},ma=/^(img|br|input|textarea|hr)$/i;function ha(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:V(e))){let n=e.parentNode;if(!n||n.nodeType!=1||ya(e)||ma.test(e.nodeName)||e.contentEditable==`false`)return!1;t=B(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?V(e):0}else return!1}}function V(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ga(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=V(e)}else if(e.parentNode&&!ya(e))t=B(e),e=e.parentNode;else return null}}function _a(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!ya(e))t=B(e)+1,e=e.parentNode;else return null}}function va(e,t,n){for(let r=t==0,i=t==V(e);r||i;){if(e==n)return!0;let t=B(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==V(e)}}function ya(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var ba=function(e){return e.focusNode&&pa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function xa(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Sa(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ca(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(V(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(V(r.startContainer),r.startOffset)}}}var H=typeof navigator<`u`?navigator:null,wa=typeof document<`u`?document:null,Ta=H&&H.userAgent||``,Ea=/Edge\/(\d+)/.exec(Ta),Da=/MSIE \d/.exec(Ta),Oa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ta),U=!!(Da||Oa||Ea),ka=Da?document.documentMode:Oa?+Oa[1]:Ea?+Ea[1]:0,W=!U&&/gecko\/(\d+)/i.test(Ta);W&&+(/Firefox\/(\d+)/.exec(Ta)||[0,0])[1];var Aa=!U&&/Chrome\/(\d+)/.exec(Ta),G=!!Aa,ja=Aa?+Aa[1]:0,K=!U&&!!H&&/Apple Computer/.test(H.vendor),Ma=K&&(/Mobile\/\w+/.test(Ta)||!!H&&H.maxTouchPoints>2),q=Ma||(H?/Mac/.test(H.platform):!1),Na=H?/Win/.test(H.platform):!1,Pa=/Android \d/.test(Ta),Fa=!!wa&&`webkitFontSmoothing`in wa.documentElement.style,Ia=Fa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function La(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ra(e,t){return typeof e==`number`?e:e[t]}function za(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Ba(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=la(o);continue}let e=o,n=e==a.body,s=n?La(a):za(e),c=0,l=0;if(t.top<s.top+Ra(r,`top`)?l=-(s.top-t.top+Ra(i,`top`)):t.bottom>s.bottom-Ra(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ra(i,`top`)-s.top:t.bottom-s.bottom+Ra(i,`bottom`)),t.left<s.left+Ra(r,`left`)?c=-(s.left-t.left+Ra(i,`left`)):t.right>s.right-Ra(r,`right`)&&(c=t.right-s.right+Ra(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:la(o)}}function Va(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Ha(e.dom)}}function Ha(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=la(r));return t}function Ua({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Wa(n,r==0?0:r-t)}function Wa(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Ga=null;function Ka(e){if(e.setActive)return e.setActive();if(Ga)return e.focus(Ga);let t=Ha(e);e.focus(Ga==null?{get preventScroll(){return Ga={preventScroll:!0},!0}}:void 0),Ga||(Ga=!1,Wa(t,0))}function qa(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=da(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Ja(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:qa(n,i)}function Ja(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=no(r,1);if(n.top!=n.bottom&&Ya(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Ya(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Xa(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Za(e,t,n){let{node:r,offset:i}=qa(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Qa(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function $a(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Ya(t,i))return $a(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function eo(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ca(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Ya(t,n)||(o=$a(e.dom,t,n),!o))return null}if(K)for(let e=o;r&&e;e=la(e))e.draggable&&(r=void 0);if(o=Xa(o,t),r){if(W&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Fa&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Qa(e,r,i,t))}s??=Za(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function to(e){return e.top<e.bottom||e.left<e.right}function no(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(to(e))return e}return Array.prototype.find.call(n,to)||e.getBoundingClientRect()}var ro=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function io(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Fa||W;if(r.nodeType==3)if(o&&(ro.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=no(da(r,i,i),n);if(W&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=no(da(r,i-1,i-1),-1);if(t.top==e.top){let n=no(da(r,i,i+1),-1);if(n.top!=e.top)return ao(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,ao(no(da(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==V(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return oo(e.getBoundingClientRect(),!1)}if(a==null&&i<V(r)){let e=r.childNodes[i];if(e.nodeType==1)return oo(e.getBoundingClientRect(),!0)}return oo(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==V(r))){let e=r.childNodes[i-1],t=e.nodeType==3?da(e,V(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return ao(no(t,1),!1)}if(a==null&&i<V(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?da(e,0,+!o):e.nodeType==1?e:null:null;if(t)return ao(no(t,-1),!0)}return ao(no(r.nodeType==3?da(r):r,-n),n>=0)}function ao(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function oo(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function so(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function co(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return so(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=io(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=da(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var lo=/[\u0590-\u08ac]/;function uo(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!lo.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:so(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var fo=null,po=null,mo=!1;function ho(e,t,n){return fo==t&&po==n?mo:(fo=t,po=n,mo=n==`up`||n==`down`?co(e,t,n):uo(e,t,n))}var J=0,go=1,_o=2,Y=3,vo=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=J,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>B(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof To){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof yo&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?B(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?B(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=B(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=B(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((W||K)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
34
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:B(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(W&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&K)&&pa(o.node,o.offset,l.anchorNode,l.anchorOffset)&&pa(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&W)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?_o:go,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Y:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?_o:Y}n=a}this.dirty=_o}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?_o:go;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},yo=class extends vo{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==J&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},bo=class extends vo{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},xo=class e extends vo{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(n,r,i,a){let o=a.nodeViews[r.type.name],s=o&&o(r,a,i);return(!s||!s.dom)&&(s=t.S.renderSpec(document,r.type.spec.toDOM(r,i),null,r.attrs)),new e(n,r,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Y||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Y&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=J){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=J}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Ho(a,n,o,r)),t>0&&(a=Ho(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},So=class e extends vo{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(n,r,i,a,o,s){let c=o.nodeViews[r.type.name],l,u=c&&c(r,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},i,a),d=u&&u.dom,f=u&&u.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!d){let e=t.S.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs);({dom:d,contentDOM:f}=e)}!f&&!r.isText&&d.nodeName!=`BR`&&(d.hasAttribute(`contenteditable`)||(d.contentEditable=`false`),r.type.spec.draggable&&(d.draggable=!0));let p=d;return d=No(d,i,r),u?l=new Eo(n,r,i,a,d,f||null,p,u,o,s+1):r.isText?new wo(n,r,i,a,d,p,o):new e(n,r,i,a,d,f||null,p,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>t.C.empty)}return e}matchesNode(e,t,n){return this.dirty==J&&e.eq(this.node)&&Po(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,n){let r=this.node.inlineContent,i=n,a=e.composing?this.localCompositionInfo(e,n):null,o=a&&a.pos>-1?a:null,s=a&&a.pos<0,c=new Io(this,o&&o.node,e);zo(this.node,this.innerDeco,(n,a,o)=>{n.spec.marks?c.syncToMarks(n.spec.marks,r,e,a):n.type.side>=0&&!o&&c.syncToMarks(a==this.node.childCount?t.w.none:this.node.child(a).marks,r,e,a),c.placeWidget(n,e,i)},(t,n,o,l)=>{c.syncToMarks(t.marks,r,e,l);let u;c.findNodeMatch(t,n,o,l)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(u=c.findIndexWithChild(a.node))>-1&&c.updateNodeAt(t,n,o,u,e)||c.updateNextNode(t,n,o,e,l,i)||c.addNode(t,n,o,e,i),i+=t.nodeSize}),c.syncToMarks([],r,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==_o)&&(o&&this.protectLocalComposition(e,o),Do(this.contentDOM,this.children,e),Ma&&Bo(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof t.c)||r<n||i>n+this.node.content.size)return null;let a=e.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let e=a.nodeValue,t=Vo(this.node.content,e,r-n,i-n);return t<0?null:{node:a,pos:t,text:e}}else return{node:a,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new bo(this,i,t,r);e.input.compositionNodes.push(a),this.children=Ho(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Y||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=J}updateOuterDeco(e){if(Po(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=jo(this.dom,this.nodeDOM,Ao(this.outerDeco,this.node,t),Ao(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Co(e,t,n,r,i){No(r,t,e);let a=new So(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var wo=class e extends So{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Y||this.dirty!=J&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=J||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=J,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Y)}get domAtom(){return!1}isText(e){return this.node.text==e}},To=class extends vo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==J&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Eo=class extends So{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Y)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Do(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Fo(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof xo){let t=r?r.previousSibling:e.lastChild;Do(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Fo(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Oo=function(e){e&&(this.nodeName=e)};Oo.prototype=Object.create(null);var ko=[new Oo];function Ao(e,t,n){if(e.length==0)return ko;let r=n?ko[0]:new Oo,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Oo(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Oo(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function jo(e,t,n,r){if(n==ko&&r==ko)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=ko[0],i=t)}Mo(i,o||ko[0],a)}return i}function Mo(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function No(e,t,n){return jo(e,e,ko,Ao(t,n,e.nodeType!=1))}function Po(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Fo(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Io=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Lo(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=J,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=xo.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Y&&a.dom==a.contentDOM&&(a.dirty=_o),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof So){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Y&&Po(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=_o,u.updateChildren(r,a+1),u.dirty=J),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Po(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=So.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=So.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new yo(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof xo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof wo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((K||G)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new To(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Lo(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof xo)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ro(e,t){return e.type.side-t.type.side}function zo(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ro);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Bo(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Vo(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Ho(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Uo(e,n=null){let r=e.domSelectionRange(),i=e.state.doc;if(!r.focusNode)return null;let a=e.docView.nearestDesc(r.focusNode),o=a&&a.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let c=i.resolve(s),l,u;if(ba(r)){for(l=s;a&&!a.node;)a=a.parent;let e=a.node;if(a&&e.isAtom&&t.r.isSelectable(e)&&a.parent&&!(e.isInline&&va(r.focusNode,r.focusOffset,a.dom))){let e=a.posBefore;u=new t.r(s==e?c:i.resolve(e))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let t=s,n=s;for(let i=0;i<r.rangeCount;i++){let a=r.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),n=Math.max(n,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[l,s]=n==e.state.selection.anchor?[n,t]:[t,n],c=i.resolve(s)}else l=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let d=i.resolve(l);if(!u){let t=n==`pointer`||e.state.selection.head<c.pos&&!o?1:-1;u=es(e,d,c,t)}return u}function Wo(e){return e.editable?e.hasFocus():ns(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Go(e,n=!1){let r=e.state.selection;if(Qo(e,r),Wo(e)){if(!n&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&G){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&pa(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Zo(e);else{let{anchor:i,head:a}=r,o,s;Ko&&!(r instanceof t.c)&&(r.$from.parent.inlineContent||(o=qo(e,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(s=qo(e,r.to))),e.docView.setSelection(i,a,e,n),Ko&&(o&&Yo(o),s&&Yo(s)),r.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Xo(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Ko=K||G&&ja<63;function qo(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(K&&i&&i.contentEditable==`false`)return Jo(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Jo(i);if(a)return Jo(a)}}function Jo(e){return e.contentEditable=`true`,K&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Yo(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Xo(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Wo(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Zo(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,B(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&U&&ka<=11&&(n.disabled=!0,n.disabled=!1)}function Qo(e,n){if(n instanceof t.r){let t=e.docView.descAt(n.from);t!=e.lastSelectedViewDesc&&($o(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else $o(e)}function $o(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function es(e,n,r,i){return e.someProp(`createSelectionBetween`,t=>t(e,n,r))||t.c.between(n,r,i)}function ts(e){return e.editable&&!e.hasFocus()?!1:ns(e)}function ns(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function rs(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return pa(t.node,t.offset,n.anchorNode,n.anchorOffset)}function is(e,n){let{$anchor:r,$head:i}=e.selection,a=n>0?r.max(i):r.min(i),o=a.parent.inlineContent?a.depth?e.doc.resolve(n>0?a.after():a.before()):null:a;return o&&t.o.findFrom(o,n)}function as(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function os(e,n,r){let i=e.state.selection;if(i instanceof t.c){if(r.indexOf(`s`)>-1){let{$head:r}=i,a=r.textOffset?null:n<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+a.nodeSize*(n<0?-1:1));return as(e,new t.c(i.$anchor,o))}else if(!i.empty)return!1;else if(e.endOfTextblock(n>0?`forward`:`backward`)){let r=is(e.state,n);return r&&r instanceof t.r?as(e,r):!1}else if(!(q&&r.indexOf(`m`)>-1)){let r=i.$head,a=r.textOffset?null:n<0?r.nodeBefore:r.nodeAfter,o;if(!a||a.isText)return!1;let s=n<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM?t.r.isSelectable(a)?as(e,new t.r(n<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Fa?as(e,new t.c(e.state.doc.resolve(n<0?s:s+a.nodeSize))):!1:!1}}else if(i instanceof t.r&&i.node.isInline)return as(e,new t.c(n>0?i.$to:i.$from));else{let t=is(e.state,n);return t?as(e,t):!1}}function ss(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cs(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function ls(e,t){return t<0?us(e):ds(e)}function us(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(W&&n.nodeType==1&&r<ss(n)&&cs(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(cs(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(fs(n))break;else{let t=n.previousSibling;for(;t&&cs(t,-1);)i=n.parentNode,a=B(t),t=t.previousSibling;if(t)n=t,r=ss(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?hs(e,n,r):i&&hs(e,i,a)}function ds(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=ss(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(cs(e,1))a=n,o=++r;else break}else if(fs(n))break;else{let t=n.nextSibling;for(;t&&cs(t,1);)a=t.parentNode,o=B(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=ss(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&hs(e,a,o)}function fs(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ps(e,t){for(;e&&t==e.childNodes.length&&!ya(e);)t=B(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function ms(e,t){for(;e&&!t&&!ya(e);)t=B(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function hs(e,t,n){if(t.nodeType!=3){let e,r;(r=ps(t,n))?(t=r,n=0):(e=ms(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ba(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Go(e)},50)}function gs(e,t){let n=e.state.doc.resolve(t);if(!(G||Na)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function _s(e,n,r){let i=e.state.selection;if(i instanceof t.c&&!i.empty||r.indexOf(`s`)>-1||q&&r.indexOf(`m`)>-1)return!1;let{$from:a,$to:o}=i;if(!a.parent.inlineContent||e.endOfTextblock(n<0?`up`:`down`)){let r=is(e.state,n);if(r&&r instanceof t.r)return as(e,r)}if(!a.parent.inlineContent){let r=n<0?a:o,s=i instanceof t.t?t.o.near(r,n):t.o.findFrom(r,n);return s?as(e,s):!1}return!1}function vs(e,n){if(!(e.state.selection instanceof t.c))return!0;let{$head:r,$anchor:i,empty:a}=e.state.selection;if(!r.sameParent(i))return!0;if(!a)return!1;if(e.endOfTextblock(n>0?`forward`:`backward`))return!0;let o=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(o&&!o.isText){let t=e.state.tr;return n<0?t.delete(r.pos-o.nodeSize,r.pos):t.delete(r.pos,r.pos+o.nodeSize),e.dispatch(t),!0}return!1}function ys(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function bs(e){if(!K||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;ys(e,n,`true`),setTimeout(()=>ys(e,n,`false`),20)}return!1}function xs(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Ss(e,t){let n=t.keyCode,r=xs(t);if(n==8||q&&n==72&&r==`c`)return vs(e,-1)||ls(e,-1);if(n==46&&!t.shiftKey||q&&n==68&&r==`c`)return vs(e,1)||ls(e,1);if(n==13||n==27)return!0;if(n==37||q&&n==66&&r==`c`){let t=n==37?gs(e,e.state.selection.from)==`ltr`?-1:1:-1;return os(e,t,r)||ls(e,t)}else if(n==39||q&&n==70&&r==`c`){let t=n==39?gs(e,e.state.selection.from)==`ltr`?1:-1:1;return os(e,t,r)||ls(e,t)}else if(n==38||q&&n==80&&r==`c`)return _s(e,-1,r)||ls(e,-1);else if(n==40||q&&n==78&&r==`c`)return bs(e)||_s(e,1,r)||ls(e,1);else if(r==(q?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function Cs(e,n){e.someProp(`transformCopied`,t=>{n=t(n,e)});let r=[],{content:i,openStart:a,openEnd:o}=n;for(;a>1&&o>1&&i.childCount==1&&i.firstChild.childCount==1;){a--,o--;let e=i.firstChild;r.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),i=e.content}let s=e.someProp(`clipboardSerializer`)||t.S.fromSchema(e.state.schema),c=Ps(),l=c.createElement(`div`);l.appendChild(s.serializeFragment(i,{document:c}));let u=l.firstChild,d,f=0;for(;u&&u.nodeType==1&&(d=Ms[u.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=c.createElement(d[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),f++}u=l.firstChild}return u&&u.nodeType==1&&u.setAttribute(`data-pm-slice`,`${a} ${o}${f?` -${f}`:``} ${JSON.stringify(r)}`),{dom:l,text:e.someProp(`clipboardTextSerializer`,t=>t(n,e))||n.content.textBetween(0,n.content.size,`
35
+
36
+ `),slice:n}}function ws(e,n,r,i,a){let o=a.parent.type.spec.code,s,c;if(!r&&!n)return null;let l=!!n&&(i||o||!r);if(l){if(e.someProp(`transformPastedText`,t=>{n=t(n,o||i,e)}),o)return c=new t.k(t.C.from(e.state.schema.text(n.replace(/\r\n?/g,`
37
+ `))),0,0),e.someProp(`transformPasted`,t=>{c=t(c,e,!0)}),c;let r=e.someProp(`clipboardTextParser`,t=>t(n,a,i,e));if(r)c=r;else{let r=a.marks(),{schema:i}=e.state,o=t.S.fromSchema(i);s=document.createElement(`div`),n.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement(`p`));e&&t.appendChild(o.serializeNode(i.text(e,r)))})}}else e.someProp(`transformPastedHTML`,t=>{r=t(r,e)}),s=Ls(r),Fa&&Rs(s);let u=s&&s.querySelector(`[data-pm-slice]`),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute(`data-pm-slice`)||``);if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;s=e}if(c||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||t.x.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:a,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Ts.test(e.parentNode.nodeName)?{ignore:!0}:null}}),d)c=zs(js(c,+d[1],+d[2]),d[4]);else if(c=t.k.maxOpen(Es(c.content,a),!0),c.openStart||c.openEnd){let e=0,t=0;for(let t=c.content.firstChild;e<c.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=c.content.lastChild;t<c.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);c=js(c,e,t)}return e.someProp(`transformPasted`,t=>{c=t(c,e,l)}),c}var Ts=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Es(e,n){if(e.childCount<2)return e;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),a,o=[];if(e.forEach(e=>{if(!o)return;let t=i.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&a.length&&Os(t,a,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=ks(o[o.length-1],a.length));let n=Ds(e,t);o.push(n),i=i.matchType(n.type),a=t}}),o)return t.C.from(o)}return e}function Ds(e,n,r=0){for(let i=n.length-1;i>=r;i--)e=n[i].create(null,t.C.from(e));return e}function Os(e,n,r,i,a){if(a<e.length&&a<n.length&&e[a]==n[a]){let o=Os(e,n,r,i.lastChild,a+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(a==e.length-1?r.type:e[a+1]))return i.copy(i.content.append(t.C.from(Ds(r,e,a+1))))}}function ks(e,n){if(n==0)return e;let r=e.content.replaceChild(e.childCount-1,ks(e.lastChild,n-1)),i=e.contentMatchAt(e.childCount).fillBefore(t.C.empty,!0);return e.copy(r.append(i))}function As(e,n,r,i,a,o){let s=n<0?e.firstChild:e.lastChild,c=s.content;return e.childCount>1&&(o=0),a<i-1&&(c=As(c,n,r,i,a+1,o)),a>=r&&(c=n<0?s.contentMatchAt(0).fillBefore(c,o<=a).append(c):c.append(s.contentMatchAt(s.childCount).fillBefore(t.C.empty,!0))),e.replaceChild(n<0?0:e.childCount-1,s.copy(c))}function js(e,n,r){return n<e.openStart&&(e=new t.k(As(e.content,-1,n,e.openStart,0,e.openEnd),n,e.openEnd)),r<e.openEnd&&(e=new t.k(As(e.content,1,r,e.openEnd,0,0),e.openStart,r)),e}var Ms={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Ns=null;function Ps(){return Ns||=document.implementation.createHTMLDocument(`title`)}var Fs=null;function Is(e){let t=window.trustedTypes;return t?(Fs||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Fs.createHTML(e)):e}function Ls(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Ps().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Ms[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Is(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Rs(e){let t=e.querySelectorAll(G?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function zs(e,n){if(!e.size)return e;let r=e.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return e}let{content:a,openStart:o,openEnd:s}=e;for(let e=i.length-2;e>=0;e-=2){let n=r.nodes[i[e]];if(!n||n.hasRequiredAttrs())break;a=t.C.from(n.create(i[e+1],a)),o++,s++}return new t.k(a,o,s)}var X={},Z={},Bs={touchstart:!0,touchmove:!0},Vs=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Hs(e){for(let t in X){let n=X[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{qs(e,t)&&!Ks(e,t)&&(e.editable||!(t.type in Z))&&n(e,t)},Bs[t]?{passive:!0}:void 0)}K&&e.dom.addEventListener(`input`,()=>null),Gs(e)}function Us(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Ws(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Gs(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ks(e,t))})}function Ks(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function qs(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Js(e,t){!Ks(e,t)&&X[t.type]&&(e.editable||!(t.type in Z))&&X[t.type](e,t)}Z.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!cc(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Pa&&G&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ma&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,xa(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Ss(e,n)?n.preventDefault():Us(e,`key`)},Z.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Z.keypress=(e,n)=>{let r=n;if(cc(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||q&&r.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,r))){r.preventDefault();return}let i=e.state.selection;if(!(i instanceof t.c)||!i.$from.sameParent(i.$to)){let t=String.fromCharCode(r.charCode),n=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,r=>r(e,i.$from.pos,i.$to.pos,t,n))&&e.dispatch(n()),r.preventDefault()}};function Ys(e){return{left:e.clientX,top:e.clientY}}function Xs(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Zs(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Qs(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function $s(e,n){if(n==-1)return!1;let r=e.state.doc.resolve(n),i=r.nodeAfter;return i&&i.isAtom&&t.r.isSelectable(i)?(Qs(e,new t.r(r),`pointer`),!0):!1}function ec(e,n){if(n==-1)return!1;let r=e.state.selection,i,a;r instanceof t.r&&(i=r.node);let o=e.state.doc.resolve(n);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e);if(t.r.isSelectable(n)){a=i&&r.$from.depth>0&&e>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?o.before(r.$from.depth):o.before(e);break}}return a==null?!1:(Qs(e,t.r.create(e.state.doc,a),`pointer`),!0)}function tc(e,t,n,r,i){return Zs(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?ec(e,n):$s(e,n))}function nc(e,t,n,r){return Zs(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function rc(e,t,n,r){return Zs(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||ic(e,n,r)}function ic(e,n,r){if(r.button!=0)return!1;let i=e.state.doc;if(n==-1)return i.inlineContent?(Qs(e,t.c.create(i,0,i.content.size),`pointer`),!0):!1;let a=i.resolve(n);for(let n=a.depth+1;n>0;n--){let r=n>a.depth?a.nodeAfter:a.node(n),o=a.before(n);if(r.inlineContent)Qs(e,t.c.create(i,o+1,o+1+r.content.size),`pointer`);else if(t.r.isSelectable(r))Qs(e,t.r.create(i,o),`pointer`);else continue;return!0}}function ac(e){return hc(e)}var oc=q?`metaKey`:`ctrlKey`;X.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ac(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Xs(n,e.input.lastClick)&&!n[oc]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Ys(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new sc(e,o,n,!!r)):(a==`doubleClick`?nc:rc)(e,o.pos,o.inside,n)?n.preventDefault():Us(e,`pointer`))};var sc=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[oc],this.allowDefault=r.shiftKey;let a,o;if(n.inside>-1)a=e.state.doc.nodeAt(n.inside),o=n.inside;else{let t=e.state.doc.resolve(n.pos);a=t.parent,o=t.depth?t.before():0}let s=i?null:r.target,c=s?e.docView.nearestDesc(s,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:l}=e.state;r.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||l instanceof t.r&&l.from<=o&&l.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&W&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Us(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Go(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ys(e))),this.updateAllowDefault(e),this.allowDefault||!n?Us(this.view,`pointer`):tc(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||K&&this.mightDrag&&!this.mightDrag.node.isAtom||G&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Qs(this.view,t.o.near(this.view.state.doc.resolve(n.pos)),`pointer`),e.preventDefault()):Us(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Us(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};X.touchstart=e=>{e.input.lastTouch=Date.now(),ac(e),Us(e,`pointer`)},X.touchmove=e=>{e.input.lastTouch=Date.now(),Us(e,`pointer`)},X.contextmenu=e=>ac(e);function cc(e,t){return e.composing?!0:K&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var lc=Pa?5e3:-1;Z.compositionstart=Z.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:n}=e,r=n.selection.$to;if(n.selection instanceof t.c&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||G&&Na&&uc(e)))e.markCursor=e.state.storedMarks||r.marks(),hc(e,!0),e.markCursor=null;else if(hc(e,!n.selection.empty),W&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}dc(e,lc)};function uc(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Z.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,dc(e,20))};function dc(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>hc(e),t))}function fc(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=mc());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function pc(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ga(t.focusNode,t.focusOffset),r=_a(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function mc(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function hc(e,t=!1){if(!(Pa&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),fc(e),t||e.docView&&e.docView.dirty){let n=Uo(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function gc(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var _c=U&&ka<15||Ma&&Ia<604;X.copy=Z.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=_c?null:n.clipboardData,{dom:o,text:s}=Cs(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):gc(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function vc(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function yc(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?bc(e,r.value,null,i,t):bc(e,r.textContent,r.innerHTML,i,t)},50)}function bc(e,n,r,i,a){let o=ws(e,n,r,i,e.state.selection.$from);if(e.someProp(`handlePaste`,n=>n(e,a,o||t.k.empty)))return!0;if(!o)return!1;let s=vc(o),c=s?e.state.tr.replaceSelectionWith(s,i):e.state.tr.replaceSelection(o);return e.dispatch(c.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function xc(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Z.paste=(e,t)=>{let n=t;if(e.composing&&!Pa)return;let r=_c?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&bc(e,xc(r),r.getData(`text/html`),i,n)?n.preventDefault():yc(e,n)};var Sc=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Cc=q?`altKey`:`ctrlKey`;function wc(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Cc]:!n}X.dragstart=(e,n)=>{let r=n,i=e.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let a=e.state.selection,o=a.empty?null:e.posAtCoords(Ys(r)),s;if(!(o&&o.pos>=a.from&&o.pos<=(a instanceof t.r?a.to-1:a.to))){if(i&&i.mightDrag)s=t.r.create(e.state.doc,i.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let n=e.docView.nearestDesc(r.target,!0);n&&n.node.type.spec.draggable&&n!=e.docView&&(s=t.r.create(e.state.doc,n.posBefore))}}let{dom:c,text:l,slice:u}=Cs(e,(s||e.state.selection).content());(!r.dataTransfer.files.length||!G||ja>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(_c?`Text`:`text/html`,c.innerHTML),r.dataTransfer.effectAllowed=`copyMove`,_c||r.dataTransfer.setData(`text/plain`,l),e.dragging=new Sc(u,wc(e,r),s)},X.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Z.dragover=Z.dragenter=(e,t)=>t.preventDefault(),Z.drop=(e,t)=>{try{Tc(e,t,e.dragging)}finally{e.dragging=null}};function Tc(e,n,r){if(!n.dataTransfer)return;let i=e.posAtCoords(Ys(n));if(!i)return;let a=e.state.doc.resolve(i.pos),o=r&&r.slice;o?e.someProp(`transformPasted`,t=>{o=t(o,e,!1)}):o=ws(e,xc(n.dataTransfer),_c?null:n.dataTransfer.getData(`text/html`),!1,a);let s=!!(r&&wc(e,n));if(e.someProp(`handleDrop`,r=>r(e,n,o||t.k.empty,s))){n.preventDefault();return}if(!o)return;n.preventDefault();let c=o?t.g(e.state.doc,a.pos,o):a.pos;c??=a.pos;let l=e.state.tr;if(s){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let u=l.mapping.map(c),d=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(d?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(f))return;let p=l.doc.resolve(u);if(d&&t.r.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new t.r(p));else{let t=l.mapping.map(c);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),l.setSelection(es(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta(`uiEvent`,`drop`))}X.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Go(e)},20))},X.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},X.beforeinput=(e,t)=>{if(G&&Pa&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,xa(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Z)X[e]=Z[e];function Ec(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Dc=class e{constructor(e,t){this.toDOM=e,this.spec=t||Mc,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Ac(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ec(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Oc=class e{constructor(e,t){this.attrs=e,this.spec=t||Mc}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Ac(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Ec(this.attrs,t.attrs)&&Ec(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},kc=class e{constructor(e,t){this.attrs=e,this.spec=t||Mc}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Ac(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Ec(this.attrs,t.attrs)&&Ec(this.spec,t.spec)}destroy(){}},Ac=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Dc(n,r))}static inline(t,n,r,i){return new e(t,n,new Oc(r,i))}static node(t,n,r,i){return new e(t,n,new kc(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Oc}get widget(){return this.type instanceof Dc}},jc=[],Mc={},Q=class e{constructor(e,t){this.local=e.length?e:jc,this.children=t.length?t:jc}static create(e,t){return t.length?zc(t,e,0,Mc):$}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==$||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Mc)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Pc(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Bc),jc):$}add(t,n){return n.length?this==$?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Lc(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,zc(s,e,o+1,Mc)),a+=3}});let o=Fc(a?Rc(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Bc):this.local,i||this.children)}remove(e){return e.length==0||this==$?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==$?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):$}forChild(t,n){if(this==$)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Oc){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Bc),jc);return r?new Nc([t,r]):t}return r||$}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Vc(this.localsInner(e))}localsInner(e){if(this==$)return jc;if(e.inlineContent||!this.local.some(Oc.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Oc||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Q.empty=new Q([],[]),Q.removeOverlap=Vc;var $=Q.empty,Nc=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Mc));return e.from(r)}forChild(t,n){if(n.isLeaf)return Q.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=$&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Vc(n?t:t.sort(Bc)):jc}static from(t){switch(t.length){case 0:return $;case 1:return t[0];default:return new e(t.every(e=>e instanceof Q)?t:t.reduce((e,t)=>e.concat(t instanceof Q?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Pc(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==$?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=zc(Ic(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Q(t.sort(Bc),s)}function Fc(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Ac(i.from+t,i.to+t,i.type))}return n}function Ic(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Lc(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Rc(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function zc(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Lc(e,t,o+n);if(s){a=!0;let e=zc(s,t,n+o+1,r);e!=$&&i.push(o,o+t.nodeSize,e)}});let o=Fc(a?Rc(e):e,-n).sort(Bc);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Q(o,i):$}function Bc(e,t){return e.from-t.from||e.to-t.to}function Vc(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Hc(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Hc(t,i,r.copy(a.from,r.to)));break}}}return t}function Hc(e,t,n){for(;t<e.length&&Bc(n,e[t])>0;)t++;e.splice(t,0,n)}function Uc(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=$&&t.push(r)}),e.cursorWrapper&&t.push(Q.create(e.state.doc,[e.cursorWrapper.deco])),Nc.from(t)}var Wc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gc=U&&ka<=11,Kc=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},qc=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Kc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);U&&ka<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():K&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Gc&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Wc)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ts(this.view)){if(this.suppressingSelectionUpdates)return Go(this.view);if(U&&ka<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&pa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=la(n))t.add(n);for(let r=e.anchorNode;r;r=la(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ts(e)&&!this.ignoreSelectionChange(r),a=-1,o=-1,s=!1,c=[];if(e.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],c);t&&(a=a<0?t.from:Math.min(t.from,a),o=o<0?t.to:Math.max(t.to,o),t.typeOver&&(s=!0))}if(c.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of c)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(W&&c.length){let t=c.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||$c(e,n)!=t)&&r.remove()}}}let l=null;a<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ba(r)&&(l=Uo(e))&&l.eq(t.o.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Go(e),this.currentSelection.set(r),e.scrollToSelection()):(a>-1||i)&&(a>-1&&(e.docView.markDirty(a,o),Xc(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,el(e,c)),this.handleDOMChange(a,o,s,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Go(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(U&&ka<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?B(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?B(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Jc=new WeakMap,Yc=!1;function Xc(e){if(!Jc.has(e)&&(Jc.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=W,Yc)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),Yc=!0}}function Zc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return pa(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Qc(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Zc(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Zc(e,n):null}function $c(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function el(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function tl(e,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(n,r),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],ba(l)||u.push({node:l.focusNode,offset:l.focusOffset})),G&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||t.x.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace==`pre`?`full`:!0,findPositions:u,ruleFromNode:nl,context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}function nl(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(K&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||K&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var rl=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function il(e,n,r,i,a){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,n<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Uo(e,t);if(n&&!e.state.selection.eq(n)){if(G&&Pa&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,xa(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),o&&r.setMeta(`composition`,o),e.dispatch(r)}return}let s=e.state.doc.resolve(n),c=s.sharedDepth(r);n=s.before(c+1),r=e.state.doc.resolve(r).after(c+1);let l=e.state.selection,u=tl(e,n,r),d=e.state.doc,f=d.slice(u.from,u.to),p,m;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(p=e.state.selection.to,m=`end`):(p=e.state.selection.from,m=`start`),e.input.lastKeyCode=null;let h=ll(f.content,u.doc.content,u.from,p,m);if(h&&e.input.domChangeCount++,(Ma&&e.input.lastIOSEnter>Date.now()-225||Pa)&&a.some(e=>e.nodeType==1&&!rl.test(e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp(`handleKeyDown`,t=>t(e,xa(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!h)if(i&&l instanceof t.c&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let t=al(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta(`composition`,o),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof t.c&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),U&&ka<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)==` \xA0`&&(h.start--,h.endA--,h.endB--);let g=u.doc.resolveNoCache(h.start-u.from),_=u.doc.resolveNoCache(h.endB-u.from),v=d.resolve(h.start),y=g.sameParent(_)&&g.parent.inlineContent&&v.end()>=h.endA;if((Ma&&e.input.lastIOSEnter>Date.now()-225&&(!y||a.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!y&&g.pos<u.doc.content.size&&(!g.sameParent(_)||!g.parent.inlineContent)&&g.pos<_.pos&&!/\S/.test(u.doc.textBetween(g.pos,_.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,xa(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&sl(d,h.start,h.endA,g,_)&&e.someProp(`handleKeyDown`,t=>t(e,xa(8,`Backspace`)))){Pa&&G&&e.domObserver.suppressSelectionUpdates();return}G&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Pa&&!y&&g.start()!=_.start()&&_.parentOffset==0&&g.depth==_.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,_=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,xa(13,`Enter`))})},20));let b=h.start,x=h.endA,S=t=>{let n=t||e.state.tr.replace(b,x,u.doc.slice(h.start-u.from,h.endB-u.from));if(u.sel){let t=al(e,n.doc,u.sel);t&&!(G&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(x)-1)||U&&t.empty&&t.head==b)&&n.setSelection(t)}return o&&n.setMeta(`composition`,o),n.scrollIntoView()},C;if(y)if(g.pos==_.pos){U&&ka<=11&&g.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Go(e),20));let t=S(e.state.tr.delete(b,x)),n=d.resolve(h.start).marksAcross(d.resolve(h.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(h.endA==h.endB&&(C=ol(g.parent.content.cut(g.parentOffset,_.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start())))){let t=S(e.state.tr);C.type==`add`?t.addMark(b,x,C.mark):t.removeMark(b,x,C.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==_.index()-+!_.textOffset){let t=g.parent.textBetween(g.parentOffset,_.parentOffset),n=()=>S(e.state.tr.insertText(t,b,x));e.someProp(`handleTextInput`,r=>r(e,b,x,t,n))||e.dispatch(n())}else e.dispatch(S());else e.dispatch(S())}function al(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:es(e,t.resolve(n.anchor),t.resolve(n.head))}function ol(e,n){let r=e.firstChild.marks,i=n.firstChild.marks,a=r,o=i,s,c,l;for(let e=0;e<i.length;e++)a=i[e].removeFromSet(a);for(let e=0;e<r.length;e++)o=r[e].removeFromSet(o);if(a.length==1&&o.length==0)c=a[0],s=`add`,l=e=>e.mark(c.addToSet(e.marks));else if(a.length==0&&o.length==1)c=o[0],s=`remove`,l=e=>e.mark(c.removeFromSet(e.marks));else return null;let u=[];for(let e=0;e<n.childCount;e++)u.push(l(n.child(e)));if(t.C.from(u).eq(e))return{mark:c,type:s}}function sl(e,t,n,r,i){if(n-t<=i.pos-r.pos||cl(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(cl(a,!0,!0));return!o.parent.isTextblock||o.pos>n||cl(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function cl(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function ll(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&ul(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&ul(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function ul(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var dl=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Vs,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(vl),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ml(this),pl(this),this.nodeViews=gl(this),this.docView=Co(this.state.doc,fl(this),Uc(this),this.dom,this),this.domObserver=new qc(this,(e,t,n,r)=>il(this,e,t,n,r)),this.domObserver.start(),Hs(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gs(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vl),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(fc(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=gl(this);_l(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Gs(this),this.editable=ml(this),pl(this);let o=Uc(this),s=fl(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Va(this);if(i){this.domObserver.stop();let t=l&&(U||G)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&hl(n.selection,e.selection);if(l){let n=G?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pc(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Co(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&rs(this))?Go(this,t):(Qo(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Ua(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof t.r){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ba(this,t.getBoundingClientRect(),e)}else Ba(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let e=r.from+(this.state.doc.content.size-n.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==r.node&&(i=e)}this.dragging=new Sc(e.slice,e.move,i<0?void 0:t.r.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(U){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Ka(this.dom),Go(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return eo(this,e)}coordsAtPos(e,t=1){return io(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return ho(this,t||this.state,e)}pasteHTML(e,t){return bc(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return bc(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Cs(this,e)}destroy(){this.docView&&(Ws(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Uc(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,fa())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Js(this,e)}domSelectionRange(){let e=this.domSelection();return e?K&&this.root.nodeType===11&&Sa(this.dom.ownerDocument)==this.dom&&Qc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};dl.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function fl(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Ac.node(0,e.state.doc.content.size,t)]}function pl(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Ac.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ml(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function hl(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function gl(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function _l(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function vl(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return sa}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return qi}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return fi}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return ci}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return ca}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return zr}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return dl}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Yi}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ac}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return Tn}});
@@ -0,0 +1,2 @@
1
+ const e=require(`./dist-BCCSKc3M.cjs`);var t=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function n(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var r=(t,r,i)=>{let a=n(t,i);if(!a)return!1;let o=l(a);if(!o){let n=a.blockRange(),i=n&&e.y(n);return i==null?!1:(r&&r(t.tr.lift(n,i).scrollIntoView()),!0)}let c=o.nodeBefore;if(O(t,o,r,-1))return!0;if(a.parent.content.size==0&&(s(c,`end`)||e.r.isSelectable(c)))for(let n=a.depth;;n--){let i=e.b(t.doc,a.before(n),a.after(n),e.k.empty);if(i&&i.slice.size<i.to-i.from){if(r){let n=t.tr.step(i);n.setSelection(s(c,`end`)?e.o.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):e.r.create(n.doc,o.pos-c.nodeSize)),r(n.scrollIntoView())}return!0}if(n==1||a.node(n-1).childCount>1)break}return c.isAtom&&o.depth==a.depth-1?(r&&r(t.tr.delete(o.pos-c.nodeSize,o.pos).scrollIntoView()),!0):!1},i=(e,t,r)=>{let i=n(e,r);if(!i)return!1;let a=l(i);return a?o(e,a,t):!1},a=(e,t,n)=>{let r=u(e,n);if(!r)return!1;let i=p(r);return i?o(e,i,t):!1};function o(t,n,r){let i=n.nodeBefore,a=n.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let e=i.lastChild;if(!e)return!1;i=e}let o=n.nodeAfter,s=n.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let c=e.b(t.doc,a,s,e.k.empty);if(!c||c.from!=a||c instanceof e.f&&c.slice.size>=s-a)return!1;if(r){let n=t.tr.step(c);n.setSelection(e.c.create(n.doc,a)),r(n.scrollIntoView())}return!0}function s(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var c=(t,n,r)=>{let{$head:i,empty:a}=t.selection,o=i;if(!a)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock(`backward`,t):i.parentOffset>0)return!1;o=l(i)}let s=o&&o.nodeBefore;return!s||!e.r.isSelectable(s)?!1:(n&&n(t.tr.setSelection(e.r.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function l(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function u(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var d=(t,n,r)=>{let i=u(t,r);if(!i)return!1;let a=p(i);if(!a)return!1;let o=a.nodeAfter;if(O(t,a,n,1))return!0;if(i.parent.content.size==0&&(s(o,`start`)||e.r.isSelectable(o))){let r=e.b(t.doc,i.before(),i.after(),e.k.empty);if(r&&r.slice.size<r.to-r.from){if(n){let i=t.tr.step(r);i.setSelection(s(o,`start`)?e.o.findFrom(i.doc.resolve(i.mapping.map(a.pos)),1):e.r.create(i.doc,i.mapping.map(a.pos))),n(i.scrollIntoView())}return!0}}return o.isAtom&&a.depth==i.depth-1?(n&&n(t.tr.delete(a.pos,a.pos+o.nodeSize).scrollIntoView()),!0):!1},f=(t,n,r)=>{let{$head:i,empty:a}=t.selection,o=i;if(!a)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock(`forward`,t):i.parentOffset<i.parent.content.size)return!1;o=p(i)}let s=o&&o.nodeAfter;return!s||!e.r.isSelectable(s)?!1:(n&&n(t.tr.setSelection(e.r.create(t.doc,o.pos)).scrollIntoView()),!0)};function p(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var m=(t,n)=>{let r=t.selection,i=r instanceof e.r,a;if(i){if(r.node.isTextblock||!e.m(t.doc,r.from))return!1;a=r.from}else if(a=e.v(t.doc,r.from,-1),a==null)return!1;if(n){let r=t.tr.join(a);i&&r.setSelection(e.r.create(r.doc,a-t.doc.resolve(a).nodeBefore.nodeSize)),n(r.scrollIntoView())}return!0},h=(t,n)=>{let r=t.selection,i;if(r instanceof e.r){if(r.node.isTextblock||!e.m(t.doc,r.to))return!1;i=r.to}else if(i=e.v(t.doc,r.to,1),i==null)return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},g=(t,n)=>{let{$from:r,$to:i}=t.selection,a=r.blockRange(i),o=a&&e.y(a);return o==null?!1:(n&&n(t.tr.lift(a,o).scrollIntoView()),!0)},_=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
2
+ `).scrollIntoView()),!0)};function v(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var y=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let a=r.node(-1),o=r.indexAfter(-1),s=v(a.contentMatchAt(o));if(!s||!a.canReplaceWith(o,o,s))return!1;if(n){let i=r.after(),a=t.tr.replaceWith(i,i,s.createAndFill());a.setSelection(e.o.near(a.doc.resolve(i),1)),n(a.scrollIntoView())}return!0},b=(t,n)=>{let r=t.selection,{$from:i,$to:a}=r;if(r instanceof e.t||i.parent.inlineContent||a.parent.inlineContent)return!1;let o=v(a.parent.contentMatchAt(a.indexAfter()));if(!o||!o.isTextblock)return!1;if(n){let r=(!i.parentOffset&&a.index()<a.parent.childCount?i:a).pos,s=t.tr.insert(r,o.createAndFill());s.setSelection(e.c.create(s.doc,r+1)),n(s.scrollIntoView())}return!0},x=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(e.h(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let i=r.blockRange(),a=i&&e.y(i);return a==null?!1:(n&&n(t.tr.lift(i,a).scrollIntoView()),!0)};function S(t){return(n,r)=>{let{$from:i,$to:a}=n.selection;if(n.selection instanceof e.r&&n.selection.node.isBlock)return!i.parentOffset||!e.h(n.doc,i.pos)?!1:(r&&r(n.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let o=[],s,c,l=!1,u=!1;for(let e=i.depth;;e--)if(i.node(e).isBlock){l=i.end(e)==i.pos+(i.depth-e),u=i.start(e)==i.pos-(i.depth-e),c=v(i.node(e-1).contentMatchAt(i.indexAfter(e-1)));let n=t&&t(a.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=e;break}else{if(e==1)return!1;o.unshift(null)}let d=n.tr;(n.selection instanceof e.c||n.selection instanceof e.t)&&d.deleteSelection();let f=d.mapping.map(i.pos),p=e.h(d.doc,f,o.length,o);if(p||=(o[0]=c?{type:c}:null,e.h(d.doc,f,o.length,o)),!p)return!1;if(d.split(f,o.length,o),!l&&u&&i.node(s).type!=c){let e=d.mapping.map(i.before(s)),t=d.doc.resolve(e);c&&i.node(s-1).canReplaceWith(t.index(),t.index()+1,c)&&d.setNodeMarkup(d.mapping.map(i.before(s)),c)}return r&&r(d.scrollIntoView()),!0}}var C=S(),w=(e,t)=>C(e,t&&(n=>{let r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})),T=(t,n)=>{let{$from:r,to:i}=t.selection,a,o=r.sharedDepth(i);return o==0?!1:(a=r.before(o),n&&n(t.tr.setSelection(e.r.create(t.doc,a))),!0)},E=(t,n)=>(n&&n(t.tr.setSelection(new e.t(t.doc))),!0);function D(t,n,r){let i=n.nodeBefore,a=n.nodeAfter,o=n.index();return!i||!a||!i.type.compatibleContent(a.type)?!1:!i.content.size&&n.parent.canReplace(o-1,o)?(r&&r(t.tr.delete(n.pos-i.nodeSize,n.pos).scrollIntoView()),!0):!n.parent.canReplace(o,o+1)||!(a.isTextblock||e.m(t.doc,n.pos))?!1:(r&&r(t.tr.join(n.pos).scrollIntoView()),!0)}function O(t,n,r,i){let a=n.nodeBefore,o=n.nodeAfter,c,l,u=a.type.spec.isolating||o.type.spec.isolating;if(!u&&D(t,n,r))return!0;let d=!u&&n.parent.canReplace(n.index(),n.index()+1);if(d&&(c=(l=a.contentMatchAt(a.childCount)).findWrapping(o.type))&&l.matchType(c[0]||o.type).validEnd){if(r){let i=n.pos+o.nodeSize,s=e.C.empty;for(let t=c.length-1;t>=0;t--)s=e.C.from(c[t].create(null,s));s=e.C.from(a.copy(s));let l=t.tr.step(new e.d(n.pos-1,i,n.pos,i,new e.k(s,1,0),c.length,!0)),u=l.doc.resolve(i+2*c.length);u.nodeAfter&&u.nodeAfter.type==a.type&&e.m(l.doc,u.pos)&&l.join(u.pos),r(l.scrollIntoView())}return!0}let f=o.type.spec.isolating||i>0&&u?null:e.o.findFrom(n,1),p=f&&f.$from.blockRange(f.$to),m=p&&e.y(p);if(m!=null&&m>=n.depth)return r&&r(t.tr.lift(p,m).scrollIntoView()),!0;if(d&&s(o,`start`,!0)&&s(a,`end`)){let i=a,s=[];for(;s.push(i),!i.isTextblock;)i=i.lastChild;let c=o,l=1;for(;!c.isTextblock;c=c.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,c.content)){if(r){let i=e.C.empty;for(let t=s.length-1;t>=0;t--)i=e.C.from(s[t].copy(i));r(t.tr.step(new e.d(n.pos-s.length,n.pos+o.nodeSize,n.pos+l,n.pos+o.nodeSize-l,new e.k(i,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function k(t){return function(n,r){let i=n.selection,a=t<0?i.$from:i.$to,o=a.depth;for(;a.node(o).isInline;){if(!o)return!1;o--}return a.node(o).isTextblock?(r&&r(n.tr.setSelection(e.c.create(n.doc,t<0?a.start(o):a.end(o)))),!0):!1}}var A=k(-1),j=k(1);function M(t,n=null){return function(r,i){let{$from:a,$to:o}=r.selection,s=a.blockRange(o),c=s&&e._(s,t,n);return c?(i&&i(r.tr.wrap(s,c).scrollIntoView()),!0):!1}}function N(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function P(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:a,$to:o}=t[i],s=a.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(a.pos,o.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=a.pos&&t+e.nodeSize<=o.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}function F(t){let n=[];for(let r=0;r<t.length;r++){let{$from:i,$to:a}=t[r];i.doc.nodesBetween(i.pos,a.pos,(t,r)=>{if(t.isAtom&&t.content.size&&t.isInline&&r>=i.pos&&r+t.nodeSize<=a.pos)return r+1>i.pos&&n.push(new e.s(i,i.doc.resolve(r+1))),i=i.doc.resolve(r+1+t.content.size),!1}),i.pos<a.pos&&n.push(new e.s(i,a))}return n}function I(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,i=(n&&n.enterInlineAtoms)!==!1,a=!(n&&n.includeWhitespace);return function(n,o){let{empty:s,$cursor:c,ranges:l}=n.selection;if(s&&!c||!P(n.doc,l,e,i))return!1;if(o)if(c)e.isInSet(n.storedMarks||c.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,c=n.tr;i||(l=F(l)),s=r?!l.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!l.every(t=>{let n=!1;return c.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,a)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!a&&a.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<l.length;n++){let{$from:r,$to:i}=l[n];if(!s)c.removeMark(r.pos,i.pos,e);else{let n=r.pos,o=i.pos,s=r.nodeAfter,l=i.nodeBefore,u=a&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=a&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+u<o&&(n+=u,o-=d),c.addMark(n,o,e.create(t))}}o(c.scrollIntoView())}return!0}}function L(t,n){return r=>{if(!r.isGeneric)return t(r);let i=[];for(let e=0;e<r.mapping.maps.length;e++){let t=r.mapping.maps[e];for(let e=0;e<i.length;e++)i[e]=t.map(i[e]);t.forEach((e,t,n,r)=>i.push(n,r))}let a=[];for(let e=0;e<i.length;e+=2){let t=i[e],o=i[e+1],s=r.doc.resolve(t),c=s.sharedDepth(o),l=s.node(c);for(let e=s.indexAfter(c),t=s.after(c+1);t<=o;++e){let r=l.maybeChild(e);if(!r)break;if(e&&a.indexOf(t)==-1){let i=l.child(e-1);i.type==r.type&&n(i,r)&&a.push(t)}t+=r.nodeSize}}a.sort((e,t)=>e-t);for(let t=a.length-1;t>=0;t--)e.m(r.doc,a[t])&&r.join(a[t]);t(r)}}function R(e,t){let n=Array.isArray(t)?e=>t.indexOf(e.type.name)>-1:t;return(t,r,i)=>e(t,r&&L(r,n),i)}function z(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var B=z(t,r,c),V=z(t,d,f),H={Enter:z(_,b,x,C),"Mod-Enter":y,Backspace:B,"Mod-Backspace":B,"Shift-Backspace":B,Delete:V,"Mod-Delete":V,"Mod-a":E},U={"Ctrl-h":H.Backspace,"Alt-Backspace":H[`Mod-Backspace`],"Ctrl-d":H.Delete,"Ctrl-Alt-Backspace":H[`Mod-Delete`],"Alt-Delete":H[`Mod-Delete`],"Alt-d":H[`Mod-Delete`],"Ctrl-a":A,"Ctrl-e":j};for(let e in H)U[e]=H[e];var W=(typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()==`darwin`)?U:H;Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return c}});