@coffer-org/web 1.5.1 → 1.7.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 (176) hide show
  1. package/dist/assets/ExtendReasonInfo-Cw042gEq.js +1 -0
  2. package/dist/assets/GeoMap-Gfe3Mxlk.js +1 -0
  3. package/dist/assets/MarkdownEditor-BRFu6dnQ.js +1057 -0
  4. package/dist/assets/NewRecordView-B6V00NvK.js +1 -0
  5. package/dist/assets/{NoMac-BhpqH06Q.js → NoMac-D7iyE4U0.js} +1 -1
  6. package/dist/assets/PageBody-CvuReTKD.js +1 -0
  7. package/dist/assets/PluginSettingsPage-BLyv_svI.js +1 -0
  8. package/dist/assets/{ScanSummary-CmBQJkl4.js → ScanSummary-BtTfSAGX.js} +1 -1
  9. package/dist/assets/SettingsForm-YHNQLRBn.js +1 -0
  10. package/dist/assets/SettingsPage-BVB0OiB8.js +2 -0
  11. package/dist/assets/Toolbar-C08bdOI6.js +2 -0
  12. package/dist/assets/{api-j5etRnzW.js → api-V98HaFMa.js} +1 -1
  13. package/dist/assets/{apl-CnwPGSsG.js → apl-gfMMiTNf.js} +1 -1
  14. package/dist/assets/auth-context-CIGQgBfM.js +1 -0
  15. package/dist/assets/button-Dlm2GmQs.js +5 -0
  16. package/dist/assets/chunk-KS7C4IRE-B1_Zk64s.js +3 -0
  17. package/dist/assets/clike-CVjTFI47.js +1 -0
  18. package/dist/assets/clsx-enQ3xCtU.js +1 -0
  19. package/dist/assets/cobol-DHLQUbN7.js +1 -0
  20. package/dist/assets/{data-size-D-ZPRlPP.js → data-size-DCGcE2iT.js} +1 -1
  21. package/dist/assets/{development-C9_TDKdP.js → development-ChLInqDF.js} +1 -1
  22. package/dist/assets/dist-0L0REEL4.js +6 -0
  23. package/dist/assets/{dist-IN8WN7NI2.js → dist-3a5PKdzH.js} +1 -1
  24. package/dist/assets/{dist-yZ96GF-e.js → dist-6HUZUxgD.js} +1 -1
  25. package/dist/assets/{dist-CkDdxx6J.js → dist-B02SqOKT.js} +1 -1
  26. package/dist/assets/{dist-CMmmtl3f.js → dist-B2pI4xAT.js} +1 -1
  27. package/dist/assets/{dist-Ds6n3XvW.js → dist-B3teaDxf.js} +1 -1
  28. package/dist/assets/dist-BKBBNg6L.js +13 -0
  29. package/dist/assets/{dist-BWI-HTj0.js → dist-BRl6D2sz.js} +1 -1
  30. package/dist/assets/{dist-DBnWo8ZP2.js → dist-BVqKJBMt2.js} +1 -1
  31. package/dist/assets/dist-BnXQsAyw.js +1 -0
  32. package/dist/assets/{dist-C-pDVZl4.js → dist-C9iafu0r.js} +1 -1
  33. package/dist/assets/{dist-BAJKKN4w.js → dist-CFDxfp5Q.js} +1 -1
  34. package/dist/assets/{dist-BCZEBITw.js → dist-CJsxDt1W2.js} +1 -1
  35. package/dist/assets/{dist-C-Tg23jc.js → dist-CTOneYOu.js} +1 -1
  36. package/dist/assets/{dist-Cs9CnlPI.js → dist-CUwIxyXc2.js} +1 -1
  37. package/dist/assets/dist-CdqdWApy.js +1 -0
  38. package/dist/assets/{dist-CjIVK3I-.js → dist-D0lzj0II.js} +1 -1
  39. package/dist/assets/dist-DCRaLcSL.js +11 -0
  40. package/dist/assets/dist-DKL_233B.js +1 -0
  41. package/dist/assets/dist-DdxaiEI9.js +23 -0
  42. package/dist/assets/dist-DkJnaE0X.js +1 -0
  43. package/dist/assets/dist-DnLPZbvG.js +2 -0
  44. package/dist/assets/dist-DxZ6aduu.js +1 -0
  45. package/dist/assets/{dist-6pnKfkc3.js → dist-MrrIHPUp.js} +1 -1
  46. package/dist/assets/dist-TJOGNsUr.js +9 -0
  47. package/dist/assets/{dist-BjPTMVeT.js → dist-bjTa-oQ7.js} +1 -1
  48. package/dist/assets/{dist-CbMhiYBq.js → dist-mpdotBBM.js} +1 -1
  49. package/dist/assets/dist-nHZzrtBn.js +1 -0
  50. package/dist/assets/dist-qu79xOH5.js +1 -0
  51. package/dist/assets/{dist-DvWZsW-D.js → dist-ySmyIRea.js} +1 -1
  52. package/dist/assets/esm-BNZSV1P6.js +24 -0
  53. package/dist/assets/esm-DCMdnC8o.js +1 -0
  54. package/dist/assets/extend-DDZLGxKJ.js +1 -0
  55. package/dist/assets/field-frame-UyV2HVbd.js +1 -0
  56. package/dist/assets/fields-B4fdbc1_.js +64 -0
  57. package/dist/assets/floating-ui.dom-BiC1_AXf.js +1 -0
  58. package/dist/assets/index-C94DLfRb.css +2 -0
  59. package/dist/assets/index-D_9GGfvb.js +354 -0
  60. package/dist/assets/json-2IEVhd4i.js +41 -0
  61. package/dist/assets/jsx-dev-runtime-CSfA-jUb.js +6 -0
  62. package/dist/assets/jsx-runtime-JUshM5qe.js +6 -0
  63. package/dist/assets/lib-Co4B8qAy.js +1 -0
  64. package/dist/assets/lib-DqTnDi2O.js +1 -0
  65. package/dist/assets/micromark-extension-gfm-Cu0AwUgc.js +2 -0
  66. package/dist/assets/plugin-q1oOYqt7.js +1 -0
  67. package/dist/assets/purify.es-sLXpNpJ5.js +3 -0
  68. package/dist/assets/python-2zlmcyof.js +1 -0
  69. package/dist/assets/{react-D4J6PwTK.js → react-n93t21jb.js} +1 -1
  70. package/dist/assets/scheme-tChLYBuY.js +1 -0
  71. package/dist/assets/shared-D0511v9d.js +1 -0
  72. package/dist/assets/shelf-e7xL1R3N.js +1 -0
  73. package/dist/assets/{src-29EVe5AR.js → src-56y8la1R.js} +2 -2
  74. package/dist/assets/src-B5o7YUhY.js +1 -0
  75. package/dist/assets/src-BB5pAQoq.js +7 -0
  76. package/dist/assets/src-BBTJclQ3.js +1 -0
  77. package/dist/assets/{src-BAMTf8UD.js → src-BEw_wZX0.js} +1 -1
  78. package/dist/assets/{src-CEDC2fUY.js → src-BKpM04ou.js} +2 -2
  79. package/dist/assets/{src-7ex3j1NP.js → src-BNqZqACY.js} +1 -1
  80. package/dist/assets/src-BYe9NBzz.js +1 -0
  81. package/dist/assets/src-Bt8MMPOh.js +1 -0
  82. package/dist/assets/{src-YMuIAAH1.js → src-BylCqt8_.js} +1 -1
  83. package/dist/assets/src-CB26t1uZ.js +1 -0
  84. package/dist/assets/src-CQcwtQ4u.js +1 -0
  85. package/dist/assets/src-CSLTj9M0.js +4 -0
  86. package/dist/assets/src-CVMB8d9V.js +1 -0
  87. package/dist/assets/{src-C2Pe7TE7.js → src-CW-yI1QF.js} +1 -1
  88. package/dist/assets/{src-CXN5nPkW.js → src-Cldq12DB.js} +1 -1
  89. package/dist/assets/{src-B8iacye4.js → src-D6YMn8QE.js} +1 -1
  90. package/dist/assets/src-DlE7vhyV.js +1 -0
  91. package/dist/assets/src-Dm6EOjlD2.js +1 -0
  92. package/dist/assets/src-EnowVU3i.js +1 -0
  93. package/dist/assets/src-R62BabNC.js +1 -0
  94. package/dist/assets/src-iQwVT5tJ.js +1 -0
  95. package/dist/assets/src-juXm-tHq.js +1 -0
  96. package/dist/assets/textile-CyzeGT9J.js +1 -0
  97. package/dist/assets/ui-D2hIw4gq.js +2 -0
  98. package/dist/assets/{verilog-D-x6ne0Z.js → verilog-BKSQ5RMB.js} +1 -1
  99. package/dist/assets/vhdl-CBDDcIJ_.js +1 -0
  100. package/dist/assets/{xquery-fj_R-kMw.js → xquery-Cda5K8Gy.js} +1 -1
  101. package/dist/index.html +29 -28
  102. package/dist-vendor/i18next.js +16 -12
  103. package/dist-vendor/jsx-runtime.js +1 -1
  104. package/dist-vendor/{react-DvUFLPdc.js → react-CdP73OPv.js} +1 -1
  105. package/dist-vendor/react-dom.js +2 -2
  106. package/dist-vendor/react.js +2 -2
  107. package/dist-vendor/web-sdk.js +255 -214
  108. package/package.json +4 -2
  109. package/dist/assets/ExtendReasonInfo--21FkkoL.js +0 -1
  110. package/dist/assets/GeoMap-BQkjLI1p.js +0 -1
  111. package/dist/assets/MarkdownEditor-DojqYLfa.js +0 -1059
  112. package/dist/assets/NewRecordView-BJ1XG82z.js +0 -1
  113. package/dist/assets/PageBody-DXEdPT8C.js +0 -1
  114. package/dist/assets/PluginSettingsPage-BzNvTqpx.js +0 -1
  115. package/dist/assets/SettingsForm-Bhsv5BEu.js +0 -1
  116. package/dist/assets/SettingsPage-Bp3-IuWr.js +0 -2
  117. package/dist/assets/Toolbar-CXro4MxC.js +0 -1
  118. package/dist/assets/auth-context-C4OfTBfT.js +0 -1
  119. package/dist/assets/button-CbB4uqRh.js +0 -5
  120. package/dist/assets/chunk-6CSD65Y2-FavEEIOj.js +0 -3
  121. package/dist/assets/clike-DHH8Ad3s.js +0 -1
  122. package/dist/assets/clsx-CjYvs854.js +0 -1
  123. package/dist/assets/cobol-B_OZ4V-R.js +0 -1
  124. package/dist/assets/dist-B23pu61m.js +0 -11
  125. package/dist/assets/dist-BoeBnK7R.js +0 -23
  126. package/dist/assets/dist-C-RcoeMS.js +0 -1
  127. package/dist/assets/dist-CPIHW9BK.js +0 -1
  128. package/dist/assets/dist-CXFe4x2x.js +0 -6
  129. package/dist/assets/dist-CbTzBiwL.js +0 -13
  130. package/dist/assets/dist-CdBkAqXL.js +0 -1
  131. package/dist/assets/dist-DWl5C27n.js +0 -1
  132. package/dist/assets/dist-DchZ6_p12.js +0 -1
  133. package/dist/assets/dist-TV5I3hnS.js +0 -1
  134. package/dist/assets/dist-V4Bgz1i_.js +0 -9
  135. package/dist/assets/dist-gp7nAbF-.js +0 -2
  136. package/dist/assets/dist-iFwZyFpC.js +0 -1
  137. package/dist/assets/esm-Bpmih92m.js +0 -24
  138. package/dist/assets/esm-C4bBicMr.js +0 -1
  139. package/dist/assets/extend-DLMSdMhy.js +0 -1
  140. package/dist/assets/field-frame-BY_3TvHn.js +0 -1
  141. package/dist/assets/fields-DVMUyXbG.js +0 -64
  142. package/dist/assets/floating-ui.dom-CRUx2QLQ.js +0 -1
  143. package/dist/assets/index-Bkh3f49V.css +0 -2
  144. package/dist/assets/index-CPz8IKjT.js +0 -330
  145. package/dist/assets/json-Dm-WBmNs.js +0 -41
  146. package/dist/assets/jsx-dev-runtime-BMBl2lag.js +0 -6
  147. package/dist/assets/jsx-runtime-DV9KAPzc.js +0 -6
  148. package/dist/assets/lib-CMoTMQza.js +0 -1
  149. package/dist/assets/lib-lakrpPuj.js +0 -1
  150. package/dist/assets/micromark-extension-gfm-BCNbxHdH.js +0 -3
  151. package/dist/assets/module-DytlXfXo.js +0 -1
  152. package/dist/assets/objectWithoutPropertiesLoose-DBYSo7QU.js +0 -1
  153. package/dist/assets/plugin-b0fDTTXJ.js +0 -1
  154. package/dist/assets/python-BqYw9LYJ.js +0 -1
  155. package/dist/assets/scheme-CyDdOh7e.js +0 -1
  156. package/dist/assets/shared-QzShdLB7.js +0 -1
  157. package/dist/assets/src-791s3ufb.js +0 -1
  158. package/dist/assets/src-BiPG5Wj0.js +0 -1
  159. package/dist/assets/src-C-Dv1uXg.js +0 -1
  160. package/dist/assets/src-CLRRfAdi.js +0 -1
  161. package/dist/assets/src-CsYFDJmY.js +0 -1
  162. package/dist/assets/src-Ct5XUesp.js +0 -1
  163. package/dist/assets/src-CuLO2WBn2.js +0 -1
  164. package/dist/assets/src-D6UndSMF.js +0 -1
  165. package/dist/assets/src-D8ptIyqZ.js +0 -1
  166. package/dist/assets/src-DLcSAptE.js +0 -1
  167. package/dist/assets/src-DW-wOHmI.js +0 -1
  168. package/dist/assets/src-DiUhYfl4.js +0 -1
  169. package/dist/assets/src-Do7Z4dhu.js +0 -4
  170. package/dist/assets/src-pd92-ym6.js +0 -1
  171. package/dist/assets/src-zakS1nJb.js +0 -7
  172. package/dist/assets/textile-DWBqthVk.js +0 -1
  173. package/dist/assets/ui-Bl7rNE-K.js +0 -2
  174. package/dist/assets/vhdl-CMrOq2q1.js +0 -1
  175. /package/dist/assets/{chunk-QTnfLwEv.js → rolldown-runtime-QTnfLwEv.js} +0 -0
  176. /package/dist-vendor/{chunk-3b4jIN3o.js → rolldown-runtime-3b4jIN3o.js} +0 -0
@@ -1,1059 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-gp7nAbF-.js","assets/dist-BCZEBITw.js","assets/dist-CbTzBiwL.js","assets/dist-C-Tg23jc.js","assets/dist-BjPTMVeT.js","assets/dist-DWl5C27n.js","assets/dist-TV5I3hnS.js","assets/dist-B23pu61m.js","assets/dist-CPIHW9BK.js","assets/dist-Ds6n3XvW.js","assets/dist-BoeBnK7R.js","assets/dist-yZ96GF-e.js","assets/dist-DchZ6_p12.js","assets/dist-CjIVK3I-.js","assets/dist-IN8WN7NI2.js","assets/dist-Cs9CnlPI.js","assets/dist-BWI-HTj0.js","assets/dist-CXFe4x2x.js","assets/dist-C-pDVZl4.js","assets/dist-V4Bgz1i_.js","assets/dist-DvWZsW-D.js","assets/dist-6pnKfkc3.js","assets/dist-BAJKKN4w.js","assets/dist-CMmmtl3f.js","assets/dist-DBnWo8ZP2.js","assets/dockerfile-BLkNEvjs.js","assets/simple-mode-DRpGK0lJ.js","assets/factor-D7LVTn2l.js","assets/javascript-BRzqD9BA.js","assets/javascript-B9TABJff.js","assets/nsis-AQ_alPln.js","assets/pug-Ck0YjsGM.js","assets/dist-CbMhiYBq.js","assets/dist-CkDdxx6J.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-QTnfLwEv.js";import{t}from"./react-D4J6PwTK.js";import{n,t as r}from"./clsx-CjYvs854.js";import{t as i}from"./jsx-dev-runtime-BMBl2lag.js";import{c as a,i as o,n as s,r as c,s as l}from"./floating-ui.dom-CRUx2QLQ.js";import{n as u,t as d}from"./development-C9_TDKdP.js";import{a as f,c as p,d as m,f as h,g,h as _,i as v,l as y,m as b,o as x,p as S,s as ee,t as te,u as ne}from"./micromark-extension-gfm-BCNbxHdH.js";import{$ as re,A as ie,B as ae,Ct as oe,Dt as se,E as ce,Et as le,F as ue,H as de,I as fe,J as pe,K as me,L as he,Mt as ge,O as _e,Ot as ve,P as C,R as ye,S as be,St as xe,T as Se,Tt as Ce,U as we,V as Te,W as Ee,X as De,Y as Oe,Z as ke,a as w,at as Ae,bt as je,c as Me,ct as Ne,dt as Pe,et as Fe,f as Ie,ft as Le,g as Re,gt as ze,it as Be,j as Ve,kt as He,l as Ue,lt as We,mt as Ge,n as Ke,nt as qe,o as Je,ot as Ye,pt as Xe,q as Ze,st as Qe,t as $e,tt as et,ut as tt,v as nt,vt as rt,w as it,wt as at,x as ot,xt as st,z as ct}from"./dist-CbTzBiwL.js";import{i as lt,n as ut,o as dt,r as ft}from"./dist-BCZEBITw.js";import{a as pt,i as mt,n as ht,o as gt,r as _t,s as vt,t as yt,u as bt}from"./lib-lakrpPuj.js";var xt=typeof global==`object`&&global&&global.Object===Object&&global,St=typeof self==`object`&&self&&self.Object===Object&&self,Ct=xt||St||Function(`return this`)(),wt=Ct.Symbol,Tt=Object.prototype,Et=Tt.hasOwnProperty,Dt=Tt.toString,Ot=wt?wt.toStringTag:void 0;function kt(e){var t=Et.call(e,Ot),n=e[Ot];try{e[Ot]=void 0;var r=!0}catch{}var i=Dt.call(e);return r&&(t?e[Ot]=n:delete e[Ot]),i}var At=Object.prototype.toString;function jt(e){return At.call(e)}var Mt=`[object Null]`,Nt=`[object Undefined]`,Pt=wt?wt.toStringTag:void 0;function Ft(e){return e==null?e===void 0?Nt:Mt:Pt&&Pt in Object(e)?kt(e):jt(e)}function It(e){return typeof e==`object`&&!!e}var Lt=`[object Symbol]`;function Rt(e){return typeof e==`symbol`||It(e)&&Ft(e)==Lt}var zt=Array.isArray,Bt=/\s/;function Vt(e){for(var t=e.length;t--&&Bt.test(e.charAt(t)););return t}var Ht=/^\s+/;function Ut(e){return e&&e.slice(0,Vt(e)+1).replace(Ht,``)}function Wt(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Gt=NaN,Kt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Jt=/^0o[0-7]+$/i,Yt=parseInt;function Xt(e){if(typeof e==`number`)return e;if(Rt(e))return Gt;if(Wt(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Wt(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Ut(e);var n=qt.test(e);return n||Jt.test(e)?Yt(e.slice(2),n?2:8):Kt.test(e)?Gt:+e}function Zt(e){return e}var Qt=`[object AsyncFunction]`,$t=`[object Function]`,en=`[object GeneratorFunction]`,tn=`[object Proxy]`;function nn(e){if(!Wt(e))return!1;var t=Ft(e);return t==$t||t==en||t==Qt||t==tn}var rn=Ct[`__core-js_shared__`],an=function(){var e=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function on(e){return!!an&&an in e}var sn=Function.prototype.toString;function cn(e){if(e!=null){try{return sn.call(e)}catch{}try{return e+``}catch{}}return``}var ln=/[\\^$.*+?()[\]{}|]/g,un=/^\[object .+?Constructor\]$/,dn=Function.prototype,fn=Object.prototype,pn=dn.toString,mn=fn.hasOwnProperty,hn=RegExp(`^`+pn.call(mn).replace(ln,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function gn(e){return!Wt(e)||on(e)?!1:(nn(e)?hn:un).test(cn(e))}function _n(e,t){return e?.[t]}function vn(e,t){var n=_n(e,t);return gn(n)?n:void 0}var yn=Object.create,bn=function(){function e(){}return function(t){if(!Wt(t))return{};if(yn)return yn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function xn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Sn(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Cn=800,wn=16,Tn=Date.now;function En(e){var t=0,n=0;return function(){var r=Tn(),i=wn-(r-n);if(n=r,i>0){if(++t>=Cn)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Dn(e){return function(){return e}}var On=function(){try{var e=vn(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),kn=En(On?function(e,t){return On(e,`toString`,{configurable:!0,enumerable:!1,value:Dn(t),writable:!0})}:Zt),An=9007199254740991,jn=/^(?:0|[1-9]\d*)$/;function Mn(e,t){var n=typeof e;return t??=An,!!t&&(n==`number`||n!=`symbol`&&jn.test(e))&&e>-1&&e%1==0&&e<t}function Nn(e,t,n){t==`__proto__`&&On?On(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Pn(e,t){return e===t||e!==e&&t!==t}var Fn=Object.prototype.hasOwnProperty;function In(e,t,n){var r=e[t];(!(Fn.call(e,t)&&Pn(r,n))||n===void 0&&!(t in e))&&Nn(e,t,n)}function Ln(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Nn(n,s,c):In(n,s,c)}return n}var Rn=Math.max;function zn(e,t,n){return t=Rn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Rn(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),xn(e,this,s)}}function Bn(e,t){return kn(zn(e,t,Zt),e+``)}var Vn=9007199254740991;function Hn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Vn}function Un(e){return e!=null&&Hn(e.length)&&!nn(e)}function Wn(e,t,n){if(!Wt(n))return!1;var r=typeof t;return(r==`number`?Un(n)&&Mn(t,n.length):r==`string`&&t in n)?Pn(n[t],e):!1}function Gn(e){return Bn(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Wn(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Kn=Object.prototype;function qn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Kn)}function Jn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Yn=`[object Arguments]`;function Xn(e){return It(e)&&Ft(e)==Yn}var Zn=Object.prototype,Qn=Zn.hasOwnProperty,$n=Zn.propertyIsEnumerable,er=Xn(function(){return arguments}())?Xn:function(e){return It(e)&&Qn.call(e,`callee`)&&!$n.call(e,`callee`)};function tr(){return!1}var nr=typeof exports==`object`&&exports&&!exports.nodeType&&exports,rr=nr&&typeof module==`object`&&module&&!module.nodeType&&module,ir=rr&&rr.exports===nr?Ct.Buffer:void 0,ar=(ir?ir.isBuffer:void 0)||tr,or=`[object Arguments]`,sr=`[object Array]`,cr=`[object Boolean]`,lr=`[object Date]`,ur=`[object Error]`,dr=`[object Function]`,fr=`[object Map]`,pr=`[object Number]`,mr=`[object Object]`,hr=`[object RegExp]`,gr=`[object Set]`,_r=`[object String]`,vr=`[object WeakMap]`,yr=`[object ArrayBuffer]`,br=`[object DataView]`,xr=`[object Float32Array]`,Sr=`[object Float64Array]`,Cr=`[object Int8Array]`,wr=`[object Int16Array]`,Tr=`[object Int32Array]`,Er=`[object Uint8Array]`,Dr=`[object Uint8ClampedArray]`,Or=`[object Uint16Array]`,kr=`[object Uint32Array]`,Ar={};Ar[xr]=Ar[Sr]=Ar[Cr]=Ar[wr]=Ar[Tr]=Ar[Er]=Ar[Dr]=Ar[Or]=Ar[kr]=!0,Ar[or]=Ar[sr]=Ar[yr]=Ar[cr]=Ar[br]=Ar[lr]=Ar[ur]=Ar[dr]=Ar[fr]=Ar[pr]=Ar[mr]=Ar[hr]=Ar[gr]=Ar[_r]=Ar[vr]=!1;function jr(e){return It(e)&&Hn(e.length)&&!!Ar[Ft(e)]}function Mr(e){return function(t){return e(t)}}var Nr=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Pr=Nr&&typeof module==`object`&&module&&!module.nodeType&&module,Fr=Pr&&Pr.exports===Nr&&xt.process,Ir=function(){try{return Pr&&Pr.require&&Pr.require(`util`).types||Fr&&Fr.binding&&Fr.binding(`util`)}catch{}}(),Lr=Ir&&Ir.isTypedArray,Rr=Lr?Mr(Lr):jr,zr=Object.prototype.hasOwnProperty;function Br(e,t){var n=zt(e),r=!n&&er(e),i=!n&&!r&&ar(e),a=!n&&!r&&!i&&Rr(e),o=n||r||i||a,s=o?Jn(e.length,String):[],c=s.length;for(var l in e)(t||zr.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Mn(l,c)))&&s.push(l);return s}function Vr(e,t){return function(n){return e(t(n))}}function Hr(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ur=Object.prototype.hasOwnProperty;function Wr(e){if(!Wt(e))return Hr(e);var t=qn(e),n=[];for(var r in e)r==`constructor`&&(t||!Ur.call(e,r))||n.push(r);return n}function Gr(e){return Un(e)?Br(e,!0):Wr(e)}var Kr=vn(Object,`create`);function qr(){this.__data__=Kr?Kr(null):{},this.size=0}function Jr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Yr=`__lodash_hash_undefined__`,Xr=Object.prototype.hasOwnProperty;function Zr(e){var t=this.__data__;if(Kr){var n=t[e];return n===Yr?void 0:n}return Xr.call(t,e)?t[e]:void 0}var Qr=Object.prototype.hasOwnProperty;function $r(e){var t=this.__data__;return Kr?t[e]!==void 0:Qr.call(t,e)}var ei=`__lodash_hash_undefined__`;function ti(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Kr&&t===void 0?ei:t,this}function ni(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ni.prototype.clear=qr,ni.prototype.delete=Jr,ni.prototype.get=Zr,ni.prototype.has=$r,ni.prototype.set=ti;function ri(){this.__data__=[],this.size=0}function ii(e,t){for(var n=e.length;n--;)if(Pn(e[n][0],t))return n;return-1}var ai=Array.prototype.splice;function oi(e){var t=this.__data__,n=ii(t,e);return n<0?!1:(n==t.length-1?t.pop():ai.call(t,n,1),--this.size,!0)}function si(e){var t=this.__data__,n=ii(t,e);return n<0?void 0:t[n][1]}function ci(e){return ii(this.__data__,e)>-1}function li(e,t){var n=this.__data__,r=ii(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ui(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ui.prototype.clear=ri,ui.prototype.delete=oi,ui.prototype.get=si,ui.prototype.has=ci,ui.prototype.set=li;var di=vn(Ct,`Map`);function fi(){this.size=0,this.__data__={hash:new ni,map:new(di||ui),string:new ni}}function pi(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function mi(e,t){var n=e.__data__;return pi(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function hi(e){var t=mi(this,e).delete(e);return this.size-=+!!t,t}function gi(e){return mi(this,e).get(e)}function _i(e){return mi(this,e).has(e)}function vi(e,t){var n=mi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function yi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yi.prototype.clear=fi,yi.prototype.delete=hi,yi.prototype.get=gi,yi.prototype.has=_i,yi.prototype.set=vi;var bi=Vr(Object.getPrototypeOf,Object),xi=`[object Object]`,Si=Function.prototype,Ci=Object.prototype,wi=Si.toString,Ti=Ci.hasOwnProperty,Ei=wi.call(Object);function Di(e){if(!It(e)||Ft(e)!=xi)return!1;var t=bi(e);if(t===null)return!0;var n=Ti.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&wi.call(n)==Ei}function Oi(){this.__data__=new ui,this.size=0}function ki(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Ai(e){return this.__data__.get(e)}function ji(e){return this.__data__.has(e)}var Mi=200;function Ni(e,t){var n=this.__data__;if(n instanceof ui){var r=n.__data__;if(!di||r.length<Mi-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yi(r)}return n.set(e,t),this.size=n.size,this}function Pi(e){var t=this.__data__=new ui(e);this.size=t.size}Pi.prototype.clear=Oi,Pi.prototype.delete=ki,Pi.prototype.get=Ai,Pi.prototype.has=ji,Pi.prototype.set=Ni;var Fi=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ii=Fi&&typeof module==`object`&&module&&!module.nodeType&&module,Li=Ii&&Ii.exports===Fi?Ct.Buffer:void 0,Ri=Li?Li.allocUnsafe:void 0;function zi(e,t){if(t)return e.slice();var n=e.length,r=Ri?Ri(n):new e.constructor(n);return e.copy(r),r}var Bi=Ct.Uint8Array;function Vi(e){var t=new e.constructor(e.byteLength);return new Bi(t).set(new Bi(e)),t}function Hi(e,t){var n=t?Vi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ui(e){return typeof e.constructor==`function`&&!qn(e)?bn(bi(e)):{}}function Wi(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var Gi=Wi(),Ki=function(){return Ct.Date.now()},qi=`Expected a function`,Ji=Math.max,Yi=Math.min;function Xi(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(qi);t=Xt(t)||0,Wt(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Ji(Xt(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Yi(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Ki();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Ki())}function x(){var e=Ki(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Zi(e,t,n){(n!==void 0&&!Pn(e[t],n)||n===void 0&&!(t in e))&&Nn(e,t,n)}function Qi(e){return It(e)&&Un(e)}function $i(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function ea(e){return Ln(e,Gr(e))}function ta(e,t,n,r,i,a,o){var s=$i(e,n),c=$i(t,n),l=o.get(c);if(l){Zi(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=zt(c),p=!f&&ar(c),m=!f&&!p&&Rr(c);u=c,f||p||m?zt(s)?u=s:Qi(s)?u=Sn(s):p?(d=!1,u=zi(c,!0)):m?(d=!1,u=Hi(c,!0)):u=[]:Di(c)||er(c)?(u=s,er(s)?u=ea(s):(!Wt(s)||nn(s))&&(u=Ui(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Zi(e,n,u)}function na(e,t,n,r,i){e!==t&&Gi(t,function(a,o){if(i||=new Pi,Wt(a))ta(e,t,o,n,na,r,i);else{var s=r?r($i(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Zi(e,o,s)}},Gr)}function ra(e,t,n,r,i,a){return Wt(e)&&Wt(t)&&(a.set(t,e),na(e,t,void 0,ra,a),a.delete(t)),e}var ia=Gn(function(e,t,n,r){na(e,t,n,r)}),aa=Bn(function(e){return e.push(void 0,ra),xn(ia,void 0,e)}),oa=`Expected a function`;function sa(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(oa);return Wt(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),Xi(e,t,{leading:r,maxWait:t,trailing:i})}var ca=e(t(),1);function T(e){return new Je(Me.define(e))}function la(e){return n(()=>import(`./dist-gp7nAbF-.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2,3]))}var ua=[w.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return n(()=>import(`./dist-BjPTMVeT.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]))}}),w.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return n(()=>import(`./dist-BjPTMVeT.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]))}}),w.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return la(`Cassandra`)}}),w.of({name:`CSS`,extensions:[`css`],load(){return n(()=>import(`./dist-DWl5C27n.js`).then(e=>e.css()),__vite__mapDeps([5,6,2,3]))}}),w.of({name:`Go`,extensions:[`go`],load(){return n(()=>import(`./dist-B23pu61m.js`).then(e=>e.go()),__vite__mapDeps([7,1,2,3]))}}),w.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return n(()=>import(`./dist-CPIHW9BK.js`).then(e=>e.html()),__vite__mapDeps([8,9,6,2,3,10,1]))}}),w.of({name:`Java`,extensions:[`java`],load(){return n(()=>import(`./dist-yZ96GF-e.js`).then(e=>e.java()),__vite__mapDeps([11,2,3]))}}),w.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return n(()=>import(`./dist-DchZ6_p12.js`).then(e=>e.javascript()),__vite__mapDeps([12,10,1,2,3]))}}),w.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return n(()=>import(`./dist-CjIVK3I-.js`).then(e=>e.jinja()),__vite__mapDeps([13,9,6,2,3,10,1]))}}),w.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return n(()=>import(`./dist-IN8WN7NI2.js`).then(e=>e.json()),__vite__mapDeps([14,2,3]))}}),w.of({name:`JSX`,extensions:[`jsx`],load(){return n(()=>import(`./dist-DchZ6_p12.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([12,10,1,2,3]))}}),w.of({name:`LESS`,extensions:[`less`],load(){return n(()=>import(`./dist-Cs9CnlPI.js`).then(e=>e.less()),__vite__mapDeps([15,6,2,3]))}}),w.of({name:`Liquid`,extensions:[`liquid`],load(){return n(()=>import(`./dist-BWI-HTj0.js`).then(e=>e.liquid()),__vite__mapDeps([16,9,6,2,3,10,1]))}}),w.of({name:`MariaDB SQL`,load(){return la(`MariaSQL`)}}),w.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return n(()=>import(`./dist-CXFe4x2x.js`).then(e=>e.markdown()),__vite__mapDeps([17,1,2,9,6,3,10]))}}),w.of({name:`MS SQL`,load(){return la(`MSSQL`)}}),w.of({name:`MySQL`,load(){return la(`MySQL`)}}),w.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return n(()=>import(`./dist-C-pDVZl4.js`).then(e=>e.php()),__vite__mapDeps([18,9,6,2,3,10,1]))}}),w.of({name:`PLSQL`,extensions:[`pls`],load(){return la(`PLSQL`)}}),w.of({name:`PostgreSQL`,load(){return la(`PostgreSQL`)}}),w.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return n(()=>import(`./dist-V4Bgz1i_.js`).then(e=>e.python()),__vite__mapDeps([19,1,2,3]))}}),w.of({name:`Rust`,extensions:[`rs`],load(){return n(()=>import(`./dist-DvWZsW-D.js`).then(e=>e.rust()),__vite__mapDeps([20,2,3]))}}),w.of({name:`Sass`,extensions:[`sass`],load(){return n(()=>import(`./dist-6pnKfkc3.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([21,6,2,3]))}}),w.of({name:`SCSS`,extensions:[`scss`],load(){return n(()=>import(`./dist-6pnKfkc3.js`).then(e=>e.sass()),__vite__mapDeps([21,6,2,3]))}}),w.of({name:`SQL`,extensions:[`sql`],load(){return la(`StandardSQL`)}}),w.of({name:`SQLite`,load(){return la(`SQLite`)}}),w.of({name:`TSX`,extensions:[`tsx`],load(){return n(()=>import(`./dist-DchZ6_p12.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([12,10,1,2,3]))}}),w.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return n(()=>import(`./dist-DchZ6_p12.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([12,10,1,2,3]))}}),w.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return n(()=>import(`./dist-BAJKKN4w.js`).then(e=>e.wast()),__vite__mapDeps([22,2,3]))}}),w.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return n(()=>import(`./dist-CMmmtl3f.js`).then(e=>e.xml()),__vite__mapDeps([23,2,3]))}}),w.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return n(()=>import(`./dist-DBnWo8ZP2.js`).then(e=>e.yaml()),__vite__mapDeps([24,2,3]))}}),w.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return n(()=>import(`./apl-CnwPGSsG.js`).then(e=>T(e.apl)),[])}}),w.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return n(()=>import(`./asciiarmor-qTkVPQu6.js`).then(e=>T(e.asciiArmor)),[])}}),w.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return n(()=>import(`./asn1-Dr8qZg38.js`).then(e=>T(e.asn1({}))),[])}}),w.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return n(()=>import(`./asterisk-Bja0s6e1.js`).then(e=>T(e.asterisk)),[])}}),w.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return n(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>T(e.brainfuck)),[])}}),w.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return n(()=>import(`./cobol-B_OZ4V-R.js`).then(e=>T(e.cobol)),[])}}),w.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.csharp)),[])}}),w.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return n(()=>import(`./clojure-BflJGmDX.js`).then(e=>T(e.clojure)),[])}}),w.of({name:`ClojureScript`,extensions:[`cljs`],load(){return n(()=>import(`./clojure-BflJGmDX.js`).then(e=>T(e.clojure)),[])}}),w.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return n(()=>import(`./css-CYpP4FRV.js`).then(e=>T(e.gss)),[])}}),w.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return n(()=>import(`./cmake-CyVbuzPu.js`).then(e=>T(e.cmake)),[])}}),w.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return n(()=>import(`./coffeescript-B2pKbFk8.js`).then(e=>T(e.coffeeScript)),[])}}),w.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return n(()=>import(`./commonlisp-CcllspGY.js`).then(e=>T(e.commonLisp)),[])}}),w.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return n(()=>import(`./cypher-p9eYesGn.js`).then(e=>T(e.cypher)),[])}}),w.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return n(()=>import(`./python-BqYw9LYJ.js`).then(e=>T(e.cython)),[])}}),w.of({name:`Crystal`,extensions:[`cr`],load(){return n(()=>import(`./crystal-M5-qzICs.js`).then(e=>T(e.crystal)),[])}}),w.of({name:`D`,extensions:[`d`],load(){return n(()=>import(`./d-BhMjBjQP.js`).then(e=>T(e.d)),[])}}),w.of({name:`Dart`,extensions:[`dart`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.dart)),[])}}),w.of({name:`diff`,extensions:[`diff`,`patch`],load(){return n(()=>import(`./diff-ChtP43wD.js`).then(e=>T(e.diff)),[])}}),w.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return n(()=>import(`./dockerfile-BLkNEvjs.js`).then(e=>T(e.dockerFile)),__vite__mapDeps([25,26]))}}),w.of({name:`DTD`,extensions:[`dtd`],load(){return n(()=>import(`./dtd-DTF72YNO.js`).then(e=>T(e.dtd)),[])}}),w.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return n(()=>import(`./dylan-C6jEEEk-.js`).then(e=>T(e.dylan)),[])}}),w.of({name:`EBNF`,load(){return n(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>T(e.ebnf)),[])}}),w.of({name:`ECL`,extensions:[`ecl`],load(){return n(()=>import(`./ecl-BSZaIHnp.js`).then(e=>T(e.ecl)),[])}}),w.of({name:`edn`,extensions:[`edn`],load(){return n(()=>import(`./clojure-BflJGmDX.js`).then(e=>T(e.clojure)),[])}}),w.of({name:`Eiffel`,extensions:[`e`],load(){return n(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>T(e.eiffel)),[])}}),w.of({name:`Elm`,extensions:[`elm`],load(){return n(()=>import(`./elm-Cshzl8qu.js`).then(e=>T(e.elm)),[])}}),w.of({name:`Erlang`,extensions:[`erl`],load(){return n(()=>import(`./erlang-DaB2Rkuy.js`).then(e=>T(e.erlang)),[])}}),w.of({name:`Esper`,load(){return n(()=>import(`./sql-DcCJ9jop.js`).then(e=>T(e.esper)),[])}}),w.of({name:`Factor`,extensions:[`factor`],load(){return n(()=>import(`./factor-D7LVTn2l.js`).then(e=>T(e.factor)),__vite__mapDeps([27,26]))}}),w.of({name:`FCL`,load(){return n(()=>import(`./fcl-ClOhbFR7.js`).then(e=>T(e.fcl)),[])}}),w.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return n(()=>import(`./forth-Cezjo90N.js`).then(e=>T(e.forth)),[])}}),w.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return n(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>T(e.fortran)),[])}}),w.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return n(()=>import(`./mllike-B45xgp2S.js`).then(e=>T(e.fSharp)),[])}}),w.of({name:`Gas`,extensions:[`s`],load(){return n(()=>import(`./gas-BHEdbvp9.js`).then(e=>T(e.gas)),[])}}),w.of({name:`Gherkin`,extensions:[`feature`],load(){return n(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>T(e.gherkin)),[])}}),w.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return n(()=>import(`./groovy-BC3IOsC8.js`).then(e=>T(e.groovy)),[])}}),w.of({name:`Haskell`,extensions:[`hs`],load(){return n(()=>import(`./haskell-BRsoo5mP.js`).then(e=>T(e.haskell)),[])}}),w.of({name:`Haxe`,extensions:[`hx`],load(){return n(()=>import(`./haxe-DjVOVvNP.js`).then(e=>T(e.haxe)),[])}}),w.of({name:`HXML`,extensions:[`hxml`],load(){return n(()=>import(`./haxe-DjVOVvNP.js`).then(e=>T(e.hxml)),[])}}),w.of({name:`HTTP`,load(){return n(()=>import(`./http-CLVgA2GD.js`).then(e=>T(e.http)),[])}}),w.of({name:`IDL`,extensions:[`pro`],load(){return n(()=>import(`./idl-BUZw3wgd.js`).then(e=>T(e.idl)),[])}}),w.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return n(()=>import(`./javascript-BRzqD9BA.js`).then(e=>T(e.jsonld)),__vite__mapDeps([28,29]))}}),w.of({name:`Julia`,extensions:[`jl`],load(){return n(()=>import(`./julia-CQfgDRfP.js`).then(e=>T(e.julia)),[])}}),w.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.kotlin)),[])}}),w.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return n(()=>import(`./livescript-BXxG0Yva.js`).then(e=>T(e.liveScript)),[])}}),w.of({name:`Lua`,extensions:[`lua`],load(){return n(()=>import(`./lua-CiA1ziua.js`).then(e=>T(e.lua)),[])}}),w.of({name:`mIRC`,extensions:[`mrc`],load(){return n(()=>import(`./mirc-C9zpzAZU.js`).then(e=>T(e.mirc)),[])}}),w.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return n(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>T(e.mathematica)),[])}}),w.of({name:`Modelica`,extensions:[`mo`],load(){return n(()=>import(`./modelica-CqHI_q-D.js`).then(e=>T(e.modelica)),[])}}),w.of({name:`MUMPS`,extensions:[`mps`],load(){return n(()=>import(`./mumps-CW_TBmxz.js`).then(e=>T(e.mumps)),[])}}),w.of({name:`Mbox`,extensions:[`mbox`],load(){return n(()=>import(`./mbox-BEMVcqjs.js`).then(e=>T(e.mbox)),[])}}),w.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return n(()=>import(`./nginx-BMaDbqW3.js`).then(e=>T(e.nginx)),[])}}),w.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return n(()=>import(`./nsis-AQ_alPln.js`).then(e=>T(e.nsis)),__vite__mapDeps([30,26]))}}),w.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return n(()=>import(`./ntriples-d28e9m0E.js`).then(e=>T(e.ntriples)),[])}}),w.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.objectiveC)),[])}}),w.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.objectiveCpp)),[])}}),w.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return n(()=>import(`./mllike-B45xgp2S.js`).then(e=>T(e.oCaml)),[])}}),w.of({name:`Octave`,extensions:[`m`],load(){return n(()=>import(`./octave-D2Q8cUp1.js`).then(e=>T(e.octave)),[])}}),w.of({name:`Oz`,extensions:[`oz`],load(){return n(()=>import(`./oz-BwTct_5T.js`).then(e=>T(e.oz)),[])}}),w.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return n(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>T(e.pascal)),[])}}),w.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return n(()=>import(`./perl-CdEHsPfU.js`).then(e=>T(e.perl)),[])}}),w.of({name:`Pig`,extensions:[`pig`],load(){return n(()=>import(`./pig-AF4Hwhju.js`).then(e=>T(e.pig)),[])}}),w.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return n(()=>import(`./powershell-CzG71I4L.js`).then(e=>T(e.powerShell)),[])}}),w.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return n(()=>import(`./properties-C357ku5U.js`).then(e=>T(e.properties)),[])}}),w.of({name:`ProtoBuf`,extensions:[`proto`],load(){return n(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>T(e.protobuf)),[])}}),w.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return n(()=>import(`./pug-Ck0YjsGM.js`).then(e=>T(e.pug)),__vite__mapDeps([31,29]))}}),w.of({name:`Puppet`,extensions:[`pp`],load(){return n(()=>import(`./puppet-B4hC2X4m.js`).then(e=>T(e.puppet)),[])}}),w.of({name:`Q`,extensions:[`q`],load(){return n(()=>import(`./q-B9NhS7L_.js`).then(e=>T(e.q)),[])}}),w.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return n(()=>import(`./r-DADKenSm.js`).then(e=>T(e.r)),[])}}),w.of({name:`RPM Changes`,load(){return n(()=>import(`./rpm-gpDK5sbt.js`).then(e=>T(e.rpmChanges)),[])}}),w.of({name:`RPM Spec`,extensions:[`spec`],load(){return n(()=>import(`./rpm-gpDK5sbt.js`).then(e=>T(e.rpmSpec)),[])}}),w.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return n(()=>import(`./ruby-DsYpTuWg.js`).then(e=>T(e.ruby)),[])}}),w.of({name:`SAS`,extensions:[`sas`],load(){return n(()=>import(`./sas-C2OyD2Y6.js`).then(e=>T(e.sas)),[])}}),w.of({name:`Scala`,extensions:[`scala`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.scala)),[])}}),w.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return n(()=>import(`./scheme-CyDdOh7e.js`).then(e=>T(e.scheme)),[])}}),w.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return n(()=>import(`./shell-Du5Qg9im.js`).then(e=>T(e.shell)),[])}}),w.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return n(()=>import(`./sieve-BAxa3IjF.js`).then(e=>T(e.sieve)),[])}}),w.of({name:`Smalltalk`,extensions:[`st`],load(){return n(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>T(e.smalltalk)),[])}}),w.of({name:`Solr`,load(){return n(()=>import(`./solr-BBopId9w.js`).then(e=>T(e.solr)),[])}}),w.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return n(()=>import(`./mllike-B45xgp2S.js`).then(e=>T(e.sml)),[])}}),w.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return n(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>T(e.sparql)),[])}}),w.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return n(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>T(e.spreadsheet)),[])}}),w.of({name:`Squirrel`,extensions:[`nut`],load(){return n(()=>import(`./clike-DHH8Ad3s.js`).then(e=>T(e.squirrel)),[])}}),w.of({name:`Stylus`,extensions:[`styl`],load(){return n(()=>import(`./stylus-DLLZ8dgm.js`).then(e=>T(e.stylus)),[])}}),w.of({name:`Swift`,extensions:[`swift`],load(){return n(()=>import(`./swift-DKB6_1j6.js`).then(e=>T(e.swift)),[])}}),w.of({name:`sTeX`,load(){return n(()=>import(`./stex-sDrdk2BW.js`).then(e=>T(e.stex)),[])}}),w.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return n(()=>import(`./stex-sDrdk2BW.js`).then(e=>T(e.stex)),[])}}),w.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return n(()=>import(`./verilog-D-x6ne0Z.js`).then(e=>T(e.verilog)),[])}}),w.of({name:`Tcl`,extensions:[`tcl`],load(){return n(()=>import(`./tcl-BGfruO1u.js`).then(e=>T(e.tcl)),[])}}),w.of({name:`Textile`,extensions:[`textile`],load(){return n(()=>import(`./textile-DWBqthVk.js`).then(e=>T(e.textile)),[])}}),w.of({name:`TiddlyWiki`,load(){return n(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>T(e.tiddlyWiki)),[])}}),w.of({name:`Tiki wiki`,load(){return n(()=>import(`./tiki-CxVlf5KZ.js`).then(e=>T(e.tiki)),[])}}),w.of({name:`TOML`,extensions:[`toml`],load(){return n(()=>import(`./toml-LvoKBwCs.js`).then(e=>T(e.toml)),[])}}),w.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return n(()=>import(`./troff-C2dAgh7P.js`).then(e=>T(e.troff)),[])}}),w.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return n(()=>import(`./ttcn-BePYh-hG.js`).then(e=>T(e.ttcn)),[])}}),w.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return n(()=>import(`./ttcn-cfg-CY0aot7Q.js`).then(e=>T(e.ttcnCfg)),[])}}),w.of({name:`Turtle`,extensions:[`ttl`],load(){return n(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>T(e.turtle)),[])}}),w.of({name:`Web IDL`,extensions:[`webidl`],load(){return n(()=>import(`./webidl-D5jiJvOU.js`).then(e=>T(e.webIDL)),[])}}),w.of({name:`VB.NET`,extensions:[`vb`],load(){return n(()=>import(`./vb-BthdM_4N.js`).then(e=>T(e.vb)),[])}}),w.of({name:`VBScript`,extensions:[`vbs`],load(){return n(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>T(e.vbScript)),[])}}),w.of({name:`Velocity`,extensions:[`vtl`],load(){return n(()=>import(`./velocity-CqftRsjg.js`).then(e=>T(e.velocity)),[])}}),w.of({name:`Verilog`,extensions:[`v`],load(){return n(()=>import(`./verilog-D-x6ne0Z.js`).then(e=>T(e.verilog)),[])}}),w.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return n(()=>import(`./vhdl-CMrOq2q1.js`).then(e=>T(e.vhdl)),[])}}),w.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return n(()=>import(`./xquery-fj_R-kMw.js`).then(e=>T(e.xQuery)),[])}}),w.of({name:`Yacas`,extensions:[`ys`],load(){return n(()=>import(`./yacas-CXXgtw0p.js`).then(e=>T(e.yacas)),[])}}),w.of({name:`Z80`,extensions:[`z80`],load(){return n(()=>import(`./z80-CL1naaMV.js`).then(e=>T(e.z80)),[])}}),w.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return n(()=>import(`./mscgen-qgSLujhx.js`).then(e=>T(e.mscgen)),[])}}),w.of({name:`Xù`,extensions:[`xu`],load(){return n(()=>import(`./mscgen-qgSLujhx.js`).then(e=>T(e.xu)),[])}}),w.of({name:`MsGenny`,extensions:[`msgenny`],load(){return n(()=>import(`./mscgen-qgSLujhx.js`).then(e=>T(e.msgenny)),[])}}),w.of({name:`Vue`,extensions:[`vue`],load(){return n(()=>import(`./dist-CbMhiYBq.js`).then(e=>e.vue()),__vite__mapDeps([32,9,6,2,3,10,1]))}}),w.of({name:`Angular Template`,load(){return n(()=>import(`./dist-CkDdxx6J.js`).then(e=>e.angular()),__vite__mapDeps([33,9,6,2,3,10,1]))}})],da=`#e5c07b`,fa=`#e06c75`,pa=`#56b6c2`,ma=`#ffffff`,ha=`#abb2bf`,ga=`#7d8799`,_a=`#61afef`,va=`#98c379`,ya=`#d19a66`,ba=`#c678dd`,xa=`#21252b`,Sa=`#2c313a`,Ca=`#282c34`,wa=`#353a42`,Ta=`#3E4451`,Ea=`#528bff`,Da=[he.theme({"&":{color:ha,backgroundColor:Ca},".cm-content":{caretColor:Ea},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ea},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ta},".cm-panels":{backgroundColor:xa,color:ha},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:Ca,color:ga,border:`none`},".cm-activeLineGutter":{backgroundColor:Sa},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:wa},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:wa,borderBottomColor:wa},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Sa,color:ha}}},{dark:!0}),ie($e.define([{tag:C.keyword,color:ba},{tag:[C.name,C.deleted,C.character,C.propertyName,C.macroName],color:fa},{tag:[C.function(C.variableName),C.labelName],color:_a},{tag:[C.color,C.constant(C.name),C.standard(C.name)],color:ya},{tag:[C.definition(C.name),C.separator],color:ha},{tag:[C.typeName,C.className,C.number,C.changed,C.annotation,C.modifier,C.self,C.namespace],color:da},{tag:[C.operator,C.operatorKeyword,C.url,C.escape,C.regexp,C.link,C.special(C.string)],color:pa},{tag:[C.meta,C.comment],color:ga},{tag:C.strong,fontWeight:`bold`},{tag:C.emphasis,fontStyle:`italic`},{tag:C.strikethrough,textDecoration:`line-through`},{tag:C.link,color:ga,textDecoration:`underline`},{tag:C.heading,fontWeight:`bold`,color:fa},{tag:[C.atom,C.bool,C.special(C.variableName)],color:ya},{tag:[C.processingInstruction,C.string,C.inserted],color:va},{tag:C.invalid,color:ma}]))],Oa=function(e){return e.docTypeError=`docTypeError`,e.contextNotFound=`contextNotFound`,e.timerNotFound=`timerNotFound`,e.ctxCallOutOfScope=`ctxCallOutOfScope`,e.createNodeInParserFail=`createNodeInParserFail`,e.stackOverFlow=`stackOverFlow`,e.parserMatchError=`parserMatchError`,e.serializerMatchError=`serializerMatchError`,e.getAtomFromSchemaFail=`getAtomFromSchemaFail`,e.expectDomTypeError=`expectDomTypeError`,e.callCommandBeforeEditorView=`callCommandBeforeEditorView`,e.missingRootElement=`missingRootElement`,e.missingNodeInSchema=`missingNodeInSchema`,e.missingMarkInSchema=`missingMarkInSchema`,e.ctxNotBind=`ctxNotBind`,e.missingYjsDoc=`missingYjsDoc`,e.aiProviderError=`aiProviderError`,e.aiBuildContextError=`aiBuildContextError`,e}({}),ka=class extends Error{constructor(e,t,n){super(t,n),this.name=`MilkdownError`,this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},Aa=(e,t)=>typeof t==`function`?`[Function]`:t,ja=e=>JSON.stringify(e,Aa);function Ma(e){return new ka(Oa.docTypeError,`Doc type error, unsupported type: ${ja(e)}`)}function Na(e){return new ka(Oa.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function Pa(e){return new ka(Oa.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function Fa(){return new ka(Oa.ctxCallOutOfScope,`Should not call a context out of the plugin.`)}function Ia(e,t,n){let r=`Cannot create node for ${`name`in e?e.name:e}`,i=e=>{if(e==null)return`null`;if(Array.isArray(e))return`[${e.map(i).join(`, `)}]`;if(typeof e==`object`)return`toJSON`in e&&typeof e.toJSON==`function`?JSON.stringify(e.toJSON()):`spec`in e?JSON.stringify(e.spec):JSON.stringify(e);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return JSON.stringify(e);if(typeof e==`function`)return`[Function: ${e.name||`anonymous`}]`;try{return String(e)}catch{return`[Unserializable]`}},a=[[`[Description]`,r],[`[Attributes]`,t],[`[Content]`,(n??[]).map(e=>e?typeof e==`object`&&`type`in e?`${e}`:i(e):`null`)]].reduce((e,[t,n])=>{let r=`${t}: ${i(n)}.`;return e.concat(r)},[]);return new ka(Oa.createNodeInParserFail,a.join(`
3
- `))}function La(){return new ka(Oa.stackOverFlow,`Stack over flow, cannot pop on an empty stack.`)}function Ra(e){return new ka(Oa.parserMatchError,`Cannot match target parser for node: ${ja(e)}.`)}function za(e){return new ka(Oa.serializerMatchError,`Cannot match target serializer for node: ${ja(e)}.`)}function Ba(e,t){return new ka(Oa.getAtomFromSchemaFail,`Cannot get ${e}: ${t} from schema.`)}function Va(e){return new ka(Oa.expectDomTypeError,`Expect to be a dom, but get: ${ja(e)}.`)}function Ha(){return new ka(Oa.callCommandBeforeEditorView,`You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized`)}function Ua(e){return new ka(Oa.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function Wa(e){return new ka(Oa.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}function Ga(e){try{return ja(e)}catch{return`[Unserializable]`}}function Ka(e){let t=e instanceof Error?e.message:Ga(e);return new ka(Oa.aiProviderError,`AI provider error: ${t}`,{cause:e})}function qa(e){let t=e instanceof Error?e.message:Ga(e);return new ka(Oa.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:e})}var Ja=class{constructor(){this.sliceMap=new Map,this.get=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!t)throw Na(typeof e==`string`?e:e.name);return t},this.remove=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e==`string`?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},Ya=class{#e;#t;#n;constructor(e,t,n){this.#e=[],this.#n=()=>{this.#e.forEach(e=>e(this.#t))},this.set=e=>{this.#t=e,this.#n()},this.get=()=>this.#t,this.update=e=>{this.#t=e(this.#t),this.#n()},this.type=n,this.#t=t,e.set(n.id,this)}on(e){return this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){this.#e=this.#e.filter(t=>t!==e)}offAll(){this.#e=[]}},Xa=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw Fa()}}create(e,t=this._defaultValue){return new Ya(e,t,this)}},Za=(e,t)=>new Xa(e,t),Qa=class{#e;#t;#n;#r;#i;#a;#o;constructor(e,t,n){this.#r=new Set,this.#i=new Set,this.#a=new Map,this.#o=new Map,this.read=()=>({metadata:this.#e,injectedSlices:[...this.#r].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),consumedSlices:[...this.#i].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),recordedTimers:[...this.#a].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)})),waitTimers:[...this.#o].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)}))}),this.onRecord=e=>{this.#a.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#a.delete(e)},this.onDone=e=>{let t=this.#a.get(e);t&&(t.duration=Date.now()-t.start)},this.onWait=(e,t)=>{let n=Date.now();t.finally(()=>{this.#o.set(e,{duration:Date.now()-n})}).catch(console.error)},this.onInject=e=>{this.#r.add(e)},this.onRemove=e=>{this.#r.delete(e)},this.onUse=e=>{this.#i.add(e)},this.#s=e=>this.#t.get(e).get(),this.#c=e=>this.#n.get(e).status,this.#t=e,this.#n=t,this.#e=n}#s;#c},$a=class e{#e;#t;#n;#r;constructor(t,n,r){this.produce=t=>t&&Object.keys(t).length?new e(this.#e,this.#t,{...t}):this,this.inject=(e,t)=>{let n=e.create(this.#e.sliceMap);return t!=null&&n.set(t),this.#r?.onInject(e),this},this.remove=e=>(this.#e.remove(e),this.#r?.onRemove(e),this),this.record=e=>(e.create(this.#t.store),this.#r?.onRecord(e),this),this.clearTimer=e=>(this.#t.remove(e),this.#r?.onClear(e),this),this.isInjected=e=>this.#e.has(e),this.isRecorded=e=>this.#t.has(e),this.use=e=>(this.#r?.onUse(e),this.#e.get(e)),this.get=e=>this.use(e).get(),this.set=(e,t)=>this.use(e).set(t),this.update=(e,t)=>this.use(e).update(t),this.timer=e=>this.#t.get(e),this.done=e=>{this.timer(e).done(),this.#r?.onDone(e)},this.wait=e=>{let t=this.timer(e).start();return this.#r?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#e=t,this.#t=n,this.#n=r,r&&(this.#r=new Qa(t,n,r))}get meta(){return this.#n}get inspector(){return this.#r}},eo=class{constructor(){this.store=new Map,this.get=e=>{let t=this.store.get(e.id);if(!t)throw Pa(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},to=class{#e;#t;#n;#r;constructor(e,t){this.#e=null,this.#t=null,this.#r=`pending`,this.start=()=>(this.#e??=new Promise((e,t)=>{this.#t=t=>{t instanceof CustomEvent&&t.detail.id===this.#n&&(this.#r=`resolved`,this.#i(),t.stopImmediatePropagation(),e())},this.#a(()=>{this.#r===`pending`&&(this.#r=`rejected`),this.#i(),t(Error(`Timing ${this.type.name} timeout.`))}),this.#r=`pending`,addEventListener(this.type.name,this.#t)}),this.#e),this.done=()=>{let e=new CustomEvent(this.type.name,{detail:{id:this.#n}});dispatchEvent(e)},this.#i=()=>{this.#t&&removeEventListener(this.type.name,this.#t)},this.#a=e=>{setTimeout(()=>{e()},this.type.timeout)},this.#n=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#r}#i;#a},no=class{constructor(e,t=3e3){this.create=e=>new to(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},ro=(e,t=3e3)=>new no(e,t),io={};function ao(e,t){let n=t||io;return oo(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function oo(e,t,n){if(co(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 so(e.children,t,n)}return Array.isArray(e)?so(e,t,n):``}function so(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=oo(e[i],t,n);return r.join(``)}function co(e){return!!(e&&typeof e==`object`)}var lo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uo(e){return e.replace(lo,fo)}function fo(e,t,n){if(t)return t;if(n.charCodeAt(0)===g.numberSign){let e=n.charCodeAt(1),t=e===g.lowercaseX||e===g.uppercaseX;return S(n.slice(t?2:1),t?_.numericBaseHexadecimal:_.numericBaseDecimal)}return u(n)||e}var po={}.hasOwnProperty;function mo(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ho(n)(f(x(n).document().write(v()(e,t,!0))))}function ho(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Le),autolinkProtocol:le,autolinkEmail:le,atxHeading:a(Ne),blockQuote:a(ke),characterEscape:le,characterReference:le,codeFenced:a(w),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(w,o),codeText:a(Ae,o),codeTextData:le,data:le,codeFlowValue:le,definition:a(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Me),hardBreakEscape:a(Pe),hardBreakTrailing:a(Pe),htmlFlow:a(Fe,o),htmlFlowData:le,htmlText:a(Fe,o),htmlTextData:le,image:a(Ie),label:o,link:a(Le),listItem:a(ze),listItemValue:m,listOrdered:a(Re,p),listUnordered:a(Re),paragraph:a(Be),reference:Se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ne),strong:a(Ve),thematicBreak:a(Ue)},exit:{atxHeading:c(),atxHeadingSequence:ae,autolink:c(),autolinkEmail:Oe,autolinkProtocol:De,blockQuote:c(),characterEscapeValue:ue,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:Te,characterReference:Ee,codeFenced:c(ee),codeFencedFence:x,codeFencedFenceInfo:v,codeFencedFenceMeta:y,codeFlowValue:ue,codeIndented:c(te),codeText:c(he),codeTextData:ue,data:ue,definition:c(),definitionDestinationString:ie,definitionLabelString:ne,definitionTitleString:re,emphasis:c(),hardBreakEscape:c(fe),hardBreakTrailing:c(fe),htmlFlow:c(pe),htmlFlowData:ue,htmlText:c(me),htmlTextData:ue,image:c(_e),label:C,labelText:ve,lineEnding:de,link:c(ge),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Ce,resourceDestinationString:ye,resourceTitleString:be,resource:xe,setextHeading:c(ce),setextHeadingLineSequence:se,setextHeadingText:oe,strong:c(),thematicBreak:c()}};_o(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:f,data:n},c=[],u=-1;for(;++u<e.length;)if(e[u][1].type===b.listOrdered||e[u][1].type===b.listUnordered)if(e[u][0]===`enter`)c.push(u);else{let t=c.pop();d(typeof t==`number`,`expected list to be open`),u=i(e,t,u)}for(u=-1;++u<e.length;){let n=t[e[u][0]];po.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||yo).call(a,void 0,e[0])}for(r.position={start:go(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:go(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case b.listUnordered:case b.listOrdered:case b.blockQuote:t[0]===`enter`?i++:i--,l=void 0;break;case b.lineEndingBlank:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case b.linePrefix:case b.listItemValue:case b.listItemMarker:case b.listItemPrefix:case b.listItemPrefixWhitespace:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===b.listItemPrefix||i===-1&&t[0]===`exit`&&(t[1].type===b.listUnordered||t[1].type===b.listOrdered)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===b.lineEnding||t[1].type===b.lineEndingBlank){if(t[0]===`exit`)continue;s&&(e[s][1].type=b.lineEndingBlank,a=!0),t[1].type=b.lineEnding,s=i}else if(!(t[1].type===b.linePrefix||t[1].type===b.blockQuotePrefix||t[1].type===b.blockQuotePrefixWhitespace||t[1].type===b.blockQuoteMarker||t[1].type===b.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===b.listItemPrefix){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){let r=this.stack[this.stack.length-1];d(r,"expected `parent`"),d(`children`in r,"expected `parent`"),r.children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:go(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop();d(n,"expected `node`");let r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||yo).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+bt({start:e.start,end:e.end})+`): it’s not open`);d(n.type!==`fragment`,"unexpected fragment `exit`ed"),d(n.position,"expected `position` to be defined"),n.position.end=go(e.end)}function f(){return ao(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];d(t,`expected nodes on stack`),d(t.type===`list`,`expected list on stack`),t.start=Number.parseInt(this.sliceSerialize(e),_.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`code`,`expected code on stack`),t.lang=e}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`code`,`expected code on stack`),t.meta=e}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`code`,`expected code on stack`),t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`code`,`expected code on stack`),t.value=e.replace(/(\r?\n|\r)$/g,``)}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];d(n,`expected node on stack`),d(n.type===`definition`,`expected definition on stack`),n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase()}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`definition`,`expected definition on stack`),t.title=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`definition`,`expected definition on stack`),t.url=e}function ae(e){let t=this.stack[this.stack.length-1];if(d(t,`expected node on stack`),d(t.type===`heading`,`expected heading on stack`),!t.depth){let n=this.sliceSerialize(e).length;d(n===1||n===2||n===3||n===4||n===5||n===6,"expected `depth` between `1` and `6`"),t.depth=n}}function oe(){this.data.setextHeadingSlurpLineEnding=!0}function se(e){let t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`heading`,`expected heading on stack`),t.depth=this.sliceSerialize(e).codePointAt(0)===g.equalsTo?1:2}function ce(){this.data.setextHeadingSlurpLineEnding=void 0}function le(e){let t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(`children`in t,`expected parent on stack`);let n=t.children,r=n[n.length-1];(!r||r.type!==`text`)&&(r=He(),r.position={start:go(e.start),end:void 0},n.push(r)),this.stack.push(r)}function ue(e){let t=this.stack.pop();d(t,"expected a `node` to be on the stack"),d(`value`in t,"expected a `literal` to be on the stack"),d(t.position,"expected `node` to have an open position"),t.value+=this.sliceSerialize(e),t.position.end=go(e.end)}function de(e){let n=this.stack[this.stack.length-1];if(d(n,"expected `node`"),this.data.atHardBreak){d(`children`in n,"expected `parent`");let t=n.children[n.children.length-1];d(t.position,`expected tail to have a starting position`),t.position.end=go(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(le.call(this,e),ue.call(this,e))}function fe(){this.data.atHardBreak=!0}function pe(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`html`,`expected html on stack`),t.value=e}function me(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`html`,`expected html on stack`),t.value=e}function he(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`inlineCode`,`expected inline code on stack`),t.value=e}function ge(){let e=this.stack[this.stack.length-1];if(d(e,`expected node on stack`),d(e.type===`link`,`expected link on stack`),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 _e(){let e=this.stack[this.stack.length-1];if(d(e,`expected node on stack`),d(e.type===`image`,`expected image on stack`),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 ve(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];d(n,`expected ancestor on stack`),d(n.type===`image`||n.type===`link`,`expected image or link on stack`),n.label=uo(t),n.identifier=h(t).toLowerCase()}function C(){let e=this.stack[this.stack.length-1];d(e,`expected node on stack`),d(e.type===`fragment`,`expected fragment on stack`);let t=this.resume(),n=this.stack[this.stack.length-1];d(n,`expected node on stack`),d(n.type===`image`||n.type===`link`,`expected image or link on stack`),this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ye(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`image`||t.type===`link`,`expected image or link on stack`),t.url=e}function be(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`image`||t.type===`link`,`expected image or link on stack`),t.title=e}function xe(){this.data.inReference=void 0}function Se(){this.data.referenceType=`collapsed`}function Ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];d(n,`expected node on stack`),d(n.type===`image`||n.type===`link`,`expected image reference or link reference on stack`),n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function we(e){d(e.type===`characterReferenceMarkerNumeric`||e.type===`characterReferenceMarkerHexadecimal`),this.data.characterReferenceType=e.type}function Te(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;if(n)r=S(t,n===b.characterReferenceMarkerNumeric?_.numericBaseDecimal:_.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let e=u(t);d(e!==!1,`expected reference to decode`),r=e}let i=this.stack[this.stack.length-1];d(i,"expected `node`"),d(`value`in i,"expected `node.value`"),i.value+=r}function Ee(e){let t=this.stack.pop();d(t,"expected `node`"),d(t.position,"expected `node.position`"),t.position.end=go(e.end)}function De(e){ue.call(this,e);let t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`link`,`expected link on stack`),t.url=this.sliceSerialize(e)}function Oe(e){ue.call(this,e);let t=this.stack[this.stack.length-1];d(t,`expected node on stack`),d(t.type===`link`,`expected link on stack`),t.url=`mailto:`+this.sliceSerialize(e)}function ke(){return{type:`blockquote`,children:[]}}function w(){return{type:`code`,lang:null,meta:null,value:``}}function Ae(){return{type:`inlineCode`,value:``}}function je(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function Me(){return{type:`emphasis`,children:[]}}function Ne(){return{type:`heading`,depth:0,children:[]}}function Pe(){return{type:`break`}}function Fe(){return{type:`html`,value:``}}function Ie(){return{type:`image`,title:null,url:``,alt:null}}function Le(){return{type:`link`,title:null,url:``,children:[]}}function Re(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ze(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Be(){return{type:`paragraph`,children:[]}}function Ve(){return{type:`strong`,children:[]}}function He(){return{type:`text`,value:``}}function Ue(){return{type:`thematicBreak`}}}function go(e){return{line:e.line,column:e.column,offset:e.offset}}function _o(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?_o(e,r):vo(e,r)}}function vo(e,t){let n;for(n in t)if(po.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 yo(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+bt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bt({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+bt({start:t.start,end:t.end})+`) is still open`)}function bo(e){let t=this;t.parser=n;function n(n){return mo(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var xo={}.hasOwnProperty;function So(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)So(e,t.extensions[n]);for(r in t)if(xo.call(t,r))switch(r){case`extensions`:break;case`unsafe`:Co(e[r],t[r]);break;case`join`:Co(e[r],t[r]);break;case`handlers`:wo(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Co(e,t){t&&e.push(...t)}function wo(e,t){t&&Object.assign(e,t)}function To(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()),Eo);return i(),o}function Eo(e,t,n){return`>`+(n?``:` `)+e}function Do(e,t){return Oo(e,t.inConstruct,!0)&&!Oo(e,t.notInConstruct,!1)}function Oo(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 ko(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
4
- `&&Do(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
5
- `}function Ao(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 jo(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 Mo(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function No(e,t,n,r){let i=Mo(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(jo(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Po);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Ao(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 Po(e,t,n){return(n?``:` `)+e}function Fo(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Io(e,t,n,r){let i=Fo(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 Lo(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ro(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function zo(e,t,n){let r=ee(e),i=ee(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}}Bo.peek=Vo;function Bo(e,t,n,r){let i=Lo(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=zo(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ro(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zo(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ro(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Vo(e,t,n){return n.options.emphasis||`*`}function Ho(e,t){let n=!1;return yt(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)&&ao(e)&&(t.options.setext||n))}function Uo(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Ho(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=Ro(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Wo.peek=Go;function Wo(e){return e.value||``}function Go(){return`<`}Ko.peek=qo;function Ko(e,t,n,r){let i=Fo(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 qo(){return`!`}Jo.peek=Yo;function Jo(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 Yo(){return`!`}Xo.peek=Zo;function Xo(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 Zo(){return"`"}function Qo(e,t){let n=ao(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))}$o.peek=es;function $o(e,t,n,r){let i=Fo(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Qo(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 es(e,t,n){return Qo(e,n)?`<`:`[`}ts.peek=ns;function ts(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 ns(){return`[`}function rs(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 is(e){let t=rs(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 as(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ss(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 cs(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?as(n):rs(n),s=e.ordered?o===`.`?`)`:`.`:is(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),ss(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 ls(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 us(e,t,n,r){let i=ls(n),a=n.bulletCurrent||rs(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 ds(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var fs=mt([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ps(e,t,n,r){return(e.children.some(function(e){return fs(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ms(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hs.peek=gs;function hs(e,t,n,r){let i=ms(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=zo(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ro(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zo(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ro(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function gs(e,t,n){return n.options.strong||`*`}function _s(e,t,n,r){return n.safe(e.value,r)}function vs(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 ys(e,t,n){let r=(ss(n)+(n.options.ruleSpaces?` `:``)).repeat(vs(n));return n.options.ruleSpaces?r.slice(0,-1):r}var bs={blockquote:To,break:ko,code:No,definition:Io,emphasis:Bo,hardBreak:ko,heading:Uo,html:Wo,image:Ko,imageReference:Jo,inlineCode:Xo,link:$o,linkReference:ts,list:cs,listItem:us,paragraph:ds,root:ps,strong:hs,text:_s,thematicBreak:ys},xs=[Ss];function Ss(e,t,n,r){if(t.type===`code`&&jo(t,r)&&(e.type===`list`||e.type===t.type&&jo(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`&&Ho(t,r))?void 0:+!!n.spread}var Cs=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],ws=[{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:Cs},{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:Cs},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
17
- *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:Cs},{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:Cs},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:Cs},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:Cs},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:Cs},{atBreak:!0,character:`~`}];function Ts(e){return e.label||!e.identifier?e.label||``:uo(e.identifier)}function Es(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 Ds(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=Ro(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)+Ro(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function Os(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(ks(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function ks(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 As=/\r?\n|\r/g;function js(e,t){let n=[],r=0,i=0,a;for(;a=As.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 Ms(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(!Do(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(Ns);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(Ps(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Ro(r.charCodeAt(e))),c++))}return a.push(Ps(r.slice(c,l),n.after)),a.join(``)}function Ns(e,t){return e-t}function Ps(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 Fs(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 Is(e,t){let n=t||{},r={associationId:Ts,containerPhrasing:Bs,containerFlow:Vs,createTracker:Fs,compilePattern:Es,enter:a,handlers:{...bs},handle:void 0,indentLines:js,indexStack:[],join:[...xs],options:{},safe:Hs,stack:[],unsafe:[...ws]};So(r,n),r.options.tightDefinitions&&r.join.push(zs),r.handle=vt(`type`,{invalid:Ls,unknown:Rs,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 Ls(e){throw Error("Cannot handle value `"+e+"`, expected node")}function Rs(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function zs(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function Bs(e,t){return Ds(e,this,t)}function Vs(e,t){return Os(e,this,t)}function Hs(e,t){return Ms(this,e,t)}function Us(e){let t=this;t.compiler=n;function n(n){return Is(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function Ws(e){this.content=e}Ws.prototype={constructor:Ws,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Ws(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ws(n)},addToStart:function(e,t){return new Ws([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ws(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Ws(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ws.from(e),e.size?new Ws(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ws.from(e),e.size?new Ws(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ws.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ws.from=function(e){if(e instanceof Ws)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ws(t)};function Gs(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Gs(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Ks(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Ks(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var E=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Gs(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ks(this,e,t,n)}findIndex(e){if(e==0)return Js(0,e);if(e==this.size)return Js(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Js(t+1,i):Js(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};E.empty=new E([],0);var qs={index:0,offset:0};function Js(e,t){return qs.index=e,qs.offset=t,qs}function Ys(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ys(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ys(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Xs=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ys(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Xs.none=[];var Zs=class extends Error{},D=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=$s(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Qs(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(E.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};D.empty=new D(E.empty,0,0);function Qs(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Qs(a.content,t-i-1,n-i-1)))}function $s(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=$s(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function ec(e,t,n){if(n.openStart>e.depth)throw new Zs(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Zs(`Inconsistent open depths`);return tc(e,t,n,0)}function tc(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=tc(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return oc(a,cc(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return oc(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=lc(n,e);return oc(a,sc(e,i,o,t,r))}}function nc(e,t){if(!t.type.compatibleContent(e.type))throw new Zs(`Cannot join `+t.type.name+` onto `+e.type.name)}function rc(e,t,n){let r=e.node(n);return nc(r,t.node(n)),r}function ic(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ac(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ic(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ic(i.child(e),r);t&&t.depth==n&&t.textOffset&&ic(t.nodeBefore,r)}function oc(e,t){return e.type.checkContent(t),e.copy(t)}function sc(e,t,n,r,i){let a=e.depth>i&&rc(e,t,i+1),o=r.depth>i&&rc(n,r,i+1),s=[];return ac(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(nc(a,o),ic(oc(a,sc(e,t,n,r,i+1)),s)):(a&&ic(oc(a,cc(e,t,i+1)),s),ac(t,n,i,s),o&&ic(oc(o,cc(n,r,i+1)),s)),ac(r,null,i,s),new E(s)}function cc(e,t,n){let r=[];return ac(null,e,n,r),e.depth>n&&ic(oc(rc(e,t,n+1),cc(e,t,n+1)),r),ac(t,null,n,r),new E(r)}function lc(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(E.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var uc=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Xs.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new mc(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=pc.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else pc.set(t,r=new dc);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%fc,i}},dc=class{constructor(){this.elts=[],this.i=0}},fc=12,pc=new WeakMap,mc=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},hc=Object.create(null),gc=class e{constructor(e,t,n,r=Xs.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||E.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ys(this.attrs,t||e.defaultAttrs||hc)&&Xs.sameSet(this.marks,n||Xs.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return D.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new D(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ec(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return uc.resolveCached(this,e)}resolveNoCache(e){return uc.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),vc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=E.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Xs.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Xs.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=E.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};gc.prototype.text=void 0;var _c=class e extends gc{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function vc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var yc=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new bc(t,n);if(r.next==null)return e.empty;let i=xc(r);r.next&&r.err(`Unexpected trailing text`);let a=jc(Oc(i));return Mc(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return E.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
34
- `)}};yc.empty=new yc(!0);var bc=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function xc(e){let t=[];do t.push(Sc(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Sc(e){let t=[];do t.push(Cc(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Cc(e){let t=Dc(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Tc(e,t);else break;return t}function wc(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Tc(e,t){let n=wc(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:wc(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Ec(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Dc(e){if(e.eat(`(`)){let t=xc(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Ec(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Oc(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function kc(e,t){return t-e}function Ac(e,t){let n=[];return r(t),n.sort(kc);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function jc(e){let t=Object.create(null);return n(Ac(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Ac(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new yc(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(kc);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Mc(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Nc(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Pc(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Fc(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Ic(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new zc(e,r,t[r]);return n}var Lc=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Ic(e,n.attrs),this.defaultAttrs=Nc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==yc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Pc(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new gc(this,this.computeAttrs(e),E.from(t),Xs.setFrom(n))}createChecked(e=null,t,n){return t=E.from(t),this.checkContent(t),new gc(this,this.computeAttrs(e),t,Xs.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=E.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(E.empty,!0);return i?new gc(this,e,t.append(i),Xs.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Fc(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Xs.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Rc(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var zc=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Rc(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Bc=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ic(e,r.attrs),this.excluded=null;let i=Nc(this.attrs);this.instance=i?new Xs(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Xs(this,Pc(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Fc(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Vc=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Ws.from(e.nodes),t.marks=Ws.from(e.marks||{}),this.nodes=Lc.compile(this.spec.nodes,this),this.marks=Bc.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=yc.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Hc(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Hc(this,n.split(` `))}this.nodeFromJSON=e=>gc.fromJSON(this,e),this.markFromJSON=e=>Xs.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Lc))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new _c(n,n.defaultAttrs,e,Xs.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Hc(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Uc(e){return e.tag!=null}function Wc(e){return e.style!=null}var Gc=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Uc(e))this.tags.push(e);else if(Wc(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new el(this,t,!1);return n.addAll(e,Xs.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new el(this,t,!0);return n.addAll(e,Xs.none,t.from,t.to),D.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(nl(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=rl(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=rl(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Kc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},qc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jc={ol:!0,ul:!0},Yc=1,Xc=2,Zc=4;function Qc(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Yc:0)|(t===`full`?Xc:0)}var $c=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Xs.none,this.match=i||(a&Zc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(E.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Yc)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=E.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Kc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},el=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Qc(null,t.preserveWhitespace,0)|(n?Zc:0);i=r?new $c(r.type,r.attrs,Xs.none,!0,t.topMatch||r.type.contentMatch,a):n?new $c(null,null,Xs.none,!0,null,a):new $c(e.schema.topNodeType,null,Xs.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Xc?`full`:this.localPreserveWS||(r.options&Yc)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
35
- `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Jc.hasOwnProperty(a)&&this.parser.normalizeLists&&tl(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:qc.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Kc.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
36
- `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Xs.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):il(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Qc(e,i,a.options);a.options&Zc&&a.content.length==0&&(o|=Zc);let s=Xs.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):il(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new $c(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Yc);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function tl(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Jc.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function nl(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function rl(e){let t={};for(let n in e)t[n]=e[n];return t}function il(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var al=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=sl(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return sl(t).createTextNode(e.text);let{dom:n,contentDOM:r}=dl(sl(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dl(sl(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:dl(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=ol(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ol(e.marks)}};function ol(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function sl(e){return e.document||window.document}var cl=new WeakMap;function ll(e){let t=cl.get(e);return t===void 0&&cl.set(e,t=ul(e)),t}function ul(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function dl(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=ll(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=dl(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var fl=65535,pl=2**16;function ml(e,t){return e+t*pl}function hl(e){return e&fl}function gl(e){return(e-(e&fl))/pl}var _l=1,vl=2,yl=4,bl=8,xl=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&bl)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&yl)>0}},Sl=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=hl(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+gl(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ml(o/3,e-s),f=e==s?vl:e==u?_l:yl;return(t<0?e!=s:e!=u)&&(f|=bl),new xl(a,f,d)}r+=l-c}return n?e+r:new xl(e+r,0,null)}touches(e,t){let n=0,r=hl(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Sl.empty=new Sl([]);var Cl=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new xl(e,r,null)}},wl=Object.create(null),Tl=class{getMap(){return Sl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=wl[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in wl)throw RangeError(`Duplicate use of step JSON ID `+e);return wl[e]=t,t.prototype.jsonID=e,t}},El=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Zs)return e.fail(t.message);throw t}}};function Dl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Dl(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return E.fromArray(r)}var Ol=class e extends Tl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new D(Dl(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return El.fromReplace(e,this.from,this.to,i)}invert(){return new kl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Tl.jsonID(`addMark`,Ol);var kl=class e extends Tl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new D(Dl(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return El.fromReplace(e,this.from,this.to,n)}invert(){return new Ol(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Tl.jsonID(`removeMark`,kl);var Al=class e extends Tl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return El.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return El.fromReplace(e,this.pos,this.pos+1,new D(E.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new jl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Tl.jsonID(`addNodeMark`,Al);var jl=class e extends Tl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return El.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return El.fromReplace(e,this.pos,this.pos+1,new D(E.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Al(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Tl.jsonID(`removeNodeMark`,jl);var Ml=class e extends Tl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Pl(e,this.from,this.to)?El.fail(`Structure replace would overwrite content`):El.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Sl([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?D.empty:new D(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?D.empty:new D(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,D.fromJSON(t,n.slice),!!n.structure)}};Ml.MAP_BIAS=1,Tl.jsonID(`replace`,Ml);var Nl=class e extends Tl{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Pl(e,this.from,this.gapFrom)||Pl(e,this.gapTo,this.to)))return El.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return El.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?El.fromReplace(e,this.from,this.to,n):El.fail(`Content does not fit in gap`)}getMap(){return new Sl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(t,n.slice),n.insert,!!n.structure)}};Tl.jsonID(`replaceAround`,Nl);function Pl(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Fl(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new kl(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Ol(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Il(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Bc){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new kl(t.from,t.to,t.style)))}function Ll(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Ml(s,l,D.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new kl(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new D(E.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Ml(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(E.empty,!0);e.replace(s,s,new D(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Rl(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function zl(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Rl(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Bl(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=E.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=E.from(r.node(e).copy(u)),d++):c--;let f=E.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=E.from(i.node(e).copy(f)),p++):l++;e.step(new Nl(c,l,o,s,new D(u.append(f),d,p),u.size-d,!0))}function Vl(e,t,n=null,r=e){let i=Ul(e,t),a=i&&Wl(r,t);return a?i.map(Hl).concat({type:t,attrs:n}).concat(a.map(Hl)):null}function Hl(e){return{type:e,attrs:null}}function Ul(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Wl(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Gl(e,t,n){let r=E.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=E.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Nl(i,a,i,a,new D(r,0,0),n.length,!0))}function Kl(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Yl(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Jl(e,t,n,a),Ll(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Nl(c,l,c+1,l-1,new D(E.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&ql(e,t,n,a),!1}})}function ql(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Jl(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
37
- `))}})}function Yl(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Xl(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Nl(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new D(E.from(o),0,0),1,!0))}function Zl(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Ql(e,t,n=1,r){let i=e.doc.resolve(t),a=E.empty,o=E.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=E.from(i.node(e).copy(a));let t=r&&r[s];o=E.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Ml(t,t,new D(a.append(o),n,n),!0))}function $l(e,t){let n=e.resolve(t),r=n.index();return tu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eu(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function tu(e,t){return!!(e&&t&&!e.isLeaf&&eu(e,t))}function nu(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Jl(e,r.node(),r.before(),s)}o.inlineContent&&Ll(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Ml(l,c.map(t+n,-1),D.empty,!0)),r===!0){let t=e.doc.resolve(l);ql(e,t.node(),t.before(),e.steps.length)}return e}function ru(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function iu(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function au(e,t,n=t,r=D.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return ou(i,a,r)?new Ml(t,n,r):new su(i,a,r).fit()}function ou(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var su=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=E.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=E.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new D(i,a,o);return e>-1?new Nl(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Ml(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=uu(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(E.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new D(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new D(cu(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new D(cu(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(du(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=lu(this.placed,t,E.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?D.empty:new D(cu(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new D(cu(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!fu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=fu(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=fu(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=lu(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=lu(this.placed,this.depth,E.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(E.empty,!0);e.childCount&&(this.placed=lu(this.placed,this.frontier.length,e))}};function cu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(cu(e.firstChild.content,t-1,n)))}function lu(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(lu(e.lastChild.content,t-1,n)))}function uu(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function du(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,du(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),e.copy(r)}function fu(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!pu(n,a.content,o)?s:null}function pu(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function mu(e){return e.spec.defining||e.spec.definingForContent}function hu(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(ou(i,a,r))return e.step(new Ml(t,n,r));let o=yu(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=mu(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new D(gu(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function gu(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(gu(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(E.empty,!0))}return e}function _u(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=ru(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new D(E.from(r),0,0))}function vu(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=yu(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function yu(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var bu=class e extends Tl{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return El.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return El.fromReplace(e,this.pos,this.pos+1,new D(E.from(r),0,+!t.isLeaf))}getMap(){return Sl.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Tl.jsonID(`attr`,bu);var xu=class e extends Tl{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return El.ok(n)}getMap(){return Sl.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Tl.jsonID(`docAttr`,xu);var Su=class extends Error{};Su=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Su.prototype=Object.create(Error.prototype),Su.prototype.constructor=Su,Su.prototype.name=`TransformError`;var Cu=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Cl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Su(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=D.empty){let r=au(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new D(E.from(n),0,0))}delete(e,t){return this.replace(e,t,D.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return hu(this,e,t,n),this}replaceRangeWith(e,t,n){return _u(this,e,t,n),this}deleteRange(e,t){return vu(this,e,t),this}lift(e,t){return Bl(this,e,t),this}join(e,t=1){return nu(this,e,t),this}wrap(e,t){return Gl(this,e,t),this}setBlockType(e,t=e,n,r=null){return Kl(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Xl(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new bu(e,t,n)),this}setDocAttribute(e,t){return this.step(new xu(e,t)),this}addNodeMark(e,t){return this.step(new Al(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Xs)t.isInSet(n.marks)&&this.step(new jl(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new jl(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Ql(this,e,t,n),this}addMark(e,t,n){return Fl(this,e,t,n),this}removeMark(e,t,n){return Il(this,e,t,n),this}clearIncompatible(e,t,n){return Ll(this,e,t,n),this}},wu=Object.create(null),Tu=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Eu(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=D.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?D.empty:t),o==0&&Pu(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Pu(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new O(e):Nu(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Nu(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Nu(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ju(e.node(0))}static atStart(e){return Nu(e,e,0,0,1)||new ju(e)}static atEnd(e){return Nu(e,e,e.content.size,e.childCount,-1)||new ju(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=wu[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in wu)throw RangeError(`Duplicate use of selection JSON ID `+e);return wu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return O.between(this.$anchor,this.$head).getBookmark()}};Tu.prototype.visible=!0;var Eu=class{constructor(e,t){this.$from=e,this.$to=t}},Du=!1;function Ou(e){!Du&&!e.parent.inlineContent&&(Du=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var O=class e extends Tu{constructor(e,t=e){Ou(e),Ou(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Tu.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=D.empty){if(super.replace(e,t),t==D.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new ku(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Tu.findFrom(n,r,!0)||Tu.findFrom(n,-r,!0);if(e)n=e.$head;else return Tu.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Tu.findFrom(t,-r,!0)||Tu.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Tu.jsonID(`text`,O);var ku=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return O.between(e.resolve(this.anchor),e.resolve(this.head))}},k=class e extends Tu{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Tu.near(a):new e(a)}content(){return new D(E.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Au(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};k.prototype.visible=!1,Tu.jsonID(`node`,k);var Au=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new ku(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&k.isSelectable(n)?new k(t):Tu.near(t)}},ju=class e extends Tu{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=D.empty){if(t==D.empty){e.delete(0,e.doc.content.size);let t=Tu.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Mu}};Tu.jsonID(`all`,ju);var Mu={map(){return this},resolve(e){return new ju(e)}};function Nu(e,t,n,r,i,a=!1){if(t.inlineContent)return O.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Nu(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&k.isSelectable(r))return k.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Pu(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ml||i instanceof Nl))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Tu.near(e.doc.resolve(o),n))}var Fu=1,Iu=2,Lu=4,Ru=class extends Cu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Fu)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Fu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Iu,this}ensureMarks(e){return Xs.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Iu)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Xs.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Tu.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Lu,this}get scrolledIntoView(){return(this.updated&Lu)>0}};function zu(e,t){return!t||!e?e:e.bind(t)}var Bu=class{constructor(e,t,n){this.name=e,this.init=zu(t.init,n),this.apply=zu(t.apply,n)}},Vu=[new Bu(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Bu(`selection`,{init(e,t){return e.selection||Tu.atStart(t.doc)},apply(e){return e.selection}}),new Bu(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Bu(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Hu=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Vu.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Bu(e.key,e.spec.state,e))})}},Uu=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Ru(this)}static create(t){let n=new Hu(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Hu(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Hu(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=gc.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Tu.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Wu(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Wu(i,t,{})),n[r]=i}return n}var Gu=class{constructor(e){this.spec=e,this.props={},e.props&&Wu(e.props,this,this.props),this.key=e.key?e.key.key:qu(`plugin`)}getState(e){return e[this.key]}},Ku=Object.create(null);function qu(e){return e in Ku?e+`$`+ ++Ku[e]:(Ku[e]=0,e+`$`)}var Ju=class{constructor(e=`key`){this.key=qu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Yu=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Xu(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Zu=(e,t,n)=>{let r=Xu(e,n);if(!r)return!1;let i=nd(r);if(!i){let n=r.blockRange(),i=n&&zl(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(gd(e,i,t,-1))return!0;if(r.parent.content.size==0&&(ed(a,`end`)||k.isSelectable(a)))for(let n=r.depth;;n--){let o=au(e.doc,r.before(n),r.after(n),D.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(ed(a,`end`)?Tu.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):k.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Qu=(e,t,n)=>{let r=Xu(e,n);if(!r)return!1;let i=nd(r);return i?$u(e,i,t):!1};function $u(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=au(e.doc,i,o,D.empty);if(!s||s.from!=i||s instanceof Ml&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(O.create(t.doc,i)),n(t.scrollIntoView())}return!0}function ed(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 td=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=nd(r)}let o=a&&a.nodeBefore;return!o||!k.isSelectable(o)?!1:(t&&t(e.tr.setSelection(k.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function nd(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 rd(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var id=(e,t,n)=>{let r=rd(e,n);if(!r)return!1;let i=od(r);if(!i)return!1;let a=i.nodeAfter;if(gd(e,i,t,1))return!0;if(r.parent.content.size==0&&(ed(a,`start`)||k.isSelectable(a))){let n=au(e.doc,r.before(),r.after(),D.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(ed(a,`start`)?Tu.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):k.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},ad=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=od(r)}let o=a&&a.nodeAfter;return!o||!k.isSelectable(o)?!1:(t&&t(e.tr.setSelection(k.create(e.doc,a.pos)).scrollIntoView()),!0)};function od(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 sd=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
38
- `).scrollIntoView()),!0)};function cd(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 ld=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=cd(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Tu.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ud=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ju||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=cd(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(O.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},dd=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Zl(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&zl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function fd(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof k&&t.selection.node.isBlock)return!r.parentOffset||!Zl(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=cd(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof O||t.selection instanceof ju)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Zl(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,Zl(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var pd=fd(),md=(e,t)=>(t&&t(e.tr.setSelection(new ju(e.doc))),!0);function hd(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||$l(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function gd(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&hd(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=E.empty;for(let e=o.length-1;e>=0;e--)s=E.from(o[e].create(null,s));s=E.from(i.copy(s));let c=e.tr.step(new Nl(t.pos-1,r,t.pos,r,new D(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&$l(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Tu.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&zl(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&ed(a,`start`,!0)&&ed(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=E.empty;for(let e=o.length-1;e>=0;e--)r=E.from(o[e].copy(r));n(e.tr.step(new Nl(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new D(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function _d(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(O.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var vd=_d(-1),yd=_d(1);function bd(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Vl(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function xd(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 Sd(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 Cd(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new Eu(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new Eu(r,i))}return t}function wd(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||!Sd(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=Cd(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 Td(...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 Ed=Td(Yu,Zu,td),Dd=Td(Yu,id,ad),Od={Enter:Td(sd,ud,dd,pd),"Mod-Enter":ld,Backspace:Ed,"Mod-Backspace":Ed,"Shift-Backspace":Ed,Delete:Dd,"Mod-Delete":Dd,"Mod-a":md},kd={"Ctrl-h":Od.Backspace,"Alt-Backspace":Od[`Mod-Backspace`],"Ctrl-d":Od.Delete,"Ctrl-Alt-Backspace":Od[`Mod-Delete`],"Alt-Delete":Od[`Mod-Delete`],"Alt-d":Od[`Mod-Delete`],"Ctrl-a":vd,"Ctrl-e":yd};for(let e in Od)kd[e]=Od[e];var Ad=(typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()==`darwin`)?kd:Od,jd=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?Md(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Md(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 Nd=(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 jd(/--$/,`—`,{inCodeMark:!1}),new jd(/\.\.\.$/,`…`,{inCodeMark:!1}),new jd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new jd(/"$/,`”`,{inCodeMark:!1}),new jd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new jd(/'$/,`’`,{inCodeMark:!1});function Pd(e,t,n=null,r){return new jd(e,(e,i,a,o)=>{let s=n instanceof Function?n(i):n,c=e.tr.delete(a,o),l=c.doc.resolve(a).blockRange(),u=l&&Vl(l,t,s);if(!u)return null;c.wrap(l,u);let d=c.doc.resolve(a-1).nodeBefore;return d&&d.type==t&&$l(c.doc,a-1)&&(!r||r(i,d))&&c.join(a-1),c})}function Fd(e,t,n=null){return new jd(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})}var Id=typeof navigator<`u`?navigator:null,Ld=typeof document<`u`?document:null,Rd=Id&&Id.userAgent||``,zd=/Edge\/(\d+)/.exec(Rd),Bd=/MSIE \d/.exec(Rd),Vd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rd),Hd=!!(Bd||Vd||zd),Ud=Bd?document.documentMode:Vd?+Vd[1]:zd?+zd[1]:0,Wd=!Hd&&/gecko\/(\d+)/i.test(Rd),Gd=Wd&&+(/Firefox\/(\d+)/.exec(Rd)||[0,0])[1],Kd=!Hd&&/Chrome\/(\d+)/.exec(Rd),qd=!!Kd,Jd=Kd?+Kd[1]:0,Yd=!Hd&&!!Id&&/Apple Computer/.test(Id.vendor),Xd=Yd&&(/Mobile\/\w+/.test(Rd)||!!Id&&Id.maxTouchPoints>2),Zd=Xd||(Id?/Mac/.test(Id.platform):!1),Qd=/Android \d/.test(Rd),$d=!!Ld&&`webkitFontSmoothing`in Ld.documentElement.style,ef=$d?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tf=Object.freeze({__proto__:null,android:Qd,chrome:qd,chrome_version:Jd,gecko:Wd,gecko_version:Gd,ie:Hd,ie_version:Ud,ios:Xd,mac:Zd,safari:Yd,webkit:$d,webkit_version:ef});function nf(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state,s=o.doc.resolve(t);if(s.parent.type.spec.code)return!1;let c=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,``)+r;for(let s of i){let i=s,l=i.match.exec(c),u=l&&l[0]&&i.handler(o,l,t-(l[0].length-r.length),n);if(u)return i.undoable!==!1&&u.setMeta(a,{transform:u,from:t,to:n,text:r}),e.dispatch(u),!0}return!1}var rf=new Ju(`MILKDOWN_CUSTOM_INPUTRULES`);function af({rules:e}){let t=new Gu({key:rf,isInputRules:!0,state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return nf(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&nf(n,r.pos,r.pos,``,e,t)}),!1),keydown:(e,t)=>!(Qd&&qd&&t.key===`Enter`)||e.composing?!1:e.someProp(`handleKeyDown`,n=>n(e,t))?(t.preventDefault(),!0):!1},handleKeyDown(n,r){if(r.key!==`Enter`)return!1;let{$cursor:i}=n.state.selection;return i?nf(n,i.pos,i.pos,`
39
- `,e,t):!1}}});return t}function of(e,t,n={}){return new jd(e,(e,r,i,a)=>{var o;let{tr:s}=e,c=r[r.length-1],l=r[0],u=[],d,f={group:c,fullMatch:l,start:i,end:a},p=n.updateCaptured?.call(n,f);if(Object.assign(f,p),{group:c,fullMatch:l,start:i,end:a}=f,l===null||c?.trim()===``)return null;if(c){let e=l.search(/\S/),f=i+l.indexOf(c),p=f+c.length;u=s.storedMarks??[],p<a&&s.delete(p,a),f>i&&s.delete(i+e,f),d=i+e+c.length;let m=n.getAttr?.call(n,r);s.addMark(i,d,t.create(m)),s.setStoredMarks(u),(o=n.beforeDispatch)==null||o.call(n,{match:r,start:i,end:a,tr:s})}return s})}function sf(e,t,n={}){return new jd(e,(e,r,i,a)=>{var o;let{tr:s}=e,c=r[1],l=r[0],u={group:c,fullMatch:l,start:i,end:a},d=n.updateCaptured?.call(n,u);if(Object.assign(u,d),{group:c,fullMatch:l,start:i,end:a}=u,l===null||!c||c.trim()===``)return null;let f=n.getAttr?.call(n,r),p=t.createAndFill(f);return p&&(s.replaceRangeWith(t.isBlock?s.doc.resolve(i).before():i,a,p),(o=n.beforeDispatch)==null||o.call(n,{match:[l,c],start:i,end:a,tr:s})),s})}var cf=Object.defineProperty,lf=Object.defineProperties,uf=Object.getOwnPropertyDescriptors,df=Object.getOwnPropertySymbols,ff=Object.prototype.hasOwnProperty,pf=Object.prototype.propertyIsEnumerable,mf=(e,t,n)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hf=(e,t)=>{for(var n in t||={})ff.call(t,n)&&mf(e,n,t[n]);if(df)for(var n of df(t))pf.call(t,n)&&mf(e,n,t[n]);return e},gf=(e,t)=>lf(e,uf(t));function _f(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function vf(e,t,n){let r=e.state.doc.content.size,i=_f(t,0,r),a=_f(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return gf(hf({},f),{toJSON:()=>f})}function yf(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function bf(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function xf(e){if(e.content.childCount===1){let t=e.content.firstChild;if(t?.type.name===`text`&&t.marks.length===0)return t;if(t?.type.name===`paragraph`&&t.childCount===1){let e=t.firstChild;if(e?.type.name===`text`&&e.marks.length===0)return e}}return!1}function Sf(e){return t=>{for(let n=t.depth;n>0;--n){let r=t.node(n);if(e(r))return{from:t.before(n),to:t.after(n),node:r}}}}function Cf(e,t){return Sf(e=>e.type===t)(e)}function wf(e,t){let n=t.nodes[e];if(!n)throw Ba(`node`,e);return n}function Tf(e){return t=>{for(let n=t.depth;n>0;n--){let r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}function Ef(e){return t=>Tf(e)(t.$from)}function Df(e,t){if(!(e instanceof k))return;let{node:n,$from:r}=e;if(bf(t,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}var Of=(e,t)=>{let{selection:n,doc:r}=e;if(n instanceof k)return{hasNode:n.node.type===t,pos:n.from,target:n.node};let{from:i,to:a}=n,o=!1,s=-1,c=null;return r.nodesBetween(i,a,(e,n)=>c?!1:e.type===t?(o=!0,s=n,c=e,!1):!0),{hasNode:o,pos:s,target:c}},kf=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Af=typeof navigator<`u`&&/Win/.test(navigator.platform);function jf(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))kf?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 Mf(e){let t=Object.create(null);for(let n in e)t[jf(n)]=e[n];return t}function Nf(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 Pf(e){return new Gu({props:{handleKeyDown:Ff(e)}})}function Ff(e){let t=Mf(e);return function(e,n){let r=Ye(n),i,a=t[Nf(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Nf(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Af&&n.ctrlKey&&n.altKey)&&(i=Ae[n.keyCode])&&i!=r){let r=t[Nf(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var If=class{},Lf=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw La();return e}}},Rf=class e extends If{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(t,n,r){return new e(t,n,r)}},zf=class extends Lf{#e;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(t,e),n.toDoc())}}constructor(e){super(),this.#e=Xs.none,this.#t=e=>e.isText,this.#n=(e,t)=>{if(this.#t(e)&&this.#t(t)&&Xs.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)},this.#r=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t)throw Ra(e);return t},this.#i=e=>{let t=this.#r(e);t.spec.parseMarkdown.runner(this,e,t)},this.injectRoot=(e,t,n)=>(this.openNode(t,n),this.next(e.children),this),this.openNode=(e,t)=>(this.open(Rf.create(e,[],t)),this),this.#a=()=>{this.#e=Xs.none;let e=this.close();return this.#o(e.type,e.attrs,e.content)},this.closeNode=()=>{try{this.#a()}catch(e){console.error(e)}return this},this.#o=(e,t,n)=>{let r=e.createAndFill(t,n,this.#e);if(!r)throw Ia(e,t,n);return this.push(r),r},this.addNode=(e,t,n)=>{try{this.#o(e,t,n)}catch(e){console.error(e)}return this},this.openMark=(e,t)=>{let n=e.create(t);return this.#e=n.addToSet(this.#e),this},this.closeMark=e=>(this.#e=e.removeFromSet(this.#e),this),this.addText=e=>{try{let t=this.top();if(!t)throw La();let n=t.pop(),r=this.schema.text(e,this.#e);if(!n)return t.push(r),this;let i=this.#n(n,r);return i?(t.push(i),this):(t.push(n,r),this)}catch(e){return console.error(e),this}},this.build=()=>{let e;do e=this.#a();while(this.size());return e},this.next=(e=[])=>([e].flat().forEach(e=>this.#i(e)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{let n=e.runSync(e.parse(t),t);return this.next(n),this},this.schema=e}#t;#n;#r;#i;#a;#o},Bf=class e extends If{constructor(e,t,n,r={}){super(),this.type=e,this.children=t,this.value=n,this.props=r,this.push=(e,...t)=>{this.children||=[],this.children.push(e,...t)},this.pop=()=>this.children?.pop()}static{this.create=(t,n,r,i={})=>new e(t,n,r,i)}},Vf=e=>Object.prototype.hasOwnProperty.call(e,`size`),Hf=class extends Lf{#e;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(e),n.toString(t))}}constructor(e){super(),this.#e=Xs.none,this.#t=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t)throw za(e.type);return t},this.#n=e=>this.#t(e).spec.toMarkdown.runner(this,e),this.#r=(e,t)=>this.#t(e).spec.toMarkdown.runner(this,e,t),this.#i=e=>{let{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort((e,t)=>n(e)-n(t)).every(t=>!this.#r(t,e))&&this.#n(e),t.forEach(e=>this.#f(e))},this.#a=(e,t)=>{if(e.type===t||e.children?.length!==1)return e;let n=e=>{if(e.type===t)return e.value==null?e:null;if(e.children?.length!==1)return null;let[r]=e.children;return r?n(r):null},r=n(e);if(!r)return e;let i=r.children?[...r.children]:void 0,a={...e,children:i};return a.children=i,r.children=[a],r},this.#o=e=>{let{children:t}=e;return t&&(e.children=t.reduce((e,t,n)=>{if(n===0)return[t];let r=e.at(-1);if(r&&r.isMark&&t.isMark){t=this.#a(t,r.type);let{children:n,...i}=t,{children:a,...o}=r;if(t.type===r.type&&n&&a&&JSON.stringify(i)===JSON.stringify(o)){let t={...o,children:[...a,...n]};return e.slice(0,-1).concat(this.#o(t))}}return e.concat(t)},[])),e},this.#s=e=>{let t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t},this.openNode=(e,t,n)=>(this.open(Bf.create(e,void 0,t,n)),this),this.#c=(e,t)=>{let n=``,r=``,i=e.children,a=-1,o=-1,s=e=>{e&&e.forEach((e,t)=>{e.type===`text`&&e.value&&(a<0&&(a=t),o=t)})};if(i){s(i);let e=i?.[o],t=i?.[a];if(e&&e.value.endsWith(` `)){let t=e.value,n=t.trimEnd();r=t.slice(n.length),e.value=n}if(t&&t.value.startsWith(` `)){let e=t.value,r=e.trimStart();n=e.slice(0,e.length-r.length),t.value=r}}n.length&&this.#u(`text`,void 0,n);let c=t();return r.length&&this.#u(`text`,void 0,r),c},this.#l=(e=!1)=>{let t=this.close(),n=()=>this.#u(t.type,t.children,t.value,t.props);return e?this.#c(t,n):n()},this.closeNode=()=>(this.#l(),this),this.#u=(e,t,n,r)=>{let i=Bf.create(e,t,n,r),a=this.#o(this.#s(i));return this.push(a),a},this.addNode=(e,t,n,r)=>(this.#u(e,t,n,r),this),this.#d=(e,t,n,r)=>e.isInSet(this.#e)?this:(this.#e=e.addToSet(this.#e),this.openNode(t,n,{...r,isMark:!0})),this.#f=e=>{e.isInSet(this.#e)&&(this.#e=e.type.removeFromSet(this.#e),this.#l(!0))},this.withMark=(e,t,n,r)=>(this.#d(e,t,n,r),this),this.closeMark=e=>(this.#f(e),this),this.build=()=>{let e=null;do e=this.#l();while(this.size());return e},this.next=e=>Vf(e)?(e.forEach(e=>{this.#i(e)}),this):(this.#i(e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.next(e),this),this.schema=e}#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f},Uf=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Wf=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Gf=null,Kf=function(e,t,n){let r=Gf||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},qf=function(){Gf=null},Jf=function(e,t,n,r){return n&&(Xf(e,t,n,r,-1)||Xf(e,t,n,r,1))},Yf=/^(img|br|input|textarea|hr)$/i;function Xf(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zf(e))){let n=e.parentNode;if(!n||n.nodeType!=1||tp(e)||Yf.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Uf(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?Zf(e):0}else return!1}}function Zf(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Qf(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=Zf(e)}else if(e.parentNode&&!tp(e))t=Uf(e),e=e.parentNode;else return null}}function $f(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&&!tp(e))t=Uf(e)+1,e=e.parentNode;else return null}}function ep(e,t,n){for(let r=t==0,i=t==Zf(e);r||i;){if(e==n)return!0;let t=Uf(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Zf(e)}}function tp(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 np=function(e){return e.focusNode&&Jf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function rp(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function ip(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ap(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Zf(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Zf(r.startContainer),r.startOffset)}}}var op=typeof navigator<`u`?navigator:null,sp=typeof document<`u`?document:null,cp=op&&op.userAgent||``,lp=/Edge\/(\d+)/.exec(cp),up=/MSIE \d/.exec(cp),dp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(cp),fp=!!(up||dp||lp),pp=up?document.documentMode:dp?+dp[1]:lp?+lp[1]:0,mp=!fp&&/gecko\/(\d+)/i.test(cp);mp&&+(/Firefox\/(\d+)/.exec(cp)||[0,0])[1];var hp=!fp&&/Chrome\/(\d+)/.exec(cp),gp=!!hp,_p=hp?+hp[1]:0,vp=!fp&&!!op&&/Apple Computer/.test(op.vendor),yp=vp&&(/Mobile\/\w+/.test(cp)||!!op&&op.maxTouchPoints>2),bp=yp||(op?/Mac/.test(op.platform):!1),xp=op?/Win/.test(op.platform):!1,Sp=/Android \d/.test(cp),Cp=!!sp&&`webkitFontSmoothing`in sp.documentElement.style,wp=Cp?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Tp(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 Ep(e,t){return typeof e==`number`?e:e[t]}function Dp(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 Op(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=Wf(o);continue}let e=o,n=e==a.body,s=n?Tp(a):Dp(e),c=0,l=0;if(t.top<s.top+Ep(r,`top`)?l=-(s.top-t.top+Ep(i,`top`)):t.bottom>s.bottom-Ep(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ep(i,`top`)-s.top:t.bottom-s.bottom+Ep(i,`bottom`)),t.left<s.left+Ep(r,`left`)?c=-(s.left-t.left+Ep(i,`left`)):t.right>s.right-Ep(r,`right`)&&(c=t.right-s.right+Ep(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:Wf(o)}}function kp(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:Ap(e.dom)}}function Ap(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Wf(r));return t}function jp({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Mp(n,r==0?0:r-t)}function Mp(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 Np=null;function Pp(e){if(e.setActive)return e.setActive();if(Np)return e.focus(Np);let t=Ap(e);e.focus(Np==null?{get preventScroll(){return Np={preventScroll:!0},!0}}:void 0),Np||(Np=!1,Mp(t,0))}function Fp(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=Kf(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?Ip(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Fp(n,i)}function Ip(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=Wp(r,1);if(n.top!=n.bottom&&Lp(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Lp(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Rp(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function zp(e,t,n){let{node:r,offset:i}=Fp(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 Bp(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 Vp(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(Lp(t,i))return Vp(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Hp(e,t){let n=e.dom.ownerDocument,r,i=0,a=ap(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(!Lp(t,n)||(o=Vp(e.dom,t,n),!o))return null}if(vp)for(let e=o;r&&e;e=Wf(e))e.draggable&&(r=void 0);if(o=Rp(o,t),r){if(mp&&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;Cp&&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=Bp(e,r,i,t))}s??=zp(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Up(e){return e.top<e.bottom||e.left<e.right}function Wp(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Up(e))return e}return Array.prototype.find.call(n,Up)||e.getBoundingClientRect()}var Gp=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Kp(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Cp||mp;if(r.nodeType==3)if(o&&(Gp.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Wp(Kf(r,i,i),n);if(mp&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Wp(Kf(r,i-1,i-1),-1);if(t.top==e.top){let n=Wp(Kf(r,i,i+1),-1);if(n.top!=e.top)return qp(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++,qp(Wp(Kf(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Zf(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Jp(e.getBoundingClientRect(),!1)}if(a==null&&i<Zf(r)){let e=r.childNodes[i];if(e.nodeType==1)return Jp(e.getBoundingClientRect(),!0)}return Jp(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Zf(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Kf(e,Zf(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return qp(Wp(t,1),!1)}if(a==null&&i<Zf(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Kf(e,0,+!o):e.nodeType==1?e:null:null;if(t)return qp(Wp(t,-1),!0)}return qp(Wp(r.nodeType==3?Kf(r):r,-n),n>=0)}function qp(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 Jp(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 Yp(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 Xp(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Yp(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=Kp(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=Kf(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 Zp=/[\u0590-\u08ac]/;function Qp(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?!Zp.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Yp(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 $p=null,em=null,tm=!1;function nm(e,t,n){return $p==t&&em==n?tm:($p=t,em=n,tm=n==`up`||n==`down`?Xp(e,t,n):Qp(e,t,n))}var rm=0,im=1,am=2,om=3,sm=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=rm,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>Uf(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 mm){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 cm&&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?Uf(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?Uf(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=Uf(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=Uf(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((mp||vp)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
40
- `),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:Uf(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(mp&&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&&vp)&&Jf(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Jf(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&mp)){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?am:im,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=om:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?am:om}n=a}this.dirty=am}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?am:im;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},cm=class extends sm{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==rm&&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}},lm=class extends sm{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}},um=class e extends sm{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=al.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&om||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=om&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=rm){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=rm}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=jm(a,n,o,r)),t>0&&(a=jm(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()}},dm=class e extends sm{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=al.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Sm(u,r,n),l?c=new hm(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new pm(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>E.empty)}return e}matchesNode(e,t,n){return this.dirty==rm&&e.eq(this.node)&&Cm(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Tm(this,a&&a.node,e);Om(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Xs.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==am)&&(a&&this.protectLocalComposition(e,a),gm(this.contentDOM,this.children,e),yp&&km(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof O)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Am(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new lm(this,i,t,r);e.input.compositionNodes.push(a),this.children=jm(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==om||!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=rm}updateOuterDeco(e){if(Cm(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=bm(this.dom,this.nodeDOM,ym(this.outerDeco,this.node,t),ym(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 fm(e,t,n,r,i){Sm(r,t,e);let a=new dm(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var pm=class e extends dm{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==om||this.dirty!=rm&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=rm||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=rm,!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=om)}get domAtom(){return!1}isText(e){return this.node.text==e}},mm=class extends sm{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==rm&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},hm=class extends dm{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==om)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 gm(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=wm(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof um){let t=r?r.previousSibling:e.lastChild;gm(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=wm(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var _m=function(e){e&&(this.nodeName=e)};_m.prototype=Object.create(null);var vm=[new _m];function ym(e,t,n){if(e.length==0)return vm;let r=n?vm[0]:new _m,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new _m(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new _m(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 bm(e,t,n,r){if(n==vm&&r==vm)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=vm[0],i=t)}xm(i,o||vm[0],a)}return i}function xm(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 Sm(e,t,n){return bm(e,e,vm,ym(t,n,e.nodeType!=1))}function Cm(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 wm(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Tm=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Em(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=rm,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=um.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==om&&a.dom==a.contentDOM&&(a.dirty=am),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 dm){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!=om&&Cm(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=am,u.updateChildren(r,a+1),u.dirty=rm),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)||!Cm(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=dm.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=dm.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 cm(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 um;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof pm)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vp||gp)&&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 mm(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 Em(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 um)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 Dm(e,t){return e.type.side-t.type.side}function Om(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(Dm);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 km(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 Am(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 jm(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 Mm(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(np(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&k.isSelectable(e)&&i.parent&&!(e.isInline&&ep(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new k(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Um(e,u,s,n)}return l}function Nm(e){return e.editable?e.hasFocus():Gm(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Pm(e,t=!1){let n=e.state.selection;if(Vm(e,n),Nm(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&gp){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Jf(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Bm(e);else{let{anchor:r,head:i}=n,a,o;Fm&&!(n instanceof O)&&(n.$from.parent.inlineContent||(a=Im(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Im(e,n.to))),e.docView.setSelection(r,i,e,t),Fm&&(a&&Rm(a),o&&Rm(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&zm(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Fm=vp||gp&&_p<63;function Im(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(vp&&i&&i.contentEditable==`false`)return Lm(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Lm(i);if(a)return Lm(a)}}function Lm(e){return e.contentEditable=`true`,vp&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Rm(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function zm(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(()=>{(!Nm(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Bm(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Uf(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&fp&&pp<=11&&(n.disabled=!0,n.disabled=!1)}function Vm(e,t){if(t instanceof k){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Hm(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Hm(e)}function Hm(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Um(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||O.between(t,n,r)}function Wm(e){return e.editable&&!e.hasFocus()?!1:Gm(e)}function Gm(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 Km(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Jf(t.node,t.offset,n.anchorNode,n.anchorOffset)}function qm(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Tu.findFrom(a,t)}function Jm(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ym(e,t,n){let r=e.state.selection;if(r instanceof O){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Jm(e,new O(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=qm(e.state,t);return n&&n instanceof k?Jm(e,n):!1}else if(!(bp&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?k.isSelectable(i)?Jm(e,new k(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Cp?Jm(e,new O(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof k&&r.node.isInline)return Jm(e,new O(t>0?r.$to:r.$from));else{let n=qm(e.state,t);return n?Jm(e,n):!1}}function Xm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Zm(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Qm(e,t){return t<0?$m(e):eh(e)}function $m(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(mp&&n.nodeType==1&&r<Xm(n)&&Zm(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Zm(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(th(n))break;else{let t=n.previousSibling;for(;t&&Zm(t,-1);)i=n.parentNode,a=Uf(t),t=t.previousSibling;if(t)n=t,r=Xm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?ih(e,n,r):i&&ih(e,i,a)}function eh(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Xm(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Zm(e,1))a=n,o=++r;else break}else if(th(n))break;else{let t=n.nextSibling;for(;t&&Zm(t,1);)a=t.parentNode,o=Uf(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Xm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&ih(e,a,o)}function th(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function nh(e,t){for(;e&&t==e.childNodes.length&&!tp(e);)t=Uf(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 rh(e,t){for(;e&&!t&&!tp(e);)t=Uf(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 ih(e,t,n){if(t.nodeType!=3){let e,r;(r=nh(t,n))?(t=r,n=0):(e=rh(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(np(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&&Pm(e)},50)}function ah(e,t){let n=e.state.doc.resolve(t);if(!(gp||xp)&&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 oh(e,t,n){let r=e.state.selection;if(r instanceof O&&!r.empty||n.indexOf(`s`)>-1||bp&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=qm(e.state,t);if(n&&n instanceof k)return Jm(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof ju?Tu.near(n,t):Tu.findFrom(n,t);return o?Jm(e,o):!1}return!1}function sh(e,t){if(!(e.state.selection instanceof O))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function ch(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function lh(e){if(!vp||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;ch(e,n,`true`),setTimeout(()=>ch(e,n,`false`),20)}return!1}function uh(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function dh(e,t){let n=t.keyCode,r=uh(t);if(n==8||bp&&n==72&&r==`c`)return sh(e,-1)||Qm(e,-1);if(n==46&&!t.shiftKey||bp&&n==68&&r==`c`)return sh(e,1)||Qm(e,1);if(n==13||n==27)return!0;if(n==37||bp&&n==66&&r==`c`){let t=n==37?ah(e,e.state.selection.from)==`ltr`?-1:1:-1;return Ym(e,t,r)||Qm(e,t)}else if(n==39||bp&&n==70&&r==`c`){let t=n==39?ah(e,e.state.selection.from)==`ltr`?1:-1:1;return Ym(e,t,r)||Qm(e,t)}else if(n==38||bp&&n==80&&r==`c`)return oh(e,-1,r)||Qm(e,-1);else if(n==40||bp&&n==78&&r==`c`)return lh(e)||oh(e,1,r)||Qm(e,1);else if(r==(bp?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function fh(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||al.fromSchema(e.state.schema),s=Ch(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=xh[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
41
-
42
- `),slice:t}}function ph(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new D(E.from(e.state.schema.text(t.replace(/\r\n?/g,`
43
- `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=al.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Eh(n),Cp&&Dh(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Gc.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!mh.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Oh(bh(s,+u[1],+u[2]),u[4]);else if(s=D.maxOpen(hh(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=bh(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var mh=/^(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 hh(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&_h(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=vh(a[a.length-1],i.length));let n=gh(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return E.from(a)}return e}function gh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,E.from(e));return e}function _h(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=_h(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(E.from(gh(n,e,i+1))))}}function vh(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,vh(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(E.empty,!0);return e.copy(n.append(r))}function yh(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=yh(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function bh(e,t,n){return t<e.openStart&&(e=new D(yh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new D(yh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var xh={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Sh=null;function Ch(){return Sh||=document.implementation.createHTMLDocument(`title`)}var wh=null;function Th(e){let t=window.trustedTypes;return t?(wh||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),wh.createHTML(e)):e}function Eh(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Ch().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&xh[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Th(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Dh(e){let t=e.querySelectorAll(gp?`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 Oh(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=E.from(t.create(r[e+1],i)),a++,o++}return new D(i,a,o)}var kh={},Ah={},jh={touchstart:!0,touchmove:!0},Mh=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 Nh(e){for(let t in kh){let n=kh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Rh(e,t)&&!Lh(e,t)&&(e.editable||!(t.type in Ah))&&n(e,t)},jh[t]?{passive:!0}:void 0)}vp&&e.dom.addEventListener(`input`,()=>null),Ih(e)}function Ph(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Fh(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 Ih(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Lh(e,t))})}function Lh(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Rh(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 zh(e,t){!Lh(e,t)&&kh[t.type]&&(e.editable||!(t.type in Ah))&&kh[t.type](e,t)}Ah.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!$h(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Sp&&gp&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),yp&&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,rp(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||dh(e,n)?n.preventDefault():Ph(e,`key`)},Ah.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Ah.keypress=(e,t)=>{let n=t;if($h(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||bp&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof O)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Bh(e){return{left:e.clientX,top:e.clientY}}function Vh(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Hh(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 Uh(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 Wh(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&k.isSelectable(r)?(Uh(e,new k(n),`pointer`),!0):!1}function Gh(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof k&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(k.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Uh(e,k.create(e.state.doc,i),`pointer`),!0)}function Kh(e,t,n,r,i){return Hh(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Gh(e,n):Wh(e,n))}function qh(e,t,n,r){return Hh(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Jh(e,t,n,r){return Hh(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Yh(e,n,r)}function Yh(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Uh(e,O.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Uh(e,O.create(r,a+1,a+1+n.content.size),`pointer`);else if(k.isSelectable(n))Uh(e,k.create(r,a),`pointer`);else continue;return!0}}function Xh(e){return og(e)}var Zh=bp?`metaKey`:`ctrlKey`;kh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Xh(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Vh(n,e.input.lastClick)&&!n[Zh]&&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(Bh(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Qh(e,o,n,!!r)):(a==`doubleClick`?qh:Jh)(e,o.pos,o.inside,n)?n.preventDefault():Ph(e,`pointer`))};var Qh=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Zh],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof k&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&mp&&!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)),Ph(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(()=>Pm(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Bh(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ph(this.view,`pointer`):Kh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vp&&this.mightDrag&&!this.mightDrag.node.isAtom||gp&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Uh(this.view,Tu.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Ph(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Ph(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)}};kh.touchstart=e=>{e.input.lastTouch=Date.now(),Xh(e),Ph(e,`pointer`)},kh.touchmove=e=>{e.input.lastTouch=Date.now(),Ph(e,`pointer`)},kh.contextmenu=e=>Xh(e);function $h(e,t){return e.composing?!0:vp&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var eg=Sp?5e3:-1;Ah.compositionstart=Ah.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof O&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||gp&&xp&&tg(e)))e.markCursor=e.state.storedMarks||n.marks(),og(e,!0),e.markCursor=null;else if(og(e,!t.selection.empty),mp&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}ng(e,eg)};function tg(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`}Ah.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++,ng(e,20))};function ng(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>og(e),t))}function rg(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=ag());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ig(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Qf(t.focusNode,t.focusOffset),r=$f(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 ag(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function og(e,t=!1){if(!(Sp&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rg(e),t||e.docView&&e.docView.dirty){let n=Mm(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 sg(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 cg=fp&&pp<15||yp&&wp<604;kh.copy=Ah.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=cg?null:n.clipboardData,{dom:o,text:s}=fh(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):sg(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function lg(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ug(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?dg(e,r.value,null,i,t):dg(e,r.textContent,r.innerHTML,i,t)},50)}function dg(e,t,n,r,i){let a=ph(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||D.empty)))return!0;if(!a)return!1;let o=lg(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function fg(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,` `):``}Ah.paste=(e,t)=>{let n=t;if(e.composing&&!Sp)return;let r=cg?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&dg(e,fg(r),r.getData(`text/html`),i,n)?n.preventDefault():ug(e,n)};var pg=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},mg=bp?`altKey`:`ctrlKey`;function hg(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[mg]:!n}kh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Bh(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof k?i.to-1:i.to))){if(r&&r.mightDrag)o=k.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=k.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=fh(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!gp||_p>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(cg?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,cg||n.dataTransfer.setData(`text/plain`,c),e.dragging=new pg(l,hg(e,n),o)},kh.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Ah.dragover=Ah.dragenter=(e,t)=>t.preventDefault(),Ah.drop=(e,t)=>{try{gg(e,t,e.dragging)}finally{e.dragging=null}};function gg(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Bh(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=ph(e,fg(t.dataTransfer),cg?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&hg(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||D.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?iu(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&k.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new k(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Um(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}kh.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())&&Pm(e)},20))},kh.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)},kh.beforeinput=(e,t)=>{if(gp&&Sp&&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,rp(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 Ah)kh[e]=Ah[e];function _g(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 vg=class e{constructor(e,t){this.toDOM=e,this.spec=t||Cg,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 xg(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&&_g(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},yg=class e{constructor(e,t){this.attrs=e,this.spec=t||Cg}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 xg(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&_g(this.attrs,t.attrs)&&_g(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},bg=class e{constructor(e,t){this.attrs=e,this.spec=t||Cg}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 xg(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&&_g(this.attrs,t.attrs)&&_g(this.spec,t.spec)}destroy(){}},xg=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 vg(n,r))}static inline(t,n,r,i){return new e(t,n,new yg(r,i))}static node(t,n,r,i){return new e(t,n,new bg(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof yg}get widget(){return this.type instanceof vg}},Sg=[],Cg={},wg=class e{constructor(e,t){this.local=e.length?e:Sg,this.children=t.length?t:Sg}static create(e,t){return t.length?Mg(t,e,0,Cg):Tg}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==Tg||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Cg)}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?Dg(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Ng),Sg):Tg}add(t,n){return n.length?this==Tg?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=Ag(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,Mg(s,e,o+1,Cg)),a+=3}});let o=Og(a?jg(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(Ng):this.local,i||this.children)}remove(e){return e.length==0||this==Tg?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==Tg?(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):Tg}forChild(t,n){if(this==Tg)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 yg){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(Ng),Sg);return r?new Eg([t,r]):t}return r||Tg}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 Pg(this.localsInner(e))}localsInner(e){if(this==Tg)return Sg;if(e.inlineContent||!this.local.some(yg.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof yg||t.push(this.local[e]);return t}forEachSet(e){e(this)}};wg.empty=new wg([],[]),wg.removeOverlap=Pg;var Tg=wg.empty,Eg=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Cg));return e.from(r)}forChild(t,n){if(n.isLeaf)return wg.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Tg&&(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?Pg(n?t:t.sort(Ng)):Sg}static from(t){switch(t.length){case 0:return Tg;case 1:return t[0];default:return new e(t.every(e=>e instanceof wg)?t:t.reduce((e,t)=>e.concat(t instanceof wg?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Dg(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==Tg?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Mg(kg(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 wg(t.sort(Ng),s)}function Og(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 xg(i.from+t,i.to+t,i.type))}return n}function kg(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 Ag(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 jg(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Mg(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Ag(e,t,o+n);if(s){a=!0;let e=Mg(s,t,n+o+1,r);e!=Tg&&i.push(o,o+t.nodeSize,e)}});let o=Og(a?jg(e):e,-n).sort(Ng);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 wg(o,i):Tg}function Ng(e,t){return e.from-t.from||e.to-t.to}function Pg(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),Fg(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),Fg(t,i,r.copy(a.from,r.to)));break}}}return t}function Fg(e,t,n){for(;t<e.length&&Ng(n,e[t])>0;)t++;e.splice(t,0,n)}function Ig(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Tg&&t.push(r)}),e.cursorWrapper&&t.push(wg.create(e.state.doc,[e.cursorWrapper.deco])),Eg.from(t)}var Lg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Rg=fp&&pp<=11,zg=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}},Bg=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zg,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]);fp&&pp<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():vp&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Rg&&(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,Lg)),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(Wm(this.view)){if(this.suppressingSelectionUpdates)return Pm(this.view);if(fp&&pp<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Jf(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=Wf(n))t.add(n);for(let r=e.anchorNode;r;r=Wf(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Wm(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(mp&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Kg(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&np(n)&&(c=Mm(e))&&c.eq(Tu.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Pm(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Ug(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,qg(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Pm(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(fp&&pp<=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?Uf(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Uf(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}}},Vg=new WeakMap,Hg=!1;function Ug(e){if(!Vg.has(e)&&(Vg.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=mp,Hg)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.`),Hg=!0}}function Wg(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Jf(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Gg(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Wg(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?Wg(e,n):null}function Kg(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 qg(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 Jg(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],np(c)||l.push({node:c.focusNode,offset:c.focusOffset})),gp&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||Gc.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Yg,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Yg(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(vp&&/^(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||vp&&/^(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 Xg=/^(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 Zg(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Mm(e,t);if(n&&!e.state.selection.eq(n)){if(gp&&Sp&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,rp(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Jg(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=n_(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(yp&&e.input.lastIOSEnter>Date.now()-225||Sp)&&i.some(e=>e.nodeType==1&&!Xg.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,rp(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof O&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Qg(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof O&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),fp&&pp<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((yp&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,rp(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&e_(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,rp(8,`Backspace`)))){Sp&&gp&&e.domObserver.suppressSelectionUpdates();return}gp&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Sp&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,rp(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Qg(e,n.doc,l.sel);t&&!(gp&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||fp&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){fp&&pp<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Pm(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=$g(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Qg(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Um(e,t.resolve(n.anchor),t.resolve(n.head))}function $g(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(E.from(l).eq(e))return{mark:s,type:o}}function e_(e,t,n,r,i){if(n-t<=i.pos-r.pos||t_(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(t_(a,!0,!0));return!o.parent.isTextblock||o.pos>n||t_(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function t_(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 n_(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&&r_(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&&r_(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function r_(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 i_=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 Mh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(d_),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=s_(this),o_(this),this.nodeViews=l_(this),this.docView=fm(this.state.doc,a_(this),Ig(this),this.dom,this),this.domObserver=new Bg(this,(e,t,n,r)=>Zg(this,e,t,n,r)),this.domObserver.start(),Nh(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&&Ih(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(d_),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&&(rg(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=l_(this);u_(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ih(this),this.editable=s_(this),o_(this);let o=Ig(this),s=a_(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&&kp(this);if(i){this.domObserver.stop();let t=l&&(fp||gp)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&c_(n.selection,e.selection);if(l){let n=gp?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ig(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=fm(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())&&Km(this))?Pm(this,t):(Vm(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&&jp(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 k){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Op(this,t.getBoundingClientRect(),e)}else Op(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new pg(e.slice,e.move,r<0?void 0:k.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(fp){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&&Pp(this.dom),Pm(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 Hp(this,e)}coordsAtPos(e,t=1){return Kp(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 nm(this,t||this.state,e)}pasteHTML(e,t){return dg(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return dg(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return fh(this,e)}destroy(){this.docView&&(Fh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ig(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,qf())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return zh(this,e)}domSelectionRange(){let e=this.domSelection();return e?vp&&this.root.nodeType===11&&ip(this.dom.ownerDocument)==this.dom&&Gg(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};i_.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function a_(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`,[xg.node(0,e.state.doc.content.size,t)]}function o_(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:xg.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function s_(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function c_(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 l_(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 u_(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 d_(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`)}function f_(e,t){return e.meta={package:`@milkdown/core`,group:`System`,...t},e}var p_={text:(e,t,n,r)=>{let i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(e,t,n,r)=>{let i=e.marker||n.options.strong||`*`,a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i+i),a(),s},emphasis:(e,t,n,r)=>{let i=e.marker||n.options.emphasis||`*`,a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i),a(),s}},m_=Za({},`editorView`),h_=Za({},`editorState`),g_=Za([],`initTimer`),__=Za({},`editor`),v_=Za([],`inputRules`),y_=Za([],`prosePlugins`),b_=Za([],`remarkPlugins`),x_=Za([],`nodeView`),S_=Za([],`markView`),C_=Za(pt().use(bo).use(Us),`remark`),w_=Za({handlers:p_,encode:[]},`remarkStringifyOptions`),T_=ro(`ConfigReady`);function E_(e){let t=t=>(t.record(T_),async()=>(await e(t),t.done(T_),()=>{t.clearTimer(T_)}));return f_(t,{displayName:`Config`}),t}var D_=ro(`InitReady`);function O_(e){let t=t=>(t.inject(__,e).inject(y_,[]).inject(b_,[]).inject(v_,[]).inject(x_,[]).inject(S_,[]).inject(w_,{handlers:p_,encode:[]}).inject(C_,pt().use(bo).use(Us)).inject(g_,[T_]).record(D_),async()=>{await t.waitTimers(g_);let e=t.get(w_);return t.set(C_,pt().use(bo).use(Us,e)),t.done(D_),()=>{t.remove(__).remove(y_).remove(b_).remove(v_).remove(x_).remove(S_).remove(w_).remove(C_).remove(g_).clearTimer(D_)}});return f_(t,{displayName:`Init`}),t}var k_=ro(`SchemaReady`),A_=Za([],`schemaTimer`),j_=Za({},`schema`),M_=Za([],`nodes`),N_=Za([],`marks`);function P_(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var F_=e=>(e.inject(j_,{}).inject(M_,[]).inject(N_,[]).inject(A_,[D_]).record(k_),async()=>{await e.waitTimers(A_);let t=e.get(C_),n=e.get(b_).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(C_,n);let r=new Vc({nodes:Object.fromEntries(e.get(M_).map(([e,t])=>[e,P_(t)])),marks:Object.fromEntries(e.get(N_).map(([e,t])=>[e,P_(t)]))});return e.set(j_,r),e.done(k_),()=>{e.remove(j_).remove(M_).remove(N_).remove(A_).clearTimer(k_)}});f_(F_,{displayName:`Schema`});var I_=class{constructor(){this.#e=new Ja,this.#t=null,this.setCtx=e=>{this.#t=e},this.chain=()=>{if(this.#t==null)throw Ha();let e=this.#t,t=[],n=this.get.bind(this),r={run:()=>{let n=Td(...t),r=e.get(m_);return n(r.state,r.dispatch,r)},inline:e=>(t.push(e),r),pipe:i.bind(this)};function i(e,i){let a=n(e);return t.push(a(i)),r}return r}}#e;#t;get ctx(){return this.#t}create(e,t){let n=e.create(this.#e.sliceMap);return n.set(t),n}get(e){return this.#e.get(e).get()}remove(e){return this.#e.remove(e)}call(e,t){if(this.#t==null)throw Ha();let n=this.get(e)(t),r=this.#t.get(m_);return n(r.state,r.dispatch,r)}inline(e){if(this.#t==null)throw Ha();let t=this.#t.get(m_);return e(t.state,t.dispatch,t)}};function L_(e=`cmdKey`){return Za((()=>()=>!1),e)}var A=Za(new I_,`commands`),R_=Za([k_],`commandsTimer`),z_=ro(`CommandsReady`),B_=e=>{let t=new I_;return t.setCtx(e),e.inject(A,t).inject(R_,[k_]).record(z_),async()=>(await e.waitTimers(R_),e.done(z_),()=>{e.remove(A).remove(R_).clearTimer(z_)})};f_(B_,{displayName:`Commands`});function V_(e){return e.Backspace=Td(Nd,Yu,Qu,td),e}var H_=class{constructor(){this.#e=null,this.#t=[],this.setCtx=e=>{this.#e=e},this.add=e=>(this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{if(typeof n==`function`){let r={key:e,onRun:()=>n};this.#t.push(r),t.push(()=>{this.#t=this.#t.filter(e=>e!==r)})}else this.#t.push(n),t.push(()=>{this.#t=this.#t.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{let e=V_(Ad);return this.addObjectKeymap(e)},this.build=()=>{let e={};return this.#t.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,r)=>{let i=this.#e;if(i==null)throw Fa();return Td(...n.map(e=>e.onRun(i)))(e,t,r)}]}))}}#e;#t;get ctx(){return this.#e}},U_=Za(new H_,`keymap`),W_=Za([k_],`keymapTimer`),G_=ro(`KeymapReady`),K_=e=>{let t=new H_;return t.setCtx(e),e.inject(U_,t).inject(W_,[k_]).record(G_),async()=>(await e.waitTimers(W_),e.done(G_),()=>{e.remove(U_).remove(W_).clearTimer(G_)})},q_=ro(`ParserReady`),J_=(()=>{throw Fa()}),Y_=Za(J_,`parser`),X_=Za([],`parserTimer`),Z_=e=>(e.inject(Y_,J_).inject(X_,[k_]).record(q_),async()=>{await e.waitTimers(X_);let t=e.get(C_),n=e.get(j_);return e.set(Y_,zf.create(n,t)),e.done(q_),()=>{e.remove(Y_).remove(X_).clearTimer(q_)}});f_(Z_,{displayName:`Parser`});var Q_=ro(`SerializerReady`),$_=Za([],`serializerTimer`),ev=(()=>{throw Fa()}),tv=Za(ev,`serializer`),nv=e=>(e.inject(tv,ev).inject($_,[k_]).record(Q_),async()=>{await e.waitTimers($_);let t=e.get(C_),n=e.get(j_);return e.set(tv,Hf.create(n,t)),e.done(Q_),()=>{e.remove(tv).remove($_).clearTimer(Q_)}});f_(nv,{displayName:`Serializer`});var rv=Za(``,`defaultValue`),iv=Za(e=>e,`stateOptions`),av=Za([],`editorStateTimer`),ov=ro(`EditorStateReady`);function sv(e,t,n){if(typeof e==`string`)return t(e);if(e.type===`html`)return Gc.fromSchema(n).parse(e.dom);if(e.type===`json`)return gc.fromJSON(n,e.value);throw Ma(e)}var cv=new Ju(`MILKDOWN_STATE_TRACKER`),lv=e=>(e.inject(rv,``).inject(h_,{}).inject(iv,e=>e).inject(av,[q_,Q_,z_,G_]).record(ov),async()=>{await e.waitTimers(av);let t=e.get(j_),n=e.get(Y_),r=e.get(v_),i=e.get(iv),a=e.get(y_),o=sv(e.get(rv),n,t),s=e.get(U_),c=s.addBaseKeymap(),l=[...a,new Gu({key:cv,state:{init:()=>{},apply:(t,n,r,i)=>{e.set(h_,i)}}}),af({rules:r}),Pf(s.build())];e.set(y_,l);let u=i({schema:t,doc:o,plugins:l}),d=Uu.create(u);return e.set(h_,d),e.done(ov),()=>{c(),e.remove(rv).remove(h_).remove(iv).remove(av).clearTimer(ov)}});f_(lv,{displayName:`EditorState`});var uv=Za([],`pasteRule`),dv=Za([k_],`pasteRuleTimer`),fv=ro(`PasteRuleReady`),pv=e=>(e.inject(uv,[]).inject(dv,[k_]).record(fv),async()=>(await e.waitTimers(dv),e.done(fv),()=>{e.remove(uv).remove(dv).clearTimer(fv)}));f_(pv,{displayName:`PasteRule`});var mv=ro(`EditorViewReady`),hv=Za([],`editorViewTimer`),gv=Za({},`editorViewOptions`),_v=Za(null,`root`),vv=Za(null,`rootDOM`),yv=Za({},`rootAttrs`);function bv(e,t){let n=document.createElement(`div`);n.className=`milkdown`,e.appendChild(n),t.set(vv,n);let r=t.get(yv);return Object.entries(r).forEach(([e,t])=>n.setAttribute(e,t)),n}function xv(e){e.classList.add(`editor`),e.setAttribute(`role`,`textbox`)}var Sv=new Ju(`MILKDOWN_VIEW_CLEAR`),Cv=e=>(e.inject(_v,document.body).inject(m_,{}).inject(gv,{}).inject(vv,null).inject(yv,{}).inject(hv,[ov,fv]).record(mv),async()=>{await e.wait(D_);let t=e.get(_v)||document.body,n=typeof t==`string`?document.querySelector(t):t;e.update(y_,t=>[new Gu({key:Sv,view:t=>{let r=n?bv(n,e):void 0;return(()=>{if(r&&n){let e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{r?.parentNode&&r?.parentNode.replaceChild(t.dom,r),r?.remove()}}}}),...t]),await e.waitTimers(hv);let r=e.get(h_),i=e.get(gv),a=new i_(n,{state:r,nodeViews:Object.fromEntries(e.get(x_)),markViews:Object.fromEntries(e.get(S_)),transformPasted:(t,n,r)=>(e.get(uv).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,r)}),t),...i});return xv(a.dom),e.set(m_,a),e.done(mv),()=>{a?.destroy(),e.remove(_v).remove(m_).remove(gv).remove(vv).remove(yv).remove(hv).clearTimer(mv)}});f_(Cv,{displayName:`EditorView`});var wv=function(e){return e.Idle=`Idle`,e.OnCreate=`OnCreate`,e.Created=`Created`,e.OnDestroy=`OnDestroy`,e.Destroyed=`Destroyed`,e}({}),Tv=class e{constructor(){this.#e=!1,this.#t=wv.Idle,this.#n=[],this.#r=()=>void 0,this.#i=new Ja,this.#a=new eo,this.#o=new Map,this.#s=new Map,this.#c=new $a(this.#i,this.#a),this.#l=()=>{let e=E_(async e=>{await Promise.all(this.#n.map(t=>Promise.resolve(t(e))))}),t=[F_,Z_,nv,B_,K_,pv,lv,Cv,O_(this),e];this.#u(t,this.#s)},this.#u=(e,t)=>{e.forEach(e=>{let n=this.#c.produce(this.#e?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})})},this.#d=(e,t=!1)=>Promise.all([e].flat().map(async e=>{let n=this.#o.get(e)?.cleanup;return t?this.#o.delete(e):this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof n==`function`?n():n})),this.#f=async()=>{await Promise.all([...this.#s.entries()].map(async([e,{cleanup:t}])=>typeof t==`function`?t():t)),this.#s.clear()},this.#p=e=>{this.#t=e,this.#r(e)},this.#m=e=>[...e.entries()].map(async([t,n])=>{let{ctx:r,handler:i}=n;if(!i)return;let a=await i();e.set(t,{ctx:r,handler:i,cleanup:a})}),this.enableInspector=(e=!0)=>(this.#e=e,this),this.onStatusChange=e=>(this.#r=e,this),this.config=e=>(this.#n.push(e),this),this.removeConfig=e=>(this.#n=this.#n.filter(t=>t!==e),this),this.use=e=>{let t=[e].flat();return t.flat().forEach(e=>{this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),this.#t===wv.Created&&this.#u(t,this.#o),this},this.remove=async e=>this.#t===wv.OnCreate?(console.warn(`[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code.`),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await this.#d([e].flat(),!0),this),this.create=async()=>this.#t===wv.OnCreate?this:(this.#t===wv.Created&&await this.destroy(),this.#p(wv.OnCreate),this.#l(),this.#u([...this.#o.keys()],this.#o),await Promise.all([this.#m(this.#s),this.#m(this.#o)].flat()),this.#p(wv.Created),this),this.destroy=async(e=!1)=>this.#t===wv.Destroyed||this.#t===wv.OnDestroy?this:this.#t===wv.OnCreate?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#n=[]),this.#p(wv.OnDestroy),await this.#d([...this.#o.keys()],e),await this.#f(),this.#p(wv.Destroyed),this),this.action=e=>e(this.#c),this.inspect=()=>this.#e?[...this.#s.values(),...this.#o.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new e}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;get ctx(){return this.#c}get status(){return this.#t}},Ev=e=>crypto.getRandomValues(new Uint8Array(e)),Dv=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}};((e,t=21)=>Dv(e,t|0,Ev))(`abcedfghicklmn`,10);function j(e,t){let n=L_(e),r=i=>async()=>{r.key=n,await i.wait(z_);let a=t(i);return i.get(A).create(n,a),r.run=t=>i.get(A).call(e,t),()=>{i.get(A).remove(n)}};return r}function Ov(e){let t=n=>async()=>{await n.wait(k_);let r=e(n);return n.update(v_,e=>[...e,r]),t.inputRule=r,()=>{n.update(v_,e=>e.filter(e=>e!==r))}};return t}function kv(e){let t=n=>async()=>{await n.wait(k_);let r=e(n);return n.update(uv,e=>[...e,r]),t.pasteRule=r,()=>{n.update(uv,e=>e.filter(e=>e!==r))}};return t}function Av(e,t){let n=r=>async()=>{let i=t(r);return r.update(N_,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(N_,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(j_).marks[e];if(!n)throw Wa(e);return n},n}function jv(e,t){let n=r=>async()=>{let i=t(r);return r.update(M_,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(M_,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(j_).nodes[e];if(!n)throw Ua(e);return n},n}function Mv(e){let t,n=n=>async()=>(await n.wait(k_),t=e(n),n.update(y_,e=>[...e,t]),()=>{n.update(y_,e=>e.filter(e=>e!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function Nv(e){let t=n=>async()=>{await n.wait(G_);let r=n.get(U_),i=e(n),a=r.addObjectKeymap(i);return t.keymap=i,()=>{a()}};return t}function Pv(e,t){let n=r=>async()=>{await r.wait(k_);let i=t(r);return e.type(r)instanceof Lc?r.update(x_,t=>[...t,[e.id,i]]):r.update(S_,t=>[...t,[e.id,i]]),n.view=i,n.type=e,()=>{e.type(r)instanceof Lc?r.update(x_,t=>t.filter(t=>t[0]!==e.id)):r.update(S_,t=>t.filter(t=>t[0]!==e.id))}};return n}function Fv(e,t){let n=Za(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r}function Iv(e,t){let n=Fv(t,e),r=jv(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.node=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>Iv(e,n(t)),i}function Lv(e,t){let n=Fv(t,e),r=Av(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.mark=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>Lv(e,n(t)),i}function Rv(e,t){let n=Fv(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),r=Nv(e=>{let r=e.get(n.key),i=Object.entries(t).flatMap(([e,{command:t}])=>{let n=r[e],i=[n.shortcuts].flat(),a=n.priority;return i.map(e=>[e,{key:e,onRun:t,priority:a}])});return Object.fromEntries(i)}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}var zv=(e,t=()=>({}))=>Fv(t,`${e}Attr`),Bv=(e,t=()=>({}))=>Fv(t,`${e}Attr`);function Vv(e,t,n){let r=Fv(n??{},e),i=e=>async()=>{await e.wait(D_);let n={plugin:t(e),options:e.get(r.key)};return e.update(b_,e=>[...e,n]),()=>{e.update(b_,e=>e.filter(e=>e!==n))}},a=[r,i];return a.id=e,a.plugin=i,a.options=r,a}function Hv(e){return t=>{let n=t.get(m_),r=t.get(j_),i=t.get(tv);if(!e)return i(n.state.doc);let a=n.state.doc.slice(e.from,e.to,!0),o=r.topNodeType.createAndFill(null,a.content);return o?i(o):(console.error(`No document found`),``)}}function Uv(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return n??(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}var Wv={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-Uv(e.type),compareTokens:(e,t)=>e===t};function Gv(e,t,n,r,i){for(let a=0,o=0;a<e.childCount;a++){let s=e.child(a),c=o+s.nodeSize,l=Math.max(o,n),u=Math.min(c,r);if(l<u)if(s.isText)for(let e=l;e<u;e++)i.push(t.encodeCharacter(s.text.charCodeAt(e-o),s.marks));else s.isLeaf?i.push(t.encodeNodeStart(s)):(l==o&&i.push(t.encodeNodeStart(s)),Gv(s.content,t,Math.max(o+1,l)-o-1,Math.min(c-1,u)-o-1,i),u==c&&i.push(t.encodeNodeEnd(s)));o=c}return i}var Kv=5e3;function qv(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function Jv(e,t,n,r=Wv){let i=Gv(e,r,n.fromA,n.toA,[]),a=Gv(t,r,n.fromB,n.toB,[]),o=0,s=i.length,c=a.length,l=r.compareTokens;for(;o<i.length&&o<a.length&&l(i[o],a[o]);)o++;if(o==i.length&&o==a.length)return[];for(;s>o&&c>o&&l(i[s-1],a[c-1]);)s--,c--;if(s==o||c==o||s==c&&s==o+1)return[n.slice(o,s,o,c)];let u=s-o,d=c-o,f=Math.min(Kv,u+d),p=f+1,m=[],h=[];for(let e=p*2,t=0;t<e;t++)h[t]=-1;for(let e=0;e<=f;e++){for(let t=-e;t<=e;t+=2){let r=h[t+1+f],p=h[t-1+f],g=r<p?p:r+1,_=g+t;for(;g<u&&_<d&&l(i[o+g],a[o+_]);)g++,_++;if(h[t+f]=g,g>=u&&_>=d){let r=[],i=qv(s-o,c-o),a=-1,l=-1,u=-1,d=-1,p=(e,t,o,s)=>{a>-1&&a<t+i?(a=e,u=o):(a>-1&&r.push(n.slice(a,l,u,d)),a=e,l=t,u=o,d=s)};for(let n=e-1;n>=0;n--){let e=h[t+1+f],r=h[t-1+f];e<r?(t--,g=r+o,_=g+t,p(g,g,_,_+1)):(t++,g=e+o,_=g+t,p(g,g+1,_,_)),h=m[n>>1]}return a>-1&&r.push(n.slice(a,l,u,d)),r.reverse()}}e%2==0&&m.push(h.slice())}return[n.slice(o,s,o,c)]}var Yv=class e{constructor(e,t){this.length=e,this.data=t}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(n==0&&r==e.len(t))return t;let i=[];for(let e=0,a=0;a<r;e++){let o=t[e],s=a+o.length,c=Math.min(r,s)-Math.max(n,a);c>0&&i.push(o.cut(c)),a=s}return i}static join(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let i=r(t[t.length-1].data,n[0].data);if(i==null)return t.concat(n);let a=t.slice(0,t.length-1);a.push(new e(t[t.length-1].length+n[0].length,i));for(let e=1;e<n.length;e++)a.push(n[e]);return a}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}};Yv.none=[];var Xv=class e{constructor(e,t,n,r,i,a){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=i,this.inserted=a}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(t,n,r,i){return t==0&&r==0&&n==this.toA-this.fromA&&i==this.toB-this.fromB?this:new e(this.fromA+t,this.fromA+n,this.fromB+r,this.fromB+i,Yv.slice(this.deleted,t,n),Yv.slice(this.inserted,r,i))}static merge(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let i=[];for(let a=0,o=0,s=t[0],c=n[0];;)if(!s&&!c)return i;else if(s&&(!c||s.toB<c.fromA)){let r=o?n[o-1].toB-n[o-1].toA:0;i.push(r==0?s:new e(s.fromA,s.toA,s.fromB+r,s.toB+r,s.deleted,s.inserted)),s=a++==t.length?null:t[a]}else if(c&&(!s||c.toA<s.fromB)){let r=a?t[a-1].toB-t[a-1].toA:0;i.push(r==0?c:new e(c.fromA-r,c.toA-r,c.fromB,c.toB,c.deleted,c.inserted)),c=o++==n.length?null:n[o]}else{let l=Math.min(s.fromB,c.fromA),u=Math.min(s.fromA,c.fromA-(a?t[a-1].toB-t[a-1].toA:0)),d=u,f=Math.min(c.fromB,s.fromB+(o?n[o-1].toB-n[o-1].toA:0)),p=f,m=Yv.none,h=Yv.none,g=!1,_=!1;for(;;){let e=s?l>=s.fromB?s.toB:s.fromB:2e8,i=c?l>=c.fromA?c.toA:c.fromA:2e8,u=Math.min(e,i),f=s&&l>=s.fromB,v=c&&l>=c.fromA;if(!f&&!v)break;f&&l==s.fromB&&!g&&(m=Yv.join(m,s.deleted,r),d+=s.lenA,g=!0),f&&!v&&(h=Yv.join(h,Yv.slice(s.inserted,l-s.fromB,u-s.fromB),r),p+=u-l),v&&l==c.fromA&&!_&&(h=Yv.join(h,c.inserted,r),p+=c.lenB,_=!0),v&&!f&&(m=Yv.join(m,Yv.slice(c.deleted,l-c.fromA,u-c.fromA),r),d+=u-l),f&&u==s.toB&&(s=a++==t.length?null:t[a],g=!1),v&&u==c.toA&&(c=o++==n.length?null:n[o],_=!1),l=u}(u<d||f<p)&&i.push(new e(u,d,f,p,m,h))}}static fromJSON(t){return new e(t.fromA,t.toA,t.fromB,t.toB,t.deleted.map(e=>new Yv(e.length,e.data)),t.inserted.map(e=>new Yv(e.length,e.data)))}toJSON(){return this}},Zv=class e{constructor(e,t){this.config=e,this.changes=t}addSteps(t,n,r){let i=[];for(let e=0;e<n.length;e++){let t=Array.isArray(r)?r[e]:r,a=0;n[e].forEach((e,n,r,o)=>{i.push(new Xv(e+a,n+a,r,o,e==n?Yv.none:[new Yv(n-e,t)],r==o?Yv.none:[new Yv(o-r,t)])),a=o-r-(n-e)})}if(i.length==0)return this;let a=Qv(i,this.config.combine),o=Xv.merge(this.changes,a,this.config.combine),s=o;for(let e=0;e<s.length;e++){let n=s[e];if(n.fromA==n.toA||n.fromB==n.toB||!a.some(e=>e.toB>n.fromB&&e.fromB<n.toB))continue;let r=Jv(this.config.doc.content,t.content,n,this.config.encoder);r.length==1&&r[0].fromB==0&&r[0].toB==n.toB-n.fromB||(s==o&&(s=o.slice()),r.length==1?s[e]=r[0]:(s.splice(e,1,...r),e+=r.length-1))}return new e(this.config,s)}get startDoc(){return this.config.doc}map(t){let n=e=>{let n=t(e);return n===e.data?e:new Yv(e.length,n)};return new e(this.config,this.changes.map(e=>new Xv(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(n),e.inserted.map(n))))}changedRange(e,t){if(e==this)return null;let n=t&&ey(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function i(e){return!n||e<=n.fromA?e:e+r}let a=n?n.fromB:2e8,o=n?n.toB:-2e8;function s(e,t=e){a=Math.min(e,a),o=Math.max(t,o)}let c=this.changes,l=e.changes;for(let e=0,t=0;e<c.length&&t<l.length;){let n=c[e],r=l[t];n&&r&&ty(n,r,i)?(e++,t++):r&&(!n||i(n.fromB)>=r.fromB)?(s(r.fromB,r.toB),t++):(s(i(n.fromB),i(n.toB)),e++)}return a<=o?{from:a,to:o}:null}static create(t,n=(e,t)=>e===t?e:null,r=Wv,i=[]){return new e({combine:n,doc:t,encoder:r},i)}};Zv.computeDiff=Jv;function Qv(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let i=n+r>>1;return Xv.merge(Qv(e,t,n,i),Qv(e,t,i,r),t)}function $v(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let i=e[r];t!=2e8&&(t=i.map(t,-1),n=i.map(n,1)),i.forEach((e,r,i,a)=>{t=Math.min(t,i),n=Math.max(n,a)})}return t==2e8?null:{from:t,to:n}}function ey(e){let t=$v(e);if(!t)return null;let n=$v(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}function ty(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&ny(e.deleted,t.deleted)&&ny(e.inserted,t.inserted)}function ny(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function ry(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-diff`,...t}}),e}var iy=500;function ay(e={}){let t=new WeakMap,n=new WeakMap;function r(e){let n=t.get(e);if(n!=null)return n;let r=e.attrs,i=r?Object.keys(r).filter(e=>r[e]!=null).sort():[];if(i.length===0)n=e.type.name;else{let t={};for(let e of i)t[e]=r[e];n=`${e.type.name}:${JSON.stringify(t)}`}return t.set(e,n),n}return{encodeCharacter:(e,t)=>{if(t.length===0)return e;let i=n.get(t);return i??(i=t.map(r).join(`,`),n.set(t,i)),`${e}:${i}`},encodeNodeStart:t=>{let n=t.attrs;if(n&&Object.keys(n).length>0){let r=e[t.type.name]??[],i=Object.keys(n).filter(e=>{if(r.includes(e))return!1;let i=t.type.spec.attrs?.[e]?.default;return n[e]!==i});if(i.length>0){let e={};for(let t of i.sort())e[t]=n[t];return`${t.type.name}:${JSON.stringify(e)}`}}return t.type.name},encodeNodeEnd:e=>{let t=e.type.schema,n=t.cached.changeSetIDs||(t.cached.changeSetIDs=Object.create(null)),r=n[e.type.name];return r??(n[e.type.name]=r=Object.keys(t.nodes).indexOf(e.type.name)+1),-r},compareTokens:(e,t)=>e===t}}function oy(e,t,n){let r=n.get(e);if(r!=null)return r;let i=[String(t.encodeNodeStart(e))];if(e.isText){let n=e.text;for(let r=0;r<n.length;r++)i.push(`:`+String(t.encodeCharacter(n.charCodeAt(r),e.marks)))}else e.content.forEach(e=>{i.push(`/`+oy(e,t,n))});i.push(`\\`+String(t.encodeNodeEnd(e)));let a=i.join(``);return n.set(e,a),a}function sy(e,t,n){let r=[],i=0;return e.content.forEach(e=>{r.push({node:e,offset:i,size:e.nodeSize,signature:oy(e,n.encoder,n.sigCache)}),i+=e.nodeSize}),{node:e,contentStart:t,content:r}}function cy(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)e[a].signature===t[n].signature?i[a][n]=i[a+1][n+1]+1:i[a][n]=Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].signature===t[s].signature?(a.push([o,s]),o++,s++):i[o+1][s]>=i[o][s+1]?o++:s++;return a}function ly(e,t){if(e.type!==t.type)return!1;let n=e.type;return!(n.isTextblock||n.isAtom||n.spec.code===!0||!n.isBlock)}function uy(e,t,n){return Xv.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(e=>({length:e.length,data:e.data})),inserted:e.inserted.map(e=>({length:e.length,data:e.data}))})}function dy(e,t,n){let r=e.parent.copy(E.from(e.node)),i=t.parent.copy(E.from(t.node)),a=new Ml(0,r.content.size,new D(i.content,0,0));return Zv.create(r,void 0,n.encoder).addSteps(i,[a.getMap()],null).changes.map(n=>uy(n,e.abs,t.abs))}function fy(e,t){let n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){let r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function py(e,t,n){return Xv.fromJSON({fromA:t,toA:t+e.size,fromB:n,toB:n,deleted:[{length:e.size,data:null}],inserted:[]})}function my(e,t,n){return Xv.fromJSON({fromA:t,toA:t,fromB:n,toB:n+e.size,deleted:[],inserted:[{length:e.size,data:null}]})}function hy(e,t,n,r,i){let a=new Ml(0,e.content.size,new D(t.content,0,0));return Zv.create(e,void 0,i.encoder).addSteps(t,[a.getMap()],null).changes.map(e=>uy(e,n,r))}function gy(e,t,n,r,i){if(e.childCount>iy||t.childCount>iy)return hy(e,t,n,r,i);let a=sy(e,n,i),o=sy(t,r,i),s=cy(a.content,o.content),c=[],l=0,u=0;for(let[e,t]of s)_y(a,o,{oldStart:l,oldEnd:e,newStart:u,newEnd:t},i,c),l=e+1,u=t+1;return _y(a,o,{oldStart:l,oldEnd:a.content.length,newStart:u,newEnd:o.content.length},i,c),c}function _y(e,t,n,r,i){let a=e.content,o=t.content,s=n.oldStart,c=n.newStart;for(;s<n.oldEnd||c<n.newEnd;){let l=s<n.oldEnd?a[s]:null,u=c<n.newEnd?o[c]:null,d=l&&u&&l.node.type===u.node.type;if(l&&u&&d){i.push(...vy(e,t,l,u,r)),s++,c++;continue}if(l&&(!u||!d)){let n=e.contentStart+l.offset;i.push(py(l,n,fy(t,c))),s++;continue}if(u){let n=t.contentStart+u.offset;i.push(my(u,fy(e,s),n)),c++}}}function vy(e,t,n,r,i){let a=e.contentStart+n.offset,o=t.contentStart+r.offset;return ly(n.node,r.node)&&yy(n.node,r.node,i.encoder)?gy(n.node,r.node,a+1,o+1,i):dy({node:n.node,parent:e.node,abs:a},{node:r.node,parent:t.node,abs:o},i)}function yy(e,t,n){return n.encodeNodeStart(e)===n.encodeNodeStart(t)}function by(e,t,n,r,i){let a=e.resolve(n),o=e.resolve(r),s=t.resolve(n),c=t.resolve(r),l=a.sharedDepth(r);if(s.sharedDepth(r)!==l)throw RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let e=0;e<=l;e++){if(i.encodeNodeStart(a.node(e))!==i.encodeNodeStart(s.node(e)))throw RangeError(`computeDocDiff: ancestor at depth ${e} differs in type or non-ignored attrs along the path to the shared ancestor`);if(a.start(e)!==s.start(e))throw RangeError(`computeDocDiff: ancestor at depth ${e} starts at different absolute positions in old and new docs (content before the range differs in size)`)}let u=a.node(l);if(u.isTextblock)throw RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(a.depth!==l||o.depth!==l||s.depth!==l||c.depth!==l)throw RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);let d=s.node(l),f=a.start(l),p=n-f,m=r-f;return{oldCut:u.copy(u.content.cut(p,m)),newCut:d.copy(d.content.cut(p,m)),cutAbsStart:n}}function xy(e,t,n){let r=ay(n?.ignoreAttrs),i={encoder:r,sigCache:new WeakMap},a=e.content.size,o=t.content.size,s=n?.range;if(s==null)return gy(e,t,0,0,i);let c=Math.min(a,o),l=Math.max(0,Math.min(s.from??0,c)),u=Math.max(l,Math.min(s.to??c,c));if(l===u)return[];if(l===0&&u===c&&a===o)return gy(e,t,0,0,i);let d=by(e,t,l,u,r);return gy(d.oldCut,d.newCut,d.cutAbsStart,d.cutAbsStart,i)}var Sy=Fv({ignoreAttrs:{heading:[`id`]}},`diffConfig`);ry(Sy,{displayName:`Ctx<diffConfig>`,group:`Diff`});var Cy=new Ju(`MILKDOWN_DIFF`);function wy(e,t,n){let r=xy(e,t.newDoc,n);return{...t,changes:r}}function Ty(e,t){return t.some(t=>e.fromB<t.toB&&e.toB>t.fromB)}function Ey(e){return e.changes.filter(t=>!Ty(t,e.rejectedRanges))}var Dy=Mv(e=>{let t=e.get(Sy.key);return new Gu({key:Cy,state:{init:()=>null,apply(e,n,r,i){let a=e.getMeta(Cy);if(!n){if(a?.type===`start`){let e=xy(i.doc,a.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:a.newDoc,changes:e,rejectedRanges:[],active:!0}}return null}let o=n;if(e.docChanged&&o.active&&(o=wy(i.doc,o,{ignoreAttrs:t.ignoreAttrs})),!a)return o;let s;switch(a.type){case`start`:{let e=xy(i.doc,a.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:a.newDoc,changes:e,rejectedRanges:[],active:!0}}case`accept`:case`acceptRange`:s=o;break;case`reject`:s={...o,rejectedRanges:[...o.rejectedRanges,{fromB:a.fromB,toB:a.toB}]};break;case`rejectRange`:s={...o,rejectedRanges:[...o.rejectedRanges,{fromB:a.range.fromB,toB:a.range.toB}]};break;case`acceptAll`:case`clear`:return null;default:return o}return s.active&&Ey(s).length===0?null:s}},filterTransaction(e,t){return!Cy.getState(t)?.active||e.getMeta(Cy)?!0:!e.docChanged}})});ry(Dy,{displayName:`Prose<diff>`,group:`Diff`});function Oy(e,t){let n=Ey(t);for(let r=n.length-1;r>=0;r--){let i=n[r],a=t.newDoc.slice(i.fromB,i.toB);e=e.replace(i.fromA,i.toA,a)}return e}var ky=j(`StartDiffReview`,e=>t=>(n,r)=>{if(t==null)return!1;let i=e.get(Y_)(t);return i?(r&&r(n.tr.setMeta(Cy,{type:`start`,newDoc:i})),!0):!1});ry(ky,{displayName:`Command<startDiffReview>`,group:`Diff`});var Ay=j(`StartDiffReviewFromDoc`,()=>e=>(t,n)=>!e||e.type!==t.doc.type?!1:(n&&n(t.tr.setMeta(Cy,{type:`start`,newDoc:e})),!0));ry(Ay,{displayName:`Command<startDiffReviewFromDoc>`,group:`Diff`});var jy=j(`AcceptDiffChunk`,()=>e=>(t,n)=>{if(e==null)return!1;let r=Cy.getState(t);if(!r)return!1;let i=Ey(r)[e];if(!i)return!1;if(n){let a=r.newDoc.slice(i.fromB,i.toB),o=t.tr.replace(i.fromA,i.toA,a);o=o.setMeta(Cy,{type:`accept`,changeIndex:e}),n(o)}return!0});ry(jy,{displayName:`Command<acceptDiffChunk>`,group:`Diff`});var My=j(`RejectDiffChunk`,()=>e=>(t,n)=>{if(e==null)return!1;let r=Cy.getState(t);if(!r)return!1;let i=Ey(r)[e];return i?(n&&n(t.tr.setMeta(Cy,{type:`reject`,fromB:i.fromB,toB:i.toB})),!0):!1});ry(My,{displayName:`Command<rejectDiffChunk>`,group:`Diff`});var Ny=j(`AcceptDiffRange`,()=>e=>(t,n)=>{if(!e)return!1;let r=Cy.getState(t);if(!r)return!1;if(n){let i=r.newDoc.slice(e.fromB,e.toB),a=t.tr.replace(e.fromA,e.toA,i);a=a.setMeta(Cy,{type:`acceptRange`,range:e}),n(a)}return!0});ry(Ny,{displayName:`Command<acceptDiffRange>`,group:`Diff`});var Py=j(`RejectDiffRange`,()=>e=>(t,n)=>!e||!Cy.getState(t)?!1:(n&&n(t.tr.setMeta(Cy,{type:`rejectRange`,range:e})),!0));ry(Py,{displayName:`Command<rejectDiffRange>`,group:`Diff`});var Fy=j(`AcceptAllDiffs`,()=>()=>(e,t)=>{let n=Cy.getState(e);return n?(t&&t((n.rejectedRanges.length===0?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):Oy(e.tr,n)).setMeta(Cy,{type:`acceptAll`})),!0):!1});ry(Fy,{displayName:`Command<acceptAllDiffs>`,group:`Diff`});var Iy=j(`ClearDiffReview`,()=>()=>(e,t)=>Cy.getState(e)?(t&&t(e.tr.setMeta(Cy,{type:`clear`})),!0):!1);ry(Iy,{displayName:`Command<clearDiffReview>`,group:`Diff`});var Ly=[Sy,Dy,ky,Ay,jy,Ny,My,Py,Fy,Iy],Ry=Object.defineProperty,zy=Object.getOwnPropertySymbols,By=Object.prototype.hasOwnProperty,Vy=Object.prototype.propertyIsEnumerable,Hy=(e,t,n)=>t in e?Ry(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uy=(e,t)=>{for(var n in t||={})By.call(t,n)&&Hy(e,n,t[n]);if(zy)for(var n of zy(t))Vy.call(t,n)&&Hy(e,n,t[n]);return e};function Wy(e,t){return Object.assign(e,{meta:Uy({package:`@milkdown/components`},t)}),e}var Gy=`milkdown-diff`,Ky=Fv({acceptLabel:`Accept`,rejectLabel:`Reject`,customBlockTypes:[]},`diffComponentConfig`);Wy(Ky,{displayName:`Ctx<diffComponentConfig>`,group:`DiffComponent`});function qy(e,t,n){if(t===n)return!1;let r=e.resolve(t),i=e.resolve(n);return r.index(0)!==(i.depth===0?Math.max(0,i.index(0)-1):i.index(0))}function Jy(e,t,n){if(t>=n)return!1;let r=e.resolve(t),i=e.resolve(n);if(r.sameParent(i)&&r.parent.isTextblock)return!1;let a=!1;return e.nodesBetween(t,n,(e,r)=>{if(a)return!1;if(!e.isBlock)return!0;let i=r+e.nodeSize;return r>=t&&i<=n?(a=!0,!1):!0}),a}function Yy(e,t,n){if(n!==e.content.size)return!1;let r=e.resolve(t);if(r.depth!==0)return!1;for(let t=r.index(0);t<e.childCount;t++){let n=e.child(t);if(n.type.name!==`paragraph`||n.content.size>0)return!1}return!0}function Xy(e){let t=e.content.size;for(let n=e.childCount-1;n>=0;n--){let r=e.child(n);if(r.type.name!==`paragraph`||r.content.size>0)break;t-=r.nodeSize}return t}function Zy(e,t){let n=e.resolve(t);for(let e=n.depth;e>=1;e--)if(n.node(e).isTextblock)return n.before(e);return t}function Qy(e,t,n,r){let i=0;for(let a=0;a<e.childCount;a++){let o=e.child(a),s=i+o.nodeSize;if(i>=n)break;s>t&&i<n&&r(o,i,s),i=s}}function $y(e,t,n,r){Qy(e,t,n,(t,n,i)=>{i===e.content.size&&t.type.name===`paragraph`&&t.content.size===0||r.push(xg.node(n,i,{class:`${Gy}-removed-block`}))})}function eb(e,t,n=!1){if(t<0||t>e.content.size)return null;let r=e.resolve(Math.min(t,e.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(n){let e=r.nodeBefore;if(e)return{from:t-e.nodeSize,to:t};let n=r.nodeAfter;if(n)return{from:t,to:t+n.nodeSize}}else{let e=r.nodeAfter;if(e)return{from:t,to:t+e.nodeSize};let n=r.nodeBefore;if(n)return{from:t-n.nodeSize,to:t}}return null}function tb(e,t,n){if(t<0||t>e.content.size)return null;let r=e.resolve(Math.min(t,e.content.size));for(let e=r.depth;e>=0;e--){let t=r.node(e).type.name;if(n.has(t))return t}return null}function nb(e,t,n,r=!1){let i=tb(e,t,n);if(i)return i;let a=e.resolve(Math.min(Math.max(t,0),e.content.size)),o=r?a.nodeBefore:a.nodeAfter;return o&&n.has(o.type.name)?o.type.name:null}function rb(e,t,n){let r=[],i=!0,a=-1,o=-1;return Qy(e,t,n,(e,t,n)=>{a===-1&&(a=t),o=n,r.push(e)}),(r.length===0||a!==t||o!==n)&&(i=!1),i?r:[]}function ib(e,t,n,r){return e<r&&t>n}function ab(e,t,n,r){return t===n?tb(e,t,r)!=null:nb(e,t,r)!=null||nb(e,n,r,!0)!=null}function ob(e,t,n){let r=e.resolve(n.fromA);if(!r.parent.isTextblock||r.depth<1||!r.node(1).isTextblock)return null;let i=r.after(1),a=t.resolve(n.fromB),o;if(a.depth>=1&&a.node(1).isTextblock?(o=a.after(1),o>n.toB&&(o=n.toB)):o=n.fromB,i>=n.toA&&o>=n.toB)return null;let s=[];return(i>n.fromA||o>n.fromB)&&s.push({fromA:n.fromA,toA:Math.min(i,n.toA),fromB:n.fromB,toB:o,isBlock:!1}),(n.toA>i||n.toB>o)&&s.push({fromA:i,toA:Math.max(i,n.toA),fromB:o,toB:n.toB,isBlock:!0}),s.length>1?s:null}function sb(e,t,n,r){return ab(t,e.fromA,e.toA,r)||ab(n,e.fromB,e.toB,r)}function cb(e,t,n,r){let i=[],a=new Set;for(let o=0;o<e.length;o++){if(a.has(o))continue;let s=e[o];if(!sb(s,t,n,r)){i.push({fromA:s.fromA,toA:s.toA,fromB:s.fromB,toB:s.toB,isCustomBlock:!1});continue}let c=ub(t,s.fromA,s.toA,r),l=ub(n,s.fromB,s.toB,r),u={fromA:Math.min(c?.from??s.fromA,s.fromA),toA:Math.max(c?.to??s.toA,s.toA),fromB:Math.min(l?.from??s.fromB,s.fromB),toB:Math.max(l?.to??s.toB,s.toB),isCustomBlock:!0};a.add(o);for(let t=o+1;t<e.length;t++){if(a.has(t))continue;let n=e[t],r=c&&ib(n.fromA,n.toA,c.from,c.to),i=l&&ib(n.fromB,n.toB,l.from,l.to);!r&&!i||(a.add(t),u.fromA=Math.min(u.fromA,n.fromA),u.toA=Math.max(u.toA,n.toA),u.fromB=Math.min(u.fromB,n.fromB),u.toB=Math.max(u.toB,n.toB))}let d=[];for(let e=0;e<i.length;e++){let t=i[e];if(!t.isCustomBlock)continue;let n=ib(u.fromA,u.toA,t.fromA,t.toA),r=ib(u.fromB,u.toB,t.fromB,t.toB);!n&&!r||(u.fromA=Math.min(u.fromA,t.fromA),u.toA=Math.max(u.toA,t.toA),u.fromB=Math.min(u.fromB,t.fromB),u.toB=Math.max(u.toB,t.toB),d.push(e))}for(let e=d.length-1;e>=0;e--)i.splice(d[e],1);i.push(u)}return i}function lb(e,t){let n=Xy(t);if(n!==t.content.size)for(let t of e)t.fromA===t.toA&&t.fromB<t.toB&&t.fromA>=n&&(t.fromA=n,t.toA=n)}function ub(e,t,n,r){return t===n?tb(e,t,r)==null?null:eb(e,t):nb(e,t,r)==null?nb(e,n,r,!0)==null?null:eb(e,n,!0):eb(e,t)}var db=new Ju(`MILKDOWN_DIFF_DECORATION`),fb=Mv(e=>{let t=e.get(Ky.key);return new Gu({key:db,state:{init:()=>wg.empty,apply(n,r,i,a){let o=Cy.getState(a);return o?.active?n.getMeta(Cy)||n.docChanged?mb(e,a.doc,o,t):r.map(n.mapping,n.doc):wg.empty}},props:{decorations(e){return db.getState(e)??wg.empty}}})});Wy(fb,{displayName:`Prose<diffDecoration>`,group:`DiffComponent`});function pb({doc:e,newDoc:t,segments:n,change:r,changeIndex:i,commands:a,acceptLabel:o,rejectLabel:s,decorations:c}){for(let r=0;r<n.length;r++){let a=n[r],o=a.fromA<a.toA,s=a.fromB<a.toB;if(o&&(a.isBlock?$y(e,a.fromA,a.toA,c):c.push(xg.inline(a.fromA,a.toA,{class:`${Gy}-removed`}))),s){let n=a.isBlock?Zy(e,o?a.toA:a.fromA):o?a.toA:a.fromA,s=hb(t,a,a.isBlock);c.push(xg.widget(n,s,{side:-1,key:`added-${i}-${r}`}))}}let l=n[n.length-1],u=Zy(e,l.isBlock?l.fromA<l.toA?l.toA:l.fromA:r.toA),d=gb({commands:a,isBlockLevel:!0,change:r,acceptLabel:o,rejectLabel:s});c.push(xg.widget(u,d,{side:-1,key:`controls-${i}`}))}function mb(e,t,n,r){let i=[],a=e.get(A),o=new Set(r.customBlockTypes),s=cb(Ey(n),t,n.newDoc,o);lb(s,t);for(let e=0;e<s.length;e++){let o=s[e],c=o.fromA<o.toA,l=o.fromB<o.toB;if(c&&!l&&Yy(t,o.fromA,o.toA))continue;let u=c&&qy(t,o.fromA,o.toA),d=c&&Jy(t,o.fromA,o.toA),f=l&&Jy(n.newDoc,o.fromB,o.toB),p=c&&!u&&!d&&!o.isCustomBlock&&!f,m=(u||d||f)&&!p;if(m&&!o.isCustomBlock){let s=ob(t,n.newDoc,o);if(s){pb({doc:t,newDoc:n.newDoc,segments:s,change:o,changeIndex:e,commands:a,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:i});continue}}c&&(o.isCustomBlock||m?$y(t,o.fromA,o.toA,i):i.push(xg.inline(o.fromA,o.toA,{class:`${Gy}-removed`})));let h=c?o.toA:o.fromA,g=m?Zy(t,h):h;if(l){let t=hb(n.newDoc,o,m);i.push(xg.widget(g,t,{side:-1,key:`added-${e}`}))}let _=gb({commands:a,isBlockLevel:m,change:o,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});i.push(xg.widget(g,_,{side:m?-1:1,key:`controls-${e}`}))}return wg.create(t,i)}function hb(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=`${Gy}-added`,r.contentEditable=`false`,n&&r.classList.add(`${Gy}-added-block`);let i=al.fromSchema(e.type.schema);if(n){let n=rb(e,t.fromB,t.toB);if(n.length>0){let e=document.createDocumentFragment();for(let t of n)e.appendChild(i.serializeNode(t));return r.appendChild(e),r}}let a=e.slice(t.fromB,t.toB),o=i.serializeFragment(a.content);if(r.appendChild(o),!r.textContent?.trim()&&!r.querySelector(`img, video, audio, canvas, svg`)){let n=e.textBetween(t.fromB,t.toB,`
44
- `,`
45
- `);n.trim()&&(r.textContent=n)}return r}function gb({commands:e,isBlockLevel:t,change:n,acceptLabel:r,rejectLabel:i}){let a=document.createElement(t?`div`:`span`);a.className=`${Gy}-controls`,a.contentEditable=`false`,t&&a.classList.add(`${Gy}-controls-block`);let o=t=>r=>{r.preventDefault(),r.stopPropagation();let i={fromA:n.fromA,toA:n.toA,fromB:n.fromB,toB:n.toB},a=t===`accept`?Ny.key:Py.key;e.call(a,i)},s=document.createElement(`button`);s.className=`${Gy}-accept`,s.textContent=r,s.addEventListener(`click`,o(`accept`));let c=document.createElement(`button`);return c.className=`${Gy}-reject`,c.textContent=i,c.addEventListener(`click`,o(`reject`)),a.appendChild(s),a.appendChild(c),a}var _b=[Ky,fb];function vb(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-streaming`,...t}}),e}var yb=Fv({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:[`id`]}},`streamingConfig`);vb(yb,{displayName:`Ctx<streamingConfig>`,group:`Streaming`});function bb(e,t,n){let r=e.get(Y_)(n);if(!r)return{tr:t,newDoc:null};let i=e.get(yb.key).ignoreAttrs,a=xy(t.doc,r,i?{ignoreAttrs:i}:void 0);for(let e=a.length-1;e>=0;e--){let n=a[e],i=r.slice(n.fromB,n.toB);t=t.replace(n.fromA,n.toA,i)}return{tr:t,newDoc:r}}function xb(e){if(e.parent.type.spec.code)return{type:`plain-text`,preserveNewlines:!0};for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`table`)return{type:`plain-text`,preserveNewlines:!1};return e.depth>=1?{type:`split-block`}:{type:`block`}}function Sb(e){if(e.childCount===0)return e;let t=e.lastChild;return t.type.name===`paragraph`&&t.content.size===0?e.cut(0,e.size-t.nodeSize):e}function Cb(e,t,n){let{insertPos:r,currentEndPos:i}=n,a=n.buffer.replace(/\r\n?/g,`
46
- `);if(!a)return{tr:t,applied:!1,insertEndPos:i};let o=t.doc.content.size,s=Math.max(0,Math.min(r,o)),c=Math.max(s,Math.min(i,o)),l=t.doc.resolve(s),u=(e.get(yb.key).insertStrategy??xb)(l),d={ctx:e,tr:t,buffer:a,from:s,to:c,resolved:l};switch(u.type){case`plain-text`:return wb(d,u.preserveNewlines??!1);case`split-block`:return Db(d);case`block`:return Ob(d)}}function wb({tr:e,buffer:t,from:n,to:r},i){let a=i?t:t.replace(/\n/g,` `),o=e.doc.type.schema.text(a);return e=e.replaceWith(n,r,o),{tr:e,applied:!0,insertEndPos:n+a.length}}var Tb=/[*_~`[\\<]/;function Eb(e,t,n){if(!n)return E.empty;if(!Tb.test(n))return E.from(t.text(n));let r=e.get(Y_)(n)?.firstChild;if(r?.type.name!==`paragraph`||r.content.size===0)return E.from(t.text(n));let i=!1;if(r.content.forEach(e=>{(!e.isText||e.marks.length>0)&&(i=!0)}),!i)return E.from(t.text(n));let a=r.content,o=/^\s+/.exec(n)?.[0];o&&((a.firstChild?.isText?a.firstChild.text??``:``).startsWith(o)||(a=E.from(t.text(o)).append(a)));let s=/\s+$/.exec(n)?.[0];return s&&((a.lastChild?.isText?a.lastChild.text??``:``).endsWith(s)||(a=a.append(E.from(t.text(s))))),a}function Db({ctx:e,tr:t,buffer:n,from:r,to:i,resolved:a}){let o=t.doc.type.schema,s=n.indexOf(`
47
- `);if(s<0){let a=Eb(e,o,n);return t=t.replaceWith(r,i,a),{tr:t,applied:!0,insertEndPos:r+a.size}}let c=n.substring(0,s),l=n.substring(s+1),u=e.get(Y_),d=l.trim()?u(l):null,f=d?Sb(d.content):E.empty;if(f.childCount===0){let a=Eb(e,o,n.replace(/\n/g,` `));return t=t.replaceWith(r,i,a),{tr:t,applied:!0,insertEndPos:r+a.size}}let p=a.depth,m=Eb(e,o,c);for(let e=p;e>0;e--)m=E.from(a.node(e).copy(m));let h=m.append(f),g=new D(h,p,0),_=t.doc.content.size,v=t.doc.resolve(Math.min(i,_)),y=i;p>0&&v.depth===p&&v.parentOffset===v.parent.content.size&&(y=v.after(p)),t=t.replace(r,y,g);let b=h.size-p;return{tr:t,applied:!0,insertEndPos:r+b}}function Ob({ctx:e,tr:t,buffer:n,from:r,to:i}){let a=e.get(Y_)(n);if(!a)return{tr:t,applied:!1,insertEndPos:i};let o=Sb(a.content);return o.size===0?{tr:t,applied:!1,insertEndPos:i}:(t=t.replace(r,i,new D(o,0,0)),{tr:t,applied:!0,insertEndPos:r+o.size})}function kb(e,t,n){if(n.insertPos!=null){let r=n.insertPos,i=Cb(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:i.tr,newDoc:i.applied?i.tr.doc:null,insertEndPos:i.insertEndPos}}return bb(e,t,n.buffer)}var Ab=new Ju(`MILKDOWN_STREAMING`);function jb(e,t){if(!e&&t?.type!==`start`)return null;if(!t)return e;switch(t.type){case`start`:return{buffer:``,originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case`push`:return e?{...e,buffer:e.buffer+t.token}:null;case`apply`:return e?{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos}:null;case`end`:case`abort`:return null;default:return e}}var Mb=Mv(e=>{let t=e.get(yb.key);return new Gu({key:Ab,state:{init:()=>null,apply(e,t){return jb(t,e.getMeta(Ab))}},filterTransaction(e,t){return!Ab.getState(t)?.active||e.getMeta(Ab)?!0:!e.docChanged},view(){return Nb(e,t)}})});vb(Mb,{displayName:`Prose<streaming>`,group:`Streaming`});function Nb(e,t){let n=null,r=-1,i=null;function a(){if(!i)return;let n=Ab.getState(i.state);if(!n?.active||n.buffer.length===r)return;r=n.buffer.length;let a=kb(e,i.state.tr,n);if(!a.newDoc)return;let o=a.tr;!o.docChanged&&a.insertEndPos==null||(o=o.setMeta(Ab,{type:`apply`,lastApplyTime:Date.now(),insertEndPos:a.insertEndPos}),t.scrollFollow&&(o=o.scrollIntoView()),i.dispatch(o))}function o(){n!=null&&clearTimeout(n),n=setTimeout(a,t.throttleMs)}return{update(e){i=e;let s=Ab.getState(e.state);if(!s?.active){n!=null&&(clearTimeout(n),n=null),r=-1;return}s.buffer.length!==r&&(Date.now()-s.lastApplyTime>=t.throttleMs?a():o())},destroy(){n!=null&&(clearTimeout(n),n=null),i=null}}}var Pb=j(`StartStreaming`,()=>e=>(t,n)=>{if(Ab.getState(t)?.active)return!1;if(n){let r,i;if(e?.insertAt!=null)if(e.insertAt===`selection`){if(r=t.selection.from,i=t.selection.to,t.selection.empty){let e=t.doc.resolve(r);e.parent.isTextblock&&!e.parent.type.spec.code&&e.parent.content.size===0&&e.depth===1&&(r=e.before(e.depth),i=e.after(e.depth))}}else{let n=e.insertAt===`cursor`?t.selection.head:e.insertAt;if(!Number.isFinite(n))return!1;r=Math.max(0,Math.min(Math.round(n),t.doc.content.size));let a=t.doc.resolve(r);a.parent.isTextblock&&!a.parent.type.spec.code&&a.parent.content.size===0&&a.depth===1&&(r=a.before(a.depth),i=a.after(a.depth))}n(t.tr.setMeta(Ab,{type:`start`,originalDoc:t.doc,insertPos:r,insertEndPos:i,lastApplyTime:Date.now()}))}return!0});vb(Pb,{displayName:`Command<startStreaming>`,group:`Streaming`});var Fb=j(`PushChunk`,()=>e=>(t,n)=>e==null||!Ab.getState(t)?.active?!1:(n&&n(t.tr.setMeta(Ab,{type:`push`,token:e})),!0));vb(Fb,{displayName:`Command<pushChunk>`,group:`Streaming`});var Ib=j(`EndStreaming`,e=>t=>(n,r)=>{let i=Ab.getState(n);if(!i?.active)return!1;if(r){let a=e.get(yb.key),o=t?.diffReview??a.diffReviewOnEnd,s=kb(e,n.tr,i),c=s.tr;if(c=c.setMeta(Ab,{type:`end`}),o&&s.newDoc){let t=c.doc;c=c.replace(0,c.doc.content.size,new D(i.originalDoc.content,0,0)),r(c);try{e.get(A).call(Ay.key,t)}catch(e){console.warn(`[milkdown/streaming] diff review handoff skipped:`,e)}return!0}r(c)}return!0});vb(Ib,{displayName:`Command<endStreaming>`,group:`Streaming`});var Lb=j(`AbortStreaming`,e=>t=>(n,r)=>{let i=Ab.getState(n);if(!i?.active)return!1;if(r){let a=t?.keep??!1,o=n.tr;o=a?kb(e,o,i).tr:o.replace(0,n.doc.content.size,new D(i.originalDoc.content,0,0)),o=o.setMeta(Ab,{type:`abort`}),r(o)}return!0});vb(Lb,{displayName:`Command<abortStreaming>`,group:`Streaming`});var Rb=[yb,Mb,Pb,Fb,Ib,Lb];function zb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bb(e){if(Array.isArray(e))return e}function Vb(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Hb(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
48
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ub(e,t){return Bb(e)||Vb(e,t)||Wb(e,t)||Hb()}function Wb(e,t){if(e){if(typeof e==`string`)return zb(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zb(e,t):void 0}}var Gb=Object.entries,Kb=Object.setPrototypeOf,qb=Object.isFrozen,Jb=Object.getPrototypeOf,Yb=Object.getOwnPropertyDescriptor,Xb=Object.freeze,Zb=Object.seal,Qb=Object.create,$b=typeof Reflect<`u`&&Reflect,ex=$b.apply,tx=$b.construct;Xb||=function(e){return e},Zb||=function(e){return e},ex||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},tx||=function(e){return new e(...[...arguments].slice(1))};var nx=Sx(Array.prototype.forEach),rx=Sx(Array.prototype.lastIndexOf),ix=Sx(Array.prototype.pop),ax=Sx(Array.prototype.push),ox=Sx(Array.prototype.splice),sx=Array.isArray,cx=Sx(String.prototype.toLowerCase),lx=Sx(String.prototype.toString),ux=Sx(String.prototype.match),dx=Sx(String.prototype.replace),fx=Sx(String.prototype.indexOf),px=Sx(String.prototype.trim),mx=Sx(Number.prototype.toString),hx=Sx(Boolean.prototype.toString),gx=typeof BigInt>`u`?null:Sx(BigInt.prototype.toString),_x=typeof Symbol>`u`?null:Sx(Symbol.prototype.toString),vx=Sx(Object.prototype.hasOwnProperty),yx=Sx(Object.prototype.toString),bx=Sx(RegExp.prototype.test),xx=Cx(TypeError);function Sx(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ex(e,t,n)}}function Cx(e){return function(){return tx(e,[...arguments])}}function wx(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cx;if(Kb&&Kb(e,null),!sx(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(qb(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Tx(e){for(let t=0;t<e.length;t++)vx(e,t)||(e[t]=null);return e}function Ex(e){let t=Qb(null);for(let r of Gb(e)){var n=Ub(r,2);let i=n[0],a=n[1];vx(e,i)&&(sx(a)?t[i]=Tx(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Ex(a):t[i]=a)}return t}function Dx(e){switch(typeof e){case`string`:return e;case`number`:return mx(e);case`boolean`:return hx(e);case`bigint`:return gx?gx(e):`0`;case`symbol`:return _x?_x(e):`Symbol()`;case`undefined`:return yx(e);case`function`:case`object`:{if(e===null)return yx(e);let t=e,n=Ox(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:yx(e)}return yx(e)}default:return yx(e)}}function Ox(e,t){for(;e!==null;){let n=Yb(e,t);if(n){if(n.get)return Sx(n.get);if(typeof n.value==`function`)return Sx(n.value)}e=Jb(e)}function n(){return null}return n}function kx(e){try{return bx(e,``),!0}catch{return!1}}var Ax=Xb(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),jx=Xb(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Mx=Xb([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Nx=Xb([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Px=Xb(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Fx=Xb([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ix=Xb([`#text`]),Lx=Xb(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Rx=Xb(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),zx=Xb(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Bx=Xb([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Vx=Zb(/{{[\w\W]*|^[\w\W]*}}/g),Hx=Zb(/<%[\w\W]*|^[\w\W]*%>/g),Ux=Zb(/\${[\w\W]*/g),Wx=Zb(/^data-[\-\w.\u00B7-\uFFFF]+$/),Gx=Zb(/^aria-[\-\w]+$/),Kx=Zb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qx=Zb(/^(?:\w+script|data):/i),Jx=Zb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yx=Zb(/^html$/i),Xx=Zb(/^[a-z][.\w]*(-[.\w]+)+$/i),Zx={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qx=function(){return typeof window>`u`?null:window},$x=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},eS=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function tS(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qx(),t=e=>tS(e);if(t.version=`3.4.8`,t.removed=[],!e||!e.document||e.document.nodeType!==Zx.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Ox(d,`cloneNode`),p=Ox(d,`remove`),m=Ox(d,`nextSibling`),h=Ox(d,`childNodes`),g=Ox(d,`parentNode`),_=Ox(d,`shadowRoot`),v=Ox(d,`attributes`),y=o&&o.prototype?Ox(o.prototype,`nodeType`):null,b=o&&o.prototype?Ox(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,ee=0,te=function(e){if(ee>0)throw xx(`The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`);ee++;try{return x.createHTML(e)}finally{ee--}},ne=n,re=ne.implementation,ie=ne.createNodeIterator,ae=ne.createDocumentFragment,oe=ne.getElementsByTagName,se=r.importNode,ce=eS();t.isSupported=typeof Gb==`function`&&typeof g==`function`&&re&&re.createHTMLDocument!==void 0;let le=Vx,ue=Hx,de=Ux,fe=Wx,pe=Gx,me=qx,he=Jx,ge=Xx,_e=Kx,ve=null,C=wx({},[...Ax,...jx,...Mx,...Px,...Ix]),ye=null,be=wx({},[...Lx,...Rx,...zx,...Bx]),xe=Object.seal(Qb(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ce=null,we=Object.seal(Qb(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Te=!0,Ee=!0,De=!1,Oe=!0,ke=!1,w=!0,Ae=!1,je=!1,Me=!1,Ne=!1,Pe=!1,Fe=!1,Ie=!0,Le=!1,Re=`user-content-`,ze=!0,Be=!1,Ve={},He=null,Ue=wx({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),We=null,Ge=wx({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ke=null,qe=wx({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Je=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=wx({},[Je,Ye,Xe],lx),tt=wx({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=wx({},[`annotation-xml`]),rt=wx({},[`title`,`style`,`font`,`a`,`script`]),it=null,at=[`application/xhtml+xml`,`text/html`],ot=null,st=null,ct=n.createElement(`form`),lt=function(e){return e instanceof RegExp||e instanceof Function},ut=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(st&&st===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ex(e),it=at.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ot=it===`application/xhtml+xml`?lx:cx,ve=vx(e,`ALLOWED_TAGS`)&&sx(e.ALLOWED_TAGS)?wx({},e.ALLOWED_TAGS,ot):C,ye=vx(e,`ALLOWED_ATTR`)&&sx(e.ALLOWED_ATTR)?wx({},e.ALLOWED_ATTR,ot):be,$e=vx(e,`ALLOWED_NAMESPACES`)&&sx(e.ALLOWED_NAMESPACES)?wx({},e.ALLOWED_NAMESPACES,lx):et,Ke=vx(e,`ADD_URI_SAFE_ATTR`)&&sx(e.ADD_URI_SAFE_ATTR)?wx(Ex(qe),e.ADD_URI_SAFE_ATTR,ot):qe,We=vx(e,`ADD_DATA_URI_TAGS`)&&sx(e.ADD_DATA_URI_TAGS)?wx(Ex(Ge),e.ADD_DATA_URI_TAGS,ot):Ge,He=vx(e,`FORBID_CONTENTS`)&&sx(e.FORBID_CONTENTS)?wx({},e.FORBID_CONTENTS,ot):Ue,Se=vx(e,`FORBID_TAGS`)&&sx(e.FORBID_TAGS)?wx({},e.FORBID_TAGS,ot):Ex({}),Ce=vx(e,`FORBID_ATTR`)&&sx(e.FORBID_ATTR)?wx({},e.FORBID_ATTR,ot):Ex({}),Ve=vx(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ex(e.USE_PROFILES):e.USE_PROFILES:!1,Te=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,De=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=e.SAFE_FOR_TEMPLATES||!1,w=e.SAFE_FOR_XML!==!1,Ae=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Ie=e.SANITIZE_DOM!==!1,Le=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,Be=e.IN_PLACE||!1,_e=kx(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Kx,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,tt=vx(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Ex(e.MATHML_TEXT_INTEGRATION_POINTS):wx({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=vx(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Ex(e.HTML_INTEGRATION_POINTS):wx({},[`annotation-xml`]);let t=vx(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Ex(e.CUSTOM_ELEMENT_HANDLING):Qb(null);if(xe=Qb(null),vx(t,`tagNameCheck`)&&lt(t.tagNameCheck)&&(xe.tagNameCheck=t.tagNameCheck),vx(t,`attributeNameCheck`)&&lt(t.attributeNameCheck)&&(xe.attributeNameCheck=t.attributeNameCheck),vx(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(xe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ke&&(Ee=!1),Pe&&(Ne=!0),Ve&&(ve=wx({},Ix),ye=Qb(null),Ve.html===!0&&(wx(ve,Ax),wx(ye,Lx)),Ve.svg===!0&&(wx(ve,jx),wx(ye,Rx),wx(ye,Bx)),Ve.svgFilters===!0&&(wx(ve,Mx),wx(ye,Rx),wx(ye,Bx)),Ve.mathMl===!0&&(wx(ve,Px),wx(ye,zx),wx(ye,Bx))),we.tagCheck=null,we.attributeCheck=null,vx(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?we.tagCheck=e.ADD_TAGS:sx(e.ADD_TAGS)&&(ve===C&&(ve=Ex(ve)),wx(ve,e.ADD_TAGS,ot))),vx(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?we.attributeCheck=e.ADD_ATTR:sx(e.ADD_ATTR)&&(ye===be&&(ye=Ex(ye)),wx(ye,e.ADD_ATTR,ot))),vx(e,`ADD_URI_SAFE_ATTR`)&&sx(e.ADD_URI_SAFE_ATTR)&&wx(Ke,e.ADD_URI_SAFE_ATTR,ot),vx(e,`FORBID_CONTENTS`)&&sx(e.FORBID_CONTENTS)&&(He===Ue&&(He=Ex(He)),wx(He,e.FORBID_CONTENTS,ot)),vx(e,`ADD_FORBID_CONTENTS`)&&sx(e.ADD_FORBID_CONTENTS)&&(He===Ue&&(He=Ex(He)),wx(He,e.ADD_FORBID_CONTENTS,ot)),ze&&(ve[`#text`]=!0),Ae&&wx(ve,[`html`,`head`,`body`]),ve.table&&(wx(ve,[`tbody`]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw xx(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw xx(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=te(``)}catch(e){throw x=t,e}}else x===void 0&&e.TRUSTED_TYPES_POLICY!==null&&(x=$x(u,i)),x&&typeof S==`string`&&(S=te(``));(ce.uponSanitizeElement.length>0||ce.uponSanitizeAttribute.length>0)&&ve===C&&(ve=Ex(ve)),ce.uponSanitizeAttribute.length>0&&ye===be&&(ye=Ex(ye)),Xb&&Xb(e),st=e},dt=wx({},[...jx,...Mx,...Nx]),ft=wx({},[...Px,...Fx]),pt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ze,tagName:`template`});let n=cx(e.tagName),r=cx(t.tagName);return $e[e.namespaceURI]?e.namespaceURI===Ye?t.namespaceURI===Xe?n===`svg`:t.namespaceURI===Je?n===`svg`&&(r===`annotation-xml`||tt[r]):!!dt[n]:e.namespaceURI===Je?t.namespaceURI===Xe?n===`math`:t.namespaceURI===Ye?n===`math`&&nt[r]:!!ft[n]:e.namespaceURI===Xe?t.namespaceURI===Ye&&!nt[r]||t.namespaceURI===Je&&!tt[r]?!1:!ft[n]&&(rt[n]||!dt[n]):!!(it===`application/xhtml+xml`&&$e[e.namespaceURI]):!1},mt=function(e){ax(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},ht=function(e,n){try{ax(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{ax(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ne||Pe)try{mt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},gt=function(e){let t=null,r=null;if(Me)e=`<remove></remove>`+e;else{let t=ux(e,/^[\r\n\t ]+/);r=t&&t[0]}it===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?te(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,it)}catch{}if(!t||!t.documentElement){t=re.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?oe.call(t,Ae?`html`:`body`)[0]:Ae?t.documentElement:a},_t=function(e){return ie.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},vt=function(e){e.normalize();let t=ie.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;nx([le,ue,de],t=>{e=dx(e,t,` `)}),n.data=e,n=t.nextNode()}let r=e.querySelectorAll?.call(e,`template`)??[];nx(Array.from(r),e=>{bt(e.content)&&vt(e.content)})},yt=function(e){let t=b?b(e):null;return typeof t!=`string`||ot(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},bt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Zx.documentFragment}catch{return!1}},xt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function St(e,n,r){nx(e,e=>{e.call(t,n,r,st)})}let Ct=function(e){let n=null;if(St(ce.beforeSanitizeElements,e,null),yt(e))return mt(e),!0;let r=ot(b?b(e):e.nodeName);if(St(ce.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),w&&e.hasChildNodes()&&!xt(e.firstElementChild)&&bx(/<[/\w!]/g,e.innerHTML)&&bx(/<[/\w!]/g,e.textContent)||w&&e.namespaceURI===Xe&&r===`style`&&xt(e.firstElementChild)||e.nodeType===Zx.progressingInstruction||w&&e.nodeType===Zx.comment&&bx(/<[/\w]/g,e.data))return mt(e),!0;if(Se[r]||!(we.tagCheck instanceof Function&&we.tagCheck(r))&&!ve[r]){if(!Se[r]&&Et(r)&&(xe.tagNameCheck instanceof RegExp&&bx(xe.tagNameCheck,r)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r)))return!1;if(ze&&!He[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return mt(e),!0}return(y?y(e):e.nodeType)===Zx.element&&!pt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&bx(/<\/no(script|embed|frames)/i,e.innerHTML)?(mt(e),!0):(ke&&e.nodeType===Zx.text&&(n=e.textContent,nx([le,ue,de],e=>{n=dx(n,e,` `)}),e.textContent!==n&&(ax(t.removed,{element:e.cloneNode()}),e.textContent=n)),St(ce.afterSanitizeElements,e,null),!1)},wt=function(e,t,r){if(Ce[t]||Ie&&(t===`id`||t===`name`)&&(r in n||r in ct))return!1;let i=ye[t]||we.attributeCheck instanceof Function&&we.attributeCheck(t,e);if(!(Ee&&!Ce[t]&&bx(fe,t))&&!(Te&&bx(pe,t))){if(!i||Ce[t]){if(!(Et(e)&&(xe.tagNameCheck instanceof RegExp&&bx(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&bx(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t,e))||t===`is`&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&bx(xe.tagNameCheck,r)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))))return!1}else if(!Ke[t]&&!bx(_e,dx(r,he,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&fx(r,`data:`)===0&&We[e])&&!(De&&!bx(me,dx(r,he,``)))&&r)return!1}return!0},Tt=wx({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Et=function(e){return!Tt[cx(e)]&&bx(ge,e)},Dt=function(e){St(ce.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||yt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:ye,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=ot(o),d=c,f=o===`value`?d:px(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,St(ce.uponSanitizeAttribute,e,r),f=r.attrValue,Le&&(l===`id`||l===`name`)&&fx(f,Re)!==0&&(ht(o,e),f=Re+f),w&&bx(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){ht(o,e);continue}if(l===`attributename`&&ux(f,`href`)){ht(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){ht(o,e);continue}if(!Oe&&bx(/\/>/i,f)){ht(o,e);continue}ke&&nx([le,ue,de],e=>{f=dx(f,e,` `)});let p=ot(e.nodeName);if(!wt(p,l,f)){ht(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=te(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),yt(e)?mt(e):ix(t.removed)}catch{ht(o,e)}}St(ce.afterSanitizeAttributes,e,null)},Ot=function(e){let t=null,n=_t(e);for(St(ce.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(St(ce.uponSanitizeShadowNode,t,null),Ct(t),Dt(t),bt(t.content)&&Ot(t.content),(y?y(t):t.nodeType)===Zx.element){let e=_?_(t):t.shadowRoot;bt(e)&&(kt(e),Ot(e))}St(ce.afterSanitizeShadowDOM,e,null)},kt=function(e){let t=y?y(e):e.nodeType;if(t===Zx.element){let t=_?_(e):e.shadowRoot;bt(t)&&(kt(t),Ot(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];nx(n,e=>{ax(r,e)});for(let e of r)kt(e);if(t===Zx.element){let t=b?b(e):null;if(typeof t==`string`&&ot(t)===`template`){let t=e.content;bt(t)&&kt(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!xt(e)&&(e=Dx(e),typeof e!=`string`))throw xx(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(je||ut(n),t.removed=[],typeof e==`string`&&(Be=!1),Be){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=ot(t);if(!ve[e]||Se[e])throw xx(`root node is forbidden and cannot be sanitized in-place`)}if(yt(e))throw xx(`root node is clobbered and cannot be sanitized in-place`);kt(e)}else if(xt(e))i=gt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Zx.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),kt(a);else{if(!Ne&&!ke&&!Ae&&e.indexOf(`<`)===-1)return x&&Fe?te(e):e;if(i=gt(e),!i)return Ne?null:Fe?S:``}i&&Me&&mt(i.firstChild);let c=_t(Be?e:i);for(;o=c.nextNode();)Ct(o),Dt(o),bt(o.content)&&Ot(o.content);if(Be)return ke&&vt(e),e;if(Ne){if(ke&&vt(i),Pe)for(s=ae.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(ye.shadowroot||ye.shadowrootmode)&&(s=se.call(r,s,!0)),s}let l=Ae?i.outerHTML:i.innerHTML;return Ae&&ve[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&bx(Yx,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
49
- `+l),ke&&nx([le,ue,de],e=>{l=dx(l,e,` `)}),x&&Fe?te(l):l},t.setConfig=function(){ut(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),je=!0},t.clearConfig=function(){st=null,je=!1},t.isValidAttribute=function(e,t,n){return st||ut({}),wt(ot(e),ot(t),n)},t.addHook=function(e,t){typeof t==`function`&&ax(ce[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=rx(ce[e],t);return n===-1?void 0:ox(ce[e],n,1)[0]}return ix(ce[e])},t.removeHooks=function(e){ce[e]=[]},t.removeAllHooks=function(){ce=eS()},t}var nS=tS(),rS=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;constructor(e){this.#a=!1,this.onShow=()=>{},this.onHide=()=>{},this.#u=e=>{c(e,this.element,{placement:this.#r.placement??`top`,middleware:[o(),l(this.#s),a(this.#c),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#d=e=>this.#i!==e.dom.parentElement,this.#f=(e,t)=>{let{state:n,composing:r}=e,{selection:i,doc:a}=n,{ranges:o}=i,c=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),u=t&&t.doc.eq(a)&&t.selection.eq(i);if(this.#a||=((this.#i??e.dom.parentElement??document.body).appendChild(this.element),!0),r||u)return;if(this.#o?.(),this.#o=void 0,!this.#t(e,t)){this.hide();return}let d={getBoundingClientRect:()=>vf(e,c,l),contextElement:e.dom};this.#d(e)?this.#o=s(d,this.element,()=>this.#u(d)):this.#u(d),this.show()},this.update=(e,t)=>{this.#l(e,t)},this.#p=e=>{let{doc:t,selection:n}=e.state,{empty:r,from:i,to:a}=n,o=!t.textBetween(i,a).length&&e.state.selection instanceof O,s=this.element.contains(document.activeElement),c=!e.hasFocus()&&!s,l=!e.editable;return!(c||r||o||l)},this.destroy=()=>{this.#o?.(),this.#l.cancel()},this.show=(e,t)=>{if(this.element.dataset.show=`true`,e){this.#o?.(),this.#o=void 0;let n={...e,contextElement:t?.dom};t&&this.#d(t)?this.#o=s(n,this.element,()=>this.#u(n)):this.#u(n)}this.onShow()},this.hide=()=>{this.element.dataset.show!==`false`&&(this.element.dataset.show=`false`,this.onHide())},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#s=e.offset,this.#c=e.shift,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#i=e.root,this.element.dataset.show=`false`,this.#l=sa(this.#f,this.#e)}#u;#d;#f;#p};function iS(e){let t=Fv({},`${e}_TOOLTIP_SPEC`),n=Mv(n=>{let r=n.get(t.key);return new Gu({key:new Ju(`${e}_TOOLTIP`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:`@milkdown/plugin-tooltip`,displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:`@milkdown/plugin-tooltip`,displayName:`Prose<tooltip>|${e}`},r}function aS(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var oS=Object.freeze({}),sS=Object.freeze([]),cS=()=>{},lS=()=>!1,uS=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),dS=e=>e.startsWith(`onUpdate:`),fS=Object.assign,pS=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},mS=Object.prototype.hasOwnProperty,hS=(e,t)=>mS.call(e,t),M=Array.isArray,gS=e=>TS(e)===`[object Map]`,_S=e=>TS(e)===`[object Set]`,vS=e=>TS(e)===`[object Date]`,yS=e=>typeof e==`function`,bS=e=>typeof e==`string`,xS=e=>typeof e==`symbol`,SS=e=>typeof e==`object`&&!!e,CS=e=>(SS(e)||yS(e))&&yS(e.then)&&yS(e.catch),wS=Object.prototype.toString,TS=e=>wS.call(e),ES=e=>TS(e).slice(8,-1),DS=e=>TS(e)===`[object Object]`,OS=e=>bS(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,kS=aS(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),AS=aS(`bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo`),jS=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},MS=/-\w/g,NS=jS(e=>e.replace(MS,e=>e.slice(1).toUpperCase())),PS=/\B([A-Z])/g,FS=jS(e=>e.replace(PS,`-$1`).toLowerCase()),IS=jS(e=>e.charAt(0).toUpperCase()+e.slice(1)),LS=jS(e=>e?`on${IS(e)}`:``),RS=(e,t)=>!Object.is(e,t),zS=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},BS=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},VS=e=>{let t=parseFloat(e);return isNaN(t)?e:t},HS,US=()=>HS||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function WS(e){if(M(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=bS(r)?JS(r):WS(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(bS(e)||SS(e))return e}var GS=/;(?![^(]*\))/g,KS=/:([^]+)/,qS=/\/\*[^]*?\*\//g;function JS(e){let t={};return e.replace(qS,``).split(GS).forEach(e=>{if(e){let n=e.split(KS);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function YS(e){let t=``;if(bS(e))t=e;else if(M(e))for(let n=0;n<e.length;n++){let r=YS(e[n]);r&&(t+=r+` `)}else if(SS(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var XS=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,ZS=`svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view`,QS=`annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics`,$S=aS(XS),eC=aS(ZS),tC=aS(QS),nC=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,rC=aS(nC);nC+``;function iC(e){return!!e||e===``}function aC(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=oC(e[r],t[r]);return n}function oC(e,t){if(e===t)return!0;let n=vS(e),r=vS(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=xS(e),r=xS(t),n||r)return e===t;if(n=M(e),r=M(t),n||r)return n&&r?aC(e,t):!1;if(n=SS(e),r=SS(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!oC(e[n],t[n]))return!1}}return String(e)===String(t)}function sC(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var cC,lC=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&cC&&(cC.active?(this.parent=cC,this.index=(cC.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=cC;try{return cC=this,e()}finally{cC=t}}else this._warnOnRun&&sC(`cannot run an inactive effect scope.`)}on(){++this._on===1&&(this.prevScope=cC,cC=this)}off(){if(this._on>0&&--this._on===0){if(cC===this)cC=this.prevScope;else{let e=cC;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function uC(){return cC}var dC,fC=new WeakSet,pC=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,cC&&(cC.active?cC.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,fC.has(this)&&(fC.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||_C(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,AC(this),bC(this);let e=dC,t=EC;dC=this,EC=!0;try{return this.fn()}finally{dC!==this&&sC(`Active effect was not restored correctly - this is likely a Vue internal bug.`),xC(this),dC=e,EC=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)wC(e);this.deps=this.depsTail=void 0,AC(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fC.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){SC(this)&&this.run()}get dirty(){return SC(this)}},mC=0,hC,gC;function _C(e,t=!1){if(e.flags|=8,t){e.next=gC,gC=e;return}e.next=hC,hC=e}function vC(){mC++}function yC(){if(--mC>0)return;if(gC){let e=gC;for(gC=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;hC;){let t=hC;for(hC=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function bC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xC(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),wC(r),TC(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function SC(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(CC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function CC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jC)||(e.globalVersion=jC,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!SC(e))))return;e.flags|=2;let t=e.dep,n=dC,r=EC;dC=e,EC=!0;try{bC(e);let n=e.fn(e._value);(t.version===0||RS(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{dC=n,EC=r,xC(e),e.flags&=-3}}function wC(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)wC(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function TC(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var EC=!0,DC=[];function OC(){DC.push(EC),EC=!1}function kC(){let e=DC.pop();EC=e===void 0?!0:e}function AC(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=dC;dC=void 0;try{t()}finally{dC=e}}}var jC=0,MC=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},NC=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(e){if(!dC||!EC||dC===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==dC)t=this.activeLink=new MC(dC,this),dC.deps?(t.prevDep=dC.depsTail,dC.depsTail.nextDep=t,dC.depsTail=t):dC.deps=dC.depsTail=t,PC(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=dC.depsTail,t.nextDep=void 0,dC.depsTail.nextDep=t,dC.depsTail=t,dC.deps===t&&(dC.deps=e)}return dC.onTrack&&dC.onTrack(fS({effect:dC},e)),t}trigger(e){this.version++,jC++,this.notify(e)}notify(e){vC();try{for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(fS({effect:t.sub},e));for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{yC()}}};function PC(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)PC(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}var FC=new WeakMap,IC=Symbol(`Object iterate`),LC=Symbol(`Map keys iterate`),RC=Symbol(`Array iterate`);function zC(e,t,n){if(EC&&dC){let r=FC.get(e);r||FC.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new NC),i.map=r,i.key=n),i.track({target:e,type:t,key:n})}}function BC(e,t,n,r,i,a){let o=FC.get(e);if(!o){jC++;return}let s=o=>{o&&o.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:a})};if(vC(),t===`clear`)o.forEach(s);else{let i=M(e),a=i&&OS(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===RC||!xS(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(RC)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(IC)),gS(e)&&s(o.get(LC)));break;case`delete`:i||(s(o.get(IC)),gS(e)&&s(o.get(LC)));break;case`set`:gS(e)&&s(o.get(IC));break}}yC()}function VC(e){let t=Mw(e);return t===e?t:(zC(t,`iterate`,RC),Aw(e)?t:t.map(Pw))}function HC(e){return zC(e=Mw(e),`iterate`,RC),e}function UC(e,t){return kw(e)?Fw(Ow(e)?Pw(t):t):Pw(t)}var WC={__proto__:null,[Symbol.iterator](){return GC(this,Symbol.iterator,e=>UC(this,e))},concat(...e){return VC(this).concat(...e.map(e=>M(e)?VC(e):e))},entries(){return GC(this,`entries`,e=>(e[1]=UC(this,e[1]),e))},every(e,t){return qC(this,`every`,e,t,void 0,arguments)},filter(e,t){return qC(this,`filter`,e,t,e=>e.map(e=>UC(this,e)),arguments)},find(e,t){return qC(this,`find`,e,t,e=>UC(this,e),arguments)},findIndex(e,t){return qC(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return qC(this,`findLast`,e,t,e=>UC(this,e),arguments)},findLastIndex(e,t){return qC(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return qC(this,`forEach`,e,t,void 0,arguments)},includes(...e){return YC(this,`includes`,e)},indexOf(...e){return YC(this,`indexOf`,e)},join(e){return VC(this).join(e)},lastIndexOf(...e){return YC(this,`lastIndexOf`,e)},map(e,t){return qC(this,`map`,e,t,void 0,arguments)},pop(){return XC(this,`pop`)},push(...e){return XC(this,`push`,e)},reduce(e,...t){return JC(this,`reduce`,e,t)},reduceRight(e,...t){return JC(this,`reduceRight`,e,t)},shift(){return XC(this,`shift`)},some(e,t){return qC(this,`some`,e,t,void 0,arguments)},splice(...e){return XC(this,`splice`,e)},toReversed(){return VC(this).toReversed()},toSorted(e){return VC(this).toSorted(e)},toSpliced(...e){return VC(this).toSpliced(...e)},unshift(...e){return XC(this,`unshift`,e)},values(){return GC(this,`values`,e=>UC(this,e))}};function GC(e,t,n){let r=HC(e),i=r[t]();return r!==e&&!Aw(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var KC=Array.prototype;function qC(e,t,n,r,i,a){let o=HC(e),s=o!==e&&!Aw(e),c=o[t];if(c!==KC[t]){let t=c.apply(e,a);return s?Pw(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,UC(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function JC(e,t,n,r){let i=HC(e),a=i!==e&&!Aw(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=UC(e,t)),n.call(this,t,UC(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?UC(e,c):c}function YC(e,t,n){let r=Mw(e);zC(r,`iterate`,RC);let i=r[t](...n);return(i===-1||i===!1)&&jw(n[0])?(n[0]=Mw(n[0]),r[t](...n)):i}function XC(e,t,n=[]){OC(),vC();let r=Mw(e)[t].apply(e,n);return yC(),kC(),r}var ZC=aS(`__proto__,__v_isRef,__isVue`),QC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(xS));function $C(e){xS(e)||(e=String(e));let t=Mw(this);return zC(t,`has`,e),t.hasOwnProperty(e)}var ew=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?xw:bw:i?yw:vw).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=M(e);if(!r){let e;if(a&&(e=WC[t]))return e;if(t===`hasOwnProperty`)return $C}let o=Reflect.get(e,t,Iw(e)?e:n);if((xS(t)?QC.has(t):ZC(t))||(r||zC(e,`get`,t),i))return o;if(Iw(o)){let e=a&&OS(t)?o:o.value;return r&&SS(e)?Tw(e):e}return SS(o)?r?Tw(o):Cw(o):o}},tw=class extends ew{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=M(e)&&OS(t);if(!this._isShallow){let r=kw(i);if(!Aw(n)&&!kw(n)&&(i=Mw(i),n=Mw(n)),!a&&Iw(i)&&!Iw(n))return r?(sC(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0):(i.value=n,!0)}let o=a?Number(t)<e.length:hS(e,t),s=Reflect.set(e,t,n,Iw(e)?e:r);return e===Mw(r)&&(o?RS(n,i)&&BC(e,`set`,t,n,i):BC(e,`add`,t,n)),s}deleteProperty(e,t){let n=hS(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&BC(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!xS(t)||!QC.has(t))&&zC(e,`has`,t),n}ownKeys(e){return zC(e,`iterate`,M(e)?`length`:IC),Reflect.ownKeys(e)}},nw=class extends ew{constructor(e=!1){super(!0,e)}set(e,t){return sC(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return sC(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},rw=new tw,iw=new nw,aw=new tw(!0),ow=new nw(!0),sw=e=>e,cw=e=>Reflect.getPrototypeOf(e);function lw(e,t,n){return function(...r){let i=this.__v_raw,a=Mw(i),o=gS(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?sw:t?Fw:Pw;return!t&&zC(a,`iterate`,c?LC:IC),fS(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function uw(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:``;sC(`${IS(e)} operation ${n}failed: target is readonly.`,Mw(this))}return e===`delete`?!1:e===`clear`?void 0:this}}function dw(e,t){let n={get(n){let r=this.__v_raw,i=Mw(r),a=Mw(n);e||(RS(n,a)&&zC(i,`get`,n),zC(i,`get`,a));let{has:o}=cw(i),s=t?sw:e?Fw:Pw;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&zC(Mw(t),`iterate`,IC),t.size},has(t){let n=this.__v_raw,r=Mw(n),i=Mw(t);return e||(RS(t,i)&&zC(r,`has`,t),zC(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=Mw(a),s=t?sw:e?Fw:Pw;return!e&&zC(o,`iterate`,IC),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return fS(n,e?{add:uw(`add`),set:uw(`set`),delete:uw(`delete`),clear:uw(`clear`)}:{add(e){let n=Mw(this),r=cw(n),i=Mw(e),a=!t&&!Aw(e)&&!kw(e)?i:e;return r.has.call(n,a)||RS(e,a)&&r.has.call(n,e)||RS(i,a)&&r.has.call(n,i)||(n.add(a),BC(n,`add`,a,a)),this},set(e,n){!t&&!Aw(n)&&!kw(n)&&(n=Mw(n));let r=Mw(this),{has:i,get:a}=cw(r),o=i.call(r,e);o?_w(r,i,e):(e=Mw(e),o=i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?RS(n,s)&&BC(r,`set`,e,n,s):BC(r,`add`,e,n),this},delete(e){let t=Mw(this),{has:n,get:r}=cw(t),i=n.call(t,e);i?_w(t,n,e):(e=Mw(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&BC(t,`delete`,e,void 0,a),o},clear(){let e=Mw(this),t=e.size!==0,n=gS(e)?new Map(e):new Set(e),r=e.clear();return t&&BC(e,`clear`,void 0,void 0,n),r}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=lw(r,e,t)}),n}function fw(e,t){let n=dw(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(hS(n,r)&&r in t?n:t,r,i)}var pw={get:fw(!1,!1)},mw={get:fw(!1,!0)},hw={get:fw(!0,!1)},gw={get:fw(!0,!0)};function _w(e,t,n){let r=Mw(n);if(r!==n&&t.call(e,r)){let t=ES(e);sC(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var vw=new WeakMap,yw=new WeakMap,bw=new WeakMap,xw=new WeakMap;function Sw(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Cw(e){return kw(e)?e:Dw(e,!1,rw,pw,vw)}function ww(e){return Dw(e,!1,aw,mw,yw)}function Tw(e){return Dw(e,!0,iw,hw,bw)}function Ew(e){return Dw(e,!0,ow,gw,xw)}function Dw(e,t,n,r,i){if(!SS(e))return sC(`value cannot be made ${t?`readonly`:`reactive`}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Sw(ES(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ow(e){return kw(e)?Ow(e.__v_raw):!!(e&&e.__v_isReactive)}function kw(e){return!!(e&&e.__v_isReadonly)}function Aw(e){return!!(e&&e.__v_isShallow)}function jw(e){return e?!!e.__v_raw:!1}function Mw(e){let t=e&&e.__v_raw;return t?Mw(t):e}function Nw(e){return!hS(e,`__v_skip`)&&Object.isExtensible(e)&&BS(e,`__v_skip`,!0),e}var Pw=e=>SS(e)?Cw(e):e,Fw=e=>SS(e)?Tw(e):e;function Iw(e){return e?e.__v_isRef===!0:!1}function N(e){return Rw(e,!1)}function Lw(e){return Rw(e,!0)}function Rw(e,t){return Iw(e)?e:new zw(e,t)}var zw=class{constructor(e,t){this.dep=new NC,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Mw(e),this._value=t?e:Pw(e),this.__v_isShallow=t}get value(){return this.dep.track({target:this,type:`get`,key:`value`}),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Aw(e)||kw(e);e=n?e:Mw(e),RS(e,t)&&(this._rawValue=e,this._value=n?e:Pw(e),this.dep.trigger({target:this,type:`set`,key:`value`,newValue:e,oldValue:t}))}};function Bw(e){return Iw(e)?e.value:e}var Vw={get:(e,t,n)=>t===`__v_raw`?e:Bw(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Iw(i)&&!Iw(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Hw(e){return Ow(e)?e:new Proxy(e,Vw)}var Uw=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new NC(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jC-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&dC!==this)return _C(this,!0),!0}get value(){let e=this.dep.track({target:this,type:`get`,key:`value`});return CC(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):sC(`Write operation failed: computed value is readonly`)}};function Ww(e,t,n=!1){let r,i;yS(e)?r=e:(r=e.get,i=e.set);let a=new Uw(r,i,n);return t&&!n&&(a.onTrack=t.onTrack,a.onTrigger=t.onTrigger),a}var Gw={},Kw=new WeakMap,qw=void 0;function Jw(e,t=!1,n=qw){if(n){let t=Kw.get(n);t||Kw.set(n,t=[]),t.push(e)}else t||sC(`onWatcherCleanup() was called when there was no active watcher to associate with.`)}function Yw(e,t,n=oS){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>{(n.onWarn||sC)(`Invalid watch source: `,e,`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`)},u=e=>i?e:Aw(e)||i===!1||i===0?Xw(e,1):Xw(e),d,f,p,m,h=!1,g=!1;if(Iw(e)?(f=()=>e.value,h=Aw(e)):Ow(e)?(f=()=>u(e),h=!0):M(e)?(g=!0,h=e.some(e=>Ow(e)||Aw(e)),f=()=>e.map(e=>{if(Iw(e))return e.value;if(Ow(e))return u(e);if(yS(e))return c?c(e,2):e();l(e)})):yS(e)?f=t?c?()=>c(e,2):e:()=>{if(p){OC();try{p()}finally{kC()}}let t=qw;qw=d;try{return c?c(e,3,[m]):e(m)}finally{qw=t}}:(f=cS,l(e)),t&&i){let e=f,t=i===!0?1/0:i;f=()=>Xw(e(),t)}let _=uC(),v=()=>{d.stop(),_&&_.active&&pS(_.effects,d)};if(a&&t){let e=t;t=(...t)=>{e(...t),v()}}let y=g?Array(e.length).fill(Gw):Gw,b=e=>{if(!(!(d.flags&1)||!d.dirty&&!e))if(t){let e=d.run();if(i||h||(g?e.some((e,t)=>RS(e,y[t])):RS(e,y))){p&&p();let n=qw;qw=d;try{let n=[e,y===Gw?void 0:g&&y[0]===Gw?[]:y,m];y=e,c?c(t,3,n):t(...n)}finally{qw=n}}}else d.run()};return s&&s(b),d=new pC(f),d.scheduler=o?()=>o(b,!1):b,m=e=>Jw(e,!1,d),p=d.onStop=()=>{let e=Kw.get(d);if(e){if(c)c(e,4);else for(let t of e)t();Kw.delete(d)}},d.onTrack=n.onTrack,d.onTrigger=n.onTrigger,t?r?b(!0):y=d.run():o?o(b.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function Xw(e,t=1/0,n){if(t<=0||!SS(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Iw(e))Xw(e.value,t,n);else if(M(e))for(let r=0;r<e.length;r++)Xw(e[r],t,n);else if(_S(e)||gS(e))e.forEach(e=>{Xw(e,t,n)});else if(DS(e)){for(let r in e)Xw(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Xw(e[r],t,n)}return e}var Zw=[];function Qw(e){Zw.push(e)}function $w(){Zw.pop()}var eT=!1;function P(e,...t){if(eT)return;eT=!0,OC();let n=Zw.length?Zw[Zw.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=tT();if(r)sT(r,n,11,[e+t.map(e=>e.toString?.call(e)??JSON.stringify(e)).join(``),n&&n.proxy,i.map(({vnode:e})=>`at <${Mk(n,e.type)}>`).join(`
50
- `),i]);else{let n=[`[Vue warn]: ${e}`,...t];i.length&&n.push(`
51
- `,...nT(i)),console.warn(...n)}kC(),eT=!1}function tT(){let e=Zw[Zw.length-1];if(!e)return[];let t=[];for(;e;){let n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});let r=e.component&&e.component.parent;e=r&&r.vnode}return t}function nT(e){let t=[];return e.forEach((e,n)=>{t.push(...n===0?[]:[`
52
- `],...rT(e))}),t}function rT({vnode:e,recurseCount:t}){let n=t>0?`... (${t} recursive calls)`:``,r=e.component?e.component.parent==null:!1,i=` at <${Mk(e.component,e.type,r)}`,a=`>`+n;return e.props?[i,...iT(e.props),a]:[i+a]}function iT(e){let t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...aT(n,e[n]))}),n.length>3&&t.push(` ...`),t}function aT(e,t,n){return bS(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t==`number`||typeof t==`boolean`||t==null?n?t:[`${e}=${t}`]:Iw(t)?(t=aT(e,Mw(t.value),!0),n?t:[`${e}=Ref<`,t,`>`]):yS(t)?[`${e}=fn${t.name?`<${t.name}>`:``}`]:(t=Mw(t),n?t:[`${e}=`,t])}var oT={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function sT(e,t,n,r){try{return r?e(...r):e()}catch(e){lT(e,t,n)}}function cT(e,t,n,r){if(yS(e)){let i=sT(e,t,n,r);return i&&CS(i)&&i.catch(e=>{lT(e,t,n)}),i}if(M(e)){let i=[];for(let a=0;a<e.length;a++)i.push(cT(e[a],t,n,r));return i}else P(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function lT(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||oS;if(t){let r=t.parent,i=t.proxy,o=oT[n];for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){OC(),sT(a,null,10,[e,i,o]),kC();return}}uT(e,n,i,r,o)}function uT(e,t,n,r=!0,i=!1){{let i=oT[t];if(n&&Qw(n),P(`Unhandled error${i?` during execution of ${i}`:``}`),n&&$w(),r)throw e;console.error(e)}}var dT=[],fT=-1,pT=[],mT=null,hT=0,gT=Promise.resolve(),_T=null,vT=100;function yT(e){let t=_T||gT;return e?t.then(this?e.bind(this):e):t}function bT(e){let t=fT+1,n=dT.length;for(;t<n;){let r=t+n>>>1,i=dT[r],a=ET(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function xT(e){if(!(e.flags&1)){let t=ET(e),n=dT[dT.length-1];!n||!(e.flags&2)&&t>=ET(n)?dT.push(e):dT.splice(bT(t),0,e),e.flags|=1,ST()}}function ST(){_T||=gT.then(DT)}function CT(e){M(e)?pT.push(...e):mT&&e.id===-1?mT.splice(hT+1,0,e):e.flags&1||(pT.push(e),e.flags|=1),ST()}function wT(e,t,n=fT+1){for(t||=new Map;n<dT.length;n++){let r=dT[n];if(r&&r.flags&2){if(e&&r.id!==e.uid||OT(t,r))continue;dT.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function TT(e){if(pT.length){let t=[...new Set(pT)].sort((e,t)=>ET(e)-ET(t));if(pT.length=0,mT){mT.push(...t);return}for(mT=t,e||=new Map,hT=0;hT<mT.length;hT++){let t=mT[hT];OT(e,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}mT=null,hT=0}}var ET=e=>e.id==null?e.flags&2?-1:1/0:e.id;function DT(e){e||=new Map;let t=t=>OT(e,t);try{for(fT=0;fT<dT.length;fT++){let e=dT[fT];if(e&&!(e.flags&8)){if(t(e))continue;e.flags&4&&(e.flags&=-2),sT(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2)}}}finally{for(;fT<dT.length;fT++){let e=dT[fT];e&&(e.flags&=-2)}fT=-1,dT.length=0,TT(e),_T=null,(dT.length||pT.length)&&DT(e)}}function OT(e,t){let n=e.get(t)||0;if(n>vT){let e=t.i,n=e&&jk(e.type);return lT(`Maximum recursive updates exceeded${n?` in component <${n}>`:``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}var kT=!1,AT=e=>{try{return kT}finally{kT=e}},jT=new Map;US().__VUE_HMR_RUNTIME__={createRecord:BT(FT),rerender:BT(LT),reload:BT(RT)};var MT=new Map;function NT(e){let t=e.type.__hmrId,n=MT.get(t);n||=(FT(t,e.type),MT.get(t)),n.instances.add(e)}function PT(e){MT.get(e.type.__hmrId).instances.delete(e)}function FT(e,t){return MT.has(e)?!1:(MT.set(e,{initialDef:IT(t),instances:new Set}),!0)}function IT(e){return Nk(e)?e.__vccOpts:e}function LT(e,t){let n=MT.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(e=>{t&&(e.render=t,IT(e.type).render=t),e.renderCache=[],kT=!0,e.job.flags&8||e.update(),kT=!1}))}function RT(e,t){let n=MT.get(e);if(!n)return;t=IT(t),zT(n.initialDef,t);let r=[...n.instances];for(let e=0;e<r.length;e++){let i=r[e],a=IT(i.type),o=jT.get(a);o||(a!==n.initialDef&&zT(a,t),jT.set(a,o=new Set)),o.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(o.add(i),i.ceReload(t.styles),o.delete(i)):i.parent?xT(()=>{i.job.flags&8||(kT=!0,i.parent.update(),kT=!1,o.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<`u`?window.location.reload():console.warn(`[HMR] Root or manually mounted instance modified. Full reload required.`),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(a)}CT(()=>{jT.clear()})}function zT(e,t){fS(e,t);for(let n in e)n!==`__file`&&!(n in t)&&delete e[n]}function BT(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn(`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`)}}}var VT,HT=[],UT=!1;function WT(e,...t){VT?VT.emit(e,...t):UT||HT.push({event:e,args:t})}function GT(e,t){VT=e,VT?(VT.enabled=!0,HT.forEach(({event:e,args:t})=>VT.emit(e,...t)),HT=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{GT(e,t)}),setTimeout(()=>{VT||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,UT=!0,HT=[])},3e3)):(UT=!0,HT=[])}function KT(e,t){WT(`app:init`,e,t,{Fragment:NO,Text:PO,Comment:FO,Static:IO})}function qT(e){WT(`app:unmount`,e)}var JT=QT(`component:added`),YT=QT(`component:updated`),XT=QT(`component:removed`),ZT=e=>{VT&&typeof VT.cleanupBuffer==`function`&&!VT.cleanupBuffer(e)&&XT(e)};function QT(e){return t=>{WT(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}var $T=tE(`perf:start`),eE=tE(`perf:end`);function tE(e){return(t,n,r)=>{WT(e,t.appContext.app,t.uid,t,n,r)}}function nE(e,t,n){WT(`component:emit`,e.appContext.app,e,t,n)}var rE=null,iE=null;function aE(e){let t=rE;return rE=e,iE=e&&e.type.__scopeId||null,t}function oE(e,t=rE,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&BO(-1);let i=aE(t),a;try{a=e(...n)}finally{aE(i),r._d&&BO(1)}return YT(t),a};return r._n=!0,r._c=!0,r._d=!0,r}function sE(e){AS(e)&&P(`Do not use built-in directive ids as custom directive id: `+e)}function cE(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(OC(),cT(c,n,8,[e.el,s,e,t]),kC())}}function lE(e,t){if((!ck||ck.isMounted)&&P(`provide() can only be used inside setup().`),ck){let n=ck.provides,r=ck.parent&&ck.parent.provides;r===n&&(n=ck.provides=Object.create(r)),n[e]=t}}function uE(e,t,n=!1){let r=lk();if(r||SD){let i=SD?SD._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&yS(t)?t.call(r&&r.proxy):t;P(`injection "${String(e)}" not found.`)}else P(`inject() can only be used inside setup() or functional components.`)}var dE=Symbol.for(`v-scx`),fE=()=>{{let e=uE(dE);return e||P(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),e}};function pE(e,t){return hE(e,null,t)}function mE(e,t,n){return yS(t)||P("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),hE(e,t,n)}function hE(e,t,n=oS){let{immediate:r,deep:i,flush:a,once:o}=n;t||(r!==void 0&&P(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`),i!==void 0&&P(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`),o!==void 0&&P(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`));let s=fS({},n);s.onWarn=P;let c=t&&r||!t&&a!==`post`,l;if(_k){if(a===`sync`){let e=fE();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=cS,e.resume=cS,e.pause=cS,e}}let u=ck;s.call=(e,t,n)=>cT(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{bO(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():xT(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=Yw(e,t,s);return _k&&(l?l.push(f):c&&f()),f}function gE(e,t,n){let r=this.proxy,i=bS(e)?e.includes(`.`)?_E(r,e):()=>r[e]:e.bind(r,r),a;yS(t)?a=t:(a=t.handler,n=t);let o=fk(this),s=hE(i,a.bind(r),n);return o(),s}function _E(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var vE=Symbol(`_vte`),yE=e=>e.__isTeleport,bE=Symbol(`_leaveCb`);function xE(e,t){e.shapeFlag&6&&e.component?(e.transition=t,xE(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function SE(e,t){return yS(e)?fS({name:e.name},t,{setup:e}):e}function CE(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}var wE=new WeakSet;function TE(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var EE=new WeakMap;function DE(e,t,n,r,i=!1){if(M(e)){e.forEach((e,a)=>DE(e,t&&(M(t)?t[a]:t),n,r,i));return}if(kE(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&DE(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ok(r.component):r.el,o=i?null:a,{i:s,r:c}=e;if(!s){P(`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`);return}let l=t&&t.r,u=s.refs===oS?s.refs={}:s.refs,d=s.setupState,f=Mw(d),p=d===oS?lS:e=>(hS(f,e)&&!Iw(f[e])&&P(`Template ref "${e}" used on a non-ref value. It will not work in the production build.`),wE.has(f[e])||TE(u,e)?!1:hS(f,e)),m=(e,t)=>!(wE.has(e)||t&&TE(u,t));if(l!=null&&l!==c){if(OE(t),bS(l))u[l]=null,p(l)&&(d[l]=null);else if(Iw(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(yS(c))sT(c,s,12,[o,u]);else{let t=bS(c),r=Iw(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)M(n)&&pS(n,a);else if(M(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r?(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o)):P(`Invalid template ref type:`,c,`(${typeof c})`)};if(o){let t=()=>{s(),EE.delete(e)};t.id=-1,EE.set(e,t),bO(t,n)}else OE(e),s()}else P(`Invalid template ref type:`,c,`(${typeof c})`)}}function OE(e){let t=EE.get(e);t&&(t.flags|=8,EE.delete(e))}US().requestIdleCallback,US().cancelIdleCallback;var kE=e=>!!e.type.__asyncLoader,AE=e=>e.type.__isKeepAlive;function jE(e,t){NE(e,`a`,t)}function ME(e,t){NE(e,`da`,t)}function NE(e,t,n=ck){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(FE(t,r,n),n){let e=n.parent;for(;e&&e.parent;)AE(e.parent.vnode)&&PE(r,t,n,e),e=e.parent}}function PE(e,t,n,r){let i=FE(t,e,r,!0);HE(()=>{pS(r[t],i)},n)}function FE(e,t,n=ck,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{OC();let i=fk(n),a=cT(t,n,e,r);return i(),kC(),a};return r?i.unshift(a):i.push(a),a}else P(`${LS(oT[e].replace(/ hook$/,``))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}var IE=e=>(t,n=ck)=>{(!_k||e===`sp`)&&FE(e,(...e)=>t(...e),n)},LE=IE(`bm`),RE=IE(`m`),zE=IE(`bu`),BE=IE(`u`),VE=IE(`bum`),HE=IE(`um`),UE=IE(`sp`),WE=IE(`rtg`),GE=IE(`rtc`);function KE(e,t=ck){FE(`ec`,e,t)}var qE=Symbol.for(`v-ndc`),JE=e=>e?gk(e)?Ok(e):JE(e.parent):null,YE=fS(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>Ew(e.props),$attrs:e=>Ew(e.attrs),$slots:e=>Ew(e.slots),$refs:e=>Ew(e.refs),$parent:e=>JE(e.parent),$root:e=>JE(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?lD(e):e.type,$forceUpdate:e=>e.f||=()=>{xT(e.update)},$nextTick:e=>e.n||=yT.bind(e.proxy),$watch:e=>__VUE_OPTIONS_API__?gE.bind(e):cS}),XE=e=>e===`_`||e===`$`,ZE=(e,t)=>e!==oS&&!e.__isScriptSetup&&hS(e,t),QE={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t===`__isVue`)return!0;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(ZE(r,t))return o[t]=1,r[t];else if(__VUE_OPTIONS_API__&&i!==oS&&hS(i,t))return o[t]=2,i[t];else if(hS(a,t))return o[t]=3,a[t];else if(n!==oS&&hS(n,t))return o[t]=4,n[t];else (!__VUE_OPTIONS_API__||iD)&&(o[t]=0)}let l=YE[t],u,d;if(l)return t===`$attrs`?(zC(e.attrs,`get`,``),kD()):t===`$slots`&&zC(e,`get`,t),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==oS&&hS(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,hS(d,t))return d[t];rE&&(!bS(t)||t.indexOf(`__v`)!==0)&&(i!==oS&&XE(t[0])&&hS(i,t)?P(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===rE&&P(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return ZE(i,t)?(i[t]=n,!0):i.__isScriptSetup&&hS(i,t)?(P(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):__VUE_OPTIONS_API__&&r!==oS&&hS(r,t)?(r[t]=n,!0):hS(e.props,t)?(P(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]===`$`&&t.slice(1)in e?(P(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:n}):a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||__VUE_OPTIONS_API__&&e!==oS&&s[0]!==`$`&&hS(e,s)||ZE(t,s)||hS(a,s)||hS(r,s)||hS(YE,s)||hS(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?hS(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};QE.ownKeys=e=>(P(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`),Reflect.ownKeys(e));function $E(e){let t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(YE).forEach(n=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:()=>YE[n](e),set:cS})}),t}function eD(e){let{ctx:t,propsOptions:[n]}=e;n&&Object.keys(n).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:cS})})}function tD(e){let{ctx:t,setupState:n}=e;Object.keys(Mw(n)).forEach(e=>{if(!n.__isScriptSetup){if(XE(e[0])){P(`setup() return property ${JSON.stringify(e)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:()=>n[e],set:cS})}})}function nD(e){return M(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function rD(){let e=Object.create(null);return(t,n)=>{e[n]?P(`${t} property "${n}" is already defined in ${e[n]}.`):e[n]=t}}var iD=!0;function aD(e){let t=lD(e),n=e.proxy,r=e.ctx;iD=!1,t.beforeCreate&&sD(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:x,renderTracked:S,renderTriggered:ee,errorCaptured:te,serverPrefetch:ne,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:se}=t,ce=rD();{let[t]=e.propsOptions;if(t)for(let e in t)ce(`Props`,e)}if(l&&oD(l,r,ce),o)for(let e in o){let t=o[e];yS(t)?(Object.defineProperty(r,e,{value:t.bind(n),configurable:!0,enumerable:!0,writable:!0}),ce(`Methods`,e)):P(`Method "${e}" has type "${typeof t}" in the component definition. Did you reference the function correctly?`)}if(i){yS(i)||P(`The data option must be a function. Plain object usage is no longer supported.`);let t=i.call(n,n);if(CS(t)&&P(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`),!SS(t))P(`data() should return an object.`);else{e.data=Cw(t);for(let e in t)ce(`Data`,e),XE(e[0])||Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>t[e],set:cS})}}if(iD=!0,a)for(let e in a){let t=a[e],i=yS(t)?t.bind(n,n):yS(t.get)?t.get.bind(n,n):cS;i===cS&&P(`Computed property "${e}" has no getter.`);let o=Pk({get:i,set:!yS(t)&&yS(t.set)?t.set.bind(n):()=>{P(`Write operation failed: computed property "${e}" is readonly.`)}});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}),ce(`Computed`,e)}if(s)for(let e in s)cD(s[e],r,n,e);if(c){let e=yS(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{lE(t,e[t])})}u&&sD(u,e,`c`);function le(e,t){M(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(le(LE,d),le(RE,f),le(zE,p),le(BE,m),le(jE,h),le(ME,g),le(KE,te),le(GE,S),le(WE,ee),le(VE,v),le(HE,b),le(UE,ne),M(re))if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};x&&e.render===cS&&(e.render=x),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),ne&&CE(e)}function oD(e,t,n=cS){M(e)&&(e=mD(e));for(let r in e){let i=e[r],a;a=SS(i)?`default`in i?uE(i.from||r,i.default,!0):uE(i.from||r):uE(i),Iw(a)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e}):t[r]=a,n(`Inject`,r)}}function sD(e,t,n){cT(M(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function cD(e,t,n,r){let i=r.includes(`.`)?_E(n,r):()=>n[r];if(bS(e)){let n=t[e];yS(n)?mE(i,n):P(`Invalid watch handler specified by key "${e}"`,n)}else if(yS(e))mE(i,e.bind(n));else if(SS(e))if(M(e))e.forEach(e=>cD(e,t,n,r));else{let r=yS(e.handler)?e.handler.bind(n):t[e.handler];yS(r)?mE(i,r,e):P(`Invalid watch handler specified by key "${e.handler}"`,r)}else P(`Invalid watch option: "${r}"`,e)}function lD(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>uD(c,e,o,!0)),uD(c,t,o)),SS(t)&&a.set(t,c),c}function uD(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&uD(e,a,n,!0),i&&i.forEach(t=>uD(e,t,n,!0));for(let i in t)if(r&&i===`expose`)P(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);else{let r=dD[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var dD={data:fD,props:_D,emits:_D,methods:gD,computed:gD,beforeCreate:hD,created:hD,beforeMount:hD,mounted:hD,beforeUpdate:hD,updated:hD,beforeDestroy:hD,beforeUnmount:hD,destroyed:hD,unmounted:hD,activated:hD,deactivated:hD,errorCaptured:hD,serverPrefetch:hD,components:gD,directives:gD,watch:vD,provide:fD,inject:pD};function fD(e,t){return t?e?function(){return fS(yS(e)?e.call(this,this):e,yS(t)?t.call(this,this):t)}:t:e}function pD(e,t){return gD(mD(e),mD(t))}function mD(e){if(M(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hD(e,t){return e?[...new Set([].concat(e,t))]:t}function gD(e,t){return e?fS(Object.create(null),e,t):t}function _D(e,t){return e?M(e)&&M(t)?[...new Set([...e,...t])]:fS(Object.create(null),nD(e),nD(t??{})):t}function vD(e,t){if(!e)return t;if(!t)return e;let n=fS(Object.create(null),e);for(let r in t)n[r]=hD(e[r],t[r]);return n}function yD(){return{app:null,config:{isNativeTag:lS,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var bD=0;function xD(e,t){return function(n,r=null){yS(n)||(n=fS({},n)),r!=null&&!SS(r)&&(P(`root props passed to app.mount() must be an object.`),r=null);let i=yD(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:bD++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Ik,get config(){return i.config},set config(e){P(`app.config cannot be replaced. Modify individual options instead.`)},use(e,...t){return a.has(e)?P(`Plugin has already been applied to target app.`):e&&yS(e.install)?(a.add(e),e.install(c,...t)):yS(e)?(a.add(e),e(c,...t)):P(`A plugin must either be a function or an object with an "install" function.`),c},mixin(e){return __VUE_OPTIONS_API__?i.mixins.includes(e)?P(`Mixin has already been applied to target app`+(e.name?`: ${e.name}`:``)):i.mixins.push(e):P(`Mixins are only available in builds supporting Options API`),c},component(e,t){return hk(e,i.config),t?(i.components[e]&&P(`Component "${e}" has already been registered in target app.`),i.components[e]=t,c):i.components[e]},directive(e,t){return sE(e),t?(i.directives[e]&&P(`Directive "${e}" has already been registered in target app.`),i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(s)P("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{a.__vue_app__&&P("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");let u=c._ceVNode||JO(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),i.reload=()=>{let t=ZO(u);t.el=null,e(t,a,l)},o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,c._instance=u.component,KT(c,Ik),Ok(u.component)}},onUnmount(e){typeof e!=`function`&&P(`Expected function as first argument to app.onUnmount(), but got ${typeof e}`),o.push(e)},unmount(){s?(cT(o,c._instance,16),e(null,c._container),c._instance=null,qT(c),delete c._container.__vue_app__):P(`Cannot unmount an app that is not mounted.`)},provide(e,t){return e in i.provides&&(hS(i.provides,e)?P(`App already provides property with key "${String(e)}". It will be overwritten with the new value.`):P(`App already provides property with key "${String(e)}" inherited from its parent element. It will be overwritten with the new value.`)),i.provides[e]=t,c},runWithContext(e){let t=SD;SD=c;try{return e()}finally{SD=t}}};return c}}var SD=null,CD=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${NS(t)}Modifiers`]||e[`${FS(t)}Modifiers`];function wD(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||oS;{let{emitsOptions:r,propsOptions:[i]}=e;if(r)if(!(t in r))(!i||!(LS(NS(t))in i))&&P(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${LS(NS(t))}" prop.`);else{let e=r[t];yS(e)&&(e(...n)||P(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=n,a=t.startsWith(`update:`),o=a&&CD(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>bS(e)?e.trim():e)),o.number&&(i=n.map(VS))),nE(e,t,i);{let n=t.toLowerCase();n!==t&&r[LS(n)]&&P(`Event "${n}" is emitted in component ${Mk(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${FS(t)}" instead of "${t}".`)}let s,c=r[s=LS(t)]||r[s=LS(NS(t))];!c&&a&&(c=r[s=LS(FS(t))]),c&&cT(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,cT(l,e,6,i)}}var TD=new WeakMap;function ED(e,t,n=!1){let r=__VUE_OPTIONS_API__&&n?TD:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(__VUE_OPTIONS_API__&&!yS(e)){let r=e=>{let n=ED(e,t,!0);n&&(s=!0,fS(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(SS(e)&&r.set(e,null),null):(M(a)?a.forEach(e=>o[e]=null):fS(o,a),SS(e)&&r.set(e,o),o)}function DD(e,t){return!e||!uS(t)?!1:(t=t.slice(2).replace(/Once$/,``),hS(e,t[0].toLowerCase()+t.slice(1))||hS(e,FS(t))||hS(e,t))}var OD=!1;function kD(){OD=!0}function AD(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=aE(e),_,v;OD=!1;try{if(n.shapeFlag&4){let e=i||r,t=p.__isScriptSetup?new Proxy(e,{get(e,t,n){return P(`Property '${String(t)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(e,t,n)}}):e;_=ek(l.call(t,e,u,Ew(d),p,f,m)),v=s}else{let e=t;s===d&&kD(),_=ek(e.length>1?e(Ew(d),{get attrs(){return kD(),Ew(s)},slots:o,emit:c}):e(Ew(d),null)),v=t.props?s:ND(s)}}catch(t){LO.length=0,lT(t,e,1),_=JO(FO)}let y=_,b;if(_.patchFlag>0&&_.patchFlag&2048&&([y,b]=jD(_)),v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;if(e.length){if(t&7)a&&e.some(dS)&&(v=PD(v,a)),y=ZO(y,v,!1,!0);else if(!OD&&y.type!==FO){let e=Object.keys(s),t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];uS(i)?dS(i)||t.push(i[2].toLowerCase()+i.slice(3)):n.push(i)}n.length&&P(`Extraneous non-props attributes (${n.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),t.length&&P(`Extraneous non-emits event listeners (${t.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(FD(y)||P(`Runtime directive used on component with non-element root node. The directives will not function as intended.`),y=ZO(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&(FD(y)||P(`Component inside <Transition> renders non-element root node that cannot be animated.`),xE(y,n.transition)),b?b(y):_=y,aE(g),_}var jD=e=>{let t=e.children,n=e.dynamicChildren,r=MD(t,!1);if(!r)return[e,void 0];if(r.patchFlag>0&&r.patchFlag&2048)return jD(r);let i=t.indexOf(r),a=n?n.indexOf(r):-1;return[ek(r),r=>{t[i]=r,n&&(a>-1?n[a]=r:r.patchFlag>0&&(e.dynamicChildren=[...n,r]))}]};function MD(e,t=!0){let n;for(let r=0;r<e.length;r++){let i=e[r];if(VO(i)){if(i.type!==FO||i.children===`v-if`){if(n)return;if(n=i,t&&n.patchFlag>0&&n.patchFlag&2048)return MD(n.children)}}else return}return n}var ND=e=>{let t;for(let n in e)(n===`class`||n===`style`||uS(n))&&((t||={})[n]=e[n]);return t},PD=(e,t)=>{let n={};for(let r in e)(!dS(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},FD=e=>e.shapeFlag&7||e.type===FO;function ID(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if((i||s)&&kT||t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?LD(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(RD(o,r,n)&&!DD(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?LD(r,o,l):!0:!!o;return!1}function LD(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(RD(t,e,a)&&!DD(n,a))return!0}return!1}function RD(e,t,n){let r=e[n],i=t[n];return n===`style`&&SS(r)&&SS(i)?!oC(r,i):r!==i}function zD({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var BD={},VD=()=>Object.create(BD),HD=e=>Object.getPrototypeOf(e)===BD;function UD(e,t,n,r=!1){let i={},a=VD();e.propsDefaults=Object.create(null),KD(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);QD(t||{},i,e),n?e.props=r?i:ww(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function WD(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function GD(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Mw(i),[c]=e.propsOptions,l=!1;if(!WD(e)&&(r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(DD(e.emitsOptions,o))continue;let u=t[o];if(c)if(hS(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=NS(o);i[t]=qD(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{KD(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!hS(t,a)&&((r=FS(a))===a||!hS(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=qD(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!hS(t,e))&&(delete a[e],l=!0)}l&&BC(e.attrs,`set`,``),QD(t||{},i,e)}function KD(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(kS(c))continue;let l=t[c],u;i&&hS(i,u=NS(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:DD(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=Mw(n),r=s||oS;for(let o=0;o<a.length;o++){let s=a[o];n[s]=qD(i,t,s,r[s],e,!hS(r,s))}}return o}function qD(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=hS(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&yS(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=fk(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===FS(n))&&(r=!0))}return r}var JD=new WeakMap;function YD(e,t,n=!1){let r=__VUE_OPTIONS_API__&&n?JD:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(__VUE_OPTIONS_API__&&!yS(e)){let r=e=>{c=!0;let[n,r]=YD(e,t,!0);fS(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return SS(e)&&r.set(e,sS),sS;if(M(a))for(let e=0;e<a.length;e++){bS(a[e])||P(`props must be strings when using array syntax.`,a[e]);let t=NS(a[e]);XD(t)&&(o[t]=oS)}else if(a){SS(a)||P(`invalid props options`,a);for(let e in a){let t=NS(e);if(XD(t)){let n=a[e],r=o[t]=M(n)||yS(n)?{type:n}:fS({},n),i=r.type,c=!1,l=!0;if(M(i))for(let e=0;e<i.length;++e){let t=i[e],n=yS(t)&&t.name;if(n===`Boolean`){c=!0;break}else n===`String`&&(l=!1)}else c=yS(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||hS(r,`default`))&&s.push(t)}}}let l=[o,s];return SS(e)&&r.set(e,l),l}function XD(e){return e[0]!==`$`&&!kS(e)?!0:(P(`Invalid prop name: "${e}" is a reserved property.`),!1)}function ZD(e){return e===null?`null`:typeof e==`function`?e.name||``:typeof e==`object`&&e.constructor&&e.constructor.name||``}function QD(e,t,n){let r=Mw(t),i=n.propsOptions[0],a=Object.keys(e).map(e=>NS(e));for(let e in i){let t=i[e];t!=null&&$D(e,r[e],t,Ew(r),!a.includes(e))}}function $D(e,t,n,r,i){let{type:a,required:o,validator:s,skipCheck:c}=n;if(o&&i){P(`Missing required prop: "`+e+`"`);return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let n=!1,r=M(a)?a:[a],i=[];for(let e=0;e<r.length&&!n;e++){let{valid:a,expectedType:o}=tO(t,r[e]);i.push(o||``),n=a}if(!n){P(nO(e,t,i));return}}s&&!s(t,r)&&P(`Invalid prop: custom validator check failed for prop "`+e+`".`)}}var eO=aS(`String,Number,Boolean,Function,Symbol,BigInt`);function tO(e,t){let n,r=ZD(t);if(r===`null`)n=e===null;else if(eO(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?SS(e):r===`Array`?M(e):e instanceof t;return{valid:n,expectedType:r}}function nO(e,t,n){if(n.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let r=`Invalid prop: type check failed for prop "${e}". Expected ${n.map(IS).join(` | `)}`,i=n[0],a=ES(t),o=rO(t,i),s=rO(t,a);return n.length===1&&iO(i)&&aO(i,a)&&(r+=` with value ${o}`),r+=`, got ${a} `,iO(a)&&(r+=`with value ${s}.`),r}function rO(e,t){return xS(e)?e.toString():t===`String`?`"${e}"`:t===`Number`?`${Number(e)}`:`${e}`}function iO(e){return[`string`,`number`,`boolean`].some(t=>e.toLowerCase()===t)}function aO(...e){return e.every(e=>{let t=e.toLowerCase();return t!==`boolean`&&t!==`symbol`})}var oO=e=>e===`_`||e===`_ctx`||e===`$stable`,sO=e=>M(e)?e.map(ek):[ek(e)],cO=(e,t,n)=>{if(t._n)return t;let r=oE((...r)=>(ck&&!(n===null&&rE)&&!(n&&n.root!==ck.root)&&P(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),sO(t(...r))),n);return r._c=!1,r},lO=(e,t,n)=>{let r=e._ctx;for(let n in e){if(oO(n))continue;let i=e[n];if(yS(i))t[n]=cO(n,i,r);else if(i!=null){P(`Non-function value encountered for slot "${n}". Prefer function slots for better performance.`);let e=sO(i);t[n]=()=>e}}},uO=(e,t)=>{AE(e.vnode)||P(`Non-function value encountered for default slot. Prefer function slots for better performance.`);let n=sO(t);e.slots.default=()=>n},dO=(e,t,n)=>{for(let r in t)(n||!oO(r))&&(e[r]=t[r])},fO=(e,t,n)=>{let r=e.slots=VD();if(e.vnode.shapeFlag&32){let e=t._;e?(dO(r,t,n),n&&BS(r,`_`,e,!0)):lO(t,r)}else t&&uO(e,t)},pO=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=oS;if(r.shapeFlag&32){let r=t._;r?kT?(dO(i,t,n),BC(e,`set`,`$slots`)):n&&r===1?a=!1:dO(i,t,n):(a=!t.$stable,lO(t,i)),o=t}else t&&(uO(e,t),o={default:1});if(a)for(let e in i)!oO(e)&&o[e]==null&&delete i[e]},mO,hO;function gO(e,t){e.appContext.config.performance&&vO()&&hO.mark(`vue-${t}-${e.uid}`),$T(e,t,vO()?hO.now():Date.now())}function _O(e,t){if(e.appContext.config.performance&&vO()){let n=`vue-${t}-${e.uid}`,r=n+`:end`,i=`<${Mk(e,e.type)}> ${t}`;hO.mark(r),hO.measure(i,n,r),hO.clearMeasures(i),hO.clearMarks(n),hO.clearMarks(r)}eE(e,t,vO()?hO.now():Date.now())}function vO(){return mO===void 0&&(typeof window<`u`&&window.performance?(mO=!0,hO=window.performance):mO=!1),mO}function yO(){let e=[];if(typeof __VUE_OPTIONS_API__!=`boolean`&&(e.push(`__VUE_OPTIONS_API__`),US().__VUE_OPTIONS_API__=!0),typeof __VUE_PROD_DEVTOOLS__!=`boolean`&&(e.push(`__VUE_PROD_DEVTOOLS__`),US().__VUE_PROD_DEVTOOLS__=!1),typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!=`boolean`&&(e.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`),US().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1),e.length){let t=e.length>1;console.warn(`Feature flag${t?`s`:``} ${e.join(`, `)} ${t?`are`:`is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
53
-
54
- For more details, see https://link.vuejs.org/feature-flags.`)}}var bO=MO;function xO(e){return SO(e)}function SO(e,t){yO();let n=US();n.__VUE__=!0,GT(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=cS,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=kT?!1:!!t.dynamicChildren)=>{if(e===t)return;e&&!HO(e,t)&&(r=be(e),ge(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case PO:g(e,t,n,r);break;case FO:_(e,t,n,r);break;case IO:e==null?v(t,n,r,o):y(e,t,n,o);break;case NO:oe(e,t,n,r,i,a,o,s,c);break;default:d&1?S(e,t,n,r,i,a,o,s,c):d&6?se(e,t,n,r,i,a,o,s,c):d&64||d&128?l.process(e,t,n,r,i,a,o,s,c,Ce):P(`Invalid VNode type:`,l,`(${typeof l})`)}u!=null&&i?DE(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&DE(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=(e,t,n,r)=>{if(t.children!==e.children){let i=f(e.anchor);x(e),[t.el,t.anchor]=m(t.children,n,i,r)}else t.el=e.el,t.anchor=e.anchor},b=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},x=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},S=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),re(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&ne(e.children,f,null,i,s,CO(e,c),l,d),_&&cE(e,null,i,`created`),te(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!kS(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ik(p,i,e)}BS(f,`__vnode`,e,!0),BS(f,`__vueParentComponent`,i,!0),_&&cE(e,null,i,`beforeMount`);let v=TO(s,g);if(v&&g.beforeEnter(f),r(f,t,n),(p=m&&m.onVnodeMounted)||v||_){let t=kT;bO(()=>{let n;n=AT(t);try{p&&ik(p,i,e),v&&g.enter(f),_&&cE(e,null,i,`mounted`)}finally{AT(n)}},s)}},te=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(n.patchFlag>0&&n.patchFlag&2048&&(n=MD(n.children)||n),t===n||jO(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;te(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},ne=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)h(null,e[l]=s?tk(e[l]):ek(e[l]),t,n,r,i,a,o,s)},re=(e,t,n,r,i,o,s)=>{let c=t.el=e.el;c.__vnode=t;let{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||oS,m=t.props||oS,h;if(n&&wO(n,!1),(h=m.onVnodeBeforeUpdate)&&ik(h,n,t,e),f&&cE(t,e,n,`beforeUpdate`),n&&wO(n,!0),kT&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?(ie(e.dynamicChildren,d,c,n,r,CO(t,i),o),EO(e,t)):s||fe(e,t,c,null,n,r,CO(t,i),o,!1),l>0){if(l&16)ae(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else !s&&d==null&&ae(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&bO(()=>{h&&ik(h,n,t,e),f&&cE(t,e,n,`updated`)},r)},ie=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];h(c,l,c.el&&(c.type===NO||!HO(c,l)||c.shapeFlag&198)?d(c.el):n,null,r,i,a,o,!0)}},ae=(e,t,n,r,i)=>{if(t!==n){if(t!==oS)for(let o in t)!kS(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(kS(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},oe=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;(kT||p&2048)&&(p=0,u=!1,m=null),h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),ne(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ie(e.dynamicChildren,m,n,a,o,c,l),EO(e,t)):fe(e,t,n,f,a,o,c,l,u)},se=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ce(t,n,r,i,a,o,c):le(e,t,c)},ce=(e,t,n,r,i,a,o)=>{let s=e.component=sk(e,r,i);if(s.type.__hmrId&&NT(s),Qw(e),gO(s,`mount`),AE(e)&&(s.ctx.renderer=Ce),gO(s,`init`),vk(s,!1,o),_O(s,`init`),kT&&(e.el=null),s.asyncDep){if(i&&i.registerDep(s,ue,o),!e.el){let r=s.subTree=JO(FO);_(null,r,t,n),e.placeholder=r.el}}else ue(s,e,t,n,i,a,o);$w(),_O(s,`mount`)},le=(e,t,n)=>{let r=t.component=e.component;if(ID(e,t,n))if(r.asyncDep&&!r.asyncResolved){Qw(t),de(r,t,n),$w();return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},ue=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=OO(e);if(n){t&&(t.el=c.el,de(e,t,o)),n.asyncDep.then(()=>{bO(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;Qw(t||e.vnode),wO(e,!1),t?(t.el=c.el,de(e,t,o)):t=c,n&&zS(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ik(f,s,t,c),wO(e,!0),gO(e,`render`);let p=AD(e);_O(e,`render`);let m=e.subTree;e.subTree=p,gO(e,`patch`),h(m,p,d(m.el),be(m),e,i,a),_O(e,`patch`),t.el=p.el,u===null&&zD(e,p.el),r&&bO(r,i),(f=t.props&&t.props.onVnodeUpdated)&&bO(()=>ik(f,s,t,c),i),YT(e),$w()}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=kE(t);if(wO(e,!1),l&&zS(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ik(o,d,t),wO(e,!0),s&&Te){let t=()=>{gO(e,`render`),e.subTree=AD(e),_O(e,`render`),gO(e,`hydrate`),Te(s,e.subTree,e,i,null),_O(e,`hydrate`)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0),gO(e,`render`);let o=e.subTree=AD(e);_O(e,`render`),gO(e,`patch`),h(null,o,n,r,e,i,a),_O(e,`patch`),t.el=o.el}if(u&&bO(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;bO(()=>ik(o,d,e),i)}(t.shapeFlag&256||d&&kE(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&bO(e.a,i),e.isMounted=!0,JT(e),t=n=r=null}};e.scope.on();let c=e.effect=new pC(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>xT(u),wO(e,!0),c.onTrack=e.rtc?t=>zS(e.rtc,t):void 0,c.onTrigger=e.rtg?t=>zS(e.rtg,t):void 0,l()},de=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,GD(e,t.props,r,n),pO(e,t.children,n),OC(),wT(e),kC()},fe=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){me(l,f,n,r,i,a,o,s,c);return}else if(p&256){pe(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&ye(l,i,a),f!==l&&u(n,f)):d&16?m&16?me(l,f,n,r,i,a,o,s,c):ye(l,i,a,!0):(d&8&&u(n,``),m&16&&ne(f,n,r,i,a,o,s,c))},pe=(e,t,n,r,i,a,o,s,c)=>{e||=sS,t||=sS;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;f<d;f++){let r=t[f]=c?tk(t[f]):ek(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?ye(e,i,a,!0,!1,d):ne(t,n,r,i,a,o,s,c,d)},me=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?tk(t[l]):ek(t[l]);if(HO(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?tk(t[f]):ek(t[f]);if(HO(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?tk(t[l]):ek(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)ge(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?tk(t[l]):ek(t[l]);e.key!=null&&(g.has(e.key)&&P(`Duplicate keys found during update:`,JSON.stringify(e.key),`Make sure keys are unique.`),g.set(e.key,l))}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){ge(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&HO(r,t[_])){u=_;break}u===void 0?ge(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let ee=b?DO(S):sS;for(_=ee.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||AO(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==ee[_]?he(d,n,p,2):_--)}}},he=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){he(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,Ce);return}if(c===NO){r(s,t,n);for(let e=0;e<u.length;e++)he(u[e],t,n,a);r(e.anchor,t,n);return}if(c===IO){b(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[bE]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),bO(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[bE];s._isLeaving&&s[bE](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},ge=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(OC(),DE(s,null,n,e,!0),kC()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!kE(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ik(_,t,e),u&6)C(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&cE(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Ce,r):l&&!l.hasOnce&&(a!==NO||d>0&&d&64)?ye(l,t,n,!1,!0):(a===NO&&d&384||!i&&u&16)&&ye(c,t,n),r&&_e(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&bO(()=>{_&&ik(_,t,e),h&&cE(e,null,t,`unmounted`),v&&(e.el=null)},n)},_e=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===NO){e.patchFlag>0&&e.patchFlag&2048&&a&&!a.persisted?e.children.forEach(e=>{e.type===FO?i(e.el):_e(e)}):ve(n,r);return}if(t===IO){x(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},ve=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},C=(e,t,n)=>{e.type.__hmrId&&PT(e);let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;kO(c),kO(l),r&&zS(r),i.stop(),a&&(a.flags|=8,ge(o,e,t,n)),s&&bO(s,t),bO(()=>{e.isUnmounted=!0},t),ZT(e)},ye=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)ge(e[o],t,n,r,i)},be=e=>{if(e.shapeFlag&6)return be(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[vE];return n?f(n):t},xe=!1,Se=(e,t,n)=>{let r;e==null?t._vnode&&(ge(t._vnode,null,null,!0),r=t._vnode.component):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,xe||=(xe=!0,wT(r),TT(),!1)},Ce={p:h,um:ge,m:he,r:_e,mt:ce,mc:ne,pc:fe,pbc:ie,n:be,o:e},we,Te;return t&&([we,Te]=t(Ce)),{render:Se,hydrate:we,createApp:xD(Se,we)}}function CO({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function wO({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function TO(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function EO(e,t,n=!1){let r=e.children,i=t.children;if(M(r)&&M(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=tk(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&EO(t,a)),a.type===PO&&(a.patchFlag===-1&&(a=i[e]=tk(a)),a.el=t.el),a.type===FO&&!a.el&&(a.el=t.el),a.el&&(a.el.__vnode=a)}}function DO(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function OO(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:OO(t)}function kO(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function AO(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?AO(t.subTree):null}var jO=e=>e.__isSuspense;function MO(e,t){t&&t.pendingBranch?M(e)?t.effects.push(...e):t.effects.push(e):CT(e)}var NO=Symbol.for(`v-fgt`),PO=Symbol.for(`v-txt`),FO=Symbol.for(`v-cmt`),IO=Symbol.for(`v-stc`),LO=[],RO=null,zO=1;function BO(e,t=!1){zO+=e,e<0&&RO&&t&&(RO.hasOnce=!0)}function VO(e){return e?e.__v_isVNode===!0:!1}function HO(e,t){if(t.shapeFlag&6&&e.component){let n=jT.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}var UO,WO=(...e)=>YO(...UO?UO(e,rE):e),GO=({key:e})=>e??null,KO=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:bS(e)||Iw(e)||yS(e)?{i:rE,r:e,k:t,f:!!n}:e);function qO(e,t=null,n=null,r=0,i=null,a=e===NO?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&GO(t),ref:t&&KO(t),scopeId:iE,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:rE};return s?(nk(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=bS(n)?8:16),c.key!==c.key&&P(`VNode created with invalid key (NaN). VNode type:`,c.type),zO>0&&!o&&RO&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&RO.push(c),c}var JO=WO;function YO(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===qE)&&(e||P(`Invalid vnode type when creating vnode: ${e}.`),e=FO),VO(e)){let r=ZO(e,t,!0);return n&&nk(r,n),zO>0&&!a&&RO&&(r.shapeFlag&6?RO[RO.indexOf(e)]=r:RO.push(r)),r.patchFlag=-2,r}if(Nk(e)&&(e=e.__vccOpts),t){t=XO(t);let{class:e,style:n}=t;e&&!bS(e)&&(t.class=YS(e)),SS(n)&&(jw(n)&&!M(n)&&(n=fS({},n)),t.style=WS(n))}let o=bS(e)?1:jO(e)?128:yE(e)?64:SS(e)?4:yS(e)?2:0;return o&4&&jw(e)&&(e=Mw(e),P("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
55
- Component that was made reactive: `,e)),qO(e,t,n,r,i,o,a,!0)}function XO(e){return e?jw(e)||HD(e)?fS({},e):e:null}function ZO(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?rk(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&GO(l),ref:t&&t.ref?n&&a?M(a)?a.concat(KO(t)):[a,KO(t)]:KO(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o===-1&&M(s)?s.map(QO):s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==NO?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ZO(e.ssContent),ssFallback:e.ssFallback&&ZO(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&xE(u,c.clone(u)),u}function QO(e){let t=ZO(e);return M(e.children)&&(t.children=e.children.map(QO)),t}function $O(e=` `,t=0){return JO(PO,null,e,t)}function ek(e){return e==null||typeof e==`boolean`?JO(FO):M(e)?JO(NO,null,e.slice()):VO(e)?tk(e):JO(PO,null,String(e))}function tk(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ZO(e)}function nk(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(M(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),nk(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!HD(t)?t._ctx=rE:r===3&&rE&&(rE.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else yS(t)?(t={default:t,_ctx:rE},n=32):(t=String(t),r&64?(n=16,t=[$O(t)]):n=8);e.children=t,e.shapeFlag|=n}function rk(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=YS([t.class,r.class]));else if(e===`style`)t.style=WS([t.style,r.style]);else if(uS(e)){let n=t[e],i=r[e];i&&n!==i&&!(M(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!dS(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ik(e,t,n,r=null){cT(e,t,7,[n,r])}var ak=yD(),ok=0;function sk(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||ak,a={uid:ok++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new lC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:YD(r,i),emitsOptions:ED(r,i),emit:null,emitted:null,propsDefaults:oS,inheritAttrs:r.inheritAttrs,ctx:oS,data:oS,props:oS,attrs:oS,slots:oS,refs:oS,setupState:oS,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx=$E(a),a.root=t?t.root:a,a.emit=wD.bind(null,a),e.ce&&e.ce(a),a}var ck=null,lk=()=>ck||rE,uk,dk;{let e=US(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};uk=t(`__VUE_INSTANCE_SETTERS__`,e=>ck=e),dk=t(`__VUE_SSR_SETTERS__`,e=>_k=e)}var fk=e=>{let t=ck;return uk(e),e.scope.on(),()=>{e.scope.off(),uk(t)}},pk=()=>{ck&&ck.scope.off(),uk(null)},mk=aS(`slot,component`);function hk(e,{isNativeTag:t}){(mk(e)||t(e))&&P(`Do not use built-in or reserved HTML elements as component id: `+e)}function gk(e){return e.vnode.shapeFlag&4}var _k=!1;function vk(e,t=!1,n=!1){t&&dk(t);let{props:r,children:i}=e.vnode,a=gk(e);UD(e,r,a,t),fO(e,i,n||t);let o=a?yk(e,t):void 0;return t&&dk(!1),o}function yk(e,t){let n=e.type;if(n.name&&hk(n.name,e.appContext.config),n.components){let t=Object.keys(n.components);for(let n=0;n<t.length;n++)hk(t[n],e.appContext.config)}if(n.directives){let e=Object.keys(n.directives);for(let t=0;t<e.length;t++)sE(e[t])}n.compilerOptions&&Ck()&&P(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`),e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,QE),eD(e);let{setup:r}=n;if(r){OC();let i=e.setupContext=r.length>1?Dk(e):null,a=fk(e),o=sT(r,e,0,[Ew(e.props),i]),s=CS(o);if(kC(),a(),(s||e.sp)&&!kE(e)&&CE(e),s){if(o.then(pk,pk),t)return o.then(n=>{bk(e,n,t)}).catch(t=>{lT(t,e,0)});e.asyncDep=o,e.suspense||P(`Component <${Mk(e,n)}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}else bk(e,o,t)}else wk(e,t)}function bk(e,t,n){yS(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:SS(t)?(VO(t)&&P(`setup() should not return VNodes directly - return a render function instead.`),e.devtoolsRawSetupState=t,e.setupState=Hw(t),tD(e)):t!==void 0&&P(`setup() should return an object. Received: ${t===null?`null`:typeof t}`),wk(e,n)}var xk,Sk,Ck=()=>!xk;function wk(e,t,n){let r=e.type;if(!e.render){if(!t&&xk&&!r.render){let t=r.template||__VUE_OPTIONS_API__&&lD(e).template;if(t){gO(e,`compile`);let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=xk(t,fS(fS({isCustomElement:n,delimiters:a},i),o)),_O(e,`compile`)}}e.render=r.render||cS,Sk&&Sk(e)}if(__VUE_OPTIONS_API__){let t=fk(e);OC();try{aD(e)}finally{kC(),t()}}!r.render&&e.render===cS&&!t&&(!xk&&r.template?P(`Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`):P(`Component is missing template or render function: `,r))}var Tk={get(e,t){return kD(),zC(e,`get`,``),e[t]},set(){return P(`setupContext.attrs is readonly.`),!1},deleteProperty(){return P(`setupContext.attrs is readonly.`),!1}};function Ek(e){return new Proxy(e.slots,{get(t,n){return zC(e,`get`,`$slots`),t[n]}})}function Dk(e){let t=t=>{if(e.exposed&&P(`expose() should be called only once per setup().`),t!=null){let e=typeof t;e===`object`&&(M(t)?e=`array`:Iw(t)&&(e=`ref`)),e!==`object`&&P(`expose() should be passed a plain object, received ${e}.`)}e.exposed=t||{}};{let n,r;return Object.freeze({get attrs(){return n||=new Proxy(e.attrs,Tk)},get slots(){return r||=Ek(e)},get emit(){return(t,...n)=>e.emit(t,...n)},expose:t})}}function Ok(e){return e.exposed?e.exposeProxy||=new Proxy(Hw(Nw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in YE)return YE[n](e)},has(e,t){return t in e||t in YE}}):e.proxy}var kk=/(?:^|[-_])\w/g,Ak=e=>e.replace(kk,e=>e.toUpperCase()).replace(/[-_]/g,``);function jk(e,t=!0){return yS(e)?e.displayName||e.name:e.name||t&&e.__name}function Mk(e,t,n=!1){let r=jk(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?Ak(r):n?`App`:`Anonymous`}function Nk(e){return yS(e)&&`__vccOpts`in e}var Pk=(e,t)=>{let n=Ww(e,t,_k);{let e=lk();e&&e.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function F(e,t,n){try{BO(-1);let r=arguments.length;return r===2?SS(t)&&!M(t)?VO(t)?JO(e,null,[t]):JO(e,t):JO(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&VO(n)&&(n=[n]),JO(e,t,n))}finally{BO(1)}}function Fk(){if(typeof window>`u`)return;let e={style:`color:#3ba776`},t={style:`color:#1677ff`},n={style:`color:#f5222d`},r={style:`color:#eb2f96`},i={__vue_custom_formatter:!0,header(t){if(!SS(t))return null;if(t.__isVue)return[`div`,e,`VueInstance`];if(Iw(t)){OC();let n=t.value;return kC(),[`div`,{},[`span`,e,u(t)],`<`,s(n),`>`]}else if(Ow(t))return[`div`,{},[`span`,e,Aw(t)?`ShallowReactive`:`Reactive`],`<`,s(t),`>${kw(t)?` (readonly)`:``}`];else if(kw(t))return[`div`,{},[`span`,e,Aw(t)?`ShallowReadonly`:`Readonly`],`<`,s(t),`>`];return null},hasBody(e){return e&&e.__isVue},body(e){if(e&&e.__isVue)return[`div`,{},...a(e.$)]}};function a(e){let t=[];e.type.props&&e.props&&t.push(o(`props`,Mw(e.props))),e.setupState!==oS&&t.push(o(`setup`,e.setupState)),e.data!==oS&&t.push(o(`data`,Mw(e.data)));let n=c(e,`computed`);n&&t.push(o(`computed`,n));let i=c(e,`inject`);return i&&t.push(o(`injected`,i)),t.push([`div`,{},[`span`,{style:r.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:e}]]),t}function o(e,t){return t=fS({},t),Object.keys(t).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},e],[`div`,{style:`padding-left:1.25em`},...Object.keys(t).map(e=>[`div`,{},[`span`,r,e+`: `],s(t[e],!1)])]]:[`span`,{}]}function s(e,i=!0){return typeof e==`number`?[`span`,t,e]:typeof e==`string`?[`span`,n,JSON.stringify(e)]:typeof e==`boolean`?[`span`,r,e]:SS(e)?[`object`,{object:i?Mw(e):e}]:[`span`,n,String(e)]}function c(e,t){let n=e.type;if(yS(n))return;let r={};for(let i in e.ctx)l(n,i,t)&&(r[i]=e.ctx[i]);return r}function l(e,t,n){let r=e[n];if(M(r)&&r.includes(t)||SS(r)&&t in r||e.extends&&l(e.extends,t,n)||e.mixins&&e.mixins.some(e=>l(e,t,n)))return!0}function u(e){return Aw(e)?`ShallowRef`:e.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}var Ik=`3.5.35`,Lk=P,Rk=void 0,zk=typeof window<`u`&&window.trustedTypes;if(zk)try{Rk=zk.createPolicy(`vue`,{createHTML:e=>e})}catch(e){Lk(`Error creating trusted types policy: ${e}`)}var Bk=Rk?e=>Rk.createHTML(e):e=>e,Vk=`http://www.w3.org/2000/svg`,Hk=`http://www.w3.org/1998/Math/MathML`,Uk=typeof document<`u`?document:null,Wk=Uk&&Uk.createElement(`template`),Gk={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Uk.createElementNS(Vk,e):t===`mathml`?Uk.createElementNS(Hk,e):n?Uk.createElement(e,{is:n}):Uk.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Uk.createTextNode(e),createComment:e=>Uk.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Uk.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Wk.innerHTML=Bk(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Wk.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Kk=Symbol(`_vtc`);function qk(e,t,n){let r=e[Kk];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Jk=Symbol(`_vod`),Yk=Symbol(`_vsh`),Xk=Symbol(`CSS_VAR_TEXT`),Zk=/(?:^|;)\s*display\s*:/;function Qk(e,t,n){let r=e.style,i=bS(n),a=!1;if(n&&!i){if(t)if(bS(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??tA(r,t,``)}else for(let e in t)n[e]??tA(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?tA(r,i,``):aA(e,i,!bS(t)&&t?t[i]:void 0,o)||tA(r,i,o)}}else if(i){if(t!==n){let e=r[Xk];e&&(n+=`;`+e),r.cssText=n,a=Zk.test(n)}}else t&&e.removeAttribute(`style`);Jk in e&&(e[Jk]=a?r.display:``,e[Yk]&&(r.display=`none`))}var $k=/[^\\];\s*$/,eA=/\s*!important$/;function tA(e,t,n){if(M(n))n.forEach(n=>tA(e,t,n));else if(n??=``,$k.test(n)&&Lk(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith(`--`))e.setProperty(t,n);else{let r=iA(e,t);eA.test(n)?e.setProperty(FS(r),n.replace(eA,``),`important`):e[r]=n}}var nA=[`Webkit`,`Moz`,`ms`],rA={};function iA(e,t){let n=rA[t];if(n)return n;let r=NS(t);if(r!==`filter`&&r in e)return rA[t]=r;r=IS(r);for(let n=0;n<nA.length;n++){let i=nA[n]+r;if(i in e)return rA[t]=i}return t}function aA(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&bS(r)&&n===r}var oA=`http://www.w3.org/1999/xlink`;function sA(e,t,n,r,i,a=rC(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(oA,t.slice(6,t.length)):e.setAttributeNS(oA,t,n):n==null||a&&!iC(n)?e.removeAttribute(t):e.setAttribute(t,a?``:xS(n)?String(n):n)}function cA(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Bk(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=iC(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch(e){o||Lk(`Failed setting prop "${t}" on <${a.toLowerCase()}>: value ${n} is invalid.`,e)}o&&e.removeAttribute(i||t)}function lA(e,t,n,r){e.addEventListener(t,n,r)}function uA(e,t,n,r){e.removeEventListener(t,n,r)}var dA=Symbol(`_vei`);function fA(e,t,n,r,i=null){let a=e[dA]||(e[dA]={}),o=a[t];if(r&&o)o.value=yA(r,t);else{let[n,s]=mA(t);r?lA(e,n,a[t]=vA(yA(r,t),i),s):o&&(uA(e,n,o,s),a[t]=void 0)}}var pA=/(?:Once|Passive|Capture)$/;function mA(e){let t;if(pA.test(e)){t={};let n;for(;n=e.match(pA);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):FS(e.slice(2)),t]}var hA=0,gA=Promise.resolve(),_A=()=>hA||=(gA.then(()=>hA=0),Date.now());function vA(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(M(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&cT(e,t,5,a)}}else cT(r,t,5,[e])};return n.value=e,n.attached=_A(),n}function yA(e,t){return yS(e)||M(e)?e:(Lk(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
56
- Expected function or array of functions, received type ${typeof e}.`),cS)}var bA=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,xA=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?qk(e,r,o):t===`style`?Qk(e,n,r):uS(t)?dS(t)||fA(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):SA(e,t,r,o))?(cA(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&sA(e,t,r,o,a,t!==`value`)):e._isVueCE&&(CA(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bS(r)))?cA(e,NS(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),sA(e,t,r,o))};function SA(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&bA(t)&&yS(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return bA(t)&&bS(n)?!1:t in e}function CA(e,t){let n=e._def.props;if(!n)return!1;let r=NS(t);return Array.isArray(n)?n.some(e=>NS(e)===r):Object.keys(n).some(e=>NS(e)===r)}var wA=fS({patchProp:xA},Gk),TA;function EA(){return TA||=xO(wA)}var DA=((...e)=>{let t=EA().createApp(...e);kA(t),AA(t);let{mount:n}=t;return t.mount=e=>{let r=jA(e);if(!r)return;let i=t._component;!yS(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,OA(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function OA(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function kA(e){Object.defineProperty(e.config,"isNativeTag",{value:e=>$S(e)||eC(e)||tC(e),writable:!1})}function AA(e){if(Ck()){let t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Lk("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});let n=e.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return Lk(r),n},set(){Lk(r)}})}}function jA(e){if(bS(e)){let t=document.querySelector(e);return t||Lk(`Failed to mount app: mount target selector "${e}" returned null.`),t}return window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode===`closed`&&Lk('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}function MA(){Fk()}MA();function NA({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}NA.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};function PA(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-block`,...t}}),e}var FA=Fv({filterNodes:e=>!Sf(e=>e.type.name===`table`)(e)},`blockConfig`);PA(FA,{displayName:`Ctx<blockConfig>`});function IA(e,t,n){if(!e.dom.parentElement)return null;try{let r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(r==null||r<0)return null;let i=e.state.doc.resolve(r),a=e.state.doc.nodeAt(r),o=e.nodeDOM(r),s=t=>{let r=i.depth>=1&&i.index(i.depth)===0;if(!(t||r))return;let c=i.before(i.depth);a=e.state.doc.nodeAt(c),o=e.nodeDOM(c),i=e.state.doc.resolve(c),n(i,a)||s(!0)};return s(!n(i,a)),!o||!a?null:{node:a,$pos:i,el:o}}catch{return null}}var LA=tf.ie&&tf.ie_version<15||tf.ios&&tf.webkit_version<604,RA=20,zA=class{constructor(){this.#t=()=>{if(!this.#r)return null;let e=this.#r,t=this.#s;if(t&&k.isSelectable(e.node)){let n=k.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),this.#n=n,n}return null},this.#n=null,this.#r=null,this.#i=void 0,this.#a=!1,this.#l=()=>{this.#c?.({type:`hide`}),this.#r=null},this.#u=e=>{this.#r=e,this.#c?.({type:`show`,active:e})},this.bind=(e,t)=>{this.#e=e,this.#c=t},this.addEvent=e=>{e.addEventListener(`mousedown`,this.#d),e.addEventListener(`mouseup`,this.#f),e.addEventListener(`dragstart`,this.#p),e.addEventListener(`dragend`,this.#m)},this.removeEvent=e=>{e.removeEventListener(`mousedown`,this.#d),e.removeEventListener(`mouseup`,this.#f),e.removeEventListener(`dragstart`,this.#p),e.removeEventListener(`dragend`,this.#m)},this.unBind=()=>{this.#c=void 0},this.#d=()=>{this.#i=this.#r?.el.getBoundingClientRect(),this.#t()},this.#f=()=>{if(!this.#a){requestAnimationFrame(()=>{this.#i&&this.#s?.focus()});return}this.#a=!1,this.#n=null},this.#p=e=>{this.#a=!0;let t=this.#s;if(!t)return;t.dom.dataset.dragging=`true`;let n=this.#n;if(e.dataTransfer&&n){let r=n.content();e.dataTransfer.effectAllowed=`copyMove`;let{dom:i,text:a}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData(LA?`Text`:`text/html`,i.innerHTML),LA||e.dataTransfer.setData(`text/plain`,a);let o=this.#r?.el;o&&e.dataTransfer.setDragImage(o,0,0),t.dragging={slice:r,move:!0}}},this.#m=()=>{this.#s&&this.#g(this.#s)},this.keydownCallback=e=>(this.#l(),this.#a=!1,e.dom.dataset.dragging=`false`,!1),this.#h=sa((e,t)=>{if(!e.editable)return;let n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){this.#l();return}let i=this.#o;if(!i)return;let a=IA(e,{x:r,y:t.clientY},i);if(!a){this.#l();return}this.#u(a)},200),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||this.#h(e,t),!1),this.dragoverCallback=(e,t)=>{if(this.#a){let n=this.#s?.dom.parentElement;if(!n)return!1;let r=n.scrollHeight>n.clientHeight,i=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&Math.abs(t.y-i.y)<RA)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;let r=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+i.height)<r&&Math.abs(t.y-(i.height+i.y))<RA)return n.scrollTop+=10,!1}}return!1},this.dragenterCallback=e=>{e.dragging&&(this.#a=!0,e.dom.dataset.dragging=`true`)},this.dragleaveCallback=(e,t)=>{let n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(this.#r=null,this.#g(e))},this.dropCallback=e=>(this.#g(e),!1),this.dragendCallback=e=>{this.#g(e)},this.#g=e=>{this.#a=!1,e.dom.dataset.dragging=`false`}}#e;#t;#n;#r;#i;#a;get#o(){try{return this.#e?.get(FA.key).filterNodes}catch{return}}get#s(){return this.#e?.get(m_)}#c;#l;#u;#d;#f;#p;#m;#h;#g},BA=Fv(()=>new zA,`blockService`),VA=Fv({},`blockServiceInstance`);PA(BA,{displayName:`Ctx<blockService>`}),PA(VA,{displayName:`Ctx<blockServiceInstance>`});var HA=Fv({},`blockSpec`);PA(HA,{displayName:`Ctx<blockSpec>`});var UA=Mv(e=>{let t=new Ju(`MILKDOWN_BLOCK`),n=e.get(BA.key)();e.set(VA.key,n);let r=e.get(HA.key);return new Gu({key:t,...r,props:{...r.props,handleDOMEvents:{drop:e=>n.dropCallback(e),pointermove:(e,t)=>n.mousemoveCallback(e,t),keydown:e=>n.keydownCallback(e),dragover:(e,t)=>n.dragoverCallback(e,t),dragleave:(e,t)=>n.dragleaveCallback(e,t),dragenter:e=>n.dragenterCallback(e),dragend:e=>n.dragendCallback(e)}}})});PA(UA,{displayName:`Prose<block>`});var WA=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;get active(){return this.#r}constructor(e){this.#r=null,this.#a=!1,this.update=()=>{requestAnimationFrame(()=>{if(!this.#a)try{this.#d(),this.#a=!0}catch{}})},this.destroy=()=>{this.#n?.unBind(),this.#n?.removeEvent(this.#e),this.#e.remove()},this.show=e=>{let t=e.el,n=this.#t.get(m_).dom,r={ctx:this.#t,active:e,editorDom:n,blockDom:this.#e},i={contextElement:t,getBoundingClientRect:()=>this.#l?this.#l(r):t.getBoundingClientRect()},a=[o()];if(this.#c){let e=l(this.#c(r));a.push(e)}c(i,this.#e,{placement:this.#u?this.#u(r):`left`,middleware:[...a,...this.#o],...this.#s}).then(({x:e,y:t})=>{Object.assign(this.#e.style,{left:`${e}px`,top:`${t}px`}),this.#e.dataset.show=`true`}).catch(console.error)},this.hide=()=>{this.#e.dataset.show=`false`},this.#t=e.ctx,this.#e=e.content,this.#c=e.getOffset,this.#l=e.getPosition,this.#u=e.getPlacement,this.#o=e.middleware??[],this.#s=e.floatingUIOptions??{},this.#i=e.root,this.hide()}#d(){let e=this.#t.get(m_);(this.#i??e.dom.parentElement??document.body).appendChild(this.#e);let t=this.#t.get(VA.key);t.bind(this.#t,e=>{e.type===`hide`?(this.hide(),this.#r=null):e.type===`show`&&(this.show(e.active),this.#r=e.active)}),this.#n=t,this.#n.addEvent(this.#e),this.#e.draggable=!0}},GA=[HA,FA,BA,VA,UA];GA.key=HA.key,GA.pluginKey=UA.key;function KA(e,t){return function(n,r){let{$from:i,$to:a,node:o}=n.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(a))return!1;let s=i.node(-1);if(s.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let t=E.empty,a=i.index(-1)?1:i.index(-2)?2:3;for(let e=i.depth-a;e>=i.depth-3;e--)t=E.from(i.node(e).copy(t));let o=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;t=t.append(E.from(e.createAndFill()));let s=i.before(i.depth-(a-1)),c=n.tr.replace(s,i.after(-o),new D(t,4-a,0)),l=-1;c.doc.nodesBetween(s,c.doc.content.size,(e,t)=>{if(l>-1)return!1;e.isTextblock&&e.content.size==0&&(l=t+1)}),l>-1&&c.setSelection(Tu.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let c=a.pos==i.end()?s.contentMatchAt(0).defaultType:null,l=n.tr.delete(i.pos,a.pos),u=c?[t?{type:e,attrs:t}:null,{type:c}]:void 0;return Zl(l.doc,i.pos,2,u)?(r&&r(l.split(i.pos,2,u).scrollIntoView()),!0):!1}}function qA(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?JA(t,n,e,a):YA(t,n,a):!0:!1}}function JA(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Nl(a-1,o,a,o,new D(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new mc(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=zl(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return $l(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function YA(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?E.empty:E.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Nl(d-+!!s,f+ +!!c,d+1,f-1,new D((s?E.empty:E.from(i.copy(E.empty))).append(c?E.empty:E.from(i.copy(E.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function XA(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=E.from(r?e.create():null),o=new D(E.from(e.create(null,E.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Nl(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}function ZA(e){let t=new Map;if(!e||!e.type)throw Error(`mdast-util-definitions expected node`);return yt(e,`definition`,function(e){let n=QA(e.identifier);n&&!t.get(n)&&t.set(n,e)}),n;function n(e){let n=QA(e);return t.get(n)}}function QA(e){return String(e||``).toUpperCase()}function $A(){return function(e){let t=ZA(e);yt(e,function(e,n,r){if(e.type===`definition`&&r!==void 0&&typeof n==`number`)return r.children.splice(n,1),[ht,n];if(e.type===`imageReference`||e.type===`linkReference`){let i=t(e.identifier);if(i&&r&&typeof n==`number`)return r.children[n]=e.type===`imageReference`?{type:`image`,url:i.url,title:i.title,alt:e.alt}:{type:`link`,url:i.url,title:i.title,children:e.children},[ht,n]}})}}function ej(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name===`hardbreak`)){e.next(t.content);return}let n=[];t.content.forEach((e,r,i)=>{i!==t.childCount-1&&n.push(e)}),e.next(E.fromArray(n))}function I(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-commonmark`,...t}}),e}var tj=Bv(`emphasis`);I(tj,{displayName:`Attr<emphasis>`,group:`Emphasis`});var nj=Lv(`emphasis`,e=>({attrs:{marker:{default:e.get(w_).emphasis||`*`,validate:`string`}},parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style`,getAttrs:e=>e===`italic`}],toDOM:t=>[`em`,e.get(tj.key)(t)],parseMarkdown:{match:e=>e.type===`emphasis`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`emphasis`,runner:(e,t)=>{e.withMark(t,`emphasis`,void 0,{marker:t.attrs.marker})}}}));I(nj.mark,{displayName:`MarkSchema<emphasis>`,group:`Emphasis`}),I(nj.ctx,{displayName:`MarkSchemaCtx<emphasis>`,group:`Emphasis`});var rj=j(`ToggleEmphasis`,e=>()=>wd(nj.type(e)));I(rj,{displayName:`Command<toggleEmphasisCommand>`,group:`Emphasis`});var ij=Ov(e=>of(/(?:^|[^*])\*([^*]+)\*$/,nj.type(e),{getAttr:()=>({marker:`*`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`*`)?{}:{fullMatch:e.slice(1),start:t+1}}));I(ij,{displayName:`InputRule<emphasis>|Star`,group:`Emphasis`});var aj=Ov(e=>of(/\b_(?![_\s])(.*?[^_\s])_\b/,nj.type(e),{getAttr:()=>({marker:`_`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`_`)?{}:{fullMatch:e.slice(1),start:t+1}}));I(aj,{displayName:`InputRule<emphasis>|Underscore`,group:`Emphasis`});var oj=Rv(`emphasisKeymap`,{ToggleEmphasis:{shortcuts:`Mod-i`,command:e=>{let t=e.get(A);return()=>t.call(rj.key)}}});I(oj.ctx,{displayName:`KeymapCtx<emphasis>`,group:`Emphasis`}),I(oj.shortcuts,{displayName:`Keymap<emphasis>`,group:`Emphasis`});var sj=Bv(`strong`);I(sj,{displayName:`Attr<strong>`,group:`Strong`});var cj=Lv(`strong`,e=>({attrs:{marker:{default:e.get(w_).strong||`*`,validate:`string`}},parseDOM:[{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{tag:`strong`},{style:`font-style`,getAttrs:e=>e===`bold`},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:t=>[`strong`,e.get(sj.key)(t)],parseMarkdown:{match:e=>e.type===`strong`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strong`,runner:(e,t)=>{e.withMark(t,`strong`,void 0,{marker:t.attrs.marker})}}}));I(cj.mark,{displayName:`MarkSchema<strong>`,group:`Strong`}),I(cj.ctx,{displayName:`MarkSchemaCtx<strong>`,group:`Strong`});var lj=j(`ToggleStrong`,e=>()=>wd(cj.type(e)));I(lj,{displayName:`Command<toggleStrongCommand>`,group:`Strong`});var uj=Ov(e=>of(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,cj.type(e),{getAttr:e=>({marker:e[0].startsWith(`*`)?`*`:`_`})}));I(uj,{displayName:`InputRule<strong>`,group:`Strong`});var dj=Rv(`strongKeymap`,{ToggleBold:{shortcuts:[`Mod-b`],command:e=>{let t=e.get(A);return()=>t.call(lj.key)}}});I(dj.ctx,{displayName:`KeymapCtx<strong>`,group:`Strong`}),I(dj.shortcuts,{displayName:`Keymap<strong>`,group:`Strong`});var fj=Bv(`inlineCode`);I(fj,{displayName:`Attr<inlineCode>`,group:`InlineCode`});var pj=Lv(`inlineCode`,e=>({priority:100,code:!0,parseDOM:[{tag:`code`}],toDOM:t=>[`code`,e.get(fj.key)(t)],parseMarkdown:{match:e=>e.type===`inlineCode`,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`inlineCode`,runner:(e,t,n)=>(e.withMark(t,`inlineCode`,n.text||``),!0)}}));I(pj.mark,{displayName:`MarkSchema<inlineCode>`,group:`InlineCode`}),I(pj.ctx,{displayName:`MarkSchemaCtx<inlineCode>`,group:`InlineCode`});var mj=j(`ToggleInlineCode`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(r.empty)return!1;let{from:a,to:o}=r;return t.doc.rangeHasMark(a,o,pj.type(e))?(n?.(i.removeMark(a,o,pj.type(e))),!0):(Object.keys(t.schema.marks).filter(e=>e!==pj.type.name).map(e=>t.schema.marks[e]).forEach(e=>{i.removeMark(a,o,e)}),n?.(i.addMark(a,o,pj.type(e).create())),!0)});I(mj,{displayName:`Command<toggleInlineCodeCommand>`,group:`InlineCode`});var hj=Ov(e=>of(/(?:`)([^`]+)(?:`)$/,pj.type(e)));I(hj,{displayName:`InputRule<inlineCodeInputRule>`,group:`InlineCode`});var gj=Rv(`inlineCodeKeymap`,{ToggleInlineCode:{shortcuts:`Mod-e`,command:e=>{let t=e.get(A);return()=>t.call(mj.key)}}});I(gj.ctx,{displayName:`KeymapCtx<inlineCode>`,group:`InlineCode`}),I(gj.shortcuts,{displayName:`Keymap<inlineCode>`,group:`InlineCode`});var _j=Bv(`link`);I(_j,{displayName:`Attr<link>`,group:`Link`});var vj=Lv(`link`,e=>({attrs:{href:{validate:`string`},title:{default:null,validate:`string|null`}},parseDOM:[{tag:`a[href]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM:t=>[`a`,{...e.get(_j.key)(t),...t.attrs}],parseMarkdown:{match:e=>e.type===`link`,runner:(e,t,n)=>{let r=t.url,i=t.title;e.openMark(n,{href:r,title:i}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`link`,runner:(e,t)=>{e.withMark(t,`link`,void 0,{title:t.attrs.title,url:t.attrs.href})}}}));I(vj.mark,{displayName:`MarkSchema<link>`,group:`Link`});var yj=j(`ToggleLink`,e=>(t={})=>wd(vj.type(e),t));I(yj,{displayName:`Command<toggleLinkCommand>`,group:`Link`});var bj=j(`UpdateLink`,e=>(t={})=>(n,r)=>{if(!r)return!1;let i,a=-1,{selection:o}=n,{from:s,to:c}=o;if(n.doc.nodesBetween(s,s===c?c+1:c,(t,n)=>{if(vj.type(e).isInSet(t.marks))return i=t,a=n,!1}),!i)return!1;let l=i.marks.find(({type:t})=>t===vj.type(e));if(!l)return!1;let u=a,d=a+i.nodeSize,{tr:f}=n,p=vj.type(e).create({...l.attrs,...t});return p?(r(f.removeMark(u,d,l).addMark(u,d,p).setSelection(new O(f.selection.$anchor)).scrollIntoView()),!0):!1});I(bj,{displayName:`Command<updateLinkCommand>`,group:`Link`});var xj=jv(`doc`,()=>({content:`block+`,parseMarkdown:{match:({type:e})=>e===`root`,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name===`doc`,runner:(e,t)=>{e.openNode(`root`),e.next(t.content)}}}));I(xj,{displayName:`NodeSchema<doc>`,group:`Doc`});function Sj(e){return _t(e,e=>e.type===`html`&&[`<br />`,`<br>`,`<br >`,`<br/>`].includes(e.value?.trim()),(e,t)=>{if(!t.length)return;let n=t[t.length-1];if(!n)return;let r=n.children.indexOf(e);r!==-1&&n.children.splice(r,1)},!0)}var Cj=Vv(`remark-preserve-empty-line`,()=>()=>Sj);I(Cj.plugin,{displayName:`Remark<remarkPreserveEmptyLine>`,group:`Remark`}),I(Cj.options,{displayName:`RemarkConfig<remarkPreserveEmptyLine>`,group:`Remark`});var wj=zv(`paragraph`);I(wj,{displayName:`Attr<paragraph>`,group:`Paragraph`});var Tj=Iv(`paragraph`,e=>({content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM:t=>[`p`,e.get(wj.key)(t),0],parseMarkdown:{match:e=>e.type===`paragraph`,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||``),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`paragraph`,runner:(t,n)=>{let r=e.get(m_).state?.doc.lastChild;t.openNode(`paragraph`),(!n.content||n.content.size===0)&&n!==r&&Ej(e)?t.addNode(`html`,void 0,`<br />`):ej(t,n),t.closeNode()}}}));function Ej(e){let t=!1;try{e.get(Cj.id),t=!0}catch{t=!1}return t}I(Tj.node,{displayName:`NodeSchema<paragraph>`,group:`Paragraph`}),I(Tj.ctx,{displayName:`NodeSchemaCtx<paragraph>`,group:`Paragraph`});var Dj=j(`TurnIntoText`,e=>()=>xd(Tj.type(e)));I(Dj,{displayName:`Command<turnIntoTextCommand>`,group:`Paragraph`});var Oj=Rv(`paragraphKeymap`,{TurnIntoText:{shortcuts:`Mod-Alt-0`,command:e=>{let t=e.get(A);return()=>t.call(Dj.key)}}});I(Oj.ctx,{displayName:`KeymapCtx<paragraph>`,group:`Paragraph`}),I(Oj.shortcuts,{displayName:`Keymap<paragraph>`,group:`Paragraph`});var kj=[,,,,,,].fill(0).map((e,t)=>t+1);function Aj(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,`-`)}var jj=Fv(Aj,`headingIdGenerator`);I(jj,{displayName:`Ctx<HeadingIdGenerator>`,group:`Heading`});var Mj=zv(`heading`);I(Mj,{displayName:`Attr<heading>`,group:`Heading`});var Nj=Iv(`heading`,e=>{let t=e.get(jj.key);return{content:`inline*`,group:`block`,defining:!0,attrs:{id:{default:``,validate:`string`},level:{default:1,validate:`number`}},parseDOM:kj.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw Va(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(Mj.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>e===`heading`,runner:(e,t,n)=>{let r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`heading`,runner:(e,t)=>{e.openNode(`heading`,void 0,{depth:t.attrs.level}),ej(e,t),e.closeNode()}}}});I(Nj.node,{displayName:`NodeSchema<heading>`,group:`Heading`}),I(Nj.ctx,{displayName:`NodeSchemaCtx<heading>`,group:`Heading`});var Pj=Ov(e=>Fd(/^(?<hashes>#+)\s$/,Nj.type(e),t=>{let n=t.groups?.hashes?.length||0,{$from:r}=e.get(m_).state.selection,i=r.node();if(i.type.name===`heading`){let e=Number(i.attrs.level)+Number(n);return e>6&&(e=6),{level:e}}return{level:n}}));I(Pj,{displayName:`InputRule<wrapInHeadingInputRule>`,group:`Heading`});var Fj=j(`WrapInHeading`,e=>t=>(t??=1,t<1?xd(Tj.type(e)):xd(Nj.type(e),{level:t})));I(Fj,{displayName:`Command<wrapInHeadingCommand>`,group:`Heading`});var Ij=j(`DowngradeHeading`,e=>()=>(t,n,r)=>{let{$from:i}=t.selection,a=i.node();if(a.type!==Nj.type(e)||!t.selection.empty||i.parentOffset!==0)return!1;let o=a.attrs.level-1;return o?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...a.attrs,level:o})),!0):xd(Tj.type(e))(t,n,r)});I(Ij,{displayName:`Command<downgradeHeadingCommand>`,group:`Heading`});var Lj=Rv(`headingKeymap`,{TurnIntoH1:{shortcuts:`Mod-Alt-1`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,1)}},TurnIntoH2:{shortcuts:`Mod-Alt-2`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,2)}},TurnIntoH3:{shortcuts:`Mod-Alt-3`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,3)}},TurnIntoH4:{shortcuts:`Mod-Alt-4`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,4)}},TurnIntoH5:{shortcuts:`Mod-Alt-5`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,5)}},TurnIntoH6:{shortcuts:`Mod-Alt-6`,command:e=>{let t=e.get(A);return()=>t.call(Fj.key,6)}},DowngradeHeading:{shortcuts:[`Delete`,`Backspace`],command:e=>{let t=e.get(A);return()=>t.call(Ij.key)}}});I(Lj.ctx,{displayName:`KeymapCtx<heading>`,group:`Heading`}),I(Lj.shortcuts,{displayName:`Keymap<heading>`,group:`Heading`});var Rj=zv(`blockquote`);I(Rj,{displayName:`Attr<blockquote>`,group:`Blockquote`});var zj=Iv(`blockquote`,e=>({content:`block+`,group:`block`,defining:!0,parseDOM:[{tag:`blockquote`}],toDOM:t=>[`blockquote`,e.get(Rj.key)(t),0],parseMarkdown:{match:({type:e})=>e===`blockquote`,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`blockquote`,runner:(e,t)=>{e.openNode(`blockquote`).next(t.content).closeNode()}}}));I(zj.node,{displayName:`NodeSchema<blockquote>`,group:`Blockquote`}),I(zj.ctx,{displayName:`NodeSchemaCtx<blockquote>`,group:`Blockquote`});var Bj=Ov(e=>Pd(/^\s*>\s$/,zj.type(e)));I(Bj,{displayName:`InputRule<wrapInBlockquoteInputRule>`,group:`Blockquote`});var Vj=j(`WrapInBlockquote`,e=>()=>bd(zj.type(e)));I(Vj,{displayName:`Command<wrapInBlockquoteCommand>`,group:`Blockquote`});var Hj=Rv(`blockquoteKeymap`,{WrapInBlockquote:{shortcuts:`Mod-Shift-b`,command:e=>{let t=e.get(A);return()=>t.call(Vj.key)}}});I(Hj.ctx,{displayName:`KeymapCtx<blockquote>`,group:`Blockquote`}),I(Hj.shortcuts,{displayName:`Keymap<blockquote>`,group:`Blockquote`});var Uj=zv(`codeBlock`,()=>({pre:{},code:{}}));I(Uj,{displayName:`Attr<codeBlock>`,group:`CodeBlock`});var Wj=Iv(`code_block`,e=>({content:`text*`,group:`block`,marks:``,defining:!0,code:!0,attrs:{language:{default:``,validate:`string`}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{language:e.dataset.language}}}],toDOM:t=>{let n=e.get(Uj.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return[`pre`,{...n.pre,...i},[`code`,n.code,0]]},parseMarkdown:{match:({type:e})=>e===`code`,runner:(e,t,n)=>{let r=t.lang??``,i=t.value;e.openNode(n,{language:r}),i&&e.addText(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`code_block`,runner:(e,t)=>{e.addNode(`code`,void 0,t.content.firstChild?.text||``,{lang:t.attrs.language})}}}));I(Wj.node,{displayName:`NodeSchema<codeBlock>`,group:`CodeBlock`}),I(Wj.ctx,{displayName:`NodeSchemaCtx<codeBlock>`,group:`CodeBlock`});var Gj=Ov(e=>Fd(/^```(?<language>[a-z]*)?[\s\n]$/,Wj.type(e),e=>({language:e.groups?.language??``})));I(Gj,{displayName:`InputRule<createCodeBlockInputRule>`,group:`CodeBlock`});var Kj=j(`CreateCodeBlock`,e=>(t=``)=>xd(Wj.type(e),{language:t}));I(Kj,{displayName:`Command<createCodeBlockCommand>`,group:`CodeBlock`}),I(j(`UpdateCodeBlockLanguage`,()=>({pos:e,language:t}={pos:-1,language:``})=>(n,r)=>e>=0?(r?.(n.tr.setNodeAttribute(e,`language`,t)),!0):!1),{displayName:`Command<updateCodeBlockLanguageCommand>`,group:`CodeBlock`});var qj=Rv(`codeBlockKeymap`,{CreateCodeBlock:{shortcuts:`Mod-Alt-c`,command:e=>{let t=e.get(A);return()=>t.call(Kj.key)}}});I(qj.ctx,{displayName:`KeymapCtx<codeBlock>`,group:`CodeBlock`}),I(qj.shortcuts,{displayName:`Keymap<codeBlock>`,group:`CodeBlock`});var Jj=zv(`image`);I(Jj,{displayName:`Attr<image>`,group:`Image`});var Yj=Iv(`image`,e=>({inline:!0,group:`inline`,selectable:!0,draggable:!0,marks:``,atom:!0,defining:!0,isolating:!0,attrs:{src:{default:``,validate:`string`},alt:{default:``,validate:`string`},title:{default:``,validate:`string`}},parseDOM:[{tag:`img[src]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{src:e.getAttribute(`src`)||``,alt:e.getAttribute(`alt`)||``,title:e.getAttribute(`title`)||e.getAttribute(`alt`)||``}}}],toDOM:t=>[`img`,{...e.get(Jj.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>e===`image`,runner:(e,t,n)=>{let r=t.url,i=t.alt,a=t.title;e.addNode(n,{src:r,alt:i,title:a})}},toMarkdown:{match:e=>e.type.name===`image`,runner:(e,t)=>{e.addNode(`image`,void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));I(Yj.node,{displayName:`NodeSchema<image>`,group:`Image`}),I(Yj.ctx,{displayName:`NodeSchemaCtx<image>`,group:`Image`});var Xj=j(`InsertImage`,e=>(t={})=>(n,r)=>{if(!r)return!0;let{src:i=``,alt:a=``,title:o=``}=t,s=Yj.type(e).create({src:i,alt:a,title:o});return s&&r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0});I(Xj,{displayName:`Command<insertImageCommand>`,group:`Image`});var Zj=j(`UpdateImage`,e=>(t={})=>(n,r)=>{let i=Df(n.selection,Yj.type(e));if(!i)return!1;let{node:a,pos:o}=i,s={...a.attrs},{src:c,alt:l,title:u}=t;return c!==void 0&&(s.src=c),l!==void 0&&(s.alt=l),u!==void 0&&(s.title=u),r?.(n.tr.setNodeMarkup(o,void 0,s).scrollIntoView()),!0});I(Zj,{displayName:`Command<updateImageCommand>`,group:`Image`}),I(Ov(e=>new jd(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{let[a,o,s=``,c]=n;return a?t.tr.replaceWith(r,i,Yj.type(e).create({src:s,alt:o,title:c})):null})),{displayName:`InputRule<insertImageInputRule>`,group:`Image`});var Qj=zv(`hardbreak`,e=>({"data-type":`hardbreak`,"data-is-inline":e.attrs.isInline}));I(Qj,{displayName:`Attr<hardbreak>`,group:`Hardbreak`});var $j=Iv(`hardbreak`,e=>({inline:!0,group:`inline`,attrs:{isInline:{default:!1,validate:`boolean`}},selectable:!1,parseDOM:[{tag:`br`},{tag:`span[data-type="hardbreak"]`,getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?[`span`,e.get(Qj.key)(t),` `]:[`br`,e.get(Qj.key)(t)],parseMarkdown:{match:({type:e})=>e===`break`,runner:(e,t,n)=>{e.addNode(n,{isInline:!!t.data?.isInline})}},leafText:()=>`
57
- `,toMarkdown:{match:e=>e.type.name===`hardbreak`,runner:(e,t)=>{t.attrs.isInline?e.addNode(`text`,void 0,`
58
- `):e.addNode(`break`)}}}));I($j.node,{displayName:`NodeSchema<hardbreak>`,group:`Hardbreak`}),I($j.ctx,{displayName:`NodeSchemaCtx<hardbreak>`,group:`Hardbreak`});var eM=j(`InsertHardbreak`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(!(r instanceof O))return!1;if(r.empty){let e=r.$from.node();if(e.childCount>0&&e.lastChild?.type.name===`hardbreak`)return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node(`paragraph`)).setSelection(Tu.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta(`hardbreak`,!0).replaceSelectionWith($j.type(e).create()).scrollIntoView()),!0});I(eM,{displayName:`Command<insertHardbreakCommand>`,group:`Hardbreak`});var tM=Rv(`hardbreakKeymap`,{InsertHardbreak:{shortcuts:`Shift-Enter`,command:e=>{let t=e.get(A);return()=>t.call(eM.key)}}});I(tM.ctx,{displayName:`KeymapCtx<hardbreak>`,group:`Hardbreak`}),I(tM.shortcuts,{displayName:`Keymap<hardbreak>`,group:`Hardbreak`});var nM=zv(`hr`);I(nM,{displayName:`Attr<hr>`,group:`Hr`});var rM=Iv(`hr`,e=>({group:`block`,parseDOM:[{tag:`hr`}],toDOM:t=>[`hr`,e.get(nM.key)(t)],parseMarkdown:{match:({type:e})=>e===`thematicBreak`,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>e.type.name===`hr`,runner:e=>{e.addNode(`thematicBreak`)}}}));I(rM.node,{displayName:`NodeSchema<hr>`,group:`Hr`}),I(rM.ctx,{displayName:`NodeSchemaCtx<hr>`,group:`Hr`});var iM=Ov(e=>new jd(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{let{tr:a}=t;return n[0]&&a.replaceWith(r-1,i,rM.type(e).create()),a}));I(iM,{displayName:`InputRule<insertHrInputRule>`,group:`Hr`});var aM=j(`InsertHr`,e=>()=>(t,n)=>{if(!n)return!0;let r=Tj.node.type(e).create(),{tr:i,selection:a}=t,{from:o}=a,s=rM.type(e).create();if(!s)return!0;let c=i.replaceSelectionWith(s).insert(o,r),l=Tu.findFrom(c.doc.resolve(o),1,!0);return l&&n(c.setSelection(l).scrollIntoView()),!0});I(aM,{displayName:`Command<insertHrCommand>`,group:`Hr`});var oM=zv(`bulletList`);I(oM,{displayName:`Attr<bulletList>`,group:`BulletList`});var sM=Iv(`bullet_list`,e=>({content:`listItem+`,group:`block`,attrs:{spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ul`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{spread:e.dataset.spread===`true`}}}],toDOM:t=>[`ul`,{...e.get(oM.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!t,runner:(e,t,n)=>{let r=t.spread==null?`false`:`${t.spread}`;e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`bullet_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));I(sM.node,{displayName:`NodeSchema<bulletList>`,group:`BulletList`}),I(sM.ctx,{displayName:`NodeSchemaCtx<bulletList>`,group:`BulletList`});var cM=Ov(e=>Pd(/^\s*([-+*])\s$/,sM.type(e)));I(cM,{displayName:`InputRule<wrapInBulletListInputRule>`,group:`BulletList`});var lM=j(`WrapInBulletList`,e=>()=>bd(sM.type(e)));I(lM,{displayName:`Command<wrapInBulletListCommand>`,group:`BulletList`});var uM=Rv(`bulletListKeymap`,{WrapInBulletList:{shortcuts:`Mod-Alt-8`,command:e=>{let t=e.get(A);return()=>t.call(lM.key)}}});I(uM.ctx,{displayName:`KeymapCtx<bulletListKeymap>`,group:`BulletList`}),I(uM.shortcuts,{displayName:`Keymap<bulletListKeymap>`,group:`BulletList`});var dM=zv(`orderedList`);I(dM,{displayName:`Attr<orderedList>`,group:`OrderedList`});var fM=Iv(`ordered_list`,e=>({content:`listItem+`,group:`block`,attrs:{order:{default:1,validate:`number`},spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ol`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{spread:e.dataset.spread,order:e.hasAttribute(`start`)?Number(e.getAttribute(`start`)):1}}}],toDOM:t=>[`ol`,{...e.get(dM.key)(t),...t.attrs.order===1?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!!t,runner:(e,t,n)=>{let r=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{spread:r,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`ordered_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!0,start:t.attrs.order??1,spread:t.attrs.spread===`true`}),e.next(t.content),e.closeNode()}}}));I(fM.node,{displayName:`NodeSchema<orderedList>`,group:`OrderedList`}),I(fM.ctx,{displayName:`NodeSchemaCtx<orderedList>`,group:`OrderedList`});var pM=Ov(e=>Pd(/^\s*(\d+)\.\s$/,fM.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));I(pM,{displayName:`InputRule<wrapInOrderedListInputRule>`,group:`OrderedList`});var mM=j(`WrapInOrderedList`,e=>()=>bd(fM.type(e)));I(mM,{displayName:`Command<wrapInOrderedListCommand>`,group:`OrderedList`});var hM=Rv(`orderedListKeymap`,{WrapInOrderedList:{shortcuts:`Mod-Alt-7`,command:e=>{let t=e.get(A);return()=>t.call(mM.key)}}});I(hM.ctx,{displayName:`KeymapCtx<orderedList>`,group:`OrderedList`}),I(hM.shortcuts,{displayName:`Keymap<orderedList>`,group:`OrderedList`});var gM=zv(`listItem`);I(gM,{displayName:`Attr<listItem>`,group:`ListItem`});var _M=Iv(`list_item`,e=>({group:`listItem`,content:`paragraph block*`,attrs:{label:{default:`•`,validate:`string`},listType:{default:`bullet`,validate:`string`},spread:{default:!0,validate:`boolean`}},defining:!0,parseDOM:[{tag:`li`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread===`true`}}}],toDOM:t=>[`li`,{...e.get(gM.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,n)=>{let r=t.label==null?`•`:`${t.label}.`,i=t.label==null?`bullet`:`ordered`,a=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{label:r,listType:i,spread:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{e.openNode(`listItem`,void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));I(_M.node,{displayName:`NodeSchema<listItem>`,group:`ListItem`}),I(_M.ctx,{displayName:`NodeSchemaCtx<listItem>`,group:`ListItem`});var vM=j(`SinkListItem`,e=>()=>XA(_M.type(e)));I(vM,{displayName:`Command<sinkListItemCommand>`,group:`ListItem`});var yM=j(`LiftListItem`,e=>()=>qA(_M.type(e)));I(yM,{displayName:`Command<liftListItemCommand>`,group:`ListItem`});var bM=j(`SplitListItem`,e=>()=>KA(_M.type(e)));I(bM,{displayName:`Command<splitListItemCommand>`,group:`ListItem`});function xM(e){return(t,n,r)=>{let{selection:i}=t;if(!(i instanceof O))return!1;let{empty:a,$from:o}=i;return!a||o.parentOffset!==0||o.node(-1).type!==_M.type(e)?!1:Zu(t,n,r)}}var SM=j(`LiftFirstListItem`,e=>()=>xM(e));I(SM,{displayName:`Command<liftFirstListItemCommand>`,group:`ListItem`});var CM=Rv(`listItemKeymap`,{NextListItem:{shortcuts:`Enter`,command:e=>{let t=e.get(A);return()=>t.call(bM.key)}},SinkListItem:{shortcuts:[`Tab`,`Mod-]`],command:e=>{let t=e.get(A);return()=>t.call(vM.key)}},LiftListItem:{shortcuts:[`Shift-Tab`,`Mod-[`],command:e=>{let t=e.get(A);return()=>t.call(yM.key)}},LiftFirstListItem:{shortcuts:[`Backspace`,`Delete`],command:e=>{let t=e.get(A);return()=>t.call(SM.key)}}});I(CM.ctx,{displayName:`KeymapCtx<listItem>`,group:`ListItem`}),I(CM.shortcuts,{displayName:`Keymap<listItem>`,group:`ListItem`});var wM=jv(`text`,()=>({group:`inline`,parseMarkdown:{match:({type:e})=>e===`text`,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name===`text`,runner:(e,t)=>{e.addNode(`text`,void 0,t.text)}}}));I(wM,{displayName:`NodeSchema<text>`,group:`Text`});var TM=zv(`html`);I(TM,{displayName:`Attr<html>`,group:`Html`});var EM=Iv(`html`,e=>({atom:!0,group:`inline`,inline:!0,attrs:{value:{default:``,validate:`string`}},toDOM:t=>{let n=document.createElement(`span`),r={...e.get(TM.key)(t),"data-value":t.attrs.value,"data-type":`html`};return n.textContent=t.attrs.value,[`span`,r,t.attrs.value]},parseDOM:[{tag:`span[data-type="html"]`,getAttrs:e=>({value:e.dataset.value??``})}],parseMarkdown:{match:({type:e})=>e===`html`,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===`html`,runner:(e,t)=>{e.addNode(`html`,void 0,t.attrs.value)}}}));I(EM.node,{displayName:`NodeSchema<html>`,group:`Html`}),I(EM.ctx,{displayName:`NodeSchemaCtx<html>`,group:`Html`});var DM=[xj,wj,Tj,jj,Mj,Nj,Qj,$j,Rj,zj,Uj,Wj,nM,rM,Jj,Yj,oM,sM,dM,fM,gM,_M,tj,nj,sj,cj,fj,pj,_j,vj,TM,EM,wM].flat(),OM=[Bj,cM,pM,Gj,iM,Pj].flat(),kM=[ij,aj,hj,uj],AM=j(`IsMarkSelected`,()=>e=>t=>{if(!e)return!1;let{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),jM=j(`IsNoteSelected`,()=>e=>t=>e?Of(t,e).hasNode:!1),MM=j(`ClearTextInCurrentBlock`,()=>()=>(e,t)=>{let n=e.tr,{$from:r,$to:i}=n.selection,{pos:a}=r,{pos:o}=i,s=a-r.node().content.size;return s<0?!1:(n=n.deleteRange(s,o),t?.(n),!0)}),NM=j(`SetBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr,{from:o,to:s}=a.selection;try{a.setBlockType(o,s,r,i)}catch{return!1}return n?.(a),!0}),PM=j(`WrapInBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let{$from:e,$to:t}=a.selection,n=e.blockRange(t),o=n&&Vl(n,r,i);if(!o)return!1;a=a.wrap(n,o)}catch{return!1}return n?.(a),!0}),FM=j(`AddBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let e=r instanceof gc?r:r.createAndFill(i);if(!e)return!1;a.replaceSelectionWith(e)}catch{return!1}return n?.(a),!0}),IM=j(`SelectTextNearPos`,()=>e=>(t,n)=>{let{pos:r}=e??{};if(r==null)return!1;let i=(e,t,n)=>Math.min(Math.max(e,t),n),a=t.tr;try{let e=t.doc.resolve(i(r,0,t.doc.content.size));a.setSelection(O.near(e))}catch{return!1}return n?.(a.scrollIntoView()),!0}),LM=[Dj,Vj,Fj,Ij,Kj,eM,aM,Xj,Zj,mM,lM,vM,bM,yM,SM,rj,mj,lj,yj,bj,AM,jM,MM,NM,PM,FM,IM],RM=[Hj,qj,tM,Lj,CM,hM,uM,Oj,oj,gj,dj].flat(),zM=Vv(`remarkAddOrderInList`,()=>()=>e=>{yt(e,`list`,e=>{if(e.ordered){let t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});I(zM.plugin,{displayName:`Remark<remarkAddOrderInListPlugin>`,group:`Remark`}),I(zM.options,{displayName:`RemarkConfig<remarkAddOrderInListPlugin>`,group:`Remark`});var BM=Vv(`remarkLineBreak`,()=>()=>e=>{let t=/[\t ]*(?:\r?\n|\r)/g;yt(e,`text`,(e,n,r)=>{if(!e.value||typeof e.value!=`string`)return;let i=[],a=0;t.lastIndex=0;let o=t.exec(e.value);for(;o;){let n=o.index;a!==n&&i.push({type:`text`,value:e.value.slice(a,n)}),i.push({type:`break`,data:{isInline:!0}}),a=n+o[0].length,o=t.exec(e.value)}if(i.length>0&&r&&typeof n==`number`)return a<e.value.length&&i.push({type:`text`,value:e.value.slice(a)}),r.children.splice(n,1,...i),n+i.length})});I(BM.plugin,{displayName:`Remark<remarkLineBreak>`,group:`Remark`}),I(BM.options,{displayName:`RemarkConfig<remarkLineBreak>`,group:`Remark`});var VM=Vv(`remarkInlineLink`,()=>$A);I(VM.plugin,{displayName:`Remark<remarkInlineLinkPlugin>`,group:`Remark`}),I(VM.options,{displayName:`RemarkConfig<remarkInlineLinkPlugin>`,group:`Remark`});var HM=e=>!!e.children,UM=e=>e.type===`html`;function WM(e,t){return n(e,0,null)[0];function n(e,r,i){if(HM(e)){let t=[];for(let r=0,i=e.children.length;r<i;r++){let i=e.children[r];if(i){let a=n(i,r,e);if(a)for(let e=0,n=a.length;e<n;e++){let n=a[e];n&&t.push(n)}}}e.children=t}return t(e,r,i)}}var GM=[`root`,`blockquote`,`listItem`],KM=Vv(`remarkHTMLTransformer`,()=>()=>e=>{WM(e,(e,t,n)=>(UM(e)&&n&&GM.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type=`paragraph`),[e]))});I(KM.plugin,{displayName:`Remark<remarkHtmlTransformer>`,group:`Remark`}),I(KM.options,{displayName:`RemarkConfig<remarkHtmlTransformer>`,group:`Remark`});var qM=Vv(`remarkMarker`,()=>()=>(e,t)=>{let n=e=>t.value.charAt(e.position.start.offset);yt(e,e=>[`strong`,`emphasis`].includes(e.type),e=>{e.marker=n(e)})});I(qM.plugin,{displayName:`Remark<remarkMarker>`,group:`Remark`}),I(qM.options,{displayName:`RemarkConfig<remarkMarker>`,group:`Remark`});var JM=Mv(()=>{let e=!1,t=new Gu({key:new Ju(`MILKDOWN_INLINE_NODES_CURSOR`),state:{init(){return!1},apply(e){if(!e.selection.empty)return!1;let t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!!(n&&r&&n.isInline&&!n.isText&&r.isInline&&!r.isText)}},props:{handleDOMEvents:{compositionend:(n,r)=>e?(e=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){let e=n.state.selection.from;r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e))}}),!0):!1,compositionstart:n=>(t.getState(n.state)&&(e=!0),!1),beforeinput:(n,r)=>{if(t.getState(n.state)&&r instanceof InputEvent&&r.data&&!e){let e=n.state.selection.from;return r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e)),!0}return!1}},decorations(e){if(t.getState(e)){let t=e.selection.$from.pos,n=document.createElement(`span`),r=xg.widget(t,n,{side:-1}),i=document.createElement(`span`),a=xg.widget(t,i);return setTimeout(()=>{n.contentEditable=`true`,i.contentEditable=`true`}),wg.create(e.doc,[r,a])}return wg.empty}}});return t});I(JM,{displayName:`Prose<inlineNodesCursorPlugin>`,group:`Prose`});var YM=Mv(e=>new Gu({key:new Ju(`MILKDOWN_HARDBREAK_MARKS`),appendTransaction:(t,n,r)=>{if(!t.length)return;let[i]=t;if(!i)return;let[a]=i.steps;if(i.getMeta(`hardbreak`)){if(!(a instanceof Ml))return;let{from:t}=a;return r.tr.setNodeMarkup(t,$j.type(e),void 0,[])}if(a instanceof Ol){let t=r.tr,{from:n,to:i}=a;return r.doc.nodesBetween(n,i,(n,r)=>{n.type===$j.type(e)&&(t=t.setNodeMarkup(r,$j.type(e),void 0,[]))}),t}}}));I(YM,{displayName:`Prose<hardbreakClearMarkPlugin>`,group:`Prose`});var XM=Fv([`table`,`code_block`],`hardbreakFilterNodes`);I(XM,{displayName:`Ctx<hardbreakFilterNodes>`,group:`Prose`});var ZM=Mv(e=>{let t=e.get(XM.key);return new Gu({key:new Ju(`MILKDOWN_HARDBREAK_FILTER`),filterTransaction:(e,n)=>{let r=e.getMeta(`hardbreak`),[i]=e.steps;if(r&&i){let{from:e}=i,r=n.doc.resolve(e),a=r.depth,o=!0;for(;a>0;)t.includes(r.node(a).type.name)&&(o=!1),a--;return o}return!0}})});I(ZM,{displayName:`Prose<hardbreakFilterPlugin>`,group:`Prose`});var QM=Mv(e=>{let t=new Ju(`MILKDOWN_HEADING_ID`),n=n=>{if(n.composing)return;let r=e.get(jj.key),i=n.state.tr.setMeta(`addToHistory`,!1),a=!1,o={};n.state.doc.descendants((n,s)=>{if(n.type===Nj.type(e)){if(n.textContent.trim().length===0)return;let e=n.attrs,c=r(n);o[c]?(o[c]+=1,c+=`-#${o[c]}`):o[c]=1,e.id!==c&&(a=!0,i.setMeta(t,!0).setNodeMarkup(s,void 0,{...e,id:c}))}}),a&&n.dispatch(i)};return new Gu({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});I(QM,{displayName:`Prose<syncHeadingIdPlugin>`,group:`Prose`});var $M=Mv(e=>new Gu({key:new Ju(`MILKDOWN_KEEP_LIST_ORDER`),appendTransaction:(t,n,r)=>{if(!r.selection||t.some(e=>e.getMeta(`addToHistory`)===!1||!e.isGeneric))return null;let i=fM.type(e),a=sM.type(e),o=_M.type(e),s=(e,t,n=1)=>{let r=!1,i=`${t+n}.`;return e.label!==i&&(e.label=i,r=!0),r},c=r.tr,l=!1;return r.doc.descendants((e,t,n,r)=>{if(e.type===a){let n=e.maybeChild(0);n?.type===o&&n.attrs.listType===`ordered`&&(l=!0,c.setNodeMarkup(t,i,{spread:`true`}),e.descendants((e,t,n,r)=>{if(e.type===o){let n={...e.attrs};s(n,r)&&(c=c.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===o&&n?.type===i){let i={...e.attrs},a=!1;i.listType!==`ordered`&&(i.listType=`ordered`,a=!0),n?.maybeChild(0)&&(a=s(i,r,n?.attrs.order??1)),a&&(c=c.setNodeMarkup(t,void 0,i),l=!0)}}),l?c.setMeta(`addToHistory`,!1):null}}));I($M,{displayName:`Prose<syncListOrderPlugin>`,group:`Prose`});var eN=[DM,OM,kM,LM,RM,[YM,XM,ZM,JM,zM,VM,BM,KM,qM,Cj,QM,$M].flat()].flat();function tN(e){let t=Fv({},`${e}_SLASH_SPEC`),n=Mv(n=>{let r=n.get(t.key);return new Gu({key:new Ju(`${e}_SLASH`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:`@milkdown/plugin-slash`,displayName:`Ctx<slashSpec>|${e}`},n.meta={package:`@milkdown/plugin-slash`,displayName:`Prose<slash>|${e}`},r}var nN=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){this.#e=!1,this.onShow=()=>{},this.onHide=()=>{},this.#l=(e,t)=>{let{state:n,composing:r}=e,{selection:i,doc:a}=n,{ranges:s}=i,u=Math.min(...s.map(e=>e.$from.pos)),d=Math.max(...s.map(e=>e.$to.pos)),f=t&&t.doc.eq(a)&&t.selection.eq(i);if(this.#e||=((this.#r??e.dom.parentElement??document.body).appendChild(this.element),!0),!(r||f)){if(!this.#o(e,t)){this.hide();return}c({getBoundingClientRect:()=>vf(e,u,d)},this.element,{placement:`bottom-start`,middleware:[o(),l(this.#c),...this.#t],...this.#n}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error),this.show()}},this.#u=e=>{let t=this.getContent(e);if(!t)return!1;let n=t.at(-1);return n?Array.isArray(this.#a)?this.#a.includes(n):this.#a===n:!1},this.update=(e,t)=>{this.#s(e,t)},this.getContent=(e,t=e=>e.type.name===`paragraph`)=>{let{selection:n}=e.state,{empty:r,$from:i}=n,a=e.state.selection instanceof O;if(typeof document>`u`)return;let o=this.element.contains(document.activeElement),s=!e.hasFocus()&&!o,c=!e.editable,l=!Ef(t)(e.state.selection);if(!(s||c||!r||!a||l))return i.parent.textBetween(Math.max(0,i.parentOffset-500),i.parentOffset,void 0,``)},this.destroy=()=>{this.#s.cancel()},this.show=()=>{this.element.dataset.show=`true`,this.onShow()},this.hide=()=>{this.element.dataset.show=`false`,this.onHide()},this.element=e.content,this.#i=e.debounce??200,this.#o=e.shouldShow??this.#u,this.#a=e.trigger??`/`,this.#c=e.offset,this.#t=e.middleware??[],this.#n=e.floatingUIOptions??{},this.#r=e.root,this.#s=Xi(this.#l,this.#i)}#l;#u},rN=e=>crypto.getRandomValues(new Uint8Array(e)),iN=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},aN=(e,t=21)=>iN(e,t|0,rN),oN=Object.defineProperty,sN=Object.getOwnPropertySymbols,cN=Object.prototype.hasOwnProperty,lN=Object.prototype.propertyIsEnumerable,uN=(e,t,n)=>t in e?oN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dN=(e,t)=>{for(var n in t||={})cN.call(t,n)&&uN(e,n,t[n]);if(sN)for(var n of sN(t))lN.call(t,n)&&uN(e,n,t[n]);return e};function fN(e,t){return Object.assign(e,{meta:dN({package:`@milkdown/components`},t)}),e}var pN=Fv({imageIcon:`🌌`,captionIcon:`💬`,uploadButton:`Upload file`,confirmButton:`Confirm ⏎`,uploadPlaceholderText:`or paste the image link ...`,captionPlaceholderText:`Image caption`,onUpload:e=>Promise.resolve(URL.createObjectURL(e))},`imageBlockConfigCtx`);fN(pN,{displayName:`Config<image-block>`,group:`ImageBlock`});function mN(e){return yt(e,`paragraph`,(e,t,n)=>{if(e.children?.length!==1)return;let r=e.children?.[0];if(!r||r.type!==`image`)return;let{url:i,alt:a,title:o}=r,s={type:`image-block`,url:i,alt:a,title:o};n.children.splice(t,1,s)})}var hN=Vv(`remark-image-block`,()=>()=>mN);fN(hN.plugin,{displayName:`Remark<remarkImageBlock>`,group:`ImageBlock`}),fN(hN.options,{displayName:`RemarkConfig<remarkImageBlock>`,group:`ImageBlock`});var gN=Object.defineProperty,_N=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,bN=(e,t,n)=>t in e?gN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xN=(e,t)=>{for(var n in t||={})vN.call(t,n)&&bN(e,n,t[n]);if(_N)for(var n of _N(t))yN.call(t,n)&&bN(e,n,t[n]);return e},SN=`image-block`,CN=Iv(`image-block`,()=>({inline:!1,group:`block`,selectable:!0,draggable:!0,isolating:!0,marks:``,atom:!0,priority:100,attrs:{src:{default:``,validate:`string`},caption:{default:``,validate:`string`},ratio:{default:1,validate:`number`}},parseDOM:[{tag:`img[data-type="${SN}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{src:e.getAttribute(`src`)||``,caption:e.getAttribute(`caption`)||``,ratio:Number(e.getAttribute(`ratio`)??1)}}}],toDOM:e=>[`img`,xN({"data-type":SN},e.attrs)],parseMarkdown:{match:({type:e})=>e===`image-block`,runner:(e,t,n)=>{let r=t.url,i=t.title,a=Number(t.alt||1);(Number.isNaN(a)||a===0)&&(a=1),e.addNode(n,{src:r,caption:i,ratio:a})}},toMarkdown:{match:e=>e.type.name===`image-block`,runner:(e,t)=>{e.openNode(`paragraph`),e.addNode(`image`,void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));fN(CN.node,{displayName:`NodeSchema<image-block>`,group:`ImageBlock`});function wN({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}wN.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var TN=aN(`abcdefg`,8),EN=SE({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:i,imageIcon:a,uploadButton:o,confirmButton:s,uploadPlaceholderText:c,className:l,onImageLoadError:u}){let d=N(!1),f=N(),p=N(t.value??``),m=N(TN()),h=N(t.value?.length!==0),g=e=>{let t=e.target.value;h.value=t.length!==0,p.value=t},_=e=>{e.key===`Enter`&&n(f.value?.value??``)},v=()=>{n(f.value?.value??``)},y=e=>{let t=e.target.files?.[0];t&&i(t).then(e=>{e&&(n(e),h.value=!0)}).catch(e=>{console.error(`An error occurred while uploading image`),console.error(e)})};return()=>F(`div`,{class:r(`image-edit`,l)},F(wN,{icon:a,class:`image-icon`}),F(`div`,{class:r(`link-importer`,d.value&&`focus`)},F(`input`,{ref:f,draggable:`true`,onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:`link-input-area`,value:p.value,onInput:g,onKeydown:_,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!h.value&&F(`div`,{class:`placeholder`},F(`input`,{disabled:e.value,class:`hidden`,id:m.value,type:`file`,accept:`image/*`,onChange:y}),F(`label`,{class:`uploader`,for:m.value},F(wN,{icon:o})),F(`span`,{class:`text`,onClick:()=>f.value?.focus()},c))),p.value&&F(NO,null,F(`div`,{class:`image-preview`},F(`img`,{src:p.value,alt:``,onError:e=>Promise.resolve(u?.(e)).catch(()=>{})})),F(`div`,{class:`confirm`,onClick:()=>v()},F(wN,{icon:s}))))}}),DN=SE({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:i,config:a}){let o=N(),s=N(),c=N(!!t.value?.length),l=N(0),u=()=>{let e=o.value;if(!e)return;let t=e.closest(`.milkdown-image-block`);if(!t)return;let r=t.getBoundingClientRect().width;if(!r)return;a.maxWidth&&a.maxWidth<r&&(r=a.maxWidth);let i=e.naturalHeight,s=e.naturalWidth,c=s<r?i:i/s*r;a.maxHeight&&c>a.maxHeight&&(c=a.maxHeight);let l=(c*(n.value??1)).toFixed(2);e.dataset.origin=c.toFixed(2),e.dataset.height=l,e.style.height=`${l}px`,a.maxWidth&&(e.style.maxWidth=`${a.maxWidth}px`)},d=e=>{e.preventDefault(),e.stopPropagation(),!r.value&&(c.value=!c.value)},f=e=>{let t=e.target.value;l.value&&window.clearTimeout(l.value),l.value=window.setTimeout(()=>{i(`caption`,t)},1e3)},p=e=>{let t=e.target.value;l.value&&=(window.clearTimeout(l.value),0),i(`caption`,t)},m=e=>{e.preventDefault();let t=o.value;if(!t)return;let n=t.getBoundingClientRect().top,r=e.clientY-n;r<100&&(r=100),a.maxHeight&&r>a.maxHeight&&(r=a.maxHeight);let i=Number(r).toFixed(2);t.dataset.height=i,t.style.height=`${i}px`},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h);let e=o.value;if(!e)return;let t=Number(e.dataset.origin),n=Number(e.dataset.height),r=Number.parseFloat(Number(n/t).toFixed(2));Number.isNaN(r)||i(`ratio`,r)},g=e=>{r.value||(e.preventDefault(),e.stopPropagation(),window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h))};return()=>F(NO,null,F(`div`,{class:`image-wrapper`},F(`div`,{class:`operation`},F(`div`,{class:`operation-item`,onPointerdown:d},F(wN,{icon:a.captionIcon}))),F(`img`,{ref:o,"data-type":SN,onLoad:u,src:e.value,alt:t.value,onError:e=>Promise.resolve(a.onImageLoadError?.call(a,e)).catch(()=>{})}),F(`div`,{ref:s,class:`image-resize-handle`,onPointerdown:g})),c.value&&F(`input`,{draggable:`true`,onDragstart:e=>{e.preventDefault(),e.stopPropagation()},class:`caption-input`,placeholder:a?.captionPlaceholderText,onInput:f,onBlur:p,value:t.value}))}}),ON=Object.defineProperty,kN=Object.getOwnPropertySymbols,AN=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable,MN=(e,t,n)=>t in e?ON(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NN=(e,t)=>{for(var n in t||={})AN.call(t,n)&&MN(e,n,t[n]);if(kN)for(var n of kN(t))jN.call(t,n)&&MN(e,n,t[n]);return e},PN=SE({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let{src:t}=e;return()=>t.value?.length?F(DN,NN({},e)):F(EN,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr(`src`,t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}),FN=Pv(CN.node,e=>(t,n,r)=>{let i=N(t.attrs.src),a=N(t.attrs.caption),o=N(t.attrs.ratio),s=N(!1),c=N(!n.editable),l=(e,t)=>{if(!n.editable)return;let i=r();i!=null&&n.dispatch(n.state.tr.setNodeAttribute(i,e,e===`src`?nS.sanitize(t):t))},u=e.get(pN.key),d=DA(PN,{src:i,caption:a,ratio:o,selected:s,readonly:c,setAttr:l,config:u}),f=document.createElement(`div`);f.className=`milkdown-image-block`;let p=pE(()=>{s.value?f.classList.add(`selected`):f.classList.remove(`selected`)}),m=u.proxyDomURL,h=e=>{if(!m)i.value=e.attrs.src;else{let t=m(e.attrs.src);typeof t==`string`?i.value=t:t.then(e=>{i.value=e}).catch(console.error)}o.value=e.attrs.ratio,a.value=e.attrs.caption,c.value=!n.editable};return h(t),d.mount(f),{dom:f,update:e=>e.type===t.type?(h(e),!0):!1,stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{p(),d.unmount(),f.remove()}}});fN(FN,{displayName:`NodeView<image-block>`,group:`ImageBlock`});var IN=[hN,CN,FN,pN].flat(),LN,RN;if(typeof WeakMap<`u`){let e=new WeakMap;LN=t=>e.get(t),RN=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;LN=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},RN=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var zN=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return LN(e)||RN(e,BN(e))}};function BN(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=VN(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new zN(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&HN(s,o,e),s}function VN(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function HN(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=UN(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function UN(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function WN(e,t){if(typeof e==`string`)return{};let n=e.getAttribute(`data-colwidth`),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(`,`).map(e=>Number(e)):null,i=Number(e.getAttribute(`colspan`)||1),a={colspan:i,rowspan:Number(e.getAttribute(`rowspan`)||1),colwidth:r&&r.length==i?r:null};for(let n in t){let r=t[n].getFromDOM,i=r&&r(e);i!=null&&(a[n]=i)}return a}function GN(e,t){let n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n[`data-colwidth`]=e.attrs.colwidth.join(`,`));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function KN(e){if(e!==null){if(!Array.isArray(e))throw TypeError(`colwidth must be null or an array`);for(let t of e)if(typeof t!=`number`)throw TypeError(`colwidth must be null or an array of numbers`)}}function qN(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:`number`},rowspan:{default:1,validate:`number`},colwidth:{default:null,validate:KN}};for(let e in t)n[e]={default:t[e].default,validate:t[e].validate};return{table:{content:`table_row+`,tableRole:`table`,isolating:!0,group:e.tableGroup,parseDOM:[{tag:`table`}],toDOM(){return[`table`,[`tbody`,0]]}},table_row:{content:`(table_cell | table_header)*`,tableRole:`row`,parseDOM:[{tag:`tr`}],toDOM(){return[`tr`,0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:`cell`,isolating:!0,parseDOM:[{tag:`td`,getAttrs:e=>WN(e,t)}],toDOM(e){return[`td`,GN(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:`header_cell`,isolating:!0,parseDOM:[{tag:`th`,getAttrs:e=>WN(e,t)}],toDOM(e){return[`th`,GN(e,t),0]}}}}function JN(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var YN=new Ju(`selectingCells`);function XN(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function ZN(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function QN(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=XN(t.$head)||$N(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function $N(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function eP(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function tP(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function nP(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function rP(e,t,n){let r=e.node(-1),i=zN.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function iP(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function aP(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function oP(e,t,n){let r=JN(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var sP=class e extends Tu{constructor(e,t=e){let n=e.node(-1),r=zN.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Eu(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(eP(r)&&eP(i)&&nP(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return O.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=zN.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=iP(e,0,l)),u>0&&(e=iP(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(E.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new D(E.from(o),1,1)}replace(e,t=D.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?D.empty:t)}let i=Tu.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new D(E.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=zN.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=zN.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=zN.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=zN.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new cP(this.$anchorCell.pos,this.$headCell.pos)}};sP.prototype.visible=!1,Tu.jsonID(`cell`,sP);var cP=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&nP(t,n)?new sP(t,n):Tu.near(n,1)}};function lP(e){if(!(e.selection instanceof sP))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(xg.node(n,n+e.nodeSize,{class:`selectedCell`}))}),wg.create(e.doc,t)}function uP({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function dP({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function fP(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof k&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=sP.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=sP.rowSelection(e,e)}else if(!n){let e=zN.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=sP.create(i,t+1,n)}}else r instanceof O&&uP(r)?a=O.create(i,r.from):r instanceof O&&dP(r)&&(a=O.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var pP=new Ju(`fix-tables`);function mP(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?mP(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function hP(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=gP(e,t,r,n))};return t?t.doc!=e.doc&&mP(t.doc,e.doc,0,r):e.doc.descendants(r),n}function gP(e,t,n,r){let i=zN.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,iP(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=JN(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(pP,{fixTables:!0})}function _P(e){let t=zN.get(e),n=[],r=t.height,i=t.width;for(let a=0;a<r;a++){let r=[];for(let n=0;n<i;n++){let o=a*i+n,s=t.map[o];if(a>0){let e=o-i;if(s===t.map[e]){r.push(null);continue}}if(n>0){let e=o-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function vP(e,t){let n=[],r=zN.get(e),i=r.height,a=r.width;for(let o=0;o<i;o++){let i=e.child(o),s=[];for(let n=0;n<a;n++){let i=t[o][n];if(!i)continue;let a=r.map[o*r.width+n],c=e.nodeAt(a);if(!c)continue;let l=c.type.createChecked(i.attrs,i.content,i.marks);s.push(l)}let c=i.type.createChecked(i.attrs,s,i.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function yP(e,t,n,r){let i=t[0]>n[0]?-1:1,a=e.splice(t[0],t.length),o=+(a.length%2==0),s;return s=r===-1&&i===1?n[0]-1:r===1&&i===-1?n[n.length-1]-o+1:i===-1?n[0]:n[n.length-1]-o,e.splice(s,0,...a),e}function bP(e){return xP(e=>e.type.spec.tableRole===`table`,e)}function xP(e,t){for(let n=t.depth;n>=0;--n){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function SP(e,t){let n=bP(t.$from);if(!n)return;let r=zN.get(n.node);if(!(e<0||e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function CP(e,t){let n=bP(t.$from);if(!n)return;let r=zN.get(n.node);if(!(e<0||e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function wP(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=SP(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=SP(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=SP(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=SP(r,e.selection),s=CP(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=SP(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function TP(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=CP(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=CP(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=CP(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=CP(r,e.selection),s=SP(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=CP(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function EP(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function DP(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=bP(t.doc.resolve(a));if(!o)return!1;let s=wP(t,n)?.indexes,c=wP(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=OP(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=zN.get(l),d=o.start,f=r,p=u.positionAt(u.height-1,f,l),m=t.doc.resolve(d+p),h=u.positionAt(0,f,l),g=t.doc.resolve(d+h);return t.setSelection(sP.colSelection(m,g)),!0}function OP(e,t,n,r){let i=EP(_P(e));return i=yP(i,t,n,r),i=EP(i),vP(e,i)}function kP(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=bP(t.doc.resolve(a));if(!o)return!1;let s=TP(t,n)?.indexes,c=TP(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=AP(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=zN.get(l),d=o.start,f=r,p=u.positionAt(f,u.width-1,l),m=t.doc.resolve(d+p),h=u.positionAt(f,0,l),g=t.doc.resolve(d+h);return t.setSelection(sP.rowSelection(m,g)),!0}function AP(e,t,n,r){let i=_P(e);return i=yP(i,t,n,r),vP(e,i)}function jP(e){let t=e.selection,n=QN(e),r=n.node(-1),i=n.start(-1),a=zN.get(r);return{...t instanceof sP?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function MP(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;oP(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,aP(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?JN(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function NP(e,t){if(!ZN(e))return!1;if(t){let n=jP(e);t(MP(e.tr,n,n.left))}return!0}function PP(e,t){if(!ZN(e))return!1;if(t){let n=jP(e);t(MP(e.tr,n,n.right))}return!0}function FP(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,iP(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function IP(e,t){if(!ZN(e))return!1;if(t){let n=jP(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;FP(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=zN.get(e)}t(r)}return!0}function LP(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function RP(e,t){if(!ZN(e))return!1;if(t){let n=jP(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;LP(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=zN.get(n.table)}t(r)}return!0}function zP(e,t){return function(n,r){if(!ZN(n))return!1;let i=QN(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof sP?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function BP(e){return function(t,n){if(!ZN(t))return!1;if(n){let r=JN(t.schema),i=jP(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function VP(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function HP(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?BP(e):function(t,n){if(!ZN(t))return!1;if(n){let r=JN(t.schema),i=jP(t),a=t.tr,o=VP(`row`,i,r),s=VP(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}HP(`row`,{useDeprecatedLogic:!0}),HP(`column`,{useDeprecatedLogic:!0}),HP(`cell`,{useDeprecatedLogic:!0});function UP(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function WP(e){return function(t,n){if(!ZN(t))return!1;let r=UP(QN(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(O.between(e,tP(e))).scrollIntoView())}return!0}}function GP(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function KP(e,t){let n=e.selection;if(!(n instanceof sP))return!1;if(t){let r=e.tr,i=JN(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new D(i,0,0))}),r.docChanged&&t(r)}return!0}function qP(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return kP({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function JP(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return DP({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function YP(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=ZP(JN(o).row,new D(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?ZP(JN(o).row,new D(t,n,r)).content:t);else return null;return XP(o,s)}function XP(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(E.empty),n[i]<r){let a=JN(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(E.from(o))}return{height:t.length,width:r,rows:t}}function ZP(e,t){let n=e.createAndFill();return new Cu(n).replace(0,n.content.size,t).doc}function QP({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(iP(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(E.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(E.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function $P(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=JN(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,E.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function eF(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function tF(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,iP(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(iP(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function nF(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=zN.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=zN.get(a),f=d.mapping.maps.length}$P(d,o,a,n,l,u,f)&&p(),eF(d,o,a,n,c,l,s,f)&&p(),eF(d,o,a,n,c,l,u,f)&&p(),tF(d,o,a,n,s,u,c,f)&&p(),tF(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new D(i.rows[e-s],0,0))}p(),d.setSelection(new sP(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var rF=Ff({ArrowLeft:aF(`horiz`,-1),ArrowRight:aF(`horiz`,1),ArrowUp:aF(`vert`,-1),ArrowDown:aF(`vert`,1),"Shift-ArrowLeft":oF(`horiz`,-1),"Shift-ArrowRight":oF(`horiz`,1),"Shift-ArrowUp":oF(`vert`,-1),"Shift-ArrowDown":oF(`vert`,1),Backspace:KP,"Mod-Backspace":KP,Delete:KP,"Mod-Delete":KP});function iF(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function aF(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof sP)return iF(n,r,Tu.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=uF(i,e,t);if(o==null)return!1;if(e==`horiz`)return iF(n,r,Tu.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=rP(i,e,t),s;return s=a?Tu.near(a,1):t<0?Tu.near(n.doc.resolve(i.before(-1)),-1):Tu.near(n.doc.resolve(i.after(-1)),1),iF(n,r,s)}}}function oF(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof sP)o=a;else{let r=uF(i,e,t);if(r==null)return!1;o=new sP(n.doc.resolve(r))}let s=rP(o.$headCell,e,t);return s?iF(n,r,new sP(o.$anchorCell,s)):!1}}function sF(e,t){let n=e.state.doc,r=XN(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new sP(r))),!0):!1}function cF(e,t,n){if(!ZN(e.state))return!1;let r=YP(n),i=e.state.selection;if(i instanceof sP){r||={width:1,height:1,rows:[E.from(ZP(JN(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=zN.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=QP(r,o.right-o.left,o.bottom-o.top),nF(e.state,e.dispatch,a,o,r),!0}else if(r){let t=QN(e.state),n=t.start(-1);return nF(e.state,e.dispatch,n,zN.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function lF(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=dF(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof sP)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=XN(e.state.selection.$anchor))!=null&&fF(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=fF(e,n),i=YN.getState(e.state)==null;if(!r||!nP(t,r))if(i)r=t;else return;let a=new sP(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(YN,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),YN.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(YN,-1))}function o(r){let o=r,s=YN.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(dF(e,o.target)!=n&&(c=fF(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function uF(e,t,n){if(!(e.state.selection instanceof O))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function dF(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function fF(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&XN(e.state.doc.resolve(r))||XN(e.state.doc.resolve(i))}var pF=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),mF(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,mF(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function mF(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var hF=new Ju(`tableColumnResizing`);function gF({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=pF,lastColumnResizable:i=!0}={}){let a=new Gu({key:hF,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=JN(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new _F(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=hF.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{vF(t,n,e,i)},mouseleave:e=>{yF(e)},mousedown:(e,r)=>{bF(e,r,t,n)}},decorations:e=>{let t=hF.getState(e);if(t&&t.activeHandle>-1)return kF(e,t.activeHandle)},nodeViews:{}}});return a}var _F=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(hF);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return eP(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function vF(e,t,n,r){if(!e.editable)return;let i=hF.getState(e.state);if(i&&!i.dragging){let a=SF(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=CF(e,t,`left`,n):i-t.clientX<=n&&(o=CF(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=zN.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}TF(e,o)}}}function yF(e){if(!e.editable)return;let t=hF.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&TF(e,-1)}function bF(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=hF.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=xF(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(hF,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=hF.getState(e.state);r?.dragging&&(EF(e,r.activeHandle,wF(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(hF,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=hF.getState(e.state);if(i&&i.dragging){let a=wF(i.dragging,t,n);DF(e,i.activeHandle,a,r)}}return DF(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function xF(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function SF(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function CF(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=XN(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=zN.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function wF(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function TF(e,t){e.dispatch(e.state.tr.setMeta(hF,{setHandle:t}))}function EF(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=zN.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():OF(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function DF(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=zN.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&mF(a,c.firstChild,c,r,s,n)}function OF(e){return Array(e).fill(0)}function kF(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return wg.empty;let a=zN.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,hF.getState(e)?.dragging&&n.push(xg.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(xg.widget(s,c))}}return wg.create(e.doc,n)}function AF({allowTableNodeSelection:e=!1}={}){return new Gu({key:YN,state:{init(){return null},apply(e,t){let n=e.getMeta(YN);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:lP,handleDOMEvents:{mousedown:lF},createSelectionBetween(e){return YN.getState(e.state)==null?null:e.state.selection},handleTripleClick:sF,handleKeyDown:rF,handlePaste:cF},appendTransaction(t,n,r){return fP(r,hP(r,n),e)}})}var jF=typeof navigator<`u`?navigator:null,MF=jF&&jF.userAgent||``,NF=/Edge\/(\d+)/.exec(MF),PF=/MSIE \d/.exec(MF),FF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(MF),IF=!(PF||FF||NF)&&!!jF&&/Apple Computer/.test(jF.vendor),LF=new Ju(`safari-ime-span`),RF=!1,zF={key:LF,props:{decorations:BF,handleDOMEvents:{compositionstart:()=>{RF=!0},compositionend:()=>{RF=!1}}}};function BF(e){let{$from:t,$to:n,to:r}=e.selection;if(RF&&t.sameParent(n)){let t=xg.widget(r,VF,{ignoreSelection:!0,key:`safari-ime-span`});return wg.create(e.doc,[t])}}function VF(e){let t=e.dom.ownerDocument.createElement(`span`);return t.className=`ProseMirror-safari-ime-span`,t}var HF=new Gu(IF?zF:{key:LF});function UF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function WF(e,t,n){let r=mt((n||{}).ignore||[]),i=GF(t),a=-1;for(;++a<i.length;)_t(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function GF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([KF(e[0]),qF(e[1])])}return t}function KF(e){return typeof e==`string`?new RegExp(UF(e),`g`):e}function qF(e){return typeof e==`function`?e:function(){return e}}var JF=`phrasing`,YF=[`autolink`,`link`,`image`,`label`];function XF(){return{transforms:[iI],enter:{literalAutolink:QF,literalAutolinkEmail:$F,literalAutolinkHttp:$F,literalAutolinkWww:$F},exit:{literalAutolink:rI,literalAutolinkEmail:nI,literalAutolinkHttp:eI,literalAutolinkWww:tI}}}function ZF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:JF,notInConstruct:YF},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:JF,notInConstruct:YF},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:JF,notInConstruct:YF}]}}function QF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function $F(e){this.config.enter.autolinkProtocol.call(this,e)}function eI(e){this.config.exit.autolinkProtocol.call(this,e)}function tI(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];d(t.type===`link`),t.url=`http://`+this.sliceSerialize(e)}function nI(e){this.config.exit.autolinkEmail.call(this,e)}function rI(e){this.exit(e)}function iI(e){WF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aI],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oI]],{ignore:[`link`,`linkReference`]})}function aI(e,t,n,r,i){let a=``;if(!lI(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!sI(n)))return!1;let o=cI(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function oI(e,t,n,r){return!lI(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function sI(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cI(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=gt(e,`(`),a=gt(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function lI(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||m(n)||ne(n))&&(!t||n!==47)}yI.peek=vI;function uI(){this.buffer()}function dI(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function fI(){this.buffer()}function pI(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function mI(e){let t=this.resume(),n=this.stack[this.stack.length-1];d(n.type===`footnoteReference`),n.identifier=h(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hI(e){this.exit(e)}function gI(e){let t=this.resume(),n=this.stack[this.stack.length-1];d(n.type===`footnoteDefinition`),n.identifier=h(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _I(e){this.exit(e)}function vI(){return`[`}function yI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function bI(){return{enter:{gfmFootnoteCallString:uI,gfmFootnoteCall:dI,gfmFootnoteDefinitionLabelString:fI,gfmFootnoteDefinition:pI},exit:{gfmFootnoteCallString:mI,gfmFootnoteCall:hI,gfmFootnoteDefinitionLabelString:gI,gfmFootnoteDefinition:_I}}}function xI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
59
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?CI:SI))),s(),o}}function SI(e,t,n){return t===0?e:CI(e,t,n)}function CI(e,t,n){return(n?``:` `)+e}var wI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];kI.peek=AI;function TI(){return{canContainEols:[`delete`],enter:{strikethrough:DI},exit:{strikethrough:OI}}}function EI(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:wI}],handlers:{delete:kI}}}function DI(e){this.enter({type:`delete`,children:[]},e)}function OI(e){this.exit(e)}function kI(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function AI(){return`~`}function jI(e){return e.length}function MI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||jI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=NI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=PI(r[d]);else{let e=PI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
60
- `)}function NI(e){return e==null?``:String(e)}function PI(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function FI(){return{enter:{table:II,tableData:BI,tableHeader:BI,tableRow:RI},exit:{codeText:VI,table:LI,tableData:zI,tableHeader:zI,tableRow:zI}}}function II(e){let t=e._align;d(t,"expected `_align` on table"),this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function LI(e){this.exit(e),this.data.inTable=void 0}function RI(e){this.enter({type:`tableRow`,children:[]},e)}function zI(e){this.exit(e)}function BI(e){this.enter({type:`tableCell`,children:[]},e)}function VI(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,HI));let n=this.stack[this.stack.length-1];d(n.type===`inlineCode`),n.value=t,this.exit(e)}function HI(e,t){return t===`|`?t:e}function UI(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
61
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
62
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return MI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=bs.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function WI(){return{exit:{taskListCheckValueChecked:KI,taskListCheckValueUnchecked:KI,paragraph:qI}}}function GI(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:JI}}}function KI(e){let t=this.stack[this.stack.length-2];d(t.type===`listItem`),t.checked=e.type===`taskListCheckValueChecked`}function qI(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];d(e.type===`paragraph`);let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function JI(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=bs.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function YI(){return[XF(),bI(),TI(),FI(),WI()]}function XI(e){return{extensions:[ZF(),xI(e),EI(),UI(e),GI()]}}var ZI={};function QI(e){let t=this,n=e||ZI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(te(n)),a.push(YI()),o.push(XI(n))}function L(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-gfm`,...t}}),e}var $I=Bv(`strike_through`);L($I,{displayName:`Attr<strikethrough>`,group:`Strikethrough`});var eL=Lv(`strike_through`,e=>({parseDOM:[{tag:`del`},{style:`text-decoration`,getAttrs:e=>e===`line-through`}],toDOM:t=>[`del`,e.get($I.key)(t)],parseMarkdown:{match:e=>e.type===`delete`,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strike_through`,runner:(e,t)=>{e.withMark(t,`delete`)}}}));L(eL.mark,{displayName:`MarkSchema<strikethrough>`,group:`Strikethrough`}),L(eL.ctx,{displayName:`MarkSchemaCtx<strikethrough>`,group:`Strikethrough`});var tL=j(`ToggleStrikeThrough`,e=>()=>wd(eL.type(e)));L(tL,{displayName:`Command<ToggleStrikethrough>`,group:`Strikethrough`});var nL=Ov(e=>of(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)/,eL.type(e)));L(nL,{displayName:`InputRule<strikethrough>`,group:`Strikethrough`});var rL=Rv(`strikeThroughKeymap`,{ToggleStrikethrough:{shortcuts:`Mod-Alt-x`,command:e=>{let t=e.get(A);return()=>t.call(tL.key)}}});L(rL.ctx,{displayName:`KeymapCtx<strikethrough>`,group:`Strikethrough`}),L(rL.shortcuts,{displayName:`Keymap<strikethrough>`,group:`Strikethrough`});var iL=qN({tableGroup:`block`,cellContent:`paragraph`,cellAttributes:{alignment:{default:`left`,getFromDOM:e=>e.style.textAlign||`left`,setDOMAttr:(e,t)=>{t.style=`text-align: ${e||`left`}`}}}}),aL=Iv(`table`,()=>({...iL.table,content:`table_header_row table_row+`,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`table`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r,isHeader:t===0}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table`,runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode(`table`,void 0,{align:r}),e.next(t.content),e.closeNode()}}}));L(aL.node,{displayName:`NodeSchema<table>`,group:`Table`}),L(aL.ctx,{displayName:`NodeSchemaCtx<table>`,group:`Table`});var oL=Iv(`table_header_row`,()=>({...iL.table_row,disableDropCursor:!0,content:`(table_header)*`,parseDOM:[{tag:`tr[data-is-header]`},{tag:`tr`,getAttrs:e=>e instanceof HTMLElement&&e.querySelector(`th`)?{}:!1}],toDOM(){return[`tr`,{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type===`tableRow`&&e.isHeader),runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`,void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));L(oL.node,{displayName:`NodeSchema<tableHeaderRow>`,group:`Table`}),L(oL.ctx,{displayName:`NodeSchemaCtx<tableHeaderRow>`,group:`Table`});var sL=Iv(`table_row`,()=>({...iL.table_row,disableDropCursor:!0,content:`(table_cell)*`,parseMarkdown:{match:e=>e.type===`tableRow`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`),e.next(t.content),e.closeNode())}}}));L(sL.node,{displayName:`NodeSchema<tableRow>`,group:`Table`}),L(sL.ctx,{displayName:`NodeSchemaCtx<tableRow>`,group:`Table`});var cL=Iv(`table_cell`,()=>({...iL.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name===`table_cell`,runner:(e,t)=>{e.openNode(`tableCell`).next(t.content).closeNode()}}}));L(cL.node,{displayName:`NodeSchema<tableCell>`,group:`Table`}),L(cL.ctx,{displayName:`NodeSchemaCtx<tableCell>`,group:`Table`});var lL=Iv(`table_header`,()=>({...iL.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header`,runner:(e,t)=>{e.openNode(`tableCell`),e.next(t.content),e.closeNode()}}}));L(lL.node,{displayName:`NodeSchema<tableHeader>`,group:`Table`}),L(lL.ctx,{displayName:`NodeSchemaCtx<tableHeader>`,group:`Table`});function uL(e,t=3,n=3){let r=Array(n).fill(0).map(()=>cL.type(e).createAndFill()),i=Array(n).fill(0).map(()=>lL.type(e).createAndFill()),a=Array(t).fill(0).map((t,n)=>n===0?oL.type(e).create(null,i):sL.type(e).create(null,r));return aL.type(e).create(null,a)}function dL(e){return(t,n)=>r=>{n??=r.selection.from;let i=r.doc.resolve(n),a=Tf(e=>e.type.name===`table`)(i),o=a?{node:a.node,from:a.start}:void 0,s=e===`row`;if(o){let e=zN.get(o.node);if(t>=0&&t<(s?e.height:e.width)){let n=e.positionAt(s?t:e.height-1,s?e.width-1:t,o.node),i=r.doc.resolve(o.from+n),a=s?sP.rowSelection:sP.colSelection,c=e.positionAt(s?t:0,s?0:t,o.node),l=r.doc.resolve(o.from+c);return yf(r.setSelection(a(i,l)))}}return r}}var fL=dL(`row`),pL=dL(`col`);function mL(e,t,{map:n,tableStart:r,table:i},a){let o=Array(a).fill(0).reduce((e,t,n)=>e+i.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{let a=i.nodeAt(n.map[r]);return cL.type(e).createAndFill({alignment:a?.attrs.alignment})});return t.insert(o,sL.type(e).create(null,s)),t}function hL(e){let t=bP(e.$from);if(!t)return;let n=zN.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{let n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}function gL(e){let t=hL(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){let t=e.doc.resolve(r.pos);return yf(e.setSelection(new sP(t,n)))}}return e}var _L=j(`GoToPrevTableCell`,()=>()=>WP(-1));L(_L,{displayName:`Command<goToPrevTableCellCommand>`,group:`Table`});var vL=j(`GoToNextTableCell`,()=>()=>WP(1));L(vL,{displayName:`Command<goToNextTableCellCommand>`,group:`Table`});var yL=j(`ExitTable`,e=>()=>(t,n)=>{if(!ZN(t))return!1;let{$head:r}=t.selection,i=Cf(r,aL.type(e));if(!i)return!1;let{to:a}=i,o=t.tr.replaceWith(a,a,Tj.type(e).createAndFill());return o.setSelection(Tu.near(o.doc.resolve(a),1)).scrollIntoView(),n?.(o),!0});L(yL,{displayName:`Command<breakTableCommand>`,group:`Table`});var bL=j(`InsertTable`,e=>({row:t,col:n}={})=>(r,i)=>{let{selection:a,tr:o}=r,{from:s}=a,c=uL(e,t,n),l=o.replaceSelectionWith(c),u=Tu.findFrom(l.doc.resolve(s),1,!0);return u&&l.setSelection(u),i?.(l),!0});L(bL,{displayName:`Command<insertTableCommand>`,group:`Table`});var xL=j(`MoveRow`,()=>({from:e,to:t,pos:n}={})=>qP({from:e??0,to:t??0,pos:n}));L(xL,{displayName:`Command<moveRowCommand>`,group:`Table`});var SL=j(`MoveCol`,()=>({from:e,to:t,pos:n}={})=>JP({from:e??0,to:t??0,pos:n}));L(SL,{displayName:`Command<moveColCommand>`,group:`Table`});var CL=j(`SelectRow`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(fL(e.index,e.pos)(r))});L(CL,{displayName:`Command<selectRowCommand>`,group:`Table`});var wL=j(`SelectCol`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(pL(e.index,e.pos)(r))});L(wL,{displayName:`Command<selectColCommand>`,group:`Table`});var TL=j(`SelectTable`,()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(gL(n))});L(TL,{displayName:`Command<selectTableCommand>`,group:`Table`});var EL=j(`DeleteSelectedCells`,()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof sP))return!1;let r=n.isRowSelection(),i=n.isColSelection();return r&&i?GP(e,t):i?IP(e,t):RP(e,t)});L(EL,{displayName:`Command<deleteSelectedCellsCommand>`,group:`Table`});var DL=j(`AddColBefore`,()=>()=>NP);L(DL,{displayName:`Command<addColBeforeCommand>`,group:`Table`});var OL=j(`AddColAfter`,()=>()=>PP);L(OL,{displayName:`Command<addColAfterCommand>`,group:`Table`});var kL=j(`AddRowBefore`,e=>()=>(t,n)=>{if(!ZN(t))return!1;if(n){let r=jP(t);n(mL(e,t.tr,r,r.top))}return!0});L(kL,{displayName:`Command<addRowBeforeCommand>`,group:`Table`});var AL=j(`AddRowAfter`,e=>()=>(t,n)=>{if(!ZN(t))return!1;if(n){let r=jP(t);n(mL(e,t.tr,r,r.bottom))}return!0});L(AL,{displayName:`Command<addRowAfterCommand>`,group:`Table`});var jL=j(`SetAlign`,()=>(e=`left`)=>zP(`alignment`,e));L(jL,{displayName:`Command<setAlignCommand>`,group:`Table`});var ML=Ov(e=>new jd(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,i)=>{let a=t.doc.resolve(r);if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),aL.type(e)))return null;let o=uL(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,i,o);return s.setSelection(O.create(s.doc,r+3)).scrollIntoView()}));L(ML,{displayName:`InputRule<insertTableInputRule>`,group:`Table`});var NL=kv(e=>({run:(t,n,r)=>{if(r)return t;function i(t){let n=t.childCount,r=t.lastChild?.childCount??0;if(n===0||r===0)return Tj.type(e).create();let i=t.firstChild;if(!(r>0&&i&&i.childCount===0))return t;if(n>=3){let r=t.child(1),a=[];for(let t=0;t<r.childCount;t++){let n=r.child(t);a.push(lL.type(e).create(n.attrs,n.content,n.marks))}let o=i.type.create(i.attrs,a),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[o,...s])}let a=Array(r).fill(0).map(()=>lL.type(e).createAndFill()),o=new D(E.from(a),0,0),s=i.replace(0,0,o);return t.replace(0,i.nodeSize,new D(E.from(s),0,0))}function a(t){let n=sL.type(e),r=[],a=[],o=!1;function s(){if(a.length===0)return;let t=oL.type(e).createAndFill(),n=aL.type(e).create(null,[t,...a]);r.push(i(n)),a=[]}return t.forEach(e=>{e.type===n?(o=!0,a.push(e)):(s(),r.push(e))}),s(),o?E.from(r):t}function o(t){let n=a(t),r=n!==t,s=[];return n.forEach(t=>{if(t.type===aL.type(e)){let e=i(t);e!==t&&(r=!0),s.push(e)}else if(t.childCount>0){let e=o(t.content);e===t.content?s.push(t):(r=!0,s.push(t.copy(e)))}else s.push(t)}),r?E.from(s):t}function s(t){let n=[],r=[];t.forEach(e=>r.push(e));for(let t=0;t<r.length;t++){let i=r[t],a=r[t+1];i.type===Tj.type(e)&&i.content.size===0&&a&&a.type===aL.type(e)||n.push(i)}return n.length<r.length?E.from(n):t}let c=o(t.content);return c=s(c),new D(E.from(c),t.openStart,t.openEnd)}}));L(NL,{displayName:`PasteRule<table>`,group:`Table`});var PL=Rv(`tableKeymap`,{NextCell:{priority:100,shortcuts:[`Mod-]`,`Tab`],command:e=>{let t=e.get(A);return()=>t.call(vL.key)}},PrevCell:{shortcuts:[`Mod-[`,`Shift-Tab`],command:e=>{let t=e.get(A);return()=>t.call(_L.key)}},ExitTable:{shortcuts:[`Mod-Enter`,`Enter`],command:e=>{let t=e.get(A);return()=>t.call(yL.key)}}});L(PL.ctx,{displayName:`KeymapCtx<table>`,group:`Table`}),L(PL.shortcuts,{displayName:`Keymap<table>`,group:`Table`});var FL=`footnote_definition`,IL=`footnoteDefinition`,LL=Iv(`footnote_definition`,()=>({group:`block`,content:`block+`,defining:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`dl[data-type="${FL}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{label:e.dataset.label}},contentElement:`dd`}],toDOM:e=>{let t=e.attrs.label;return[`dl`,{"data-label":t,"data-type":FL},[`dt`,t],[`dd`,0]]},parseMarkdown:{match:({type:e})=>e===IL,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===FL,runner:(e,t)=>{e.openNode(IL,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));L(LL.ctx,{displayName:`NodeSchemaCtx<footnodeDef>`,group:`footnote`}),L(LL.node,{displayName:`NodeSchema<footnodeDef>`,group:`footnote`});var RL=`footnote_reference`,zL=Iv(`footnote_reference`,()=>({group:`inline`,inline:!0,atom:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`sup[data-type="${RL}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return[`sup`,{"data-label":t,"data-type":RL},t]},parseMarkdown:{match:({type:e})=>e===`footnoteReference`,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===RL,runner:(e,t)=>{e.addNode(`footnoteReference`,void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));L(zL.ctx,{displayName:`NodeSchemaCtx<footnodeRef>`,group:`footnote`}),L(zL.node,{displayName:`NodeSchema<footnodeRef>`,group:`footnote`});var BL=_M.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:`boolean|null`}},parseDOM:[{tag:`li[data-item-type="task"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Va(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?e.dataset.checked===`true`:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&e.attrs.checked==null?n.toDOM(e):[`li`,{"data-item-type":`task`,"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,r)=>{if(t.checked==null){n.parseMarkdown.runner(e,t,r);return}let i=t.label==null?`•`:`${t.label}.`,a=t.checked==null?null:!!t.checked,o=t.label==null?`bullet`:`ordered`,s=t.spread==null?`true`:`${t.spread}`;e.openNode(r,{label:i,listType:o,spread:s,checked:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{if(t.attrs.checked==null){n.toMarkdown.runner(e,t);return}let r=t.attrs.label,i=t.attrs.listType,a=t.attrs.spread===`true`,o=t.attrs.checked;e.openNode(`listItem`,void 0,{label:r,listType:i,spread:a,checked:o}),e.next(t.content),e.closeNode()}}}});L(BL.node,{displayName:`NodeSchema<taskListItem>`,group:`ListItem`}),L(BL.ctx,{displayName:`NodeSchemaCtx<taskListItem>`,group:`ListItem`});var VL=Ov(()=>new jd(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{let i=e.doc.resolve(n),a=0,o=i.node(a);for(;o&&o.type.name!==`list_item`;)a--,o=i.node(a);if(!o||o.attrs.checked!=null)return null;let s=t.groups?.checked===`x`,c=i.before(a),l=e.tr;return l.deleteRange(n,r).setNodeMarkup(c,void 0,{...o.attrs,checked:s}),l}));L(VL,{displayName:`InputRule<wrapInTaskListInputRule>`,group:`ListItem`});var HL=[rL,PL].flat(),UL=[ML,VL],WL=[nL],GL=[NL],KL=Mv(()=>HF);L(KL,{displayName:`Prose<autoInsertSpanPlugin>`,group:`Prose`}),L(Mv(()=>gF({})),{displayName:`Prose<columnResizingPlugin>`,group:`Prose`});var qL=Mv(()=>AF({allowTableNodeSelection:!0}));L(qL,{displayName:`Prose<tableEditingPlugin>`,group:`Prose`});var JL=Vv(`remarkGFM`,()=>QI);L(JL.plugin,{displayName:`Remark<remarkGFMPlugin>`,group:`Remark`}),L(JL.options,{displayName:`RemarkConfig<remarkGFMPlugin>`,group:`Remark`});var YL=new Ju(`MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN`);function XL(e,t){let n=0;return t.forEach((t,r,i)=>{t===e&&(n=i)}),n}var ZL=Mv(()=>new Gu({key:YL,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||=n.tr,e.type.name!==`table_cell`)return;let i=n.doc.resolve(t),a=i.node(i.depth),o=i.node(i.depth-1).firstChild;if(!o)return;let s=XL(e,a),c=o.maybeChild(s);if(!c)return;let l=c.attrs.alignment;l!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:l})}),r}}));L(ZL,{displayName:`Prose<keepTableAlignPlugin>`,group:`Prose`});var QL=[ZL,KL,JL,qL].flat(),$L=[[BL,aL,oL,sL,lL,cL,LL,zL,$I,eL].flat(),UL,GL,WL,HL,[vL,_L,yL,bL,xL,SL,CL,wL,TL,EL,kL,AL,DL,OL,jL,tL],QL].flat(),eR=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=aR(e.state,n.from);return r.line?nR(e):r.block?iR(e):!1};function tR(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var nR=tR(uR,0),rR=tR(lR,0),iR=tR((e,t)=>lR(e,t,cR(t)),0);function aR(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var oR=50;function sR(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-oR,r),o=e.sliceDoc(i,i+oR),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*oR?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+oR),d=e.sliceDoc(i-oR,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function cR(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function lR(e,t,n=t.selection.ranges){let r=n.map(e=>aR(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>sR(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function uR(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=aR(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var dR=Qe.define(),fR=Qe.define(),pR=Ge.define(),mR=Ge.define({combine(e){return le(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),hR=st.define({create(){return PR.empty},update(e,t){let n=t.state.facet(mR),r=t.annotation(dR);if(r){let i=SR.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?CR(o,o.length,n.minDepth,i):kR(o,t.startState.selection),new PR(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(fR);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(oe.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=SR.fromTransaction(t),o=t.annotation(oe.time),s=t.annotation(oe.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new PR(e.done.map(SR.fromJSON),e.undone.map(SR.fromJSON))}});function gR(e={}){return[hR,mR.of(e),he.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?vR:e.inputType==`historyRedo`?yR:null;return n?(e.preventDefault(),n(t)):!1}})]}function _R(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(hR,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var vR=_R(0,!1),yR=_R(1,!1),bR=_R(0,!0),xR=_R(1,!0),SR=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&We.fromJSON(t.changes),[],t.mapped&&Ne.fromJSON(t.mapped),t.startSelection&&Le.fromJSON(t.startSelection),t.selectionsAfter.map(Le.fromJSON))}static fromTransaction(t,n){let r=DR;for(let e of t.startState.facet(pR)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,DR)}static selection(t){return new e(void 0,DR,void 0,void 0,t)}};function CR(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function wR(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function TR(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function ER(e,t){return e.length?t.length?e.concat(t):e:t}var DR=[],OR=200;function kR(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-OR));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),CR(e,e.length-1,1e9,n.setSelAfter(r)))}else return[SR.selection([t])]}function AR(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function jR(e,t){if(!e.length)return e;let n=e.length,r=DR;for(;n;){let i=MR(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[SR.selection(r)]:DR}function MR(e,t,n){let r=ER(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):DR,n);if(!e.changes)return SR.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new SR(i,je.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var NR=/^(input\.type|delete)($|\.)/,PR=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||NR.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,wR(s.changes,t.changes))||r==`input.type.compose`)?CR(o,o.length-1,i.minDepth,new SR(t.changes.compose(s.changes),ER(je.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,DR)):CR(o,o.length,i.minDepth,t),new e(o,DR,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:DR;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&TR(a[a.length-1],t)?this:new e(kR(this.done,t),this.undone,n,r)}addMapping(t){return new e(jR(this.done,t),jR(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:dR.of({side:e,rest:AR(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?DR:r.slice(0,r.length-1);return i.mapped&&(n=jR(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:dR.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};PR.empty=new PR(DR,DR);var FR=[{key:`Mod-z`,run:vR,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:yR,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:yR,preventDefault:!0},{key:`Mod-u`,run:bR,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:xR,preventDefault:!0}];function IR(e,t){return Le.create(e.ranges.map(t),e.mainIndex)}function LR(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function RR({state:e,dispatch:t},n){let r=IR(e.selection,n);return r.eq(e.selection,!0)?!1:(t(LR(e,r)),!0)}function zR(e,t){return Le.cursor(t?e.to:e.from)}function BR(e,t){return RR(e,n=>n.empty?e.moveByChar(n,t):zR(n,t))}function VR(e){return e.textDirectionAt(e.state.selection.main.head)==fe.LTR}var HR=e=>BR(e,!VR(e)),UR=e=>BR(e,VR(e));function WR(e,t){return RR(e,n=>n.empty?e.moveByGroup(n,t):zR(n,t))}var GR=e=>WR(e,!VR(e)),KR=e=>WR(e,VR(e));typeof Intl<`u`&&Intl.Segmenter;function qR(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function JR(e,t,n){let r=Ve(e).resolveInner(t.head),i=n?ge.closedBy:ge.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;qR(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?_e(e,r.from,1):_e(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Le.cursor(s,n?-1:1)}var YR=e=>RR(e,t=>JR(e.state,t,!VR(e))),XR=e=>RR(e,t=>JR(e.state,t,VR(e)));function ZR(e,t){return RR(e,n=>{if(!n.empty)return zR(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var QR=e=>ZR(e,!1),$R=e=>ZR(e,!0);function ez(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(he.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function tz(e,t){let n=ez(e),{state:r}=e,i=IR(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):zR(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=he.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(LR(r,i),{effects:a}),!0}var nz=e=>tz(e,!1),rz=e=>tz(e,!0);function iz(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Le.cursor(r.from+n))}return i}var az=e=>RR(e,t=>iz(e,t,!0)),oz=e=>RR(e,t=>iz(e,t,!1)),sz=e=>RR(e,t=>iz(e,t,!VR(e))),cz=e=>RR(e,t=>iz(e,t,VR(e))),lz=e=>RR(e,t=>Le.cursor(e.lineBlockAt(t.head).from,1)),uz=e=>RR(e,t=>Le.cursor(e.lineBlockAt(t.head).to,-1));function dz(e,t,n){let r=!1,i=IR(e.selection,t=>{let i=_e(e,t.head,-1)||_e(e,t.head,1)||t.head>0&&_e(e,t.head-1,1)||t.head<e.doc.length&&_e(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Le.range(t.anchor,a):Le.cursor(a)});return r?(t(LR(e,i)),!0):!1}var fz=({state:e,dispatch:t})=>dz(e,t,!1);function pz(e,t){let n=IR(e.state.selection,e=>{let n=t(e);return Le.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(LR(e.state,n)),!0)}function mz(e,t){return pz(e,n=>e.moveByChar(n,t))}var hz=e=>mz(e,!VR(e)),gz=e=>mz(e,VR(e));function _z(e,t){return pz(e,n=>e.moveByGroup(n,t))}var vz=e=>_z(e,!VR(e)),yz=e=>_z(e,VR(e)),bz=e=>pz(e,t=>JR(e.state,t,!VR(e))),xz=e=>pz(e,t=>JR(e.state,t,VR(e)));function Sz(e,t){return pz(e,n=>e.moveVertically(n,t))}var Cz=e=>Sz(e,!1),wz=e=>Sz(e,!0);function Tz(e,t){return pz(e,n=>e.moveVertically(n,t,ez(e).height))}var Ez=e=>Tz(e,!1),Dz=e=>Tz(e,!0),Oz=e=>pz(e,t=>iz(e,t,!0)),kz=e=>pz(e,t=>iz(e,t,!1)),Az=e=>pz(e,t=>iz(e,t,!VR(e))),jz=e=>pz(e,t=>iz(e,t,VR(e))),Mz=e=>pz(e,t=>Le.cursor(e.lineBlockAt(t.head).from)),Nz=e=>pz(e,t=>Le.cursor(e.lineBlockAt(t.head).to)),Pz=({state:e,dispatch:t})=>(t(LR(e,{anchor:0})),!0),Fz=({state:e,dispatch:t})=>(t(LR(e,{anchor:e.doc.length})),!0),Iz=({state:e,dispatch:t})=>(t(LR(e,{anchor:e.selection.main.anchor,head:0})),!0),Lz=({state:e,dispatch:t})=>(t(LR(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Rz=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),zz=({state:e,dispatch:t})=>{let n=iB(e).map(({from:t,to:n})=>Le.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Le.create(n),userEvent:`select`})),!0},Bz=({state:e,dispatch:t})=>{let n=IR(e.selection,t=>{let n=Ve(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Le.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(LR(e,n)),!0)};function Vz(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(LR(n,Le.create(i,i.length-1))),!0)}var Hz=e=>Vz(e,!1),Uz=e=>Vz(e,!0),Wz=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Le.create([n.main]):n.main.empty||(r=Le.create([Le.cursor(n.main.head)])),r?(t(LR(e,r)),!0):!1};function Gz(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Kz(e,o,!1)):o>i&&(n=`delete.forward`,o=Kz(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Kz(e,i,!1),a=Kz(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Le.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?he.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Kz(e,t,n){if(e instanceof he)for(let r of e.state.facet(he.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var qz=(e,t,n)=>Gz(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=se(s,a.tabSize)%ot(a)||ot(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=ve(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=ve(o.text,c-o.from,!1,!1)+o.from);return c}),Jz=e=>qz(e,!1,!0),Yz=e=>qz(e,!0,!1),Xz=(e,t)=>Gz(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=ve(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Zz=e=>Xz(e,!1),Qz=e=>Xz(e,!0),$z=e=>Gz(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),eB=e=>Gz(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),tB=e=>Gz(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nB=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:xe.of([``,``])},range:Le.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},rB=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:ve(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:ve(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Le.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function iB(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function aB(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of iB(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Le.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Le.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Le.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var oB=({state:e,dispatch:t})=>aB(e,t,!1),sB=({state:e,dispatch:t})=>aB(e,t,!0);function cB(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of iB(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var lB=({state:e,dispatch:t})=>cB(e,t,!1),uB=({state:e,dispatch:t})=>cB(e,t,!0),dB=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(iB(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=IR(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function fB(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ve(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(ge.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var pB=hB(!1),mB=hB(!0);function hB(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&fB(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Ke(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=be(s,r);for(c??=se(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Se(t,c)];return o&&l.push(Se(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:xe.of(l)},range:Le.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function gB(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Le.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var _B=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ke(e,{overrideIndentation:e=>n[e]??-1}),i=gB(e,(t,i,a)=>{let o=be(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Se(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},vB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gB(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ce)})}),{userEvent:`input.indent`})),!0),yB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gB(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=se(r,e.tabSize),a=0,o=Se(e,Math.max(0,i-ot(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),bB=e=>(e.setTabFocusMode(),!0),xB=[{key:`Ctrl-b`,run:HR,shift:hz,preventDefault:!0},{key:`Ctrl-f`,run:UR,shift:gz},{key:`Ctrl-p`,run:QR,shift:Cz},{key:`Ctrl-n`,run:$R,shift:wz},{key:`Ctrl-a`,run:lz,shift:Mz},{key:`Ctrl-e`,run:uz,shift:Nz},{key:`Ctrl-d`,run:Yz},{key:`Ctrl-h`,run:Jz},{key:`Ctrl-k`,run:$z},{key:`Ctrl-Alt-h`,run:Zz},{key:`Ctrl-o`,run:nB},{key:`Ctrl-t`,run:rB},{key:`Ctrl-v`,run:rz}],SB=[{key:`ArrowLeft`,run:HR,shift:hz,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:GR,shift:vz,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:sz,shift:Az,preventDefault:!0},{key:`ArrowRight`,run:UR,shift:gz,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:KR,shift:yz,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:cz,shift:jz,preventDefault:!0},{key:`ArrowUp`,run:QR,shift:Cz,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Pz,shift:Iz},{mac:`Ctrl-ArrowUp`,run:nz,shift:Ez},{key:`ArrowDown`,run:$R,shift:wz,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Fz,shift:Lz},{mac:`Ctrl-ArrowDown`,run:rz,shift:Dz},{key:`PageUp`,run:nz,shift:Ez},{key:`PageDown`,run:rz,shift:Dz},{key:`Home`,run:oz,shift:kz,preventDefault:!0},{key:`Mod-Home`,run:Pz,shift:Iz},{key:`End`,run:az,shift:Oz,preventDefault:!0},{key:`Mod-End`,run:Fz,shift:Lz},{key:`Enter`,run:pB,shift:pB},{key:`Mod-a`,run:Rz},{key:`Backspace`,run:Jz,shift:Jz,preventDefault:!0},{key:`Delete`,run:Yz,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Zz,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Qz,preventDefault:!0},{mac:`Mod-Backspace`,run:eB,preventDefault:!0},{mac:`Mod-Delete`,run:tB,preventDefault:!0}].concat(xB.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),CB=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:YR,shift:bz},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:XR,shift:xz},{key:`Alt-ArrowUp`,run:oB},{key:`Shift-Alt-ArrowUp`,run:lB},{key:`Alt-ArrowDown`,run:sB},{key:`Shift-Alt-ArrowDown`,run:uB},{key:`Mod-Alt-ArrowUp`,run:Hz},{key:`Mod-Alt-ArrowDown`,run:Uz},{key:`Escape`,run:Wz},{key:`Mod-Enter`,run:mB},{key:`Alt-l`,mac:`Ctrl-l`,run:zz},{key:`Mod-i`,run:Bz,preventDefault:!0},{key:`Mod-[`,run:yB},{key:`Mod-]`,run:vB},{key:`Mod-Alt-\\`,run:_B},{key:`Shift-Mod-k`,run:dB},{key:`Shift-Mod-\\`,run:fz},{key:`Mod-/`,run:eR},{key:`Alt-A`,run:rR},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:bB}].concat(SB),wB={key:`Tab`,run:vB,shift:yB},TB=200,EB=function(){};EB.prototype.append=function(e){return e.length?(e=EB.from(e),!this.length&&e||e.length<TB&&this.leafAppend(e)||this.length<TB&&e.leafPrepend(this)||this.appendInner(e)):this},EB.prototype.prepend=function(e){return e.length?EB.from(e).append(this):this},EB.prototype.appendInner=function(e){return new OB(this,e)},EB.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?EB.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},EB.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},EB.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},EB.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},EB.from=function(e){return e instanceof EB?e:e&&e.length?new DB(e):EB.empty};var DB=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=TB)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=TB)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(EB);EB.empty=new DB([]);var OB=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(EB),kB=500,AB=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new MB(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new MB(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new MB(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>PB&&(s=jB(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Cl;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new MB(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new MB(i,o,l))}else r.push(new MB(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new MB(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>kB&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new MB(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(EB.from(i.reverse()),a)}};AB.empty=new AB(EB.empty,0);function jB(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var MB=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},NB=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},PB=20;function FB(e,t,n,r){let i=n.getMeta(UB),a;if(i)return i.historyState;n.getMeta(WB)&&(e=new NB(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(UB))return o.getMeta(UB).redo?new NB(e.done.addTransform(n,void 0,r,HB(t)),e.undone,LB(n.mapping.maps),e.prevTime,e.prevComposition):new NB(e.done,e.undone.addTransform(n,void 0,r,HB(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!IB(n,e.prevRanges)),s=o?RB(e.prevRanges,n.mapping):LB(n.mapping.maps);return new NB(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,HB(t)),AB.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new NB(e.done.rebased(n,a),e.undone.rebased(n,a),RB(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new NB(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),RB(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function IB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function LB(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function RB(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function zB(e,t,n){let r=HB(t),i=UB.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new NB(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(UB,{redo:n,historyState:c})}var BB=!1,VB=null;function HB(e){let t=e.plugins;if(VB!=t){BB=!1,VB=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){BB=!0;break}}return BB}var UB=new Ju(`history`),WB=new Ju(`closeHistory`);function GB(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Gu({key:UB,state:{init(){return new NB(AB.empty,AB.empty,null,0,-1)},apply(t,n,r){return FB(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?qB:n==`historyRedo`?JB:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function KB(e,t){return(n,r)=>{let i=UB.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=zB(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var qB=KB(!1,!0),JB=KB(!0,!0),YB=Object.defineProperty,XB=Object.getOwnPropertySymbols,ZB=Object.prototype.hasOwnProperty,QB=Object.prototype.propertyIsEnumerable,$B=(e,t,n)=>t in e?YB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eV=(e,t)=>{for(var n in t||={})ZB.call(t,n)&&$B(e,n,t[n]);if(XB)for(var n of XB(t))QB.call(t,n)&&$B(e,n,t[n]);return e};function tV(e,t){return Object.assign(e,{meta:eV({package:`@milkdown/components`},t)}),e}var nV=Fv({extensions:[],languages:[],expandIcon:`⬇`,searchIcon:`🔍`,clearSearchIcon:`⌫`,searchPlaceholder:`Search language`,noResultText:`No result`,copyText:`Copy`,copyIcon:`📋`,onCopy:()=>{},renderLanguage:e=>e,renderPreview:()=>null,previewToggleButton:e=>e?`Edit`:`Hide`,previewLabel:`Preview`,previewLoading:`Loading...`},`codeBlockConfigCtx`);tV(nV,{displayName:`Config<code-block>`,group:`CodeBlock`});var rV=class{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){let t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}};function iV({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}iV.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var aV=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function oV(e){return aV(this,null,function*(){try{return navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`),n=document.activeElement;t.value=e,t.setAttribute(`readonly`,``),t.style.contain=`strict`,t.style.position=`absolute`,t.style.left=`-9999px`,t.style.fontSize=`12pt`;let r=document.getSelection(),i=r?r.rangeCount>0&&r.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand(`copy`),document.body.removeChild(t),i&&(r.removeAllRanges(),r.addRange(i)),n&&n.focus()}})}var sV=SE({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(e){let t=()=>{oV(e.text).then(()=>e.onCopy(e.text)).catch(console.error)};return()=>F(NO,null,F(`button`,{type:`button`,class:`copy-button`,onClick:t},F(iV,{icon:e.copyIcon}),e.copyText))}}),cV=SE({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:e,config:t,setLanguage:n,getAllLanguages:i,getReadOnly:a}){let o=N(),s=N(!1),l=N(),u=N(),d=N(``);mE([s,o,u],()=>{d.value=``;let e=o.value,t=u.value;!e||!t||c(e,t,{placement:`bottom-start`}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})}).catch(console.error)});let f=e=>{if(e.preventDefault(),e.stopPropagation(),a())return;let t=!s.value;s.value=t,t&&setTimeout(()=>l.value?.focus(),0)},p=e=>{d.value=e.target.value},m=e=>{e.key===`Escape`&&(d.value=``)},h=Pk(()=>{if(!s.value)return[];let t=i()??[],n=t.find(t=>t.name.toLowerCase()===e.value.toLowerCase()),r=t.filter(e=>{let t=d.value.toLowerCase();return(e.name.toLowerCase().includes(t)||e.alias.some(e=>e.toLowerCase().includes(t)))&&e!==n});return r.length===0?[]:n?[n,...r]:r}),g=e=>{let t=e.target;if(o.value&&o.value.contains(t))return;let n=u.value,r=o.value;!r||!n||r.dataset.expanded===`true`&&(n.contains(t)||(s.value=!1))};return RE(()=>{window.addEventListener(`click`,g)}),HE(()=>{window.removeEventListener(`click`,g)}),()=>F(NO,null,F(`button`,{type:`button`,ref:o,class:`language-button`,onClick:f,"data-expanded":String(s.value)},e.value||`Text`,F(`div`,{class:`expand-icon`},F(iV,{icon:t.expandIcon}))),F(`div`,{ref:u,class:`language-picker`},s.value?F(`div`,{class:`list-wrapper`},F(`div`,{class:`search-box`},F(`div`,{class:`search-icon`},F(iV,{icon:t.searchIcon})),F(`input`,{ref:l,class:`search-input`,placeholder:t.searchPlaceholder,value:d.value,onInput:p,onKeydown:m}),F(`div`,{class:r(`clear-icon`,d.value.length===0&&`hidden`),onMousedown:e=>{e.preventDefault(),d.value=``}},F(iV,{icon:t.clearSearchIcon}))),F(`ul`,{class:`language-list`,role:`listbox`,onKeydown:e=>{if(e.key===`Enter`){let e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&n(e.dataset.language)}}},h.value.length?h.value.map(r=>F(`li`,{role:`listitem`,tabindex:`0`,class:`language-list-item`,"aria-selected":r.name.toLowerCase()===e.value.toLowerCase(),"data-language":r.name,onClick:()=>{n(r.name),s.value=!1}},t.renderLanguage(r.name,r.name.toLowerCase()===e.value.toLowerCase()))):F(`li`,{class:`language-list-item no-result`},t.noResultText))):null))}}),lV=`http://www.w3.org/2000/svg`;function uV(){let e=nS(),t={ADD_TAGS:[`foreignObject`],ADD_ATTR:[`xmlns`],HTML_INTEGRATION_POINTS:{foreignobject:!0}};return e.addHook(`uponSanitizeElement`,(e,t)=>{var n;if(t.tagName===`foreignobject`){let t=e.parentElement;(!t||t.namespaceURI!==lV)&&((n=e.parentNode)==null||n.removeChild(e))}}),n=>e.sanitize(n,t)}var dV;function fV(e){return dV??=uV(),dV(e)}var pV=SE({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(e){let{previewOnlyMode:t,config:n,preview:r}=e,i=N();return pE(()=>{let e=i.value;if(!e)return;for(;e.firstChild;)e.removeChild(e.firstChild);let t=r.value;(typeof t==`string`||t instanceof Element)&&(e.innerHTML=fV(t))}),()=>r.value?F(`div`,{class:`preview-panel`},!t.value&&F(NO,null,F(`div`,{class:`preview-divider`}),F(`div`,{class:`preview-label`},n.previewLabel)),F(`div`,{ref:i,class:`preview`})):null}}),mV=SE({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let t=N(e.config.previewOnlyByDefault??e.getReadOnly()),n=N(),i=N(null);RE(()=>{for(;n.value?.firstChild;)n.value.removeChild(n.value.firstChild);n.value&&n.value.appendChild(e.codemirror.dom)}),mE(()=>[e.text.value,e.language.value],()=>{let t=e.config.renderPreview(e.language.value,e.text.value,e=>i.value=e);t&&(i.value=t),t===void 0&&!i.value&&(i.value=nS.sanitize(e.config.previewLoading)),t===null&&(i.value=null)},{immediate:!0});let a=()=>{};return()=>F(NO,null,F(`div`,{class:`tools`},F(cV,{language:e.language,config:e.config,setLanguage:e.setLanguage,getAllLanguages:e.getAllLanguages,getReadOnly:e.getReadOnly}),F(`div`,{class:`tools-button-group`},F(sV,{copyIcon:e.config.copyIcon,copyText:e.config.copyText,onCopy:e.config.onCopy??a,text:e.text.value}),i.value?F(`button`,{class:`preview-toggle-button`,onClick:()=>t.value=!t.value},F(iV,{icon:e.config.previewToggleButton(t.value)})):null)),F(`div`,{ref:n,class:r(`codemirror-host`,i.value&&t.value&&`hidden`)}),F(pV,{text:e.text,language:e.language,config:e.config,previewOnlyMode:t,preview:i}))}}),hV=new WeakMap,gV=null;function _V(){return gV||=new IntersectionObserver(e=>{for(let t of e)hV.get(t.target)?.(t.isIntersecting)},{rootMargin:`200px`}),gV}var vV=class e{constructor(e,t,n,r,i){this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=i,this.selected=N(!1),this.language=N(``),this.text=N(``),this.initialized=!1,this.updating=!1,this.languageName=``,this.teardownTimer=null,this.forwardUpdate=e=>{if(this.updating||!this.cm.hasFocus)return;let t=(this.getPos()??0)+1,{main:n}=e.state.selection,r=t+n.from,i=t+n.to,a=this.view.state.selection;if(e.docChanged||a.from!==r||a.to!==i){let n=this.view.state.tr;e.changes.iterChanges((e,r,i,a,o)=>{o.length?n.replaceWith(t+e,t+r,this.view.state.schema.text(o.toString())):n.delete(t+e,t+r),t+=a-i-(r-e)}),n.setSelection(O.create(n.doc,r,i)),this.view.dispatch(n)}},this.createApp=()=>DA(mV,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{let e=this.view;return[{key:`ArrowUp`,run:()=>this.maybeEscape(`line`,-1)},{key:`ArrowLeft`,run:()=>this.maybeEscape(`char`,-1)},{key:`ArrowDown`,run:()=>this.maybeEscape(`line`,1)},{key:`ArrowRight`,run:()=>this.maybeEscape(`char`,1)},{key:`Mod-Enter`,run:()=>ld(e.state,e.dispatch)?(e.focus(),!0):!1},{key:`Mod-z`,run:()=>qB(e.state,e.dispatch)},{key:`Shift-Mod-z`,run:()=>JB(e.state,e.dispatch)},{key:`Mod-y`,run:()=>JB(e.state,e.dispatch)},{key:`Backspace`,run:()=>{let e=this.cm.state.selection.ranges;if(e.length>1)return!1;let t=e[0];if(t&&(!t.empty||t.anchor>0)||this.cm.state.doc.lines>=2)return!1;let n=this.view.state,r=this.getPos()??0,i=n.tr.replaceWith(r,r+this.node.nodeSize,n.schema.nodes.paragraph.createChecked({},this.node.content));return i.setSelection(O.near(i.doc.resolve(r))),this.view.dispatch(i),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{let{state:n}=this.cm,r=n.selection.main;if(!r.empty||(e===`line`&&(r=n.doc.lineAt(r.head)),t<0?r.from>0:r.to<n.doc.length))return!1;let i=(this.getPos()??0)+(t<0?0:this.node.nodeSize),a=O.near(this.view.state.doc.resolve(i),t),o=this.view.state.tr.setSelection(a).scrollIntoView();return this.view.dispatch(o),this.view.focus(),!0},this.setLanguage=e=>{this.view.dispatch(this.view.state.tr.setNodeAttribute(this.getPos()??0,`language`,e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new Pe,this.readOnlyConf=new Pe,this.text.value=this.node.textContent,this.language.value=this.node.attrs.language??``,this.dom=document.createElement(`div`),this.dom.className=`milkdown-code-block`,this.disposeSelectedWatcher=pE(()=>{this.selected.value?this.dom.classList.add(`selected`):this.dom.classList.remove(`selected`)}),this.renderPlaceholder(),hV.set(this.dom,e=>{e?(this.cancelTeardown(),this.initializeCodeMirror()):this.initialized&&this.scheduleTeardown()}),_V().observe(this.dom)}renderPlaceholder(){let e=document.createElement(`pre`);e.className=`milkdown-code-block-placeholder`;let t=document.createElement(`code`);t.textContent=this.node.textContent,e.appendChild(t),this.dom.appendChild(e)}initializeCodeMirror(){if(this.initialized)return;this.initialized=!0,this.cm=new he({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(Xe.readOnly.of(!this.view.editable)),de(),De.of(this.codeMirrorKeymap()),this.languageConf.of([]),Xe.changeFilter.of(()=>this.view.editable),...this.config.extensions,he.updateListener.of(this.forwardUpdate)]});let e=this.dom.querySelector(`.milkdown-code-block-placeholder`);e&&this.dom.removeChild(e),this.app=this.createApp(),this.app.mount(this.dom),this.updateLanguage()}teardownCodeMirror(){if(this.initialized&&!(this.cm.hasFocus||this.selected.value)){for(this.app.unmount(),this.cm.destroy(),this.initialized=!1,this.languageName=``;this.dom.firstChild;)this.dom.removeChild(this.dom.firstChild);this.renderPlaceholder()}}scheduleTeardown(){this.cancelTeardown(),this.teardownTimer=setTimeout(()=>this.teardownCodeMirror(),e.TEARDOWN_DELAY)}cancelTeardown(){this.teardownTimer!=null&&(clearTimeout(this.teardownTimer),this.teardownTimer=null)}updateLanguage(){let e=this.node.attrs.language;e!==this.languageName&&(this.language.value=e,this.loader.load(e??``).then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)}).catch(console.error))}setSelection(e,t){this.initialized||this.initializeCodeMirror(),this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){if(e.type!==this.node.type)return!1;if(this.updating)return!0;if(this.node=e,this.text.value=e.textContent,this.language.value=e.attrs.language??``,!this.initialized){let t=this.dom.querySelector(`.milkdown-code-block-placeholder code`);return t&&(t.textContent=e.textContent),!0}this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(Xe.readOnly.of(!this.view.editable))});let t=bV(this.cm.state.doc.toString(),e.textContent);return t&&(this.updating=!0,this.cm.dispatch({changes:{from:t.from,to:t.to,insert:t.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.initialized||this.initializeCodeMirror(),this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.cancelTeardown(),_V().unobserve(this.dom),hV.delete(this.dom),this.initialized&&(this.app.unmount(),this.cm.destroy()),this.disposeSelectedWatcher()}};vV.TEARDOWN_DELAY=5e3;var yV=vV;function bV(e,t){if(e===t)return null;let n=0,r=e.length,i=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&i>n&&e.charCodeAt(r-1)===t.charCodeAt(i-1);)r--,i--;return{from:n,to:r,text:t.slice(n,i)}}var xV=Pv(Wj.node,e=>{let t=e.get(nV.key),n=new rV(t.languages);return(e,r,i)=>new yV(e,r,i,n,t)});tV(xV,{displayName:`NodeView<code-block>`,group:`CodeBlock`});var SV=[xV,nV],CV=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,wV=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(CV(e)):CV,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return at(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=He(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ce(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(wV.prototype[Symbol.iterator]=function(){return this});var TV={from:-1,to:-1,match:/.*/.exec(``),precise:!0},EV=`gm`+(/x/.unicode==null?``:`u`),DV=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=TV,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new AV(e,t,n,r,i);this.re=new RegExp(t,EV+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=MV(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=MV(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},OV=new WeakMap,kV=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=OV.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return OV.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),OV.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},AV=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=TV,this.matchPos=MV(e,r),this.re=new RegExp(t,EV+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=kV.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=MV(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=kV.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(DV.prototype[Symbol.iterator]=AV.prototype[Symbol.iterator]=function(){return this});function jV(e){try{return new RegExp(e,EV),!0}catch{return!1}}function MV(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var NV=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=et(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=Le.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,he.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},PV={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},FV=Ge.define({combine(e){return le(e,PV,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function IV(e){let t=[HV,VV];return e&&t.push(FV.of(e)),t}var LV=ue.mark({class:`cm-selectionMatch`}),RV=ue.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function zV(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=tt.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=tt.Word)}function BV(e,t,n,r){return e(t.sliceDoc(n,n+1))==tt.Word&&e(t.sliceDoc(r-1,r))==tt.Word}var VV=ye.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(FV),{state:n}=e,r=n.selection;if(r.ranges.length>1)return ue.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return ue.none;let e=n.wordAt(i.head);if(!e)return ue.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return ue.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(zV(o,n,i.from,i.to)&&BV(o,n,i.from,i.to)))return ue.none}else if(a=n.sliceDoc(i.from,i.to),!a)return ue.none}let s=[];for(let r of e.visibleRanges){let e=new wV(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||zV(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(RV.range(r,a)):(r>=i.to||a<=i.from)&&s.push(LV.range(r,a)),s.length>t.maxMatches))return ue.none}}return ue.set(s)}},{decorations:e=>e.decorations}),HV=he.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),UV=({state:e,dispatch:t})=>{let{selection:n}=e,r=Le.create(n.ranges.map(t=>e.wordAt(t.head)||Le.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function WV(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new wV(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new wV(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var GV=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return UV({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=WV(e,r);return i?(t(e.update({selection:e.selection.addRange(Le.range(i.from,i.to),!1),effects:he.scrollIntoView(i.to)})),!0):!1},KV=Ge.define({combine(e){return le(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new EH(e),scrollToMatch:e=>he.scrollIntoView(e)})}}),qV=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||jV(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
63
- `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new iH(this):new QV(this)}getCursor(e,t=0,n){let r=e.doc?e:Xe.create({doc:e});return n??=r.doc.length,this.regexp?eH(this,r,t,n):XV(this,r,t,n)}},JV=class{constructor(e){this.spec=e}};function YV(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function XV(e,t,n,r){let i;return e.wholeWord&&(i=ZV(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=YV(e.test,t,i)),new wV(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function ZV(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(tH(i,n-a))!=tt.Word||t(nH(i,n-a))!=tt.Word)&&(t(nH(i,r-a))!=tt.Word||t(tH(i,r-a))!=tt.Word))}var QV=class extends JV{constructor(e){super(e)}nextMatch(e,t,n){let r=XV(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=XV(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=XV(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=XV(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=XV(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function $V(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function eH(e,t,n,r){let i;return e.wholeWord&&(i=rH(t.charCategorizer(t.selection.main.head))),e.test&&(i=$V(e.test,t,i)),new DV(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function tH(e,t){return e.slice(ve(e,t,!1),t)}function nH(e,t){return e.slice(t,ve(e,t))}function rH(e){return(t,n,r)=>!r[0].length||(e(tH(r.input,r.index))!=tt.Word||e(nH(r.input,r.index))!=tt.Word)&&(e(nH(r.input,r.index+r[0].length))!=tt.Word||e(tH(r.input,r.index+r[0].length))!=tt.Word)}var iH=class extends JV{nextMatch(e,t,n){let r=eH(this.spec,e,n,e.doc.length).next();return r.done&&(r=eH(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=eH(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=eH(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=eH(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},aH=je.define(),oH=je.define(),sH=st.define({create(e){return new cH(bH(e).create(),null)},update(e,t){for(let n of t.effects)n.is(aH)?e=new cH(n.value.create(),e.panel):n.is(oH)&&(e=new cH(e.query,n.value?yH:null));return e},provide:e=>qe.from(e,e=>e.panel)}),cH=class{constructor(e,t){this.query=e,this.panel=t}},lH=ue.mark({class:`cm-searchMatch`}),uH=ue.mark({class:`cm-searchMatch cm-searchMatch-selected`}),dH=ye.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sH))}update(e){let t=e.state.field(sH);(t!=e.startState.field(sH)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return ue.none;let{view:n}=this,r=new rt;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?uH:lH)})}return r.finish()}},{decorations:e=>e.decorations});function fH(e){return t=>{let n=t.state.field(sH,!1);return n&&n.query.spec.valid?e(t,n):CH(t)}}var pH=fH((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Le.single(r.from,r.to),a=e.state.facet(KV);return e.dispatch({selection:i,effects:[AH(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),SH(e),!0}),mH=fH((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Le.single(i.from,i.to),o=e.state.facet(KV);return e.dispatch({selection:a,effects:[AH(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),SH(e),!0}),hH=fH((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Le.create(n.map(e=>Le.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),gH=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new wV(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(Le.range(t.value.from,t.value.to))}return t(e.update({selection:Le.create(a,o),userEvent:`select.search.matches`})),!0},_H=fH((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),u.push(he.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=Le.single(o.from,o.to).map(d),u.push(AH(e,o)),u.push(n.facet(KV).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),vH=fH((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:he.announce.of(r),userEvent:`input.replace.all`}),!0});function yH(e){return e.state.facet(KV).createPanel(e)}function bH(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(KV);return new qV({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function xH(e){let t=Ee(e,yH);return t&&t.dom.querySelector(`[main-field]`)}function SH(e){let t=xH(e);t&&t==e.root.activeElement&&t.select()}var CH=e=>{let t=e.state.field(sH,!1);if(t&&t.panel){let n=xH(e);if(n&&n!=e.root.activeElement){let r=bH(e.state,t.query.spec);r.valid&&e.dispatch({effects:aH.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[oH.of(!0),t?aH.of(bH(e.state,t.query.spec)):je.appendConfig.of(MH)]});return!0},wH=e=>{let t=e.state.field(sH,!1);if(!t||!t.panel)return!1;let n=Ee(e,yH);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:oH.of(!1)}),!0},TH=[{key:`Mod-f`,run:CH,scope:`editor search-panel`},{key:`F3`,run:pH,shift:mH,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:pH,shift:mH,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:wH,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:gH},{key:`Mod-Alt-g`,run:NV},{key:`Mod-d`,run:GV,preventDefault:!0}],EH=class{constructor(e){this.view=e;let t=this.query=e.state.field(sH).query.spec;this.commit=this.commit.bind(this),this.searchField=Be(`input`,{value:t.search,placeholder:DH(e,`Find`),"aria-label":DH(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=Be(`input`,{value:t.replace,placeholder:DH(e,`Replace`),"aria-label":DH(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=Be(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=Be(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=Be(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return Be(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=Be(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>pH(e),[DH(e,`next`)]),n(`prev`,()=>mH(e),[DH(e,`previous`)]),n(`select`,()=>hH(e),[DH(e,`all`)]),Be(`label`,null,[this.caseField,DH(e,`match case`)]),Be(`label`,null,[this.reField,DH(e,`regexp`)]),Be(`label`,null,[this.wordField,DH(e,`by word`)]),...e.state.readOnly?[]:[Be(`br`),this.replaceField,n(`replace`,()=>_H(e),[DH(e,`replace`)]),n(`replaceAll`,()=>vH(e),[DH(e,`replace all`)])],Be(`button`,{name:`close`,onclick:()=>wH(e),"aria-label":DH(e,`close`),type:`button`},[`×`])])}commit(){let e=new qV({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:aH.of(e)}))}keydown(e){Fe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?mH:pH)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),_H(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(aH)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(KV).top}};function DH(e,t){return e.state.phrase(t)}var OH=30,kH=/[\s\.,:;?!]/;function AH(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-OH),o=Math.min(i,n+OH),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<OH;e++)if(!kH.test(s[e+1])&&kH.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-OH;e--)if(!kH.test(s[e-1])&&kH.test(s[e])){s=s.slice(0,e);break}}return he.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var jH=he.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),MH=[sH,ze.low(dH),jH],NH=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},PH=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(JH).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new rt,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=aU(s);if(i)o.add(n,n,ue.widget({widget:new QH(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,ue.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,FH(f))}};function FH(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new NH(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new NH(r.from,n,r.diagnostic)}),r}function IH(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(JH).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(RH))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function LH(e,t){return e.field(VH,!1)?t:t.concat(je.appendConfig.of(sU))}var RH=je.define(),zH=je.define(),BH=je.define(),VH=st.define({create(){return new PH(ue.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=FH(n,e.selected.diagnostic,i)||FH(n,null,i)}!n.size&&i&&t.state.facet(JH).autoPanel&&(i=null),e=new PH(n,i,r)}for(let n of t.effects)if(n.is(RH)){let r=t.state.facet(JH).autoPanel?n.value.length?eU.open:null:e.panel;e=PH.init(n.value,r,t.state)}else n.is(zH)?e=new PH(e.diagnostics,n.value?eU.open:null,e.selected):n.is(BH)&&(e=new PH(e.diagnostics,e.panel,n.value));return e},provide:e=>[qe.from(e,e=>e.panel),he.decorations.from(e,e=>e.diagnostics)]}),HH=ue.mark({class:`cm-lintRange cm-lintRange-active`});function UH(e,t,n){let{diagnostics:r}=e.state.field(VH),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(JH).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:WH(e,i)}}}:null}function WH(e,t){return Be(`ul`,{class:`cm-tooltip-lint`},t.map(t=>ZH(e,t,!1)))}var GH=e=>{let t=e.state.field(VH,!1);(!t||!t.panel)&&e.dispatch({effects:LH(e.state,[zH.of(!0)])});let n=Ee(e,eU.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},KH=e=>{let t=e.state.field(VH,!1);return!t||!t.panel?!1:(e.dispatch({effects:zH.of(!1)}),!0)},qH=[{key:`Mod-Shift-m`,run:GH,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(VH,!1);if(!t)return!1;let n=e.state.selection.main,r=FH(t.diagnostics,null,n.to+1);return!r&&(r=FH(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),ae(e,r.from,1,{tooltip:oU,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],JH=Ge.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...le(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:YH,tooltipFilter:YH,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function YH(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function XH(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function ZH(e,t,n){let r=n?XH(t.actions):[];return Be(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},Be(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=FH(e.state.field(VH).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),Be(`u`,s.slice(c,c+1)),s.slice(c+1)];return Be(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&Be(`div`,{class:`cm-diagnosticSource`},t.source))}var QH=class extends ct{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Be(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},$H=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=ZH(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},eU=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)KH(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=XH(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=FH(this.view.state.field(VH).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=Be(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=Be(`div`,{class:`cm-panel-lint`},this.list,Be(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>KH(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(VH).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(VH),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new $H(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new $H(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=FH(this.view.state.field(VH).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:BH.of(t)})}static open(t){return new e(t)}};function tU(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function nU(e){return tU(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var rU=he.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:nU(`#f11`)},".cm-lintRange-warning":{backgroundImage:nU(`orange`)},".cm-lintRange-info":{backgroundImage:nU(`#999`)},".cm-lintRange-hint":{backgroundImage:nU(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function iU(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function aU(e){let t=`hint`,n=1;for(let r of e){let e=iU(r.severity);e>n&&(n=e,t=r.severity)}return t}var oU=Oe(UH,{hideOn:IH}),sU=[VH,he.decorations.compute([VH],e=>{let{selected:t,panel:n}=e.field(VH);return!t||!n||t.from==t.to?ue.none:ue.set([HH.range(t.from,t.to)])}),oU,rU],cU=[ke(),Ze(),pe(),gR(),Re(),de(),we(),Xe.allowMultipleSelections.of(!0),it(),ie(Ie,{fallback:!0}),Ue(),ft(),ut(),re(),Te(),me(),IV(),De.of([...lt,...CB,...TH,...FR,...nt,...dt,...qH])];function lU(e){return e.nodeType===1}function uU(e){return lU(e)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`}function dU(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){let[r,i]=t.pop();if(r>=0){let t=e.nodeDOM(r);if(t&&uU(t)){let{top:e,bottom:a,left:o,right:s}=t.getBoundingClientRect();n.push([r,[o,e,s,e]],[r+i.nodeSize,[o,a,s,a]])}}if(i.isBlock&&!i.isTextblock){let e=r+1;for(let n of i.children)t.push([e,n]),e+=n.nodeSize}}return n}function fU(e,t){let n=[],r,i,a=()=>{let t=e.dom.getBoundingClientRect(),a=e.state.doc;return n&&r&&i&&t.width===i.width&&t.height===i.height&&t.x===i.x&&t.y===i.y&&r.eq(a)?n:(i=t,r=a,n=dU(e),n)},o=(n,r)=>{if(!e.editable||e.isDestroyed)return;let i=(e,t)=>{let[r,i]=e,[a,o]=t;return hU(n,i)-hU(n,o)||r-a},o=a();o.sort(i),o=o.slice(0,8);let s=o.find(n=>t?.({view:e,pos:n[0],event:r})!==!1);if(!(s&&gU(e,s[0])))return s},s,c;return(e,t)=>s&&pU(s,e)?c:(s=e,c=o(e,t),c)}function pU(e,t){return e[0]===t[0]&&e[1]===t[1]}function mU(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function hU(e,t){return Math.min(mU(e,[t[0],t[1]]),mU(e,[t[2],t[3]]))}function gU(e,t){let n=e.dragging;if(!n)return;let{move:r}=n;if(!r)return;let i=e.state.selection;if(!(i instanceof k))return;let{from:a,to:o}=i;return a<=t&&t<=o}function _U(e){let t;return new Gu({key:new Ju(`prosekit-drop-indicator`),view:n=>(t=fU(n,e.onDrag),yU(n,t,e)),props:{handleDrop(e,n,r,i){if(!t)return!1;let a=t([n.clientX,n.clientY],n);if(!a)return!1;n.preventDefault();let o=a[0],s=e.state.tr;if(i){let{node:t}=e.dragging||{};t?t.replace(s):s.deleteSelection()}let c=s.mapping.map(o),l=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,u=s.doc;if(l?s.replaceRangeWith(c,c,r.content.firstChild):s.replaceRange(c,c,r),s.doc.eq(u))return!0;let d=s.doc.resolve(c);if(l&&k.isSelectable(r.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new k(d));else{let t=s.mapping.map(o);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),s.setSelection(vU(e,d,s.doc.resolve(t)))}return e.focus(),e.dispatch(s.setMeta(`uiEvent`,`drop`)),!0}}})}function vU(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||O.between(t,n,r)}function yU(e,t,n){let r=e.dom,i,a,o,s=!1,c=()=>{i&&clearTimeout(i),s=!1,i=setTimeout(()=>{s||n.onHide?.()},30)},l=r=>{s=!0;let{clientX:i,clientY:l}=r;if(a===i&&o===l)return;a=i,o=l;let u=t([i,l],r);if(u){let[t,[r,i,a,o]]=u,s={p1:{x:r,y:i},p2:{x:a,y:o}};n.onShow?.({view:e,pos:t,line:s})}else{c();return}};return r.addEventListener(`dragover`,l),r.addEventListener(`dragend`,c),r.addEventListener(`drop`,c),r.addEventListener(`dragleave`,c),{destroy:()=>{r.removeEventListener(`dragover`,l),r.removeEventListener(`dragend`,c),r.removeEventListener(`drop`,c),r.removeEventListener(`dragleave`,c)}}}var bU=class e extends Tu{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Tu.near(r)}content(){return D.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new xU(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!CU(e)||!wU(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!k.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};bU.prototype.visible=!1,bU.findFrom=bU.findGapCursorFrom,Tu.jsonID(`gapcursor`,bU);var xU=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return bU.valid(t)?new bU(t):Tu.near(t)}};function SU(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function CU(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||SU(e.type))return!0;if(e.inlineContent)return!1}}return!0}function wU(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||SU(e.type))return!0;if(e.inlineContent)return!1}}return!0}function TU(){return new Gu({props:{decorations:AU,createSelectionBetween(e,t,n){return t.pos==n.pos&&bU.valid(n)?new bU(n):null},handleClick:OU,handleKeyDown:EU,handleDOMEvents:{beforeinput:kU}}})}var EU=Ff({ArrowLeft:DU(`horiz`,-1),ArrowRight:DU(`horiz`,1),ArrowUp:DU(`vert`,-1),ArrowDown:DU(`vert`,1)});function DU(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof O){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=bU.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new bU(c))),!0):!1}}function OU(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!bU.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&k.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new bU(r))),!0)}function kU(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof bU))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=E.empty;for(let e=r.length-1;e>=0;e--)i=E.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new D(i,0,0));return a.setSelection(O.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function AU(e){if(!(e.selection instanceof bU))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,wg.create(e.doc,[xg.widget(e.selection.head,t,{key:`gapcursor`})])}function jU(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-cursor`,...t}}),e}var MU=Fv(null,`dropIndicatorState`);jU(MU,{displayName:`Ctx<dropIndicatorState>`});var NU=Fv({width:2,color:!1,class:`milkdown-drop-indicator`},`dropIndicatorConfig`);jU(NU,{displayName:`Ctx<dropIndicatorConfig>`});var PU=new Ju(`MILKDOWN_DROP_INDICATOR_DOM`),FU=Mv(e=>new Gu({key:PU,view:t=>{let n=e.get(NU.key),r=document.createElement(`div`);Object.assign(r.style,{position:`fixed`,pointerEvents:`none`,display:`none`,backgroundColor:n.color,top:`0`,left:`0`}),r.classList.add(n.class),r.classList.add(`milkdown-drop-indicator`),t.dom.parentNode?.appendChild(r);let i=e.use(MU.key),a=e=>{IU(r,e,n)};return i.on(a),{destroy:()=>{i.off(a),r.remove()}}}}));jU(FU,{displayName:`Prose<dropIndicatorDOM>`});function IU(e,t,n){if(!t){Object.assign(e.style,{display:`none`});return}let{line:r}=t,{width:i}=n,{p1:{x:a,y:o},p2:{x:s,y:c}}=r,l=o===c,u,d,f=o,p=a;l?(u=s-a,d=i,f-=i/2):(u=i,d=c-o,p-=i/2),f=Math.round(f),p=Math.round(p),Object.assign(e.style,{display:`block`,width:`${u}px`,height:`${d}px`,transform:`translate(${p}px, ${f}px)`})}var LU=Mv(e=>_U({onShow:t=>{e.set(MU.key,t)},onHide:()=>{e.set(MU.key,null)},onDrag:()=>!0}));jU(LU,{displayName:`Prose<dropIndicator>`});var RU=Mv(()=>TU());jU(RU,{displayName:`Prose<gapCursor>`});var zU=[RU,NU,MU,FU,LU].flat();function BU(e){let t=e?.skipWarning??!1,n=typeof document>`u`?null:document.createElement(`div`);return new Gu({key:VU,view:e=>{t!==!0&&qU(e.state.schema,t||[]);let r=e.dom.ownerDocument;n||=document.createElement(`div`);let i=n,a=()=>{GU(e,i)},o;return window.ResizeObserver&&(o=new window.ResizeObserver(()=>a()),o.observe(e.dom)),r.addEventListener(`selectionchange`,a),{update:()=>{a()},destroy:()=>{r.removeEventListener(`selectionchange`,a),o&&o.unobserve(e.dom)}}},props:{handleKeyDown:(e,t)=>{let{selection:n}=e.state;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.isComposing||![`ArrowLeft`,`ArrowRight`].includes(t.key)||!WU(n)||!n.empty)return!1;let r=n.$head,[i,a]=UU(r),o=e.state.storedMarks||r.marks();if(i&&a&&!Xs.sameSet(i,a)){if(t.key===`ArrowLeft`&&!Xs.sameSet(i,o))return e.dispatch(e.state.tr.setStoredMarks(i)),!0;if(t.key===`ArrowRight`&&!Xs.sameSet(a,o))return e.dispatch(e.state.tr.setStoredMarks(a)),!0}return t.key===`ArrowLeft`&&r.textOffset===1?(e.dispatch(e.state.tr.setSelection(O.create(e.state.doc,r.pos-1)).setStoredMarks(r.marks())),!0):t.key===`ArrowRight`&&r.textOffset+1===r.parent.maybeChild(r.index())?.nodeSize?(e.dispatch(e.state.tr.setSelection(O.create(e.state.doc,r.pos+1)).setStoredMarks(r.marks())),!0):!1},decorations:e=>{if(!(!n||!WU(e.selection)||!e.selection.empty))return wg.create(e.doc,[xg.widget(0,n,{key:`prosemirror-virtual-cursor`})])},attributes:{class:`virtual-cursor-enabled`}}})}var VU=new Ju(`prosemirror-virtual-cursor`);function HU(e,t){let n=window.getSelection();if(!n||!n.rangeCount)return null;let r=(n?.getRangeAt(0))?.cloneRange();if(!r)return null;r.collapse(t);let i=r.getClientRects(),a=i?.length?i[i.length-1]:null;return a?.height?a:e.coordsAtPos(e.state.selection.head)}function UU(e){let t=e.index(),n=e.parent.maybeChild(t),r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[r?.marks,n?.marks]}function WU(e){return e&&typeof e==`object`&&`$cursor`in e}function GU(e,t){if(!e||!e.dom||e.isDestroyed||!t)return;let{state:n,dom:r}=e,{selection:i}=n;if(!WU(i))return;let a=HU(e,i.$head===i.$from);if(!a)return t;let o=r.getBoundingClientRect(),s=`prosemirror-virtual-cursor`,c=n.selection.$head,[l,u]=UU(c),d=n.storedMarks||c.marks();i.$cursor&&l&&u&&d&&!Xs.sameSet(l,u)&&(Xs.sameSet(l,d)?s+=` prosemirror-virtual-cursor-left`:Xs.sameSet(u,d)&&(s+=` prosemirror-virtual-cursor-right`)),t.className=s,KU(t,`prosemirror-virtual-cursor-animation`),t.style.height=`${a.bottom-a.top}px`,t.style.left=`${a.left-o.left}px`,t.style.top=`${a.top-o.top}px`}function KU(e,t){e.classList.remove(t),e.offsetWidth,e.classList.add(t)}function qU(e,t){for(let[n,r]of Object.entries(e.marks))r.spec.inclusive===!1&&!t.includes(n)&&console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}var JU=Object.defineProperty,YU=Object.getOwnPropertySymbols,XU=Object.prototype.hasOwnProperty,ZU=Object.prototype.propertyIsEnumerable,QU=(e,t,n)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$U=(e,t)=>{for(var n in t||={})XU.call(t,n)&&QU(e,n,t[n]);if(YU)for(var n of YU(t))ZU.call(t,n)&&QU(e,n,t[n]);return e};function eW(e,t){return Object.assign(e,{meta:$U({package:`@milkdown/components`},t)}),e}var tW=Fv({imageIcon:`🌌`,uploadButton:`Upload`,confirmButton:`⏎`,uploadPlaceholderText:`/Paste`,onUpload:e=>Promise.resolve(URL.createObjectURL(e))},`inlineImageConfigCtx`);eW(tW,{displayName:`Config<image-inline>`,group:`ImageInline`});function nW({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}nW.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var rW=aN(`abcdefg`,8),iW=SE({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:i,imageIcon:a,uploadButton:o,confirmButton:s,uploadPlaceholderText:c,className:l,onImageLoadError:u}){let d=N(!1),f=N(),p=N(t.value??``),m=N(rW()),h=N(t.value?.length!==0),g=e=>{let t=e.target.value;h.value=t.length!==0,p.value=t},_=e=>{e.key===`Enter`&&n(f.value?.value??``)},v=()=>{n(f.value?.value??``)},y=e=>{let t=e.target.files?.[0];t&&i(t).then(e=>{e&&(n(e),h.value=!0)}).catch(e=>{console.error(`An error occurred while uploading image`),console.error(e)})};return()=>F(`div`,{class:r(`image-edit`,l)},F(nW,{icon:a,class:`image-icon`}),F(`div`,{class:r(`link-importer`,d.value&&`focus`)},F(`input`,{ref:f,draggable:`true`,onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:`link-input-area`,value:p.value,onInput:g,onKeydown:_,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!h.value&&F(`div`,{class:`placeholder`},F(`input`,{disabled:e.value,class:`hidden`,id:m.value,type:`file`,accept:`image/*`,onChange:y}),F(`label`,{class:`uploader`,for:m.value},F(nW,{icon:o})),F(`span`,{class:`text`,onClick:()=>f.value?.focus()},c))),p.value&&F(NO,null,F(`div`,{class:`image-preview`},F(`img`,{src:p.value,alt:``,onError:e=>Promise.resolve(u?.(e)).catch(()=>{})})),F(`div`,{class:`confirm`,onClick:()=>v()},F(nW,{icon:s}))))}}),aW=SE({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let{src:t,alt:n,title:r}=e;return()=>t.value?.length?F(`img`,{class:`image-inline`,src:t.value,alt:n.value,title:r.value}):F(iW,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr(`src`,t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,className:`empty-image-inline`})}}),oW=Pv(Yj.node,e=>(t,n,r)=>{let i=N(t.attrs.src),a=N(t.attrs.alt),o=N(t.attrs.title),s=N(!1),c=N(!n.editable),l=(e,t)=>{if(!n.editable)return;let i=r();i!=null&&n.dispatch(n.state.tr.setNodeAttribute(i,e,e===`src`?nS.sanitize(t):t))},u=e.get(tW.key),d=DA(aW,{src:i,alt:a,title:o,selected:s,readonly:c,setAttr:l,config:u}),f=document.createElement(`span`);f.className=`milkdown-image-inline`;let p=pE(()=>{s.value?f.classList.add(`selected`):f.classList.remove(`selected`)}),m=u.proxyDomURL,h=e=>{if(!m)i.value=e.attrs.src;else{let t=m(e.attrs.src);typeof t==`string`?i.value=t:t.then(e=>{i.value=e}).catch(console.error)}a.value=e.attrs.alt,o.value=e.attrs.title};return h(t),d.mount(f),{dom:f,update:e=>e.type===t.type?(h(e),!0):!1,stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{p(),d.unmount(),f.remove()}}});eW(oW,{displayName:`NodeView<image-inline>`,group:`ImageInline`});var sW=[tW,oW],R=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},cW=/([A-Z])/g,lW=e=>e.replace(cW,`-$1`).toLowerCase(),uW={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},dW=/[&><"']/g,fW=e=>String(e).replace(dW,e=>uW[e]),pW=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?pW(e.body[0]):e:e.type===`font`?pW(e.body):e,mW=new Set([`mathord`,`textord`,`atom`]),hW=e=>mW.has(pW(e).type),gW=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},_W={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function vW(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function yW(e){return e.default===void 0?vW(Array.isArray(e.type)?e.type[0]:e.type):e.default}function bW(e,t,n,r){var i=n[t];e[t]=i===void 0?yW(r):r.processor?r.processor(i):i}var xW=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(_W)){var n=_W[t];n&&bW(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new R(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=gW(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},SW=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return jW[MW[this.id]]}sub(){return jW[NW[this.id]]}fracNum(){return jW[PW[this.id]]}fracDen(){return jW[FW[this.id]]}cramp(){return jW[IW[this.id]]}text(){return jW[LW[this.id]]}isTight(){return this.size>=2}},CW=0,wW=1,TW=2,EW=3,DW=4,OW=5,kW=6,AW=7,jW=[new SW(CW,0,!1),new SW(wW,0,!0),new SW(TW,1,!1),new SW(EW,1,!0),new SW(DW,2,!1),new SW(OW,2,!0),new SW(kW,3,!1),new SW(AW,3,!0)],MW=[DW,OW,DW,OW,kW,AW,kW,AW],NW=[OW,OW,OW,OW,AW,AW,AW,AW],PW=[TW,EW,DW,OW,kW,AW,kW,AW],FW=[EW,EW,OW,OW,AW,AW,AW,AW],IW=[wW,wW,EW,EW,OW,OW,AW,AW],LW=[CW,wW,TW,EW,TW,EW,TW,EW],RW={DISPLAY:jW[CW],TEXT:jW[TW],SCRIPT:jW[DW],SCRIPTSCRIPT:jW[kW]},zW=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function BW(e){for(var t=0;t<zW.length;t++)for(var n=zW[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var VW=[];zW.forEach(e=>e.blocks.forEach(e=>VW.push(...e)));function HW(e){for(var t=0;t<VW.length;t+=2)if(e>=VW[t]&&e<=VW[t+1])return!0;return!1}var UW=e=>e+` `+e,WW=80,GW=function(e,t){return`M95,`+(622+e+t)+`
64
- c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
65
- c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
66
- c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
67
- s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
68
- c69,-144,104.5,-217.7,106.5,-221
69
- l`+e/2.075+` -`+e+`
70
- c5.3,-9.3,12,-14,20,-14
71
- H400000v`+(40+e)+`H845.2724
72
- s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
73
- c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
74
- M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},KW=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
75
- c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
76
- c340,-704.7,510.7,-1060.3,512,-1067
77
- l`+e/2.084+` -`+e+`
78
- c4.7,-7.3,11,-11,19,-11
79
- H40000v`+(40+e)+`H1012.3
80
- s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
81
- c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
82
- s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
83
- c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
84
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},qW=function(e,t){return`M983 `+(10+e+t)+`
85
- l`+e/3.13+` -`+e+`
86
- c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
87
- H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
88
- s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
89
- c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
90
- c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
91
- c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
92
- c53.7,-170.3,84.5,-266.8,92.5,-289.5z
93
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},JW=function(e,t){return`M424,`+(2398+e+t)+`
94
- c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
95
- c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
96
- s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
97
- s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
98
- l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
99
- v`+(40+e)+`H1014.6
100
- s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
101
- c-2,6,-10,9,-24,9
102
- c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
103
- h400000v`+(40+e)+`h-400000z`},YW=function(e,t){return`M473,`+(2713+e+t)+`
104
- c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
105
- c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
106
- s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
107
- c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
108
- c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
109
- s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
110
- 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},XW=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},ZW=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
111
- H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
112
- h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
113
- c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
114
- 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},QW=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=GW(t,WW);break;case`sqrtSize1`:r=KW(t,WW);break;case`sqrtSize2`:r=qW(t,WW);break;case`sqrtSize3`:r=JW(t,WW);break;case`sqrtSize4`:r=YW(t,WW);break;case`sqrtTall`:r=ZW(t,WW,n)}return r},$W=function(e,t){switch(e){case`⎜`:return UW(`M291 0 H417 V`+t+` H291z`);case`∣`:return UW(`M145 0 H188 V`+t+` H145z`);case`∥`:return UW(`M145 0 H188 V`+t+` H145z`)+UW(`M367 0 H410 V`+t+` H367z`);case`⎟`:return UW(`M457 0 H583 V`+t+` H457z`);case`⎢`:return UW(`M319 0 H403 V`+t+` H319z`);case`⎥`:return UW(`M263 0 H347 V`+t+` H263z`);case`⎪`:return UW(`M384 0 H504 V`+t+` H384z`);case`⏐`:return UW(`M312 0 H355 V`+t+` H312z`);case`‖`:return UW(`M257 0 H300 V`+t+` H257z`)+UW(`M478 0 H521 V`+t+` H478z`);default:return``}},eG={doubleleftarrow:`M262 157
115
- l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
116
- 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
117
- 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
118
- c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
119
- 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
120
- -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
121
- -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
122
- m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
123
- -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
124
- 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
125
- -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
126
- -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
127
- -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
128
- c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
129
- -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
130
- 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
131
- -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
132
- c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
133
- 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
134
- 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
135
- l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
136
- -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
137
- 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
138
- 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
139
- 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
140
- -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
141
- H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
142
- 435 0h399565z`,leftgroupunder:`M400000 262
143
- H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
144
- 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
145
- -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
146
- -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
147
- -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
148
- 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
149
- -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
150
- -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
151
- m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
152
- 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
153
- 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
154
- -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
155
- 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
156
- -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
157
- v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
158
- -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
159
- -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
160
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:UW(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:UW(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:UW(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:UW(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
161
- -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
162
- c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
163
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:UW(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
164
- c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
165
- -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
166
- 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
167
- 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
168
- c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
169
- 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
170
- 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
171
- -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
172
- -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
173
- m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
174
- 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
175
- -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
176
- m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
177
- c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
178
- -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
179
- m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
180
- 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
181
- -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
182
- m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
183
- c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
184
- -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
185
- 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
186
- 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
187
- -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
188
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
189
- 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
190
- -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
191
- s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
192
- c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
193
- 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
194
- -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
195
- 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
196
- 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
197
- -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
198
- -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
199
- 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
200
- -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
201
- 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
202
- m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
203
- 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
204
- -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
205
- -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
206
- 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
207
- 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
208
- -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
209
- m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
210
- 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
211
- -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
212
- 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:UW(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:UW(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:UW(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
213
- 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
214
- -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
215
- -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
216
- 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
217
- -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
218
- -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
219
- -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
220
- 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
221
- c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
222
- 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
223
- 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
224
- -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
225
- 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
226
- -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
227
- 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
228
- 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
229
- -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
230
- -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
231
- 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
232
- c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
233
- 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
234
- -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
235
- 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
236
- 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
237
- -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
238
- -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
239
- 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
240
- 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
241
- -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
242
- 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
243
- 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
244
- -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
245
- -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
246
- H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
247
- c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
248
- c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
249
- -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
250
- -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
251
- -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
252
- -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
253
- -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
254
- -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
255
- -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
256
- c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
257
- c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
258
- s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
259
- 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
260
- s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
261
- c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
262
- M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
263
- -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
264
- 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
265
- -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
266
- -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
267
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
268
- 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
269
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
270
- c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
271
- c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
272
- c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
273
- M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
274
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
275
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
276
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
277
- M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
278
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
279
- 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
280
- -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
281
- M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
282
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
283
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
284
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
285
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},tG=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
286
- H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
287
- M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
288
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
289
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
290
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
291
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
292
- M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
293
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
294
- c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
295
- MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
296
- MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
297
- M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
298
- M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
299
- c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
300
- -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
301
- 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
302
- c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
303
- -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
304
- l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
305
- -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
306
- 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
307
- c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
308
- c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
309
- c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
310
- c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
311
- c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
312
- l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
313
- -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function nG(e){return`toText`in e}var rG=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(nG(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},iG={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},aG={ex:!0,em:!0,mu:!0},oG=function(e){return typeof e!=`string`&&(e=e.unit),e in iG||e in aG||e===`ex`},sG=function(e,t){var n;if(e.unit in iG)n=iG[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new R(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},z=function(e){return+e.toFixed(4)+`em`},cG=function(e){return e.filter(e=>e).join(` `)},lG=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=lW(n)+`:`+r+`;`)}return t},uG=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},dG=function(e){var t=document.createElement(e);t.className=cG(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},fG=/[\s"'>/=\x00-\x1f]/,pG=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+fW(cG(this.classes))+`"`);var n=lG(this.style);n&&(t+=` style="`+fW(n)+`"`);for(var r of Object.keys(this.attributes)){if(fG.test(r))throw new R(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+fW(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},mG=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,uG.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return dG.call(this,`span`)}toMarkup(){return pG.call(this,`span`)}},hG=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,uG.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return dG.call(this,`a`)}toMarkup(){return pG.call(this,`a`)}},gG=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+fW(this.src)+`"`+(` alt="`+fW(this.alt)+`"`),t=lG(this.style);return t&&(e+=` style="`+fW(t)+`"`),e+=`'/>`,e}},_G={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},vG=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=BW(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=_G[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=z(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=cG(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=fW(cG(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+z(this.italic)+`;`),n+=lG(this.style),n&&(e=!0,t+=` style="`+fW(n)+`"`);var r=fW(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},yG=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+fW(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},bG=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,eG[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+fW(this.alternate)+`"/>`:`<path d="`+fW(eG[this.pathName])+`"/>`}},xG=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+fW(this.attributes[t])+`"`;return e+=`/>`,e}};function SG(e){if(e instanceof vG)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function CG(e){if(e instanceof mG)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var wG=e=>e instanceof mG||e instanceof hG||e instanceof rG,TG={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},EG={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},DG={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function OG(e,t){TG[e]=t}function kG(e,t,n){if(!TG[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=TG[t][r];if(!i&&e[0]in DG&&(r=DG[e[0]].charCodeAt(0),i=TG[t][r]),!i&&n===`text`&&HW(r)&&(i=TG[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var AG={};function jG(e){var t=e>=5?0:e>=3?1:2;if(!AG[t]){var n=AG[t]={cssEmPerMu:EG.quad[t]/18};for(var r in EG)EG.hasOwnProperty(r)&&(n[r]=EG[r][t])}return AG[t]}var MG={math:{},text:{}};function B(e,t,n,r,i,a){MG[e][i]={font:t,group:n,replace:r},a&&r&&(MG[e][r]=MG[e][i])}var V=`math`,H=`text`,U=`main`,W=`ams`,NG=`accent-token`,G=`bin`,PG=`close`,FG=`inner`,K=`mathord`,IG=`op-token`,LG=`open`,RG=`punct`,q=`rel`,zG=`spacing`,J=`textord`;B(V,U,q,`≡`,`\\equiv`,!0),B(V,U,q,`≺`,`\\prec`,!0),B(V,U,q,`≻`,`\\succ`,!0),B(V,U,q,`∼`,`\\sim`,!0),B(V,U,q,`⊥`,`\\perp`),B(V,U,q,`⪯`,`\\preceq`,!0),B(V,U,q,`⪰`,`\\succeq`,!0),B(V,U,q,`≃`,`\\simeq`,!0),B(V,U,q,`∣`,`\\mid`,!0),B(V,U,q,`≪`,`\\ll`,!0),B(V,U,q,`≫`,`\\gg`,!0),B(V,U,q,`≍`,`\\asymp`,!0),B(V,U,q,`∥`,`\\parallel`),B(V,U,q,`⋈`,`\\bowtie`,!0),B(V,U,q,`⌣`,`\\smile`,!0),B(V,U,q,`⊑`,`\\sqsubseteq`,!0),B(V,U,q,`⊒`,`\\sqsupseteq`,!0),B(V,U,q,`≐`,`\\doteq`,!0),B(V,U,q,`⌢`,`\\frown`,!0),B(V,U,q,`∋`,`\\ni`,!0),B(V,U,q,`∝`,`\\propto`,!0),B(V,U,q,`⊢`,`\\vdash`,!0),B(V,U,q,`⊣`,`\\dashv`,!0),B(V,U,q,`∋`,`\\owns`),B(V,U,RG,`.`,`\\ldotp`),B(V,U,RG,`⋅`,`\\cdotp`),B(V,U,RG,`⋅`,`·`),B(H,U,J,`⋅`,`·`),B(V,U,J,`#`,`\\#`),B(H,U,J,`#`,`\\#`),B(V,U,J,`&`,`\\&`),B(H,U,J,`&`,`\\&`),B(V,U,J,`ℵ`,`\\aleph`,!0),B(V,U,J,`∀`,`\\forall`,!0),B(V,U,J,`ℏ`,`\\hbar`,!0),B(V,U,J,`∃`,`\\exists`,!0),B(V,U,J,`∇`,`\\nabla`,!0),B(V,U,J,`♭`,`\\flat`,!0),B(V,U,J,`ℓ`,`\\ell`,!0),B(V,U,J,`♮`,`\\natural`,!0),B(V,U,J,`♣`,`\\clubsuit`,!0),B(V,U,J,`℘`,`\\wp`,!0),B(V,U,J,`♯`,`\\sharp`,!0),B(V,U,J,`♢`,`\\diamondsuit`,!0),B(V,U,J,`ℜ`,`\\Re`,!0),B(V,U,J,`♡`,`\\heartsuit`,!0),B(V,U,J,`ℑ`,`\\Im`,!0),B(V,U,J,`♠`,`\\spadesuit`,!0),B(V,U,J,`§`,`\\S`,!0),B(H,U,J,`§`,`\\S`),B(V,U,J,`¶`,`\\P`,!0),B(H,U,J,`¶`,`\\P`),B(V,U,J,`†`,`\\dag`),B(H,U,J,`†`,`\\dag`),B(H,U,J,`†`,`\\textdagger`),B(V,U,J,`‡`,`\\ddag`),B(H,U,J,`‡`,`\\ddag`),B(H,U,J,`‡`,`\\textdaggerdbl`),B(V,U,PG,`⎱`,`\\rmoustache`,!0),B(V,U,LG,`⎰`,`\\lmoustache`,!0),B(V,U,PG,`⟯`,`\\rgroup`,!0),B(V,U,LG,`⟮`,`\\lgroup`,!0),B(V,U,G,`∓`,`\\mp`,!0),B(V,U,G,`⊖`,`\\ominus`,!0),B(V,U,G,`⊎`,`\\uplus`,!0),B(V,U,G,`⊓`,`\\sqcap`,!0),B(V,U,G,`∗`,`\\ast`),B(V,U,G,`⊔`,`\\sqcup`,!0),B(V,U,G,`◯`,`\\bigcirc`,!0),B(V,U,G,`∙`,`\\bullet`,!0),B(V,U,G,`‡`,`\\ddagger`),B(V,U,G,`≀`,`\\wr`,!0),B(V,U,G,`⨿`,`\\amalg`),B(V,U,G,`&`,`\\And`),B(V,U,q,`⟵`,`\\longleftarrow`,!0),B(V,U,q,`⇐`,`\\Leftarrow`,!0),B(V,U,q,`⟸`,`\\Longleftarrow`,!0),B(V,U,q,`⟶`,`\\longrightarrow`,!0),B(V,U,q,`⇒`,`\\Rightarrow`,!0),B(V,U,q,`⟹`,`\\Longrightarrow`,!0),B(V,U,q,`↔`,`\\leftrightarrow`,!0),B(V,U,q,`⟷`,`\\longleftrightarrow`,!0),B(V,U,q,`⇔`,`\\Leftrightarrow`,!0),B(V,U,q,`⟺`,`\\Longleftrightarrow`,!0),B(V,U,q,`↦`,`\\mapsto`,!0),B(V,U,q,`⟼`,`\\longmapsto`,!0),B(V,U,q,`↗`,`\\nearrow`,!0),B(V,U,q,`↩`,`\\hookleftarrow`,!0),B(V,U,q,`↪`,`\\hookrightarrow`,!0),B(V,U,q,`↘`,`\\searrow`,!0),B(V,U,q,`↼`,`\\leftharpoonup`,!0),B(V,U,q,`⇀`,`\\rightharpoonup`,!0),B(V,U,q,`↙`,`\\swarrow`,!0),B(V,U,q,`↽`,`\\leftharpoondown`,!0),B(V,U,q,`⇁`,`\\rightharpoondown`,!0),B(V,U,q,`↖`,`\\nwarrow`,!0),B(V,U,q,`⇌`,`\\rightleftharpoons`,!0),B(V,W,q,`≮`,`\\nless`,!0),B(V,W,q,``,`\\@nleqslant`),B(V,W,q,``,`\\@nleqq`),B(V,W,q,`⪇`,`\\lneq`,!0),B(V,W,q,`≨`,`\\lneqq`,!0),B(V,W,q,``,`\\@lvertneqq`),B(V,W,q,`⋦`,`\\lnsim`,!0),B(V,W,q,`⪉`,`\\lnapprox`,!0),B(V,W,q,`⊀`,`\\nprec`,!0),B(V,W,q,`⋠`,`\\npreceq`,!0),B(V,W,q,`⋨`,`\\precnsim`,!0),B(V,W,q,`⪹`,`\\precnapprox`,!0),B(V,W,q,`≁`,`\\nsim`,!0),B(V,W,q,``,`\\@nshortmid`),B(V,W,q,`∤`,`\\nmid`,!0),B(V,W,q,`⊬`,`\\nvdash`,!0),B(V,W,q,`⊭`,`\\nvDash`,!0),B(V,W,q,`⋪`,`\\ntriangleleft`),B(V,W,q,`⋬`,`\\ntrianglelefteq`,!0),B(V,W,q,`⊊`,`\\subsetneq`,!0),B(V,W,q,``,`\\@varsubsetneq`),B(V,W,q,`⫋`,`\\subsetneqq`,!0),B(V,W,q,``,`\\@varsubsetneqq`),B(V,W,q,`≯`,`\\ngtr`,!0),B(V,W,q,``,`\\@ngeqslant`),B(V,W,q,``,`\\@ngeqq`),B(V,W,q,`⪈`,`\\gneq`,!0),B(V,W,q,`≩`,`\\gneqq`,!0),B(V,W,q,``,`\\@gvertneqq`),B(V,W,q,`⋧`,`\\gnsim`,!0),B(V,W,q,`⪊`,`\\gnapprox`,!0),B(V,W,q,`⊁`,`\\nsucc`,!0),B(V,W,q,`⋡`,`\\nsucceq`,!0),B(V,W,q,`⋩`,`\\succnsim`,!0),B(V,W,q,`⪺`,`\\succnapprox`,!0),B(V,W,q,`≆`,`\\ncong`,!0),B(V,W,q,``,`\\@nshortparallel`),B(V,W,q,`∦`,`\\nparallel`,!0),B(V,W,q,`⊯`,`\\nVDash`,!0),B(V,W,q,`⋫`,`\\ntriangleright`),B(V,W,q,`⋭`,`\\ntrianglerighteq`,!0),B(V,W,q,``,`\\@nsupseteqq`),B(V,W,q,`⊋`,`\\supsetneq`,!0),B(V,W,q,``,`\\@varsupsetneq`),B(V,W,q,`⫌`,`\\supsetneqq`,!0),B(V,W,q,``,`\\@varsupsetneqq`),B(V,W,q,`⊮`,`\\nVdash`,!0),B(V,W,q,`⪵`,`\\precneqq`,!0),B(V,W,q,`⪶`,`\\succneqq`,!0),B(V,W,q,``,`\\@nsubseteqq`),B(V,W,G,`⊴`,`\\unlhd`),B(V,W,G,`⊵`,`\\unrhd`),B(V,W,q,`↚`,`\\nleftarrow`,!0),B(V,W,q,`↛`,`\\nrightarrow`,!0),B(V,W,q,`⇍`,`\\nLeftarrow`,!0),B(V,W,q,`⇏`,`\\nRightarrow`,!0),B(V,W,q,`↮`,`\\nleftrightarrow`,!0),B(V,W,q,`⇎`,`\\nLeftrightarrow`,!0),B(V,W,q,`△`,`\\vartriangle`),B(V,W,J,`ℏ`,`\\hslash`),B(V,W,J,`▽`,`\\triangledown`),B(V,W,J,`◊`,`\\lozenge`),B(V,W,J,`Ⓢ`,`\\circledS`),B(V,W,J,`®`,`\\circledR`),B(H,W,J,`®`,`\\circledR`),B(V,W,J,`∡`,`\\measuredangle`,!0),B(V,W,J,`∄`,`\\nexists`),B(V,W,J,`℧`,`\\mho`),B(V,W,J,`Ⅎ`,`\\Finv`,!0),B(V,W,J,`⅁`,`\\Game`,!0),B(V,W,J,`‵`,`\\backprime`),B(V,W,J,`▲`,`\\blacktriangle`),B(V,W,J,`▼`,`\\blacktriangledown`),B(V,W,J,`■`,`\\blacksquare`),B(V,W,J,`⧫`,`\\blacklozenge`),B(V,W,J,`★`,`\\bigstar`),B(V,W,J,`∢`,`\\sphericalangle`,!0),B(V,W,J,`∁`,`\\complement`,!0),B(V,W,J,`ð`,`\\eth`,!0),B(H,U,J,`ð`,`ð`),B(V,W,J,`╱`,`\\diagup`),B(V,W,J,`╲`,`\\diagdown`),B(V,W,J,`□`,`\\square`),B(V,W,J,`□`,`\\Box`),B(V,W,J,`◊`,`\\Diamond`),B(V,W,J,`¥`,`\\yen`,!0),B(H,W,J,`¥`,`\\yen`,!0),B(V,W,J,`✓`,`\\checkmark`,!0),B(H,W,J,`✓`,`\\checkmark`),B(V,W,J,`ℶ`,`\\beth`,!0),B(V,W,J,`ℸ`,`\\daleth`,!0),B(V,W,J,`ℷ`,`\\gimel`,!0),B(V,W,J,`ϝ`,`\\digamma`,!0),B(V,W,J,`ϰ`,`\\varkappa`),B(V,W,LG,`┌`,`\\@ulcorner`,!0),B(V,W,PG,`┐`,`\\@urcorner`,!0),B(V,W,LG,`└`,`\\@llcorner`,!0),B(V,W,PG,`┘`,`\\@lrcorner`,!0),B(V,W,q,`≦`,`\\leqq`,!0),B(V,W,q,`⩽`,`\\leqslant`,!0),B(V,W,q,`⪕`,`\\eqslantless`,!0),B(V,W,q,`≲`,`\\lesssim`,!0),B(V,W,q,`⪅`,`\\lessapprox`,!0),B(V,W,q,`≊`,`\\approxeq`,!0),B(V,W,G,`⋖`,`\\lessdot`),B(V,W,q,`⋘`,`\\lll`,!0),B(V,W,q,`≶`,`\\lessgtr`,!0),B(V,W,q,`⋚`,`\\lesseqgtr`,!0),B(V,W,q,`⪋`,`\\lesseqqgtr`,!0),B(V,W,q,`≑`,`\\doteqdot`),B(V,W,q,`≓`,`\\risingdotseq`,!0),B(V,W,q,`≒`,`\\fallingdotseq`,!0),B(V,W,q,`∽`,`\\backsim`,!0),B(V,W,q,`⋍`,`\\backsimeq`,!0),B(V,W,q,`⫅`,`\\subseteqq`,!0),B(V,W,q,`⋐`,`\\Subset`,!0),B(V,W,q,`⊏`,`\\sqsubset`,!0),B(V,W,q,`≼`,`\\preccurlyeq`,!0),B(V,W,q,`⋞`,`\\curlyeqprec`,!0),B(V,W,q,`≾`,`\\precsim`,!0),B(V,W,q,`⪷`,`\\precapprox`,!0),B(V,W,q,`⊲`,`\\vartriangleleft`),B(V,W,q,`⊴`,`\\trianglelefteq`),B(V,W,q,`⊨`,`\\vDash`,!0),B(V,W,q,`⊪`,`\\Vvdash`,!0),B(V,W,q,`⌣`,`\\smallsmile`),B(V,W,q,`⌢`,`\\smallfrown`),B(V,W,q,`≏`,`\\bumpeq`,!0),B(V,W,q,`≎`,`\\Bumpeq`,!0),B(V,W,q,`≧`,`\\geqq`,!0),B(V,W,q,`⩾`,`\\geqslant`,!0),B(V,W,q,`⪖`,`\\eqslantgtr`,!0),B(V,W,q,`≳`,`\\gtrsim`,!0),B(V,W,q,`⪆`,`\\gtrapprox`,!0),B(V,W,G,`⋗`,`\\gtrdot`),B(V,W,q,`⋙`,`\\ggg`,!0),B(V,W,q,`≷`,`\\gtrless`,!0),B(V,W,q,`⋛`,`\\gtreqless`,!0),B(V,W,q,`⪌`,`\\gtreqqless`,!0),B(V,W,q,`≖`,`\\eqcirc`,!0),B(V,W,q,`≗`,`\\circeq`,!0),B(V,W,q,`≜`,`\\triangleq`,!0),B(V,W,q,`∼`,`\\thicksim`),B(V,W,q,`≈`,`\\thickapprox`),B(V,W,q,`⫆`,`\\supseteqq`,!0),B(V,W,q,`⋑`,`\\Supset`,!0),B(V,W,q,`⊐`,`\\sqsupset`,!0),B(V,W,q,`≽`,`\\succcurlyeq`,!0),B(V,W,q,`⋟`,`\\curlyeqsucc`,!0),B(V,W,q,`≿`,`\\succsim`,!0),B(V,W,q,`⪸`,`\\succapprox`,!0),B(V,W,q,`⊳`,`\\vartriangleright`),B(V,W,q,`⊵`,`\\trianglerighteq`),B(V,W,q,`⊩`,`\\Vdash`,!0),B(V,W,q,`∣`,`\\shortmid`),B(V,W,q,`∥`,`\\shortparallel`),B(V,W,q,`≬`,`\\between`,!0),B(V,W,q,`⋔`,`\\pitchfork`,!0),B(V,W,q,`∝`,`\\varpropto`),B(V,W,q,`◀`,`\\blacktriangleleft`),B(V,W,q,`∴`,`\\therefore`,!0),B(V,W,q,`∍`,`\\backepsilon`),B(V,W,q,`▶`,`\\blacktriangleright`),B(V,W,q,`∵`,`\\because`,!0),B(V,W,q,`⋘`,`\\llless`),B(V,W,q,`⋙`,`\\gggtr`),B(V,W,G,`⊲`,`\\lhd`),B(V,W,G,`⊳`,`\\rhd`),B(V,W,q,`≂`,`\\eqsim`,!0),B(V,U,q,`⋈`,`\\Join`),B(V,W,q,`≑`,`\\Doteq`,!0),B(V,W,G,`∔`,`\\dotplus`,!0),B(V,W,G,`∖`,`\\smallsetminus`),B(V,W,G,`⋒`,`\\Cap`,!0),B(V,W,G,`⋓`,`\\Cup`,!0),B(V,W,G,`⩞`,`\\doublebarwedge`,!0),B(V,W,G,`⊟`,`\\boxminus`,!0),B(V,W,G,`⊞`,`\\boxplus`,!0),B(V,W,G,`⋇`,`\\divideontimes`,!0),B(V,W,G,`⋉`,`\\ltimes`,!0),B(V,W,G,`⋊`,`\\rtimes`,!0),B(V,W,G,`⋋`,`\\leftthreetimes`,!0),B(V,W,G,`⋌`,`\\rightthreetimes`,!0),B(V,W,G,`⋏`,`\\curlywedge`,!0),B(V,W,G,`⋎`,`\\curlyvee`,!0),B(V,W,G,`⊝`,`\\circleddash`,!0),B(V,W,G,`⊛`,`\\circledast`,!0),B(V,W,G,`⋅`,`\\centerdot`),B(V,W,G,`⊺`,`\\intercal`,!0),B(V,W,G,`⋒`,`\\doublecap`),B(V,W,G,`⋓`,`\\doublecup`),B(V,W,G,`⊠`,`\\boxtimes`,!0),B(V,W,q,`⇢`,`\\dashrightarrow`,!0),B(V,W,q,`⇠`,`\\dashleftarrow`,!0),B(V,W,q,`⇇`,`\\leftleftarrows`,!0),B(V,W,q,`⇆`,`\\leftrightarrows`,!0),B(V,W,q,`⇚`,`\\Lleftarrow`,!0),B(V,W,q,`↞`,`\\twoheadleftarrow`,!0),B(V,W,q,`↢`,`\\leftarrowtail`,!0),B(V,W,q,`↫`,`\\looparrowleft`,!0),B(V,W,q,`⇋`,`\\leftrightharpoons`,!0),B(V,W,q,`↶`,`\\curvearrowleft`,!0),B(V,W,q,`↺`,`\\circlearrowleft`,!0),B(V,W,q,`↰`,`\\Lsh`,!0),B(V,W,q,`⇈`,`\\upuparrows`,!0),B(V,W,q,`↿`,`\\upharpoonleft`,!0),B(V,W,q,`⇃`,`\\downharpoonleft`,!0),B(V,U,q,`⊶`,`\\origof`,!0),B(V,U,q,`⊷`,`\\imageof`,!0),B(V,W,q,`⊸`,`\\multimap`,!0),B(V,W,q,`↭`,`\\leftrightsquigarrow`,!0),B(V,W,q,`⇉`,`\\rightrightarrows`,!0),B(V,W,q,`⇄`,`\\rightleftarrows`,!0),B(V,W,q,`↠`,`\\twoheadrightarrow`,!0),B(V,W,q,`↣`,`\\rightarrowtail`,!0),B(V,W,q,`↬`,`\\looparrowright`,!0),B(V,W,q,`↷`,`\\curvearrowright`,!0),B(V,W,q,`↻`,`\\circlearrowright`,!0),B(V,W,q,`↱`,`\\Rsh`,!0),B(V,W,q,`⇊`,`\\downdownarrows`,!0),B(V,W,q,`↾`,`\\upharpoonright`,!0),B(V,W,q,`⇂`,`\\downharpoonright`,!0),B(V,W,q,`⇝`,`\\rightsquigarrow`,!0),B(V,W,q,`⇝`,`\\leadsto`),B(V,W,q,`⇛`,`\\Rrightarrow`,!0),B(V,W,q,`↾`,`\\restriction`),B(V,U,J,`‘`,"`"),B(V,U,J,`$`,`\\$`),B(H,U,J,`$`,`\\$`),B(H,U,J,`$`,`\\textdollar`),B(V,U,J,`%`,`\\%`),B(H,U,J,`%`,`\\%`),B(V,U,J,`_`,`\\_`),B(H,U,J,`_`,`\\_`),B(H,U,J,`_`,`\\textunderscore`),B(V,U,J,`∠`,`\\angle`,!0),B(V,U,J,`∞`,`\\infty`,!0),B(V,U,J,`′`,`\\prime`),B(V,U,J,`△`,`\\triangle`),B(V,U,J,`Γ`,`\\Gamma`,!0),B(V,U,J,`Δ`,`\\Delta`,!0),B(V,U,J,`Θ`,`\\Theta`,!0),B(V,U,J,`Λ`,`\\Lambda`,!0),B(V,U,J,`Ξ`,`\\Xi`,!0),B(V,U,J,`Π`,`\\Pi`,!0),B(V,U,J,`Σ`,`\\Sigma`,!0),B(V,U,J,`Υ`,`\\Upsilon`,!0),B(V,U,J,`Φ`,`\\Phi`,!0),B(V,U,J,`Ψ`,`\\Psi`,!0),B(V,U,J,`Ω`,`\\Omega`,!0),B(V,U,J,`A`,`Α`),B(V,U,J,`B`,`Β`),B(V,U,J,`E`,`Ε`),B(V,U,J,`Z`,`Ζ`),B(V,U,J,`H`,`Η`),B(V,U,J,`I`,`Ι`),B(V,U,J,`K`,`Κ`),B(V,U,J,`M`,`Μ`),B(V,U,J,`N`,`Ν`),B(V,U,J,`O`,`Ο`),B(V,U,J,`P`,`Ρ`),B(V,U,J,`T`,`Τ`),B(V,U,J,`X`,`Χ`),B(V,U,J,`¬`,`\\neg`,!0),B(V,U,J,`¬`,`\\lnot`),B(V,U,J,`⊤`,`\\top`),B(V,U,J,`⊥`,`\\bot`),B(V,U,J,`∅`,`\\emptyset`),B(V,W,J,`∅`,`\\varnothing`),B(V,U,K,`α`,`\\alpha`,!0),B(V,U,K,`β`,`\\beta`,!0),B(V,U,K,`γ`,`\\gamma`,!0),B(V,U,K,`δ`,`\\delta`,!0),B(V,U,K,`ϵ`,`\\epsilon`,!0),B(V,U,K,`ζ`,`\\zeta`,!0),B(V,U,K,`η`,`\\eta`,!0),B(V,U,K,`θ`,`\\theta`,!0),B(V,U,K,`ι`,`\\iota`,!0),B(V,U,K,`κ`,`\\kappa`,!0),B(V,U,K,`λ`,`\\lambda`,!0),B(V,U,K,`μ`,`\\mu`,!0),B(V,U,K,`ν`,`\\nu`,!0),B(V,U,K,`ξ`,`\\xi`,!0),B(V,U,K,`ο`,`\\omicron`,!0),B(V,U,K,`π`,`\\pi`,!0),B(V,U,K,`ρ`,`\\rho`,!0),B(V,U,K,`σ`,`\\sigma`,!0),B(V,U,K,`τ`,`\\tau`,!0),B(V,U,K,`υ`,`\\upsilon`,!0),B(V,U,K,`ϕ`,`\\phi`,!0),B(V,U,K,`χ`,`\\chi`,!0),B(V,U,K,`ψ`,`\\psi`,!0),B(V,U,K,`ω`,`\\omega`,!0),B(V,U,K,`ε`,`\\varepsilon`,!0),B(V,U,K,`ϑ`,`\\vartheta`,!0),B(V,U,K,`ϖ`,`\\varpi`,!0),B(V,U,K,`ϱ`,`\\varrho`,!0),B(V,U,K,`ς`,`\\varsigma`,!0),B(V,U,K,`φ`,`\\varphi`,!0),B(V,U,G,`∗`,`*`,!0),B(V,U,G,`+`,`+`),B(V,U,G,`−`,`-`,!0),B(V,U,G,`⋅`,`\\cdot`,!0),B(V,U,G,`∘`,`\\circ`,!0),B(V,U,G,`÷`,`\\div`,!0),B(V,U,G,`±`,`\\pm`,!0),B(V,U,G,`×`,`\\times`,!0),B(V,U,G,`∩`,`\\cap`,!0),B(V,U,G,`∪`,`\\cup`,!0),B(V,U,G,`∖`,`\\setminus`,!0),B(V,U,G,`∧`,`\\land`),B(V,U,G,`∨`,`\\lor`),B(V,U,G,`∧`,`\\wedge`,!0),B(V,U,G,`∨`,`\\vee`,!0),B(V,U,J,`√`,`\\surd`),B(V,U,LG,`⟨`,`\\langle`,!0),B(V,U,LG,`∣`,`\\lvert`),B(V,U,LG,`∥`,`\\lVert`),B(V,U,PG,`?`,`?`),B(V,U,PG,`!`,`!`),B(V,U,PG,`⟩`,`\\rangle`,!0),B(V,U,PG,`∣`,`\\rvert`),B(V,U,PG,`∥`,`\\rVert`),B(V,U,q,`=`,`=`),B(V,U,q,`:`,`:`),B(V,U,q,`≈`,`\\approx`,!0),B(V,U,q,`≅`,`\\cong`,!0),B(V,U,q,`≥`,`\\ge`),B(V,U,q,`≥`,`\\geq`,!0),B(V,U,q,`←`,`\\gets`),B(V,U,q,`>`,`\\gt`,!0),B(V,U,q,`∈`,`\\in`,!0),B(V,U,q,``,`\\@not`),B(V,U,q,`⊂`,`\\subset`,!0),B(V,U,q,`⊃`,`\\supset`,!0),B(V,U,q,`⊆`,`\\subseteq`,!0),B(V,U,q,`⊇`,`\\supseteq`,!0),B(V,W,q,`⊈`,`\\nsubseteq`,!0),B(V,W,q,`⊉`,`\\nsupseteq`,!0),B(V,U,q,`⊨`,`\\models`),B(V,U,q,`←`,`\\leftarrow`,!0),B(V,U,q,`≤`,`\\le`),B(V,U,q,`≤`,`\\leq`,!0),B(V,U,q,`<`,`\\lt`,!0),B(V,U,q,`→`,`\\rightarrow`,!0),B(V,U,q,`→`,`\\to`),B(V,W,q,`≱`,`\\ngeq`,!0),B(V,W,q,`≰`,`\\nleq`,!0),B(V,U,zG,`\xA0`,`\\ `),B(V,U,zG,`\xA0`,`\\space`),B(V,U,zG,`\xA0`,`\\nobreakspace`),B(H,U,zG,`\xA0`,`\\ `),B(H,U,zG,`\xA0`,` `),B(H,U,zG,`\xA0`,`\\space`),B(H,U,zG,`\xA0`,`\\nobreakspace`),B(V,U,zG,``,`\\nobreak`),B(V,U,zG,``,`\\allowbreak`),B(V,U,RG,`,`,`,`),B(V,U,RG,`;`,`;`),B(V,W,G,`⊼`,`\\barwedge`,!0),B(V,W,G,`⊻`,`\\veebar`,!0),B(V,U,G,`⊙`,`\\odot`,!0),B(V,U,G,`⊕`,`\\oplus`,!0),B(V,U,G,`⊗`,`\\otimes`,!0),B(V,U,J,`∂`,`\\partial`,!0),B(V,U,G,`⊘`,`\\oslash`,!0),B(V,W,G,`⊚`,`\\circledcirc`,!0),B(V,W,G,`⊡`,`\\boxdot`,!0),B(V,U,G,`△`,`\\bigtriangleup`),B(V,U,G,`▽`,`\\bigtriangledown`),B(V,U,G,`†`,`\\dagger`),B(V,U,G,`⋄`,`\\diamond`),B(V,U,G,`⋆`,`\\star`),B(V,U,G,`◃`,`\\triangleleft`),B(V,U,G,`▹`,`\\triangleright`),B(V,U,LG,`{`,`\\{`),B(H,U,J,`{`,`\\{`),B(H,U,J,`{`,`\\textbraceleft`),B(V,U,PG,`}`,`\\}`),B(H,U,J,`}`,`\\}`),B(H,U,J,`}`,`\\textbraceright`),B(V,U,LG,`{`,`\\lbrace`),B(V,U,PG,`}`,`\\rbrace`),B(V,U,LG,`[`,`\\lbrack`,!0),B(H,U,J,`[`,`\\lbrack`,!0),B(V,U,PG,`]`,`\\rbrack`,!0),B(H,U,J,`]`,`\\rbrack`,!0),B(V,U,LG,`(`,`\\lparen`,!0),B(V,U,PG,`)`,`\\rparen`,!0),B(H,U,J,`<`,`\\textless`,!0),B(H,U,J,`>`,`\\textgreater`,!0),B(V,U,LG,`⌊`,`\\lfloor`,!0),B(V,U,PG,`⌋`,`\\rfloor`,!0),B(V,U,LG,`⌈`,`\\lceil`,!0),B(V,U,PG,`⌉`,`\\rceil`,!0),B(V,U,J,`\\`,`\\backslash`),B(V,U,J,`∣`,`|`),B(V,U,J,`∣`,`\\vert`),B(H,U,J,`|`,`\\textbar`,!0),B(V,U,J,`∥`,`\\|`),B(V,U,J,`∥`,`\\Vert`),B(H,U,J,`∥`,`\\textbardbl`),B(H,U,J,`~`,`\\textasciitilde`),B(H,U,J,`\\`,`\\textbackslash`),B(H,U,J,`^`,`\\textasciicircum`),B(V,U,q,`↑`,`\\uparrow`,!0),B(V,U,q,`⇑`,`\\Uparrow`,!0),B(V,U,q,`↓`,`\\downarrow`,!0),B(V,U,q,`⇓`,`\\Downarrow`,!0),B(V,U,q,`↕`,`\\updownarrow`,!0),B(V,U,q,`⇕`,`\\Updownarrow`,!0),B(V,U,IG,`∐`,`\\coprod`),B(V,U,IG,`⋁`,`\\bigvee`),B(V,U,IG,`⋀`,`\\bigwedge`),B(V,U,IG,`⨄`,`\\biguplus`),B(V,U,IG,`⋂`,`\\bigcap`),B(V,U,IG,`⋃`,`\\bigcup`),B(V,U,IG,`∫`,`\\int`),B(V,U,IG,`∫`,`\\intop`),B(V,U,IG,`∬`,`\\iint`),B(V,U,IG,`∭`,`\\iiint`),B(V,U,IG,`∏`,`\\prod`),B(V,U,IG,`∑`,`\\sum`),B(V,U,IG,`⨂`,`\\bigotimes`),B(V,U,IG,`⨁`,`\\bigoplus`),B(V,U,IG,`⨀`,`\\bigodot`),B(V,U,IG,`∮`,`\\oint`),B(V,U,IG,`∯`,`\\oiint`),B(V,U,IG,`∰`,`\\oiiint`),B(V,U,IG,`⨆`,`\\bigsqcup`),B(V,U,IG,`∫`,`\\smallint`),B(H,U,FG,`…`,`\\textellipsis`),B(V,U,FG,`…`,`\\mathellipsis`),B(H,U,FG,`…`,`\\ldots`,!0),B(V,U,FG,`…`,`\\ldots`,!0),B(V,U,FG,`⋯`,`\\@cdots`,!0),B(V,U,FG,`⋱`,`\\ddots`,!0),B(V,U,J,`⋮`,`\\varvdots`),B(H,U,J,`⋮`,`\\varvdots`),B(V,U,NG,`ˊ`,`\\acute`),B(V,U,NG,`ˋ`,`\\grave`),B(V,U,NG,`¨`,`\\ddot`),B(V,U,NG,`~`,`\\tilde`),B(V,U,NG,`ˉ`,`\\bar`),B(V,U,NG,`˘`,`\\breve`),B(V,U,NG,`ˇ`,`\\check`),B(V,U,NG,`^`,`\\hat`),B(V,U,NG,`⃗`,`\\vec`),B(V,U,NG,`˙`,`\\dot`),B(V,U,NG,`˚`,`\\mathring`),B(V,U,K,``,`\\@imath`),B(V,U,K,``,`\\@jmath`),B(V,U,J,`ı`,`ı`),B(V,U,J,`ȷ`,`ȷ`),B(H,U,J,`ı`,`\\i`,!0),B(H,U,J,`ȷ`,`\\j`,!0),B(H,U,J,`ß`,`\\ss`,!0),B(H,U,J,`æ`,`\\ae`,!0),B(H,U,J,`œ`,`\\oe`,!0),B(H,U,J,`ø`,`\\o`,!0),B(H,U,J,`Æ`,`\\AE`,!0),B(H,U,J,`Œ`,`\\OE`,!0),B(H,U,J,`Ø`,`\\O`,!0),B(H,U,NG,`ˊ`,`\\'`),B(H,U,NG,`ˋ`,"\\`"),B(H,U,NG,`ˆ`,`\\^`),B(H,U,NG,`˜`,`\\~`),B(H,U,NG,`ˉ`,`\\=`),B(H,U,NG,`˘`,`\\u`),B(H,U,NG,`˙`,`\\.`),B(H,U,NG,`¸`,`\\c`),B(H,U,NG,`˚`,`\\r`),B(H,U,NG,`ˇ`,`\\v`),B(H,U,NG,`¨`,`\\"`),B(H,U,NG,`˝`,`\\H`),B(H,U,NG,`◯`,`\\textcircled`);var BG={"--":!0,"---":!0,"``":!0,"''":!0};B(H,U,J,`–`,`--`,!0),B(H,U,J,`–`,`\\textendash`),B(H,U,J,`—`,`---`,!0),B(H,U,J,`—`,`\\textemdash`),B(H,U,J,`‘`,"`",!0),B(H,U,J,`‘`,`\\textquoteleft`),B(H,U,J,`’`,`'`,!0),B(H,U,J,`’`,`\\textquoteright`),B(H,U,J,`“`,"``",!0),B(H,U,J,`“`,`\\textquotedblleft`),B(H,U,J,`”`,`''`,!0),B(H,U,J,`”`,`\\textquotedblright`),B(V,U,J,`°`,`\\degree`,!0),B(H,U,J,`°`,`\\degree`),B(H,U,J,`°`,`\\textdegree`,!0),B(V,U,J,`£`,`\\pounds`),B(V,U,J,`£`,`\\mathsterling`,!0),B(H,U,J,`£`,`\\pounds`),B(H,U,J,`£`,`\\textsterling`,!0),B(V,W,J,`✠`,`\\maltese`),B(H,W,J,`✠`,`\\maltese`);for(var VG=`0123456789/@."`,HG=0;HG<VG.length;HG++){var UG=VG.charAt(HG);B(V,U,J,UG,UG)}for(var WG=`0123456789!@*()-=+";:?/.,`,GG=0;GG<WG.length;GG++){var KG=WG.charAt(GG);B(H,U,J,KG,KG)}for(var qG=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,JG=0;JG<qG.length;JG++){var YG=qG.charAt(JG);B(V,U,K,YG,YG),B(H,U,J,YG,YG)}B(V,W,J,`C`,`ℂ`),B(H,W,J,`C`,`ℂ`),B(V,W,J,`H`,`ℍ`),B(H,W,J,`H`,`ℍ`),B(V,W,J,`N`,`ℕ`),B(H,W,J,`N`,`ℕ`),B(V,W,J,`P`,`ℙ`),B(H,W,J,`P`,`ℙ`),B(V,W,J,`Q`,`ℚ`),B(H,W,J,`Q`,`ℚ`),B(V,W,J,`R`,`ℝ`),B(H,W,J,`R`,`ℝ`),B(V,W,J,`Z`,`ℤ`),B(H,W,J,`Z`,`ℤ`),B(V,U,K,`h`,`ℎ`),B(H,U,K,`h`,`ℎ`);for(var Y,XG=0;XG<qG.length;XG++){var ZG=qG.charAt(XG);Y=String.fromCharCode(55349,56320+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56372+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56424+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56580+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56684+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56736+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56788+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56840+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56944+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),XG<26&&(Y=String.fromCharCode(55349,56632+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y),Y=String.fromCharCode(55349,56476+XG),B(V,U,K,ZG,Y),B(H,U,J,ZG,Y))}Y=String.fromCharCode(55349,56668),B(V,U,K,`k`,Y),B(H,U,J,`k`,Y);for(var QG=0;QG<10;QG++){var $G=QG.toString();Y=String.fromCharCode(55349,57294+QG),B(V,U,K,$G,Y),B(H,U,J,$G,Y),Y=String.fromCharCode(55349,57314+QG),B(V,U,K,$G,Y),B(H,U,J,$G,Y),Y=String.fromCharCode(55349,57324+QG),B(V,U,K,$G,Y),B(H,U,J,$G,Y),Y=String.fromCharCode(55349,57334+QG),B(V,U,K,$G,Y),B(H,U,J,$G,Y)}for(var eK=`ÐÞþ`,tK=0;tK<eK.length;tK++){var nK=eK.charAt(tK);B(V,U,K,nK,nK),B(H,U,J,nK,nK)}var rK={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},iK={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},aK={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},oK={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},sK={mathClass:``,textClass:``,font:``},cK={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},lK={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},uK={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},dK={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},fK={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},pK={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},mK={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},hK=[rK,rK,iK,iK,aK,aK,oK,sK,sK,sK,cK,cK,lK,lK,uK,uK,dK,dK,fK,fK,pK,pK,sK,sK,mK,mK],gK=[rK,sK,dK,fK,mK],_K=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return hK[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return gK[Math.floor((r-120782)/10)];if(r===120485||r===120486)return hK[0];if(120486<r&&r<120782)return sK;throw new R(`Unsupported character: `+e)},vK=function(e,t,n){if(MG[n][e]){var r=MG[n][e].replace;r&&(e=r)}return{value:e,metrics:kG(e,t,n)}},yK=function(e,t,n,r,i){var a=vK(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new vG(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new vG(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},bK=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&vK(e,`Main-Bold`,t).metrics?yK(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||MG[t][e].font===`main`?yK(e,`Main-Regular`,t,n,r):yK(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},xK=function(e,t,n){return n!==`textord`&&vK(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},SK=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=_K(i);f=m.font,p=m[r+`Class`]}if(f)return yK(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=xK(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=FK[o].fontName,g=[o]):(h=PK(s,c,l),g=[s,c,l]);if(vK(i,h,r).metrics)return yK(i,h,r,t,a.concat(g));if(BG.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(yK(i[y],h,r,t,a.concat(g)));return kK(v)}}if(n===`mathord`)return yK(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=MG[r][i]&&MG[r][i].font;if(b===`ams`)return yK(i,PK(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return yK(i,PK(`textrm`,c,l),r,t,a.concat(c,l));var x=PK(b,c,l);return yK(i,x,r,t,a.concat(x,c,l))}else throw Error(`unexpected type: `+n+` in makeOrd`)},CK=(e,t)=>{if(cG(e.classes)!==cG(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},wK=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof vG&&r instanceof vG&&CK(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},TK=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new mG(e,t,n,r);return TK(i),i},EK=(e,t,n,r)=>new mG(e,t,n,r),DK=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=z(r.height),r.maxFontSize=1,r},OK=function(e,t,n,r){var i=new hG(e,t,n,r);return TK(i),i},kK=function(e){var t=new rG(e);return TK(t),t},AK=function(e,t){return e instanceof rG?X([],[e],t):e},jK=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},MK=function(e,t){for(var{children:n,depth:r}=jK(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=X([`pstrut`],[]);c.style.height=z(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=X(g,[c,h],void 0,_);v.style.top=z(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=X([`vlist`],l);y.style.height=z(d);var b;if(u<0){var x=X([`vlist`],[X([],[])]);x.style.height=z(-u),b=[X([`vlist-r`],[y,X([`vlist-s`],[new vG(`​`)])]),X([`vlist-r`],[x])]}else b=[X([`vlist-r`],[y])];var S=X([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},NK=(e,t)=>{var n=X([`mspace`],[],t),r=sG(e,t);return n.style.marginRight=z(r),n},PK=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},FK={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},IK={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},LK=function(e,t){var[n,r,i]=IK[e],a=EK([`overlay`],[new yG([new bG(n)],{width:z(r),height:z(i),style:`width:`+z(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=z(i),a.style.width=z(r),a},RK={number:3,unit:`mu`},zK={number:4,unit:`mu`},BK={number:5,unit:`mu`},VK={mord:{mop:RK,mbin:zK,mrel:BK,minner:RK},mop:{mord:RK,mop:RK,mrel:BK,minner:RK},mbin:{mord:zK,mop:zK,mopen:zK,minner:zK},mrel:{mord:BK,mop:BK,mopen:BK,minner:BK},mopen:{},mclose:{mop:RK,mbin:zK,mrel:BK,minner:RK},mpunct:{mord:RK,mop:RK,mrel:BK,mopen:RK,mclose:RK,mpunct:RK,minner:RK},minner:{mord:RK,mop:RK,mbin:zK,mrel:BK,mopen:RK,mpunct:RK,minner:RK}},HK={mord:{mop:RK},mop:{mord:RK,mop:RK},mbin:{},mrel:{},mopen:{},mclose:{mop:RK},mpunct:{},minner:{mop:RK}},UK={},WK={},GK={};function Z(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:i}=e,a=0;a<n.length;++a)UK[n[a]]=e;t&&(r&&(WK[t]=r),i&&(GK[t]=i))}function KK(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(WK[t]=n),r&&(GK[t]=r)}var qK=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},JK=function(e){return e.type===`ordgroup`?e.body:[e]},YK=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),XK=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),ZK={display:RW.DISPLAY,text:RW.TEXT,script:RW.SCRIPT,scriptscript:RW.SCRIPTSCRIPT},QK={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},$K=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=aq(e[a],t);if(o instanceof rG){var s=o.children;i.push(...s)}else i.push(o)}if(wK(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(ZK[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return eq(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&XK.has(r)?t.classes[0]=`mord`:r===`mbin`&&YK.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),eq(i,(e,t)=>{var n=rq(t),r=rq(e),i=n&&r?e.hasClass(`mtight`)?HK[n]?.[r]:VK[n]?.[r]:null;if(i)return NK(i,c)},{node:u},d,f),i},eq=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=tq(o);if(s){eq(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},tq=function(e){return e instanceof rG||e instanceof hG||e instanceof mG&&e.hasClass(`enclosing`)?e:null},nq=function(e,t){var n=tq(e);if(n){var r=n.children;if(r.length){if(t===`right`)return nq(r[r.length-1],`right`);if(t===`left`)return nq(r[0],`left`)}}return e},rq=function(e,t){return e?(t&&(e=nq(e,t)),QK[e.classes[0]]||null):null},iq=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},aq=function(e,t,n){if(!e)return X();if(WK[e.type]){var r=WK[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new R(`Got group of unknown type: '`+e.type+`'`)};function oq(e,t){var n=X([`base`],e,t),r=X([`strut`]);return r.style.height=z(n.height+n.depth),n.depth&&(r.style.verticalAlign=z(-n.depth)),n.children.unshift(r),n}function sq(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=$K(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(oq(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(oq(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(oq(o,t));var l;n?(l=oq($K(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=z(u.height+u.depth),u.depth&&(d.style.verticalAlign=z(-u.depth))}return u}function cq(e){return new rG(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=cG(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof lq&&this.children[n+1]instanceof lq){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof lq;)r+=this.children[++n].toText();e.appendChild(new lq(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=fW(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+fW(cG(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},lq=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return fW(this.toText())}toText(){return this.text}},uq=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=`  `:e>=-.05556&&e<=-.05555?this.character=` ⁣`:e>=-.1667&&e<=-.1666?this.character=` ⁣`:e>=-.2223&&e<=-.2222?this.character=` ⁣`:e>=-.2778&&e<=-.2777?this.character=` ⁣`:this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,z(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+z(this.width)+`"/>`}toText(){return this.character?this.character:` `}},dq=new Set([`\\imath`,`\\jmath`]),fq=new Set([`mrow`,`mtable`]),pq=function(e,t,n){return MG[t][e]&&MG[t][e].replace&&e.charCodeAt(0)!==55349&&!(BG.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=MG[t][e].replace),new lq(e)},mq=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},hq={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},gq=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=hq[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(dq.has(a))return null;if(MG[r][a]){var o=MG[r][a].replace;o&&(a=o)}var s=FK[n].fontName;return kG(a,s,r)?FK[n].variant:null};function _q(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof lq&&t.text===`.`}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof lq&&n.text===`,`}else return!1}var vq=function(e,t,n){if(e.length===1){var r=bq(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=bq(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}else if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}else if(_q(s)&&a.type===`mn`){a.children.push(...s.children);continue}else if(s.type===`mn`&&_q(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||_q(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof lq&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof lq&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},yq=function(e,t,n){return mq(vq(e,t,n))},bq=function(e,t){if(!e)return new Q(`mrow`);if(GK[e.type])return GK[e.type](e,t);throw new R(`Got group of unknown type: '`+e.type+`'`)};function xq(e,t,n,r,i){var a=vq(e,n),o=a.length===1&&a[0]instanceof Q&&fq.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new lq(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var Sq=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Cq=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],wq=function(e,t){return t.size<2?e:Sq[e-1][t.size-1]},Tq=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=Cq[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:wq(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Cq[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=wq(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=jG(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};Tq.BASESIZE=6;var Eq=function(e){return new Tq({style:e.displayMode?RW.DISPLAY:RW.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Dq=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},Oq=function(e,t,n){var r=Eq(n),i;return n.output===`mathml`?xq(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[sq(e,r)]):X([`katex`],[xq(e,t,r,n.displayMode,!1),sq(e,r)]),Dq(i,n))},kq=function(e,t,n){return Dq(X([`katex`],[sq(e,Eq(n))]),n)},Aq={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},jq=function(e){var t=new Q(`mo`,[new lq(Aq[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},Mq={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Nq=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),Pq=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Nq.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:EK([],[new yG([new bG(o)],{width:`100%`,height:z(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}else{var l=[],u=Mq[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
314
- `+h+` children.`);for(var v=0;v<h;v++){var y=new yG([new bG(d[v])],{width:`400em`,height:z(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=EK([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=z(m),l.push(b)}return{span:X([`stretchy`],l,t),minWidth:f,height:m}}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=z(a),i>0&&(r.style.minWidth=z(i)),r},Fq=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new xG({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new xG({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=EK([],[new yG(c,{width:`100%`,height:z(o)})],i)}return a.height=o,a.style.height=z(o),a},Iq={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Lq={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Rq(e){return e in Iq}function zq(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function Bq(e){var t=Vq(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function Vq(e){return e&&(e.type===`atom`||Lq.hasOwnProperty(e.type))?e:null}var Hq=e=>{if(e instanceof vG)return e;if(wG(e)&&e.children.length===1)return Hq(e.children[0])},Uq=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=zq(e.base,`accent`),n=r.base,e.base=n,i=CG(aq(e,t)),e.base=r):(r=zq(e,`accent`),n=r.base);var a=aq(n,t.havingCrampedStyle()),o=r.isShifty&&hW(n),s=0;o&&(s=Hq(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=Pq(r,t),u=MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+z(2*s)+`)`,marginLeft:z(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=LK(`vec`,t),f=IK.vec[1]):(d=SK({type:`textord`,mode:r.mode,text:r.label},t),d=SG(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=z(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},Wq=(e,t)=>{var n=e.isStretchy?jq(e.label):new Q(`mo`,[pq(e.label,e.mode)]),r=new Q(`mover`,[bq(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Gq=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=qK(t[0]),r=!Gq.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Uq,mathmlBuilder:Wq}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=aq(e.base,t),r=Pq(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[MK({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=jq(e.label),r=new Q(`munder`,[bq(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Kq=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=AK(aq(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=AK(aq(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Pq(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=MK({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=MK({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=jq(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Kq(bq(e.body,t));r=e.below?new Q(`munderover`,[n,Kq(bq(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,Kq(bq(e.below,t))]):(r=Kq(),r=new Q(`mover`,[n,r]));return r}});function qq(e,t){var n=$K(e.body,t,!0);return X([e.mclass],n,t)}function Jq(e,t){var n,r=vq(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:JK(i),isCharacterBox:hW(i)}},htmlBuilder:qq,mathmlBuilder:Jq});var Yq=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:Yq(t[0]),body:JK(t[1]),isCharacterBox:hW(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Yq(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:JK(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:hW(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:Yq(t[0]),body:JK(t[0])}},htmlBuilder(e,t){var n=$K(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,vq(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Xq={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Zq=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Qq=e=>e.type===`textord`&&e.text===`@`,$q=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function eJ(e,t,n){var r=Xq[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function tJ(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new R(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=Zq(),c=0;c<o.length;c++)if(!Qq(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=Bq(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l))if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if($q(o[p],l)){f=!1,c=p;break}if(Qq(o[p]))throw new R(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new R(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new R(`Expected one of "<>AV=|." after @`,o[c]);var m={type:`styling`,body:[eJ(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Zq()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=AK(aq(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=z(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[bq(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=AK(aq(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[bq(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=zq(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=zq(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new R(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new R(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var{parser:n}=e,r=zq(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:JK(i)}},htmlBuilder:(e,t)=>kK($K(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,vq(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=zq(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&zq(i,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=z(sG(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,z(sG(e.size,t)))),n}});var nJ={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},rJ=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new R(`Expected a control sequence`,e);return t},iJ=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},aJ=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(nJ[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=nJ[r.text]),zq(t.parseFunction(),`internal`);throw new R(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new R(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new R(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new R(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new R(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===nJ[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=rJ(t.gullet.popToken());return t.gullet.consumeSpaces(),aJ(t,r,iJ(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=rJ(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return aJ(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var oJ=function(e,t,n){var r=kG(MG.math[e]&&MG.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},sJ=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},cJ=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=z(i),e.height-=i,e.depth+=i},lJ=function(e,t,n,r,i,a){var o=sJ(yK(e,`Main-Regular`,i,r),t,r,a);return n&&cJ(o,r,t),o},uJ=function(e,t,n,r){return yK(e,`Size`+t+`-Regular`,n,r)},dJ=function(e,t,n,r,i,a){var o=uJ(e,t,i,r),s=sJ(X([`delimsizing`,`size`+t],[o],r),RW.TEXT,r,a);return n&&cJ(s,r,RW.TEXT),s},fJ=function(e,t,n){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[yK(e,t,n)])])}},pJ=function(e,t,n){var r=TG[`Size4-Regular`][e.charCodeAt(0)]?TG[`Size4-Regular`][e.charCodeAt(0)][4]:TG[`Size1-Regular`][e.charCodeAt(0)][4],i=EK([],[new yG([new bG(`inner`,$W(e,Math.round(1e3*t)))],{width:z(r),height:z(t),style:`width:`+z(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=z(t),i.style.width=z(r),{type:`elem`,elem:i}},mJ=.008,hJ={type:`kern`,size:-1*mJ},gJ=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),_J=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),vJ=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):gJ.has(e)?(c=`∣`,u=`vert`,d=333):_J.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=oJ(o,f,i),m=p.height+p.depth,h=oJ(c,f,i),g=h.height+h.depth,_=oJ(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=oJ(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,ee=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,te=r.fontMetrics().axisHeight;n&&(te*=r.sizeMultiplier);var ne=ee/2-te,re=[];if(u.length>0){var ie=ee-m-v,ae=Math.round(ee*1e3),oe=tG(u,Math.round(ie*1e3)),se=new bG(u,oe),ce=z(d/1e3),le=z(ae/1e3),ue=EK([],[new yG([se],{width:ce,height:le,viewBox:`0 0 `+d+` `+ae})],r);ue.height=ae/1e3,ue.style.width=ce,ue.style.height=le,re.push({type:`elem`,elem:ue})}else{if(re.push(fJ(l,f,i)),re.push(hJ),s===null){var de=ee-m-v+2*mJ;re.push(pJ(c,de,r))}else{var fe=(ee-m-v-y)/2+2*mJ;re.push(pJ(c,fe,r)),re.push(hJ),re.push(fJ(s,f,i)),re.push(hJ),re.push(pJ(c,fe,r))}re.push(hJ),re.push(fJ(o,f,i))}var pe=r.havingBaseStyle(RW.TEXT);return sJ(X([`delimsizing`,`mult`],[MK({positionType:`bottom`,positionData:ne,children:re})],pe),RW.TEXT,r,a)},yJ=80,bJ=.08,xJ=function(e,t,n,r,i){return EK([`hide-tail`],[new yG([new bG(e,QW(e,r,n))],{width:`400em`,height:z(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},SJ=function(e,t){var n=t.havingBaseSizing(),r=MJ(`\\surd`,e*n.sizeMultiplier,AJ,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+yJ,e<1?i=1:e<1.4&&(i=.7),s=(1+a+bJ)/i,c=(1+a)/i,o=xJ(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+yJ)*EJ[r.size],c=(EJ[r.size]+a)/i,s=(EJ[r.size]+a+bJ)/i,o=xJ(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+bJ,c=e+a,l=Math.floor(1e3*e+a)+yJ,o=xJ(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=z(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},CJ=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),wJ=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),TJ=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),EJ=[0,1.2,1.8,2.4,3],DJ=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),CJ.has(e)||TJ.has(e))return dJ(e,t,!1,n,r,i);if(wJ.has(e))return vJ(e,EJ[t],!1,n,r,i);throw new R(`Illegal delimiter: '`+e+`'`)},OJ=[{type:`small`,style:RW.SCRIPTSCRIPT},{type:`small`,style:RW.SCRIPT},{type:`small`,style:RW.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],kJ=[{type:`small`,style:RW.SCRIPTSCRIPT},{type:`small`,style:RW.SCRIPT},{type:`small`,style:RW.TEXT},{type:`stack`}],AJ=[{type:`small`,style:RW.SCRIPTSCRIPT},{type:`small`,style:RW.SCRIPT},{type:`small`,style:RW.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],jJ=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},MJ=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=oJ(e,jJ(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},NJ=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=TJ.has(e)?OJ:CJ.has(e)?AJ:kJ,s=MJ(e,t,o,r);return s.type===`small`?lJ(e,s.style,n,r,i,a):s.type===`large`?dJ(e,s.size,n,r,i,a):vJ(e,t,n,r,i,a)},PJ=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return NJ(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},FJ={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},IJ=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function LJ(e){return`isMiddle`in e}function RJ(e,t){var n=Vq(e);if(n&&IJ.has(n.text))return n;throw n?new R(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new R(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=RJ(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:FJ[e.funcName].size,mclass:FJ[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):DJ(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(pq(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=z(EJ[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function zJ(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new R(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:RJ(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=RJ(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=zq(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{zJ(e);for(var n=$K(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];LJ(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?iq(t,[`mopen`]):PJ(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(LJ(u)){var d=u.isMiddle;n[l]=PJ(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=iq(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=PJ(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{zJ(e);var n=vq(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[pq(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[pq(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return mq(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=RJ(t[0],e);if(!e.parser.leftrightDepth)throw new R(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=iq(t,[]):(n=DJ(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?pq(`|`,`text`):pq(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var{parser:r,funcName:i}=e,a=zq(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=AK(aq(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=hW(e.body);if(r===`sout`)a=X([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=sG({number:.6,unit:`pt`},t),l=sG({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=z(d/2+c);var f=Math.floor(1e3*d*i);a=EK([`hide-tail`],[new yG([new bG(`phase`,XW(f))],{width:`400em`,height:z(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=z(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=Fq(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=z(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=z(h),a.style.borderRightWidth=z(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=MK({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=MK({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[bq(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+z(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var{parser:r,funcName:i}=e,a=zq(t[0],`color-token`).color,o=zq(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var BJ={};function VJ(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)BJ[n[c]]=s;a&&(WK[t]=a),o&&(GK[t]=o)}var HJ={};function $(e,t){HJ[e]=t}var UJ=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},WJ=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,UJ.range(this,t))}};function GJ(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var KJ=e=>{if(!e.parser.settings.displayMode)throw new R(`{`+e.envName+`} can be used only in display mode.`)},qJ=new Set([`gather`,`gather*`]);function JJ(e){if(!e.includes(`ed`))return!e.includes(`*`)}function YJ(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new R(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new WJ(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(GJ(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var ee=e.fetch().text;if(ee===`&`){if(d&&m.length===d){if(l||s)throw new R(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(ee===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(ee===`\\\\`){e.consume();var te=void 0;e.gullet.future().text!==` `&&(te=e.parseSizeGroup(!0)),g.push(te?te.value:null),b(),_.push(GJ(e)),m=[],h.push(m),y()}else throw new R(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function XJ(e){return e.slice(0,1)===`d`?`display`:`text`}var ZJ=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(RW.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?sG({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var ee=aq(y[r],t);x<ee.depth&&(x=ee.depth),b<ee.height&&(b=ee.height),S.cells[r]=ee}var te=e.rowGaps[n],ne=0;te&&(ne=sG(te,t),ne>0&&(ne+=g,x<ne&&(x=ne),ne=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+ne,s[n]=S,v(a[n+1])}var re=_/2+t.fontMetrics().axisHeight,ie=e.cols||[],ae=[],oe,se,ce=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var le=s[n],ue=le.pos-re,de=e.tags[n],fe=void 0;fe=de===!0?X([`eqn-num`],[],t):de===!1?X([],[],t):X([],$K(de,t,!0),t),fe.depth=le.depth,fe.height=le.height,ce.push({type:`elem`,elem:fe,shift:ue})}for(r=0,se=0;r<o||se<ie.length;++r,++se){for(var pe=ie[se],me=!0;(he=pe)?.type===`separator`;){var he;if(me||(oe=X([`arraycolsep`],[]),oe.style.width=z(t.fontMetrics().doubleRuleSep),ae.push(oe)),pe.separator===`|`||pe.separator===`:`){var ge=pe.separator===`|`?`solid`:`dashed`,_e=X([`vertical-separator`],[],t);_e.style.height=z(_),_e.style.borderRightWidth=z(l),_e.style.borderRightStyle=ge,_e.style.margin=`0 `+z(-l/2);var ve=_-re;ve&&(_e.style.verticalAlign=z(-ve)),ae.push(_e)}else throw new R(`Invalid separator type: `+pe.separator);se++,pe=ie[se],me=!1}if(!(r>=o)){var C=void 0;(r>0||e.hskipBeforeAndAfter)&&(C=pe?.pregap??d,C!==0&&(oe=X([`arraycolsep`],[]),oe.style.width=z(C),ae.push(oe)));var ye=[];for(n=0;n<i;++n){var be=s[n],xe=be.cells[r];if(xe){var Se=be.pos-re;xe.depth=be.depth,xe.height=be.height,ye.push({type:`elem`,elem:xe,shift:Se})}}var Ce=MK({positionType:`individualShift`,children:ye}),we=X([`col-align-`+(pe?.align||`c`)],[Ce]);ae.push(we),(r<o-1||e.hskipBeforeAndAfter)&&(C=pe?.postgap??d,C!==0&&(oe=X([`arraycolsep`],[]),oe.style.width=z(C),ae.push(oe)))}}var Te=X([`mtable`],ae);if(c.length>0){for(var Ee=DK(`hline`,t,l),De=DK(`hdashline`,t,l),Oe=[{type:`elem`,elem:Te,shift:0}];c.length>0;){var ke=c.pop(),w=ke.pos-re;ke.isDashed?Oe.push({type:`elem`,elem:De,shift:w}):Oe.push({type:`elem`,elem:Ee,shift:w})}Te=MK({positionType:`individualShift`,children:Oe})}if(ce.length===0)return X([`mord`],[Te],t);var Ae=X([`tag`],[MK({positionType:`individualShift`,children:ce})],t);return kK([Te,Ae])},QJ={c:`center `,l:`left `,r:`right `},$J=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[bq(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,z(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=QJ[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var ee=``,te=e.hLinesBeforeRow;d+=te[0].length>0?`left `:``,d+=te[te.length-1].length>0?`right `:``;for(var ne=1;ne<te.length-1;ne++)ee+=te[ne].length===0?`none `:te[ne][0]?`dashed `:`solid `;return/[sd]/.test(ee)&&l.setAttribute(`rowlines`,ee.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},eY=function(e,t){e.envName.includes(`ed`)||KJ(e);var n=[],r=e.envName===`split`,i=YJ(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:JJ(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var c=``,l=0;l<t[0].body.length;l++){var u=zq(t[0].body[l],`textord`);c+=u.text}a=Number(c),o=a*2}var d=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)zq(zq(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(d)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new R(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var f=0;f<o;++f){var p=`r`,m=0;f%2==1?p=`l`:f>0&&d&&(m=1),n[f]={type:`align`,align:p,pregap:m,postgap:0}}return i.colSeparationType=d?`align`:`alignat`,i};VJ({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(Vq(t[0])?[t[0]]:zq(t[0],`ordgroup`).body).map(function(e){var t=Bq(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new R(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return YJ(e.parser,r,XJ(e.envName))},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new R(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=YJ(e.parser,r,XJ(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=YJ(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(Vq(t[0])?[t[0]]:zq(t[0],`ordgroup`).body).map(function(e){var t=Bq(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new R(`Unknown column alignment: `+t,e)});if(n.length>1)throw new R(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=YJ(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new R(`{subarray} can contain only one column`);return i},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=YJ(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},XJ(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:eY,htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){qJ.has(e.envName)&&KJ(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:JJ(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return YJ(e.parser,t,`display`)},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:eY,htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){KJ(e);var t={autoTag:JJ(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return YJ(e.parser,t,`display`)},htmlBuilder:ZJ,mathmlBuilder:$J}),VJ({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return KJ(e),tJ(e.parser)},htmlBuilder:ZJ,mathmlBuilder:$J}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new R(e.funcName+` valid only within array environment`)}});var tY=BJ;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new R(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=zq(i.body[o],`textord`).text;if(r===`\\begin`){if(!tY.hasOwnProperty(a))throw new R(`No such environment: `+a,i);var s=tY[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=zq(n.parseFunction(),`environment`);if(p.name!==a)throw new R(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var nY=(e,t)=>{var n=e.font,r=t.withFont(n);return aq(e.body,r)},rY=(e,t)=>{var n=e.font,r=t.withFont(n);return bq(e.body,r)},iY={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=qK(t[0]),a=r in iY?iY[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:nY,mathmlBuilder:rY}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:Yq(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:hW(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var aY=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=aq(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=aq(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=sG(e.barSize,t),u=DK(`frac-line`,t,d)):u=DK(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===RW.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=MK({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=MK({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===RW.DISPLAY.size?t.fontMetrics().delim1:n.size===RW.SCRIPTSCRIPT.size?t.havingStyle(RW.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?iq(t,[`mopen`]):NJ(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?iq(t,[`mclose`]):NJ(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},oY=(e,t)=>{var n=new Q(`mfrac`,[bq(e.numer,t),bq(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=sG(e.barSize,t);n.setAttribute(`linethickness`,z(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new lq(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new lq(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return mq(i)}return n},sY=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),sY({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:aY,mathmlBuilder:oY}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var cY=[`display`,`text`,`script`,`scriptscript`],lY=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=qK(t[0]),o=a.type===`atom`&&a.family===`open`?lY(a.text):null,s=qK(t[1]),c=s.type===`atom`&&s.family===`close`?lY(s.text):null,l=zq(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=zq(p.body[0],`textord`);f=cY[Number(m.text)]}}else p=zq(p,`textord`),f=cY[Number(p.text)];return sY({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:zq(t[0],`size`).value,token:i}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=zq(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var uY=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?aq(e.sup,t.havingStyle(n.sup()),t):aq(e.sub,t.havingStyle(n.sub()),t),i=zq(e.base,`horizBrace`)):i=zq(e,`horizBrace`);var a=aq(i.base,t.havingBaseStyle(RW.DISPLAY)),o=Pq(i,t),s=i.isOver?MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):MK({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):MK({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:uY,mathmlBuilder:(e,t)=>{var n=jq(e.label);return new Q(e.isOver?`mover`:`munder`,[bq(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],i=zq(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:JK(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=$K(e.body,t,!1);return OK(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=yq(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=zq(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:JK(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:JK(t[0])}},htmlBuilder(e,t){return kK($K(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,vq(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=zq(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new R(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:JK(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=$K(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>yq(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:JK(t[0]),mathml:JK(t[1])}},htmlBuilder:(e,t)=>kK($K(e.html,t,!1)),mathmlBuilder:(e,t)=>yq(e.mathml,t)});var dY=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new R(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!oG(n))throw new R(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=zq(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=dY(d);break;case`height`:a=dY(d);break;case`totalheight`:o=dY(d);break;default:throw new R(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=zq(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=sG(e.height,t),r=0;e.totalheight.number>0&&(r=sG(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=sG(e.width,t));var a={height:z(n+r)};i>0&&(a.width=z(i)),r>0&&(a.verticalAlign=z(-r));var o=new gG(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=sG(e.height,t),i=0;if(e.totalheight.number>0&&(i=sG(e.totalheight,t)-r,n.setAttribute(`valign`,z(-i))),n.setAttribute(`height`,z(r+i)),e.width.number>0){var a=sG(e.width,t);n.setAttribute(`width`,z(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,i=zq(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return NK(e.dimension,t)},mathmlBuilder(e,t){return new uq(sG(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[aq(e.body,t)]),n=X([`inner`],[n],t)):n=X([`inner`],[aq(e.body,t)]);var r=X([`fix`],[]),i=X([e.alignment],[n,r],t),a=X([`strut`]);return a.style.height=z(i.height+i.depth),i.depth&&(a.style.verticalAlign=z(-i.depth)),i.children.unshift(a),i=X([`thinbox`],[i],t),X([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[bq(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new R(`Mismatched `+e.funcName)}});var fY=(e,t)=>{switch(t.style.size){case RW.DISPLAY.size:return e.display;case RW.TEXT.size:return e.text;case RW.SCRIPT.size:return e.script;case RW.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:JK(t[0]),text:JK(t[1]),script:JK(t[2]),scriptscript:JK(t[3])}},htmlBuilder:(e,t)=>kK($K(fY(e,t),t,!1)),mathmlBuilder:(e,t)=>yq(fY(e,t),t)});var pY=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&hW(n),c,l;if(t){var u=aq(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=aq(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=MK({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:z(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:z(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=MK({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:z(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=MK({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:z(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=z(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},mY=new Set([`\\smallint`]),hY=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=zq(e.base,`op`),i=!0):a=zq(e,`op`);var o=t.style,s=!1;o.size===RW.DISPLAY.size&&a.symbol&&!mY.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=yK(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=LK(d+`Size`+(s?`2`:`1`),t);c=MK({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=$K(a.body,t,!0);p.length===1&&p[0]instanceof vG?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(bK(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof vG||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?pY(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=z(g)),c)},gY=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[pq(e.name,e.mode)]),mY.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,vq(e.body,t));else{n=new Q(`mi`,[new lq(e.name.slice(1))]);var r=new Q(`mo`,[pq(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):cq([n,r])}return n},_Y={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=_Y[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:hY,mathmlBuilder:gY}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:JK(r)}}});var vY={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=vY[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var yY=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=zq(e.base,`operatorname`),i=!0):a=zq(e,`operatorname`);var o;if(a.body.length>0){for(var s=$K(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof vG&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?pY(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:JK(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:yY,mathmlBuilder:(e,t)=>{for(var n=vq(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof uq))if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof lq?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}r&&(n=[new lq(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[pq(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):cq([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),KK({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?kK($K(e.body,t,!1)):X([`mord`],$K(e.body,t,!0),t)},mathmlBuilder(e,t){return yq(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=aq(e.body,t.havingCrampedStyle()),r=DK(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`overline`],[MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new lq(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[bq(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:JK(r)}},htmlBuilder:(e,t)=>kK($K(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,vq(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`inner`],[aq(e.body,t.withPhantom())]),X([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,vq(JK(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var{parser:n}=e,r=zq(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=aq(e.body,t);return MK({positionType:`shift`,positionData:-sG(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[bq(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var{parser:r}=e,i=n[0],a=zq(t[0],`size`),o=zq(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&zq(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`rule`],[],t),r=sG(e.width,t),i=sG(e.height,t),a=e.shift?sG(e.shift,t):0;return n.style.borderRightWidth=z(r),n.style.borderTopWidth=z(i),n.style.bottom=z(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=sG(e.width,t),r=sG(e.height,t),i=e.shift?sG(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,z(n)),o.setAttribute(`height`,z(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,z(i)):(s.setAttribute(`height`,z(i)),s.setAttribute(`depth`,z(-i))),s.setAttribute(`voffset`,z(i)),s}});function bY(e,t,n){for(var r=$K(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return kK(r)}var xY=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:xY,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:xY.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return bY(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,vq(e.body,n));return r.setAttribute(`mathsize`,z(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&zq(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=Bq(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[aq(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[bq(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=aq(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=AK(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<RW.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=SJ(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=z(c);var d=MK({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(RW.SCRIPTSCRIPT),p=aq(e.index,f,t);return X([`mord`,`sqrt`],[X([`root`],[MK({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}else return X([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Q(`mroot`,[bq(n,t),bq(r,t)]):new Q(`msqrt`,[bq(n,t)])}});var SY={display:RW.DISPLAY,text:RW.TEXT,script:RW.SCRIPT,scriptscript:RW.SCRIPTSCRIPT};function CY(e){return e in SY}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!CY(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=SY[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),bY(e.body,r,t)},mathmlBuilder(e,t){var n=SY[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,vq(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var wY=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===RW.DISPLAY.size||n.alwaysHandleSupSub)?hY:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===RW.DISPLAY.size||n.limits)?yY:null:n.type===`accent`?hW(n.base)?Uq:null:n.type===`horizBrace`&&!e.sub===n.isOver?uY:null:null};KK({type:`supsub`,htmlBuilder(e,t){var n=wY(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=aq(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&hW(r);if(i){var p=t.havingStyle(t.style.sup());s=aq(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=aq(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===RW.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=z(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof vG||y)&&(v=z(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=MK({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=MK({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=MK({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([rq(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[bq(e.base,t)];e.sub&&a.push(bq(e.sub,t)),e.sup&&a.push(bq(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===RW.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===RW.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===RW.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===RW.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===RW.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===RW.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),KK({type:`atom`,htmlBuilder(e,t){return bK(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[pq(e.text,e.mode)]);if(e.family===`bin`){var r=gq(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var TY={mi:`italic`,mn:`normal`,mtext:`normal`};KK({type:`mathord`,htmlBuilder(e,t){return SK(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[pq(e.text,e.mode,t)]),r=gq(e,t)||`italic`;return r!==TY[n.type]&&n.setAttribute(`mathvariant`,r),n}}),KK({type:`textord`,htmlBuilder(e,t){return SK(e,t)},mathmlBuilder(e,t){var n=pq(e.text,e.mode,t),r=gq(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==TY[i.type]&&i.setAttribute(`mathvariant`,r),i}});var EY={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},DY={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};KK({type:`spacing`,htmlBuilder(e,t){if(DY.hasOwnProperty(e.text)){var n=DY[e.text].className||``;if(e.mode===`text`){var r=SK(e,t);return r.classes.push(n),r}else return X([`mspace`,n],[bK(e.text,e.mode,t)],t)}else if(EY.hasOwnProperty(e.text))return X([`mspace`,EY[e.text]],[],t);else throw new R(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(DY.hasOwnProperty(e.text))n=new Q(`mtext`,[new lq(`\xA0`)]);else if(EY.hasOwnProperty(e.text))return new Q(`mspace`);else throw new R(`Unknown type of space "`+e.text+`"`);return n}});var OY=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};KK({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[OY(),new Q(`mtd`,[yq(e.body,t)]),OY(),new Q(`mtd`,[yq(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var kY={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},AY={"\\textbf":`textbf`,"\\textmd":`textmd`},jY={"\\textit":`textit`,"\\textup":`textup`},MY=(e,t)=>{var n=e.font;return n?kY[n]?t.withTextFontFamily(kY[n]):AY[n]?t.withTextFontWeight(AY[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(jY[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:JK(i),font:r}},htmlBuilder(e,t){var n=MY(e,t);return X([`mord`,`text`],$K(e.body,n,!0),n)},mathmlBuilder(e,t){var n=MY(e,t);return yq(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=aq(e.body,t),r=DK(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`underline`],[MK({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new lq(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[bq(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=aq(e.body,t),r=t.fontMetrics().axisHeight;return MK({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[bq(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new R(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=NY(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(yK(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),wK(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new lq(NY(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var NY=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),PY=UK,FY=`[ \r
315
- ]`,IY=`\\\\[a-zA-Z@]+`,LY=`\\\\[^\ud800-\udfff]`,RY=`(`+IY+`)`+FY+`*`,zY=`\\\\(
316
- |[ \r ]+
317
- ?)[ \r ]*`,BY=`[̀-ͯ]`,VY=RegExp(BY+`+$`),HY=`(`+FY+`+)|`+(zY+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(BY+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(BY+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+RY)+(`|`+LY+`)`),UY=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(HY,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new WJ(`EOF`,new UJ(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new R(`Unexpected character: '`+e[t]+`'`,new WJ(e[t],new UJ(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
318
- `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new WJ(r,new UJ(this,t,this.tokenRegex.lastIndex))}},WY=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new R(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},GY=HJ;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var KY={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new R("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=KY[t.text],r==null||r>=n)throw new R(`Invalid base-`+n+` digit `+t.text);for(var i;(i=KY[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var qY=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new R(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new R(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new R(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new R(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>qY(e,!1,!0,!1)),$(`\\renewcommand`,e=>qY(e,!0,!1,!1)),$(`\\providecommand`,e=>qY(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),PY[n],MG.math[n],MG.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var JY={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},YY=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in JY?t=JY[n]:(n.slice(0,4)===`\\not`||n in MG.math&&YY.has(MG.math[n].group))&&(t=`\\dotsb`),t});var XY={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in XY?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in XY&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in XY?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new R(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var ZY=z(TG[`Main-Regular`][84][1]-.7*TG[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+ZY+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+ZY+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var QY=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,QY(!1)),$(`\\bra@set`,QY(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var $Y={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},eX=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new WY(GY,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new UY(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new WJ(`EOF`,n.loc)),this.pushTokens(r),new WJ(``,UJ.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new R(`Extra }`,i)}else if(i.text===`EOF`)throw new R(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n)if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new R(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new R(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new R(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new R(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new R(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new R(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new WJ(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new UY(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||PY.hasOwnProperty(e)||MG.math.hasOwnProperty(e)||MG.text.hasOwnProperty(e)||$Y.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?PY.hasOwnProperty(e)&&!PY[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},tX=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,nX=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),rX={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},iX={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},aX=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new eX(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new R(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new WJ(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&PY[i.text]&&PY[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new R(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new R(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new R(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new R(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new R(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new R(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(nX[i.text]){var s=tX.test(i.text),c=[];for(c.push(new WJ(nX[i.text])),this.consume();;){var l=this.fetch().text;if(!nX[l]||tX.test(l)!==s)break;c.unshift(new WJ(nX[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=PY[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new R(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new R(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new R(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=PY[e];if(o&&o.handler)return o.handler(a,t,n);throw new R(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new R(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new R(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new R(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new R(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new R(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new R(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new R(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!oG(i))throw new R(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:UJ.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!$Y.hasOwnProperty(r)){if(this.settings.throwOnError)throw new R(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:UJ.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:UJ.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:UJ.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new R(`\\verb assertion failed --
319
- please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}iX.hasOwnProperty(t[0])&&!MG[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=iX[t[0]]+t.slice(1));var i=VY.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(MG[this.mode][t]){this.settings.strict&&this.mode===`math`&&eK.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=MG[this.mode][t].group,s=UJ.range(e);a=Rq(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(HW(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:UJ.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!rX[l])throw new R(`Unknown accent ' `+l+`'`,e);var u=rX[l][this.mode]||rX[l].text;if(!u)throw new R(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:UJ.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};aX.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var oX=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new aX(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new R(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new WJ(`\\df@tag`)])}]}return r},sX=function(e,t,n){t.textContent=``;var r=dX(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),sX=function(){throw new R(`KaTeX doesn't work in quirks mode.`)});var cX=function(e,t){return dX(e,t).toMarkup()},lX=function(e,t){return oX(e,new xW(t))},uX=function(e,t,n){if(n.throwOnError||!(e instanceof R))throw e;var r=X([`katex-error`],[new vG(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},dX=function(e,t){var n=new xW(t);try{return Oq(oX(e,n),e,n)}catch(t){return uX(t,e,n)}},fX={version:`0.17.0`,render:sX,renderToString:cX,ParseError:R,SETTINGS_SCHEMA:_W,__parse:lX,__renderToDomTree:dX,__renderToHTMLTree:function(e,t){var n=new xW(t);try{return kq(oX(e,n),e,n)}catch(t){return uX(t,e,n)}},__setFontMetrics:OG,__defineSymbol:B,__defineFunction:Z,__defineMacro:$,__domTree:{Span:mG,Anchor:hG,SymbolNode:vG,SvgNode:yG,PathNode:bG,LineNode:xG}};function pX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];d(t.type===`math`),t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];d(n.type===`math`),this.exit(e),n.value=t;let r=n.data.hChildren[0];d(r.type===`element`),d(r.tagName===`code`),r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];d(n.type===`inlineMath`),this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function mX(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
320
- `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(Ao(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
321
- `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
322
- `),i&&(c+=a.move(i+`
323
- `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var hX={tokenize:_X,concrete:!0,name:`mathFlow`},gX={tokenize:vX,partial:!0};function _X(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===b.linePrefix?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return d(t===g.dollarSign,"expected `$`"),e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===g.dollarSign?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),p(e,l,b.whitespace)(t))}function l(t){return t===g.eof||y(t)?f(t):(e.enter(`mathFlowFenceMeta`),e.enter(b.chunkString,{contentType:_.contentTypeString}),u(t))}function u(t){return t===g.eof||y(t)?(e.exit(b.chunkString),e.exit(`mathFlowFenceMeta`),f(t)):t===g.dollarSign?n(t):(e.consume(t),u)}function f(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(gX,m,S)(n)}function m(t){return e.attempt({tokenize:ee,partial:!0},S,h)(t)}function h(t){return(a?p(e,v,b.linePrefix,a+1):v)(t)}function v(t){return t===g.eof?S(t):y(t)?e.attempt(gX,m,S)(t):(e.enter(`mathFlowValue`),x(t))}function x(t){return t===g.eof||y(t)?(e.exit(`mathFlowValue`),v(t)):(e.consume(t),x)}function S(n){return e.exit(`mathFlow`),t(n)}function ee(e,t,n){let i=0;return d(r.parser.constructs.disable.null,"expected `disable.null`"),p(e,a,b.linePrefix,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:_.tabSize);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===g.dollarSign?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),p(e,c,b.whitespace)(t))}function c(r){return r===g.eof||y(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function vX(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(d(y(n),`expected eol`),e.enter(b.lineEnding),e.consume(n),e.exit(b.lineEnding),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function yX(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:bX,previous:xX,name:`mathText`};function n(e,n,r){let i=this,a=0,o,s;return c;function c(t){return d(t===g.dollarSign,"expected `$`"),d(xX.call(i,i.previous),`expected correct previous`),e.enter(`mathText`),e.enter(`mathTextSequence`),l(t)}function l(n){return n===g.dollarSign?(e.consume(n),a++,l):a<2&&!t?r(n):(e.exit(`mathTextSequence`),u(n))}function u(t){return t===g.eof?r(t):t===g.dollarSign?(s=e.enter(`mathTextSequence`),o=0,p(t)):t===g.space?(e.enter(`space`),e.consume(t),e.exit(`space`),u):y(t)?(e.enter(b.lineEnding),e.consume(t),e.exit(b.lineEnding),u):(e.enter(`mathTextData`),f(t))}function f(t){return t===g.eof||t===g.space||t===g.dollarSign||y(t)?(e.exit(`mathTextData`),u(t)):(e.consume(t),f)}function p(t){return t===g.dollarSign?(e.consume(t),o++,p):o===a?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(s.type=`mathTextData`,f(t))}}}function bX(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===b.lineEnding||e[n][1].type===`space`)&&(e[t][1].type===b.lineEnding||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==b.lineEnding&&(i=r):(r===t||e[r][1].type===b.lineEnding)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xX(e){return e!==g.dollarSign||this.events[this.events.length-1][1].type===b.characterEscape}function SX(e){return{flow:{[g.dollarSign]:hX},text:{[g.dollarSign]:yX(e)}}}var CX={};function wX(e){let t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SX(n)),a.push(pX()),o.push(mX(n))}var TX=Object.defineProperty,EX=Object.getOwnPropertySymbols,DX=Object.prototype.hasOwnProperty,OX=Object.prototype.propertyIsEnumerable,kX=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AX=(e,t)=>{for(var n in t||={})DX.call(t,n)&&kX(e,n,t[n]);if(EX)for(var n of EX(t))OX.call(t,n)&&kX(e,n,t[n]);return e};function jX(e,t){return Object.assign(e,{meta:AX({package:`@milkdown/components`},t)}),e}var MX=Object.defineProperty,NX=Object.getOwnPropertySymbols,PX=Object.prototype.hasOwnProperty,FX=Object.prototype.propertyIsEnumerable,IX=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LX=(e,t)=>{for(var n in t||={})PX.call(t,n)&&IX(e,n,t[n]);if(NX)for(var n of NX(t))FX.call(t,n)&&IX(e,n,t[n]);return e},RX=Fv(LX({},{mode:`preview`}),`linkTooltipStateCtx`);jX(RX,{displayName:`State<link-tooltip>`,group:`LinkTooltip`});var zX=Fv(LX({},{addLink:()=>{},editLink:()=>{},removeLink:()=>{}}),`linkTooltipAPICtx`);jX(RX,{displayName:`API<link-tooltip>`,group:`LinkTooltip`});var BX=Fv(LX({},{linkIcon:`🔗`,editButton:`✎`,removeButton:`⌫`,confirmButton:`Confirm ⏎`,onCopyLink:()=>{},inputPlaceholder:`Paste link...`}),`linkTooltipConfigCtx`);jX(RX,{displayName:`Config<link-tooltip>`,group:`LinkTooltip`});var VX=j(`ToggleLink`,e=>()=>t=>{let{doc:n,selection:r}=t,i=vj.type(e);return n.rangeHasMark(r.from,r.to,i)?(e.get(zX.key).removeLink(r.from,r.to),!0):(e.get(zX.key).addLink(r.from,r.to),!0)}),HX=iS(`LINK_PREVIEW`);jX(HX[0],{displayName:`PreviewTooltipSpec<link-tooltip>`,group:`LinkTooltip`}),jX(HX[1],{displayName:`PreviewTooltipPlugin<link-tooltip>`,group:`LinkTooltip`});var UX=iS(`LINK_EDIT`);jX(UX[0],{displayName:`EditTooltipSpec<link-tooltip>`,group:`LinkTooltip`}),jX(UX[1],{displayName:`EditTooltipPlugin<link-tooltip>`,group:`LinkTooltip`});function WX({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}WX.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var GX=SE({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){let i=N(t);mE(t,e=>{i.value=e});let a=()=>{n(i.value)},o=e=>{e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),a()),e.key===`Escape`&&(e.preventDefault(),r())};return()=>F(`div`,{class:`link-edit`},F(`input`,{class:`input-area`,placeholder:e.value.inputPlaceholder,onKeydown:o,onInput:e=>{i.value=e.target.value},value:i.value}),i.value?F(WX,{class:`button confirm`,icon:e.value.confirmButton,onClick:a}):null)}}),KX=Object.defineProperty,qX=Object.defineProperties,JX=Object.getOwnPropertyDescriptors,YX=Object.getOwnPropertySymbols,XX=Object.prototype.hasOwnProperty,ZX=Object.prototype.propertyIsEnumerable,QX=e=>{throw TypeError(e)},$X=(e,t,n)=>t in e?KX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eZ=(e,t)=>{for(var n in t||={})XX.call(t,n)&&$X(e,n,t[n]);if(YX)for(var n of YX(t))ZX.call(t,n)&&$X(e,n,t[n]);return e},tZ=(e,t)=>qX(e,JX(t)),nZ=(e,t,n)=>t.has(e)||QX(`Cannot `+n),rZ=(e,t,n)=>(nZ(e,t,`read from private field`),n?n.call(e):t.get(e)),iZ=(e,t,n)=>t.has(e)?QX(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),aZ=(e,t,n,r)=>(nZ(e,t,`write to private field`),t.set(e,n),n),oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ={from:-1,to:-1,mark:null},yZ=class{constructor(e,t){this.ctx=e,iZ(this,oZ),iZ(this,sZ),iZ(this,cZ,eZ({},vZ)),iZ(this,lZ),iZ(this,uZ),iZ(this,dZ,N(``)),iZ(this,fZ,()=>{rZ(this,hZ).call(this),rZ(this,sZ).hide(),this.ctx.update(RX.key,e=>tZ(eZ({},e),{mode:`preview`})),aZ(this,cZ,eZ({},vZ))}),iZ(this,pZ,e=>{let t=e.target;t&&(rZ(this,oZ).contains(t)||rZ(this,fZ).call(this))}),iZ(this,mZ,()=>{document.addEventListener(`pointerdown`,rZ(this,pZ),!0)}),iZ(this,hZ,()=>{document.removeEventListener(`pointerdown`,rZ(this,pZ),!0)}),iZ(this,gZ,e=>{let t=this.ctx.get(m_),{from:n,to:r,mark:i}=rZ(this,cZ),a=vj.type(this.ctx),o=nS.sanitize(e);if(i&&i.attrs.href===o){rZ(this,fZ).call(this);return}let s=t.state.tr;if(i&&s.removeMark(n,r,i),n===r){if(!o){rZ(this,fZ).call(this);return}let e=a.create({href:o});s.insertText(o,n),s.addMark(n,n+o.length,e)}else s.addMark(n,r,a.create({href:o}));t.dispatch(s),rZ(this,fZ).call(this)}),iZ(this,_Z,(e,t,n)=>{let r=this.ctx.get(BX.key);rZ(this,uZ).value=r,rZ(this,dZ).value=e,this.ctx.update(RX.key,e=>tZ(eZ({},e),{mode:`edit`}));let i=this.ctx.get(m_);i.dispatch(i.state.tr.setSelection(O.create(i.state.doc,t,n))),rZ(this,sZ).show({getBoundingClientRect:()=>vf(i,t,n)},i),rZ(this,mZ).call(this),requestAnimationFrame(()=>{var e;(e=rZ(this,oZ).querySelector(`input`))==null||e.focus()})}),this.update=e=>{let{state:t}=e,{selection:n}=t;if(!(n instanceof O))return;let{from:r,to:i}=n;r===rZ(this,cZ).from&&i===rZ(this,cZ).to||rZ(this,fZ).call(this)},this.destroy=()=>{rZ(this,hZ).call(this),rZ(this,lZ).unmount(),rZ(this,sZ).destroy(),rZ(this,oZ).remove()},this.addLink=(e,t)=>{aZ(this,cZ,{from:e,to:t,mark:null}),rZ(this,_Z).call(this,``,e,t)},this.editLink=(e,t,n)=>{aZ(this,cZ,{from:t,to:n,mark:e}),rZ(this,_Z).call(this,e.attrs.href,t,n)},this.removeLink=(e,t)=>{let n=this.ctx.get(m_),r=n.state.tr;r.removeMark(e,t,vj.type(this.ctx)),n.dispatch(r),rZ(this,fZ).call(this)},aZ(this,uZ,N(this.ctx.get(BX.key)));let n=document.createElement(`div`);n.className=`milkdown-link-edit`;let r=DA(GX,{config:rZ(this,uZ),src:rZ(this,dZ),onConfirm:rZ(this,gZ),onCancel:rZ(this,fZ)});r.mount(n),aZ(this,lZ,r),aZ(this,oZ,n),aZ(this,sZ,new rS({content:n,debounce:0,shouldShow:()=>!1})),rZ(this,sZ).onHide=()=>{requestAnimationFrame(()=>{t.dom.focus({preventScroll:!0})})},rZ(this,sZ).update(t)}};oZ=new WeakMap,sZ=new WeakMap,cZ=new WeakMap,lZ=new WeakMap,uZ=new WeakMap,dZ=new WeakMap,fZ=new WeakMap,pZ=new WeakMap,mZ=new WeakMap,hZ=new WeakMap,gZ=new WeakMap,_Z=new WeakMap;var bZ=Object.defineProperty,xZ=Object.defineProperties,SZ=Object.getOwnPropertyDescriptors,CZ=Object.getOwnPropertySymbols,wZ=Object.prototype.hasOwnProperty,TZ=Object.prototype.propertyIsEnumerable,EZ=(e,t,n)=>t in e?bZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DZ=(e,t)=>{for(var n in t||={})wZ.call(t,n)&&EZ(e,n,t[n]);if(CZ)for(var n of CZ(t))TZ.call(t,n)&&EZ(e,n,t[n]);return e},OZ=(e,t)=>xZ(e,SZ(t));function kZ(e){let t;e.update(zX.key,e=>OZ(DZ({},e),{addLink:(e,n)=>{t?.addLink(e,n)},editLink:(e,n,r)=>{t?.editLink(e,n,r)},removeLink:(e,n)=>{t?.removeLink(e,n)}})),e.set(UX.key,{view:n=>(t=new yZ(e,n),t)})}function AZ(e,t,n,r,i){let a={start:-1,end:-1};return n.nodesBetween(r,i,(n,r)=>{if(a.start>-1)return!1;a.start===-1&&e.isInSet(n.marks)&&t===n&&(a={start:r,end:r+Math.max(n.textContent.length,1)})}),a}function jZ(e,t,n){let r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;let{pos:i}=r,a=t.state.doc.nodeAt(i);if(!a)return;let o=a.marks.find(t=>t.type===vj.mark.type(e));if(o&&HX.pluginKey())return{show:!0,pos:i,node:a,mark:o}}var MZ=SE({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){let i=e=>{e.preventDefault(),e.stopPropagation(),n.value()},a=e=>{e.preventDefault(),e.stopPropagation(),r.value()},o=n=>{n.preventDefault();let r=t.value;navigator.clipboard&&r&&navigator.clipboard.writeText(r).then(()=>{e.value.onCopyLink(r)}).catch(e=>console.error(e))};return()=>F(`div`,{class:`link-preview`},F(WX,{class:`button link-icon`,icon:e.value.linkIcon,onClick:o}),F(`a`,{href:t.value,target:`_blank`,class:`link-display`},t.value),F(WX,{class:`button link-edit-button`,icon:e.value.editButton,onClick:i}),F(WX,{class:`button link-remove-button`,icon:e.value.removeButton,onClick:a}))}}),NZ=e=>{throw TypeError(e)},PZ=(e,t,n)=>t.has(e)||NZ(`Cannot `+n),FZ=(e,t,n)=>(PZ(e,t,`read from private field`),n?n.call(e):t.get(e)),IZ=(e,t,n)=>t.has(e)?NZ(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),LZ=(e,t,n,r)=>(PZ(e,t,`write to private field`),t.set(e,n),n),RZ,zZ,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ=class{constructor(e,t){this.ctx=e,IZ(this,RZ),IZ(this,zZ),IZ(this,BZ),IZ(this,VZ),IZ(this,HZ,N(``)),IZ(this,UZ,N(()=>{})),IZ(this,WZ,N(()=>{})),IZ(this,GZ),IZ(this,KZ),IZ(this,qZ,!1),IZ(this,JZ,({mode:e})=>{e===`edit`&&FZ(this,ZZ).call(this)}),IZ(this,YZ,()=>{LZ(this,qZ,!0)}),IZ(this,XZ,()=>{LZ(this,qZ,!1)}),IZ(this,ZZ,()=>{FZ(this,zZ).hide(),FZ(this,zZ).element.removeEventListener(`mouseenter`,FZ(this,YZ)),FZ(this,zZ).element.removeEventListener(`mouseleave`,FZ(this,XZ))}),this.show=(e,t,n,r)=>{FZ(this,VZ).value=this.ctx.get(BX.key),FZ(this,HZ).value=e.attrs.href,FZ(this,UZ).value=()=>{this.ctx.get(zX.key).editLink(e,t,n)},FZ(this,WZ).value=()=>{this.ctx.get(zX.key).removeLink(t,n),FZ(this,ZZ).call(this)},FZ(this,zZ).show({getBoundingClientRect:()=>r},FZ(this,KZ)),FZ(this,zZ).element.addEventListener(`mouseenter`,FZ(this,YZ)),FZ(this,zZ).element.addEventListener(`mouseleave`,FZ(this,XZ))},this.hide=()=>{FZ(this,qZ)||FZ(this,ZZ).call(this)},this.update=()=>{},this.destroy=()=>{FZ(this,GZ).unmount(),FZ(this,BZ).off(FZ(this,JZ)),FZ(this,zZ).destroy(),FZ(this,RZ).remove()},LZ(this,KZ,t),LZ(this,VZ,N(this.ctx.get(BX.key))),LZ(this,GZ,DA(MZ,{config:FZ(this,VZ),src:FZ(this,HZ),onEdit:FZ(this,UZ),onRemove:FZ(this,WZ)})),LZ(this,RZ,document.createElement(`div`)),FZ(this,RZ).className=`milkdown-link-preview`,FZ(this,GZ).mount(FZ(this,RZ)),LZ(this,zZ,new rS({debounce:0,content:FZ(this,RZ),shouldShow:()=>!1})),FZ(this,zZ).update(t),LZ(this,BZ,e.use(RX.key)),FZ(this,BZ).on(FZ(this,JZ))}};RZ=new WeakMap,zZ=new WeakMap,BZ=new WeakMap,VZ=new WeakMap,HZ=new WeakMap,UZ=new WeakMap,WZ=new WeakMap,GZ=new WeakMap,KZ=new WeakMap,qZ=new WeakMap,JZ=new WeakMap,YZ=new WeakMap,XZ=new WeakMap,ZZ=new WeakMap;function $Z(e){let t,n=Xi((n,r)=>{if(!t||!n.hasFocus()||e.get(RX.key).mode===`edit`)return;let i=jZ(e,n,r);if(i){let e=n.state.doc.resolve(i.pos),r=AZ(i.mark,i.node,n.state.doc,e.before(),e.after()),a=r.start,o=r.end;t.show(i.mark,a,o,vf(n,a,o));return}t.hide()},50);e.set(HX.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:()=>{setTimeout(()=>{t?.hide()},50)}}},view:n=>(t=new QZ(e,n),t)})}function eQ(e){$Z(e),kZ(e)}var tQ=[RX,zX,BX,HX,UX,VX].flat(),nQ=Object.defineProperty,rQ=Object.getOwnPropertySymbols,iQ=Object.prototype.hasOwnProperty,aQ=Object.prototype.propertyIsEnumerable,oQ=(e,t,n)=>t in e?nQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sQ=(e,t)=>{for(var n in t||={})iQ.call(t,n)&&oQ(e,n,t[n]);if(rQ)for(var n of rQ(t))aQ.call(t,n)&&oQ(e,n,t[n]);return e};function cQ(e,t){return Object.assign(e,{meta:sQ({package:`@milkdown/components`},t)}),e}var lQ=Fv({renderLabel:({label:e,listType:t,checked:n})=>n==null?t===`bullet`?`⦿`:e:n?`☑`:`□`},`listItemBlockConfigCtx`);cQ(lQ,{displayName:`Config<list-item-block>`,group:`ListItemBlock`});function uQ({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}uQ.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var dQ=SE({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:i,readonly:a,setAttr:o,onMount:s,selected:c}){let l=e=>{e!=null&&e instanceof Element&&s(e)},u=e=>{e.stopPropagation(),e.preventDefault(),t.value!=null&&o(`checked`,!t.value)},d=Pk(()=>i.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:a.value})),f=Pk(()=>t.value==null?n.value===`bullet`?`bullet`:`ordered`:t.value?`checked`:`unchecked`);return()=>F(`li`,{class:r(`list-item`,c.value&&`ProseMirror-selectednode`)},F(`div`,{class:`label-wrapper`,onPointerdown:u,contenteditable:!1},F(uQ,{class:r(`label`,a.value&&`readonly`,f.value),icon:d.value})),F(`div`,{class:`children`,ref:l}))}}),fQ=Pv(_M.node,e=>(t,n,r)=>{let i=document.createElement(`div`);i.className=`milkdown-list-item-block`;let a=document.createElement(`div`);a.setAttribute(`data-content-dom`,`true`),a.classList.add(`content-dom`);let o=N(t.attrs.label),s=N(t.attrs.checked),c=N(t.attrs.listType),l=N(!n.editable),u=e.get(lQ.key),d=N(!1),f=(e,t)=>{if(!n.editable)return;let i=r();i!=null&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(i,e,t)))},p=pE(()=>{d.value?i.classList.add(`selected`):i.classList.remove(`selected`)}),m=0,h=DA(dQ,{label:o,checked:s,listType:c,readonly:l,config:u,selected:d,setAttr:f,onMount:e=>{let{anchor:t,head:r}=n.state.selection;e.appendChild(a);let i=n.state.doc.resolve(t),o=n.state.doc.resolve(r);m=requestAnimationFrame(()=>{if(cancelAnimationFrame(m),!i.doc.eq(n.state.doc))return;let e=new O(i,o);n.dispatch(n.state.tr.setSelection(e))})}});h.mount(i);let g=e=>{c.value=e.attrs.listType,o.value=e.attrs.label,s.value=e.attrs.checked,l.value=!n.editable};g(t);let _=t;return{dom:i,contentDOM:a,update:e=>e.type===t.type?e.sameMarkup(_)&&e.content.eq(_.content)?!0:(_=e,g(e),!0):!1,ignoreMutation:e=>!i||!a?!0:e.type===`selection`?!1:a===e.target&&e.type===`attributes`?!0:!a.contains(e.target),selectNode:()=>{d.value=!0},deselectNode:()=>{d.value=!1},destroy:()=>{p(),h.unmount(),i.remove(),a.remove()}}});cQ(fQ,{displayName:`NodeView<list-item-block>`,group:`ListItemBlock`});var pQ=[lQ,fQ],mQ=Object.defineProperty,hQ=Object.getOwnPropertySymbols,gQ=Object.prototype.hasOwnProperty,_Q=Object.prototype.propertyIsEnumerable,vQ=(e,t,n)=>t in e?mQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yQ=(e,t)=>{for(var n in t||={})gQ.call(t,n)&&vQ(e,n,t[n]);if(hQ)for(var n of hQ(t))_Q.call(t,n)&&vQ(e,n,t[n]);return e};function bQ(e,t){return Object.assign(e,{meta:yQ({package:`@milkdown/components`},t)}),e}var xQ=Object.defineProperty,SQ=Object.getOwnPropertySymbols,CQ=Object.prototype.hasOwnProperty,wQ=Object.prototype.propertyIsEnumerable,TQ=(e,t,n)=>t in e?xQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EQ=Fv(((e,t)=>{for(var n in t||={})CQ.call(t,n)&&TQ(e,n,t[n]);if(SQ)for(var n of SQ(t))wQ.call(t,n)&&TQ(e,n,t[n]);return e})({},{renderButton:e=>{switch(e){case`add_row`:return`+`;case`add_col`:return`+`;case`delete_row`:return`-`;case`delete_col`:return`-`;case`align_col_left`:return`left`;case`align_col_center`:return`center`;case`align_col_right`:return`right`;case`col_drag_handle`:return`=`;case`row_drag_handle`:return`=`}}}),`tableBlockConfigCtx`);bQ(EQ,{displayName:`Config<table-block>`,group:`TableBlock`});function DQ({icon:e,class:t,onClick:n}){return F(`span`,{class:r(`milkdown-icon`,t),onPointerdown:n,innerHTML:e?nS.sanitize(e.trim()):void 0})}DQ.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};function OQ(e){let{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:i,xLineHandleRef:a,colHandleRef:o,rowHandleRef:s}=e,c=t.value;if(!c)return;let l=n.value;if(!l)return;let u=r.value;if(!u)return;let d=u.querySelector(`tbody`);if(!d)return;let f=c.querySelector(`tbody`);if(!f)return;let p=i.value;if(!p)return;let m=a.value;if(!m)return;let h=o.value;if(!h)return;let g=s.value;if(g)return{preview:c,wrapper:l,content:u,contentRoot:d,previewRoot:f,yHandle:p,xHandle:m,colHandle:h,rowHandle:g}}function kQ(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function AQ(e,t,n,r,i){let{width:a,height:o}=r.querySelector(`tbody`).getBoundingClientRect();if(e===`y`){let e=r.querySelectorAll(`tr`)[i];if(!e)return;n.appendChild(e.cloneNode(!0));let o=e.getBoundingClientRect().height;Object.assign(t.style,{width:`${a}px`,height:`${o}px`}),t.dataset.show=`true`;return}if(e===`x`){let e=r.querySelectorAll(`tr`),a;Array.from(e).forEach(e=>{let t=e.children[i];if(!t)return;a===void 0&&(a=t.getBoundingClientRect().width);let r=t.parentElement.cloneNode(!1),o=t.cloneNode(!0);r.appendChild(o),n.appendChild(r)}),Object.assign(t.style,{width:`${a}px`,height:`${o}px`}),t.dataset.show=`true`;return}}function jQ(e,t){return n=>{PQ(e,n,t,t=>{NQ(`y`,n,t,e);let{preview:r,content:i,previewRoot:a}=t;kQ(a);let{hoverIndex:o}=e,[s]=o.value;AQ(`y`,r,a,i,s)})}}function MQ(e,t){return n=>{PQ(e,n,t,t=>{NQ(`x`,n,t,e);let{preview:r,content:i,previewRoot:a}=t,{hoverIndex:o}=e,[s,c]=o.value;kQ(a),AQ(`x`,r,a,i,c)})}}function NQ(e,t,n,r){let{xHandle:i,yHandle:a,colHandle:o,rowHandle:s,preview:c}=n;i.dataset.displayType=e===`y`?`indicator`:`none`,a.dataset.displayType=e===`x`?`indicator`:`none`,e===`y`?(o.dataset.show=`false`,FQ(s)):(s.dataset.show=`false`,FQ(o));let{hoverIndex:l,dragInfo:u}=r,[d,f]=l.value;u.value={startCoords:[t.clientX,t.clientY],startIndex:e===`y`?d:f,endIndex:e===`y`?d:f,type:e===`y`?`row`:`col`},c.dataset.direction=e===`y`?`vertical`:`horizontal`}function PQ(e,t,n,r){if(!n?.get(m_)?.editable)return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`);let i=OQ(e);i&&requestAnimationFrame(()=>{r(i)})}function FQ(e){var t;(t=e.querySelector(`.button-group`))==null||t.setAttribute(`data-show`,`false`)}function IQ(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return-1}function LQ(e,t){if(t)try{let n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return;let r=n?.inside;if(r==null||r<0)return;let i=t.state.doc.resolve(r),a=t.state.doc.nodeAt(r);if(!a)return;let o=[`table_cell`,`table_header`],s=[`table_row`,`table_header_row`],c=o.includes(a.type.name)?a:Sf(e=>o.includes(e.type.name))(i)?.node,l=Sf(e=>s.includes(e.type.name))(i)?.node,u=Sf(e=>e.type.name===`table`)(i)?.node;if(!c||!l||!u)return;let d=IQ(l,c);return[IQ(u,l),d]}catch{return}}function RQ(e,[t,n]){let r=e.value;if(!r)return;let i=r.querySelectorAll(`tr`),a=i[t];if(!a)return;let o=i[0];if(!o)return;let s=o.children[n];if(!s)return;let c=a.children[n];if(c)return{row:a,col:c,headerCol:s}}function zQ(e,t,n){if(!n||!t)return;let{selection:r}=t.state;if(!(r instanceof sP))return;let{$from:i}=r,a=bP(i);if(!(!a||a.node!==n)){if(r.isColSelection()){let{$head:t}=r;BQ({refs:e,index:[0,t.index(t.depth-1)],before:e=>{var t;(t=e.querySelector(`.button-group`))==null||t.setAttribute(`data-show`,`true`)}});return}if(r.isRowSelection()){let{$head:t}=r,n=Sf(e=>e.type.name===`table_row`||e.type.name===`table_header_row`)(t);if(!n)return;let i=IQ(a.node,n.node);VQ({refs:e,index:[i,0],before:e=>{var t;i>0&&((t=e.querySelector(`.button-group`))==null||t.setAttribute(`data-show`,`true`))}})}}}function BQ({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:i,colHandleRef:a,hoverIndex:o}=e,s=a.value;if(!s)return;o.value=t;let l=RQ(i,t);if(!l)return;let{headerCol:u}=l;s.dataset.show=`true`,n&&n(s),c(u,s,{placement:`top`}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function VQ({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:i,rowHandleRef:a,hoverIndex:o}=e,s=a.value;if(!s)return;o.value=t;let l=RQ(i,t);if(!l)return;let{row:u}=l;s.dataset.show=`true`,n&&n(s),c(u,s,{placement:`left`}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function HQ(e,t,n){let r=n===`x`?`left`:`top`,i=n===`x`?`right`:`bottom`,a=e.length-1,o=e.findIndex((e,n)=>{let o=e.getBoundingClientRect(),s=o[r],c=o[i];return s<=t&&t<=c||n===a&&t>c||n===0&&t<s}),s=e[o];return s?[s,o]:void 0}function UQ(e,t){let n=e.querySelector(`tr`);if(n)return HQ(Array.from(n.children),t,`x`)}function WQ(e,t){return HQ(Array.from(e.querySelectorAll(`tr`)),t,`y`)}function GQ(e){return sa(t=>{let n=OQ(e);if(!n)return;let{preview:r,content:i,contentRoot:a,xHandle:o,yHandle:s}=n,{dragInfo:u,hoverIndex:d}=e;if(r.dataset.show===`false`)return;let f=RQ(e.contentWrapperRef,d.value);if(!f||!a.querySelector(`tr`))return;let p=u.value;if(!p||!a.offsetParent)return;let m=a.offsetParent.offsetTop,h=a.offsetParent.offsetLeft;if(p.type===`col`){let e=f.col.getBoundingClientRect().width,{left:n,width:o}=a.getBoundingClientRect(),u=h-n,d=t.clientX+u-e/2,[g]=p.startCoords,_=g<t.clientX?`right`:`left`;r.style.top=`${m}px`;let v=d<n+u-20?n+u-20:d>n+o+u-e+20?n+o+u-e+20:d;r.style.left=`${v}px`;let y=UQ(a,t.clientX);if(y){let[e,t]=y,n=s.getBoundingClientRect().width,r=i.getBoundingClientRect();p.endIndex=t,c(e,s,{placement:_===`left`?`left`:`right`,middleware:[l(_===`left`?-1*n:0)]}).then(({x:e})=>{s.dataset.show=`true`,Object.assign(s.style,{height:`${r.height}px`,left:`${e}px`,top:`${m}px`})}).catch(console.error)}}else if(p.type===`row`){let e=f.row.getBoundingClientRect().height,{top:n,height:s}=a.getBoundingClientRect(),u=m-n,d=t.clientY+u-e/2,[g,_]=p.startCoords,v=_<t.clientY?`down`:`up`,y=d<n+u-20?n+u-20:d>n+s+u-e+20?n+s+u-e+20:d;r.style.top=`${y}px`,r.style.left=`${h}px`;let b=WQ(a,t.clientY);if(b){let[e,t]=b,n=o.getBoundingClientRect().height,r=i.getBoundingClientRect();p.endIndex=t,c(e,o,{placement:v===`up`?`top`:`bottom`,middleware:[l(v===`up`?-1*n:0)]}).then(({y:e})=>{o.dataset.show=`true`,Object.assign(o.style,{width:`${r.width}px`,top:`${e}px`})}).catch(console.error)}}},20)}function KQ(e,t,n){let{dragPreviewRef:r,yLineHandleRef:i,xLineHandleRef:a,dragInfo:o}=e,s=jQ(e,t),c=MQ(e,t),l=()=>{let e=r.value;if(!e||e.dataset.show===`false`)return;let t=e?.querySelector(`tbody`);for(;t?.firstChild;)t?.removeChild(t.firstChild);e&&(e.dataset.show=`false`)},u=()=>{let s=r.value;if(!s)return;let c=i.value;if(!c)return;let l=a.value;if(!l)return;let u=o.value;if(!u||!t||s.dataset.show===`false`||!e.colHandleRef.value||!e.rowHandleRef.value||(c.dataset.show=`false`,l.dataset.show=`false`,u.startIndex===u.endIndex))return;let d=t.get(A),f={from:u.startIndex,to:u.endIndex,pos:(n?.()??0)+1};u.type===`col`?(d.call(wL.key,{pos:f.pos,index:u.startIndex}),d.call(SL.key,f),BQ({refs:e,index:[0,u.endIndex]})):(d.call(CL.key,{pos:f.pos,index:u.startIndex}),d.call(xL.key,f),VQ({refs:e,index:[u.endIndex,0]})),requestAnimationFrame(()=>{t.get(m_).focus()})},d=GQ(e);return RE(()=>{window.addEventListener(`dragover`,d),window.addEventListener(`dragend`,l),window.addEventListener(`drop`,u)}),HE(()=>{window.removeEventListener(`dragover`,d),window.removeEventListener(`dragend`,l),window.removeEventListener(`drop`,u)}),{dragRow:s,dragCol:c}}function qQ(e,t,n){let{xLineHandleRef:r,contentWrapperRef:i,colHandleRef:a,rowHandleRef:o,hoverIndex:s,lineHoverIndex:c}=e;return{onAddRow:()=>{if(!t)return;let e=r.value;if(!e)return;let[a]=c.value;if(a<0||!t.get(m_).editable)return;let o=Array.from(i.value?.querySelectorAll(`tr`)??[]),s=t.get(A),l=(n?.()??0)+1;o.length===a?(s.call(CL.key,{pos:l,index:a-1}),s.call(AL.key)):(s.call(CL.key,{pos:l,index:a}),s.call(kL.key)),s.call(CL.key,{pos:l,index:a}),e.dataset.show=`false`},onAddCol:()=>{if(!t||!r.value)return;let[e,a]=c.value;if(a<0||!t.get(m_).editable)return;let o=Array.from(i.value?.querySelector(`tr`)?.children??[]),s=t.get(A),l=(n?.()??0)+1;o.length===a?(s.call(wL.key,{pos:l,index:a-1}),s.call(OL.key)):(s.call(wL.key,{pos:l,index:a}),s.call(DL.key)),s.call(wL.key,{pos:l,index:a})},selectCol:()=>{if(!t)return;let[e,r]=s.value,i=t.get(A),o=(n?.()??0)+1;i.call(wL.key,{pos:o,index:r});let c=a.value?.querySelector(`.button-group`);c&&(c.dataset.show=c.dataset.show===`true`?`false`:`true`)},selectRow:()=>{if(!t)return;let[e,r]=s.value,i=t.get(A),a=(n?.()??0)+1;i.call(CL.key,{pos:a,index:e});let c=o.value?.querySelector(`.button-group`);c&&e>0&&(c.dataset.show=c.dataset.show===`true`?`false`:`true`)},deleteSelected:e=>{t&&t.get(m_).editable&&(e.preventDefault(),e.stopPropagation(),t.get(A).call(EL.key),requestAnimationFrame(()=>{t.get(m_).focus()}))},onAlign:e=>n=>{t&&t.get(m_).editable&&(n.preventDefault(),n.stopPropagation(),t.get(A).call(jL.key,e),requestAnimationFrame(()=>{t.get(m_).focus()}))}}}function JQ(e,t){return sa(n=>{if(!t?.editable)return;let{contentWrapperRef:r,yLineHandleRef:i,xLineHandleRef:a,colHandleRef:o,rowHandleRef:s,hoverIndex:u,lineHoverIndex:d}=e,f=i.value;if(!f)return;let p=a.value;if(!p)return;let m=r.value;if(!m)return;let h=s.value;if(!h)return;let g=o.value;if(!g)return;let _=LQ(n,t);if(!_)return;let v=RQ(r,_);if(!v)return;let[y,b]=_,x=v.col.getBoundingClientRect(),S=Math.abs(n.clientX-x.left)<8,ee=Math.abs(x.right-n.clientX)<8,te=Math.abs(n.clientY-x.top)<8,ne=Math.abs(x.bottom-n.clientY)<8,re=S||ee||te||ne,ie=h.querySelector(`.button-group`),ae=g.querySelector(`.button-group`);if(ie&&(ie.dataset.show=`false`),ae&&(ae.dataset.show=`false`),re){let e=m.getBoundingClientRect();h.dataset.show=`false`,g.dataset.show=`false`,p.dataset.displayType=`tool`,f.dataset.displayType=`tool`;let t=f.getBoundingClientRect().width,n=p.getBoundingClientRect().height;S||ee?(d.value[1]=S?b:b+1,c(v.col,f,{placement:S?`left`:`right`,middleware:[l(S?-1*t:0)]}).then(({x:t})=>{f.dataset.show=`true`,Object.assign(f.style,{height:`${e.height}px`,left:`${t}px`})}).catch(console.error)):f.dataset.show=`false`,_[0]!==0&&(te||ne)?(d.value[0]=te?y:y+1,c(v.row,p,{placement:te?`top`:`bottom`,middleware:[l(te?-1*n:0)]}).then(({y:t})=>{p.dataset.show=`true`,Object.assign(p.style,{width:`${e.width}px`,top:`${t}px`})}).catch(console.error)):p.dataset.show=`false`;return}d.value=[-1,-1],f.dataset.show=`false`,p.dataset.show=`false`,h.dataset.show=`true`,g.dataset.show=`true`,VQ({refs:e,index:_}),BQ({refs:e,index:_}),u.value=_},20)}function YQ(e){return()=>{let{rowHandleRef:t,colHandleRef:n,yLineHandleRef:r,xLineHandleRef:i}=e;setTimeout(()=>{let e=t.value;if(!e)return;let a=n.value;if(!a)return;let o=r.value;if(!o)return;let s=i.value;s&&(e.dataset.show=`false`,a.dataset.show=`false`,o.dataset.show=`false`,s.dataset.show=`false`)},200)}}function XQ(e,t){return{pointerMove:JQ(e,t),pointerLeave:YQ(e)}}var ZQ=SE({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:i,onMount:a}){let o=N(),s=e=>{e!=null&&(e instanceof HTMLElement?(o.value=e,a(e)):o.value=void 0)},c=N(),l=N(),u=N(),d=N(),f=N(),p=N(),m={dragPreviewRef:p,tableWrapperRef:f,contentWrapperRef:o,yLineHandleRef:d,xLineHandleRef:u,colHandleRef:c,rowHandleRef:l,hoverIndex:N([0,0]),lineHoverIndex:N([-1,-1]),dragInfo:N()},{pointerLeave:h,pointerMove:g}=XQ(m,e),{dragRow:_,dragCol:v}=KQ(m,n,r),{onAddRow:y,onAddCol:b,selectCol:x,selectRow:S,deleteSelected:ee,onAlign:te}=qQ(m,n,r);return RE(()=>{requestAnimationFrame(()=>{e.editable&&zQ(m,e,t.value)})}),()=>F(`div`,{onDragstart:e=>e.preventDefault(),onDragover:e=>e.preventDefault(),onDragleave:e=>e.preventDefault(),onPointermove:g,onPointerleave:h},F(`div`,{"data-show":`false`,contenteditable:`false`,draggable:`true`,"data-role":`col-drag-handle`,class:`handle cell-handle`,onDragstart:v,onClick:x,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:c},F(DQ,{icon:i.renderButton(`col_drag_handle`)}),F(`div`,{"data-show":`false`,class:`button-group`,onPointermove:e=>e.stopPropagation()},F(`button`,{type:`button`,onPointerdown:te(`left`)},F(DQ,{icon:i.renderButton(`align_col_left`)})),F(`button`,{type:`button`,onPointerdown:te(`center`)},F(DQ,{icon:i.renderButton(`align_col_center`)})),F(`button`,{type:`button`,onPointerdown:te(`right`)},F(DQ,{icon:i.renderButton(`align_col_right`)})),F(`button`,{type:`button`,onPointerdown:ee},F(DQ,{icon:i.renderButton(`delete_col`)})))),F(`div`,{"data-show":`false`,contenteditable:`false`,draggable:`true`,"data-role":`row-drag-handle`,class:`handle cell-handle`,onDragstart:_,onClick:S,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:l},F(DQ,{icon:i.renderButton(`row_drag_handle`)}),F(`div`,{"data-show":`false`,class:`button-group`,onPointermove:e=>e.stopPropagation()},F(`button`,{type:`button`,onPointerdown:ee},F(DQ,{icon:i.renderButton(`delete_row`)})))),F(`div`,{class:`table-wrapper`,ref:f},F(`div`,{"data-show":`false`,class:`drag-preview`,"data-direction":`vertical`,ref:p},F(`table`,null,F(`tbody`,null))),F(`div`,{"data-show":`false`,contenteditable:`false`,"data-display-type":`tool`,"data-role":`x-line-drag-handle`,class:`handle line-handle`,onPointermove:e=>e.stopPropagation(),ref:u},F(`button`,{type:`button`,onClick:y,class:`add-button`},F(DQ,{icon:i.renderButton(`add_row`)}))),F(`div`,{"data-show":`false`,contenteditable:`false`,"data-display-type":`tool`,"data-role":`y-line-drag-handle`,class:`handle line-handle`,onPointermove:e=>e.stopPropagation(),ref:d},F(`button`,{type:`button`,onClick:b,class:`add-button`},F(DQ,{icon:i.renderButton(`add_col`)}))),F(`table`,{ref:s,class:`children`})))}}),QQ=e=>{throw TypeError(e)},$Q=(e,t,n)=>t.has(e)||QQ(`Cannot `+n),e$=(e,t,n)=>t.has(e)?QQ(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),t$=(e,t,n)=>($Q(e,t,`access private method`),n),n$,r$,i$=class{constructor(e,t,n,r){this.ctx=e,this.node=t,this.view=n,this.getPos=r,e$(this,n$);let i=document.createElement(`div`);i.className=`milkdown-table-block`;let a=document.createElement(`tbody`);this.contentDOM=a,a.setAttribute(`data-content-dom`,`true`),a.classList.add(`content-dom`),this.nodeRef=Lw(t);let o=DA(ZQ,{view:n,ctx:e,getPos:r,config:e.get(EQ.key),onMount:e=>{e.appendChild(a)},node:this.nodeRef});o.mount(i),this.app=o,this.dom=i}update(e){return e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)?!1:(this.node=e,this.nodeRef.value=e,!0)}stopEvent(e){if(e.type===`drop`||e.type.startsWith(`drag`))return!0;if(e.type===`mousedown`||e.type===`pointerdown`){if(e.target instanceof Element&&e.target.closest(`button`))return!0;let t=e.target;if(t instanceof HTMLElement&&(t.closest(`th`)||t.closest(`td`))){let t=e;return t$(this,n$,r$).call(this,t)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:e.type===`selection`?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}};n$=new WeakSet,r$=function(e){let t=this.view;if(!t.editable)return!1;let{state:n,dispatch:r}=t,i=t.posAtCoords({left:e.clientX,top:e.clientY});if(!i)return!1;let a=n.doc.resolve(i.inside),o=Sf(e=>e.type.name===`table_cell`||e.type.name===`table_header`)(a);if(!o||n.selection instanceof O&&Sf(e=>e.type.name===`table_cell`||e.type.name===`table_header`)(n.selection.$from)?.node===o.node)return!1;let{from:s}=o,c=k.create(n.doc,s+1);return n.selection.eq(c)?!1:(n.selection instanceof sP?setTimeout(()=>{r(n.tr.setSelection(c).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(c).scrollIntoView())}),!0)};var a$=Pv(aL.node,e=>(t,n,r)=>new i$(e,t,n,r));bQ(a$,{displayName:`NodeView<table-block>`,group:`TableBlock`});var o$=[EQ,a$];function s$(e){if(!e)return!1;if(Array.isArray(e))return e.length>1?!1:s$(e[0]);let t=e.content;return t?s$(t):e.type===`text`}function c$(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-clipboard`,...t}}),e}function l$(e,t){let n=xf(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var u$=Mv(e=>{let t=e.get(j_);return e.update(gv,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{let r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes(`docs-internal-guid`)&&(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,`$1`),t=t.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,`$1`)),t}})),new Gu({key:new Ju(`MILKDOWN_CLIPBOARD`),props:{handlePaste:(n,r,i)=>{let a=e.get(Y_),o=n.props.editable?.(n.state),{clipboardData:s}=r;if(!o||!s||n.state.selection.$from.node().type.spec.code)return!1;let c=s.getData(`text/plain`),l=s.getData(`vscode-editor-data`);if(l){let e=JSON.parse(l)?.mode;if(c&&e){let{tr:r}=n.state,i=wf(`code_block`,t);return r.replaceSelectionWith(i.create({language:e})).setSelection(O.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(c.replace(/\r\n?/g,`
324
- `)),n.dispatch(r),!0}}let u=s.getData(`text/html`);if(u.length===0&&c.length===0)return!1;if(u.length>0&&i)return l$(n,i);let d=Gc.fromSchema(t),f;if(u.length===0){let e=a(c);if(!e||typeof e==`string`)return!1;f=al.fromSchema(t).serializeFragment(e.content)}else{let e=document.createElement(`template`);e.innerHTML=u,f=e.content.cloneNode(!0),e.remove()}return l$(n,d.parseSlice(f))},clipboardTextSerializer:n=>{let r=e.get(tv);if(s$(n.content.toJSON()))return n.content.textBetween(0,n.content.size,`
325
-
326
- `);let i=t.topNodeType.createAndFill(void 0,n.content);return i?r(i):``}}})});c$(u$,{displayName:`Prose<clipboard>`});function d$(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-history`,...t}}),e}var f$=j(`Undo`,()=>()=>qB);d$(f$,{displayName:`Command<undo>`});var p$=j(`Redo`,()=>()=>JB);d$(p$,{displayName:`Command<redo>`});var m$=Fv({},`historyProviderConfig`);d$(m$,{displayName:`Ctx<historyProviderConfig>`});var h$=Mv(e=>GB(e.get(m$.key)));d$(h$,{displayName:`Ctx<historyProviderPlugin>`});var g$=Rv(`historyKeymap`,{Undo:{shortcuts:`Mod-z`,command:e=>{let t=e.get(A);return()=>t.call(f$.key)}},Redo:{shortcuts:[`Mod-y`,`Shift-Mod-z`],command:e=>{let t=e.get(A);return()=>t.call(p$.key)}}});d$(g$.ctx,{displayName:`KeymapCtx<history>`}),d$(g$.shortcuts,{displayName:`Keymap<history>`});var _$=[m$,h$,g$,f$,p$].flat();function v$(e,t){let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof O||r instanceof ju))return e;let{to:i}=r,a=t.type===`space`?Array(t.size).fill(` `).join(``):` `;return e.insertText(a,i)}var y$=Fv({type:`space`,size:2},`indentConfig`);y$.meta={package:`@milkdown/plugin-indent`,displayName:`Ctx<indentConfig>`};var b$=Nv(e=>({Tab:(t,n)=>{let r=e.get(y$.key),{tr:i}=t,a=v$(i,r);return a.docChanged?(n?.(a),!0):!1}}));b$.meta={package:`@milkdown/plugin-indent`,displayName:`Shortcut<indent>`};var x$=[y$,b$],S$=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},C$=Za(new S$,`listener`),w$=new Ju(`MILKDOWN_LISTENER`),T$=e=>(e.inject(C$,new S$),async()=>{await e.wait(D_);let{listeners:t}=e.get(C$);t.beforeMount.forEach(t=>t(e)),await e.wait(Q_);let n=e.get(tv),r=null,i=null,a=null,o=null,s=Xi(()=>{if(!o)return;let{doc:a}=o;if(t.updated.length>0&&r&&!r.eq(a)&&t.updated.forEach(t=>{t(e,a,r)}),t.markdownUpdated.length>0&&r&&!r.eq(a)){let r=n(a);t.markdownUpdated.forEach(t=>{t(e,r,i)}),i=r}r=a,o=null},200),c=new Gu({key:w$,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,i=n(t.doc)},apply:n=>{let r=n.selection;(!a&&r||a&&!r.eq(a))&&(t.selectionUpdated.forEach(t=>{t(e,r,a)}),a=r),!(!(n.docChanged||n.storedMarksSet)||n.getMeta(`addToHistory`)===!1)&&(o=n,s())}}});e.update(y_,e=>e.concat(c)),await e.wait(mv),t.mounted.forEach(t=>t(e))});T$.meta={package:`@milkdown/plugin-listener`,displayName:`Listener`};var E$=Fv({shouldAppend:e=>!(!e||[`heading`,`paragraph`].includes(e.type.name)),getNode:e=>e.schema.nodes.paragraph.create()},`trailingConfig`);E$.meta={package:`@milkdown/plugin-trailing`,displayName:`Ctx<trailingConfig>`};var D$=Mv(e=>{let t=new Ju(`MILKDOWN_TRAILING`),{shouldAppend:n,getNode:r}=e.get(E$.key),i=new Gu({key:t,state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return n(r,t)},apply:(e,t,r,i)=>{if(!e.docChanged)return t;let a=e.doc.lastChild;return n(a,i)}},appendTransaction:(e,t,n)=>{let{doc:a,tr:o}=n,s=r?.(n),c=i.getState(n),l=a.content.size;if(!(!c||!s))return o.insert(l,s)}});return i});D$.meta={package:`@milkdown/plugin-trailing`,displayName:`Prose<trailing>`};var O$=[E$,D$];function k$(e){return new Promise(t=>{let n=new FileReader;n.addEventListener(`load`,()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})}var A$=Fv({uploader:async(e,t)=>{let n=[];for(let t=0;t<e.length;t++){let r=e.item(t);r&&r.type.includes(`image`)&&n.push(r)}let{image:r}=t.nodes;if(!r)throw Ua(`image`);return(await Promise.all(n.map(e=>k$(e)))).map(({alt:e,src:t})=>r.createAndFill({src:t,alt:e}))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{let n=document.createElement(`span`);return n.textContent=`Upload in progress...`,xg.widget(e,n,t)}},`uploadConfig`);A$.meta={package:`@milkdown/plugin-upload`,displayName:`Ctx<uploadConfig>`};var j$=Mv(e=>{let t=new Ju(`MILKDOWN_UPLOAD`),n=(e,n)=>{let r=t.getState(e);if(!r)return-1;let i=r.find(void 0,void 0,e=>e.id===n);return i.length?i[0]?.from??-1:-1},r=(r,i,a)=>{if(!a||a.length<=0)return!1;let o=Symbol(`upload symbol`),s=e.get(j_),{uploader:c,getInsertPos:l}=e.get(A$.key),{tr:u}=r.state,d=i instanceof DragEvent?r.posAtCoords({left:i.clientX,top:i.clientY})?.pos??u.selection.from:u.selection.from,f=typeof l==`function`?l(i,e,d):d;return r.dispatch(u.setMeta(t,{add:{id:o,pos:f}})),c(a,s,e,f).then(e=>{let i=n(r.state,o);i<0||r.dispatch(r.state.tr.replaceWith(i,i,e).setMeta(t,{remove:{id:o}}))}).catch(e=>{console.error(e)}),!0};return new Gu({key:t,state:{init(){return wg.empty},apply(t,n){let r=n.map(t.mapping,t.doc),i=t.getMeta(this);if(!i)return r;if(i.add){let{uploadWidgetFactory:n}=e.get(A$.key),a=n(i.add.pos,{id:i.add.id});return r.add(t.doc,[a])}if(i.remove){let e=r.find(void 0,void 0,e=>e.id===i.remove.id);return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,n)=>{let{enableHtmlFileUploader:i}=e.get(A$.key);return!(n instanceof ClipboardEvent)||!i&&n.clipboardData?.getData(`text/html`)?!1:r(t,n,n.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent?r(e,t,t.dataTransfer?.files):!1}})});j$.meta={package:`@milkdown/plugin-upload`,displayName:`Prose<upload>`};var M$=[A$,j$],N$=(e=>(e.CodeMirror=`code-mirror`,e.ListItem=`list-item`,e.LinkTooltip=`link-tooltip`,e.Cursor=`cursor`,e.ImageBlock=`image-block`,e.BlockEdit=`block-edit`,e.Toolbar=`toolbar`,e.Placeholder=`placeholder`,e.Table=`table`,e.Latex=`latex`,e.TopBar=`top-bar`,e.AI=`ai`,e))(N$||{}),P$={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0,"top-bar":!1,ai:!1},F$=`
327
- <svg
328
- xmlns="http://www.w3.org/2000/svg"
329
- width="24"
330
- height="24"
331
- viewBox="0 0 24 24"
332
- >
333
- <path
334
- fill="currentColor"
335
- d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"
336
- transform="translate(3 3) scale(0.75)"
337
- />
338
- </svg>
339
- `,I$=`
340
- <svg
341
- xmlns="http://www.w3.org/2000/svg"
342
- width="24"
343
- height="24"
344
- viewBox="0 0 24 24"
345
- >
346
- <path
347
- d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
348
- />
349
- </svg>
350
- `,L$=`
351
- <svg
352
- xmlns="http://www.w3.org/2000/svg"
353
- width="24"
354
- height="24"
355
- viewBox="0 0 24 24"
356
- >
357
- <path
358
- d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
359
- />
360
- </svg>
361
- `,R$=`
362
- <svg
363
- xmlns="http://www.w3.org/2000/svg"
364
- width="24"
365
- height="24"
366
- viewBox="0 0 24 24"
367
- >
368
- <path
369
- d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"
370
- />
371
- </svg>
372
- `,z$=`
373
- <svg
374
- xmlns="http://www.w3.org/2000/svg"
375
- width="24"
376
- height="24"
377
- viewBox="0 0 24 24"
378
- >
379
- <path
380
- d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"
381
- />
382
- </svg>
383
- `,B$=`
384
- <svg
385
- xmlns="http://www.w3.org/2000/svg"
386
- width="24"
387
- height="24"
388
- viewBox="0 0 24 24"
389
- >
390
- <g clip-path="url(#clip0_952_6527)">
391
- <circle cx="12" cy="12" r="3" />
392
- </g>
393
- <defs>
394
- <clipPath id="clip0_952_6527">
395
- <rect width="24" height="24" />
396
- </clipPath>
397
- </defs>
398
- </svg>
399
- `,V$=`
400
- <svg
401
- xmlns="http://www.w3.org/2000/svg"
402
- width="24"
403
- height="24"
404
- viewBox="0 0 24 24"
405
- >
406
- <g clip-path="url(#clip0_977_8070)">
407
- <path
408
- d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"
409
- />
410
- </g>
411
- <defs>
412
- <clipPath id="clip0_977_8070">
413
- <rect width="24" height="24" />
414
- </clipPath>
415
- </defs>
416
- </svg>
417
- `,H$=`
418
- <svg
419
- xmlns="http://www.w3.org/2000/svg"
420
- width="32"
421
- height="32"
422
- viewBox="0 0 24 24"
423
- >
424
- <path
425
- fill="currentColor"
426
- d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"
427
- />
428
- </svg>
429
- `,U$=`
430
- <svg
431
- xmlns="http://www.w3.org/2000/svg"
432
- width="24"
433
- height="24"
434
- viewBox="0 0 24 24"
435
- >
436
- <g clip-path="url(#clip0_1803_1151)">
437
- <path
438
- d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"
439
- />
440
- </g>
441
- <defs>
442
- <clipPath id="clip0_1803_1151">
443
- <rect width="24" height="24" />
444
- </clipPath>
445
- </defs>
446
- </svg>
447
- `,W$=`
448
- <svg
449
- xmlns="http://www.w3.org/2000/svg"
450
- width="24"
451
- height="24"
452
- viewBox="0 0 24 24"
453
- >
454
- <g clip-path="url(#clip0_1803_535)">
455
- <path
456
- d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"
457
- />
458
- </g>
459
- <defs>
460
- <clipPath id="clip0_1803_535">
461
- <rect width="24" height="24" />
462
- </clipPath>
463
- </defs>
464
- </svg>
465
- `,G$=`
466
- <svg
467
- xmlns="http://www.w3.org/2000/svg"
468
- fill="none"
469
- viewBox="0 0 24 24"
470
- stroke-width="1.5"
471
- stroke="currentColor"
472
- class="w-6 h-6"
473
- >
474
- <path
475
- stroke-linecap="round"
476
- stroke-linejoin="round"
477
- d="M19.5 8.25l-7.5 7.5-7.5-7.5"
478
- />
479
- </svg>
480
- `,K$=`
481
- <svg
482
- xmlns="http://www.w3.org/2000/svg"
483
- fill="none"
484
- viewBox="0 0 24 24"
485
- stroke-width="1.5"
486
- stroke="currentColor"
487
- >
488
- <path
489
- stroke-linecap="round"
490
- stroke-linejoin="round"
491
- d="M15.75 19.5L8.25 12l7.5-7.5"
492
- />
493
- </svg>
494
- `,q$=`
495
- <svg
496
- xmlns="http://www.w3.org/2000/svg"
497
- fill="none"
498
- viewBox="0 0 24 24"
499
- stroke-width="1.5"
500
- stroke="currentColor"
501
- >
502
- <path
503
- stroke-linecap="round"
504
- stroke-linejoin="round"
505
- d="M8.25 4.5l7.5 7.5-7.5 7.5"
506
- />
507
- </svg>
508
- `,J$=`
509
- <svg
510
- xmlns="http://www.w3.org/2000/svg"
511
- width="24"
512
- height="24"
513
- viewBox="0 0 24 24"
514
- >
515
- <g clip-path="url(#clip0_1098_15553)">
516
- <path
517
- d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"
518
- />
519
- </g>
520
- <defs>
521
- <clipPath id="clip0_1098_15553">
522
- <rect width="24" height="24" />
523
- </clipPath>
524
- </defs>
525
- </svg>
526
- `,Y$=`
527
- <svg
528
- xmlns="http://www.w3.org/2000/svg"
529
- width="24"
530
- height="24"
531
- viewBox="0 0 24 24"
532
- >
533
- <g clip-path="url(#clip0_977_8081)">
534
- <path
535
- d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"
536
- />
537
- </g>
538
- <defs>
539
- <clipPath id="clip0_977_8081">
540
- <rect width="24" height="24" />
541
- </clipPath>
542
- </defs>
543
- </svg>
544
- `,X$=`
545
- <svg
546
- xmlns="http://www.w3.org/2000/svg"
547
- width="24"
548
- height="24"
549
- viewBox="0 0 24 24"
550
- >
551
- <path
552
- d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z"
553
- />
554
- </svg>
555
- `,Z$=`
556
- <svg
557
- xmlns="http://www.w3.org/2000/svg"
558
- width="24"
559
- height="24"
560
- viewBox="0 0 24 24"
561
- fill="none"
562
- >
563
- <g clip-path="url(#clip0_1013_1606)">
564
- <path
565
- d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"
566
- fill="#817567"
567
- />
568
- </g>
569
- <defs>
570
- <clipPath id="clip0_1013_1606">
571
- <rect width="24" height="24" />
572
- </clipPath>
573
- </defs>
574
- </svg>
575
- `,Q$=`
576
- <svg
577
- xmlns="http://www.w3.org/2000/svg"
578
- height="24px"
579
- viewBox="0 -960 960 960"
580
- width="24px"
581
- fill="none"
582
- >
583
- <path
584
- d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
585
- />
586
- </svg>
587
- `,$$=`
588
- <svg
589
- xmlns="http://www.w3.org/2000/svg"
590
- width="24"
591
- height="24"
592
- viewBox="0 0 24 24"
593
- >
594
- <g clip-path="url(#clip0_977_7900)">
595
- <path
596
- fill-rule="evenodd"
597
- clip-rule="evenodd"
598
- d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"
599
- />
600
- </g>
601
- <defs>
602
- <clipPath id="clip0_977_7900">
603
- <rect width="24" height="24" />
604
- </clipPath>
605
- </defs>
606
- </svg>
607
- `,e1=`
608
- <svg
609
- xmlns="http://www.w3.org/2000/svg"
610
- width="16"
611
- height="16"
612
- viewBox="0 0 16 16"
613
- >
614
- <path
615
- d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"
616
- />
617
- </svg>
618
- `,t1=`
619
- <svg
620
- xmlns="http://www.w3.org/2000/svg"
621
- width="24"
622
- height="24"
623
- viewBox="0 0 24 24"
624
- >
625
- <g clip-path="url(#clip0_1013_1585)">
626
- <path
627
- d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"
628
- />
629
- </g>
630
- <defs>
631
- <clipPath id="clip0_1013_1585">
632
- <rect width="24" height="24" />
633
- </clipPath>
634
- </defs>
635
- </svg>
636
- `,n1=`
637
- <svg
638
- xmlns="http://www.w3.org/2000/svg"
639
- width="24"
640
- height="24"
641
- viewBox="0 0 24 24"
642
- >
643
- <path
644
- fill="currentColor"
645
- d="M9 16l-5-5l5-5l1.4 1.4L7.825 10H18V6h2v6H7.825l2.575 2.6z"
646
- />
647
- </svg>
648
- `,r1=`
649
- <svg
650
- xmlns="http://www.w3.org/2000/svg"
651
- width="24"
652
- height="24"
653
- viewBox="0 0 24 24"
654
- >
655
- <path
656
- fill="currentColor"
657
- d="M9.55 17.575L4.225 12.25l1.4-1.425L9.55 14.75l8.825-8.825l1.4 1.425z"
658
- />
659
- </svg>
660
- `,i1=`
661
- <svg
662
- xmlns="http://www.w3.org/2000/svg"
663
- width="24"
664
- height="24"
665
- viewBox="0 0 24 24"
666
- >
667
- <g clip-path="url(#clip0_992_5553)">
668
- <path
669
- d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"
670
- />
671
- </g>
672
- <defs>
673
- <clipPath id="clip0_992_5553">
674
- <rect width="24" height="24" />
675
- </clipPath>
676
- </defs>
677
- </svg>
678
- `,a1=`
679
- <svg
680
- xmlns="http://www.w3.org/2000/svg"
681
- width="24"
682
- height="24"
683
- viewBox="0 0 24 24"
684
- >
685
- <g clip-path="url(#clip0_992_5559)">
686
- <path
687
- d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"
688
- />
689
- </g>
690
- <defs>
691
- <clipPath id="clip0_992_5559">
692
- <rect width="24" height="24" />
693
- </clipPath>
694
- </defs>
695
- </svg>
696
- `,o1=`
697
- <svg
698
- xmlns="http://www.w3.org/2000/svg"
699
- width="24"
700
- height="24"
701
- viewBox="0 0 24 24"
702
- >
703
- <g clip-path="url(#clip0_992_5565)">
704
- <path
705
- d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
706
- />
707
- </g>
708
- <defs>
709
- <clipPath id="clip0_992_5565">
710
- <rect width="24" height="24" />
711
- </clipPath>
712
- </defs>
713
- </svg>
714
- `,s1=`
715
- <svg
716
- xmlns="http://www.w3.org/2000/svg"
717
- width="24"
718
- height="24"
719
- viewBox="0 0 24 24"
720
- >
721
- <g clip-path="url(#clip0_977_7757)">
722
- <path
723
- d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"
724
- />
725
- </g>
726
- <defs>
727
- <clipPath id="clip0_977_7757">
728
- <rect width="24" height="24" />
729
- </clipPath>
730
- </defs>
731
- </svg>
732
- `,c1=`
733
- <svg
734
- xmlns="http://www.w3.org/2000/svg"
735
- width="24"
736
- height="24"
737
- viewBox="0 0 24 24"
738
- >
739
- <g clip-path="url(#clip0_977_7760)">
740
- <path
741
- d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
742
- />
743
- </g>
744
- <defs>
745
- <clipPath id="clip0_977_7760">
746
- <rect width="24" height="24" />
747
- </clipPath>
748
- </defs>
749
- </svg>
750
- `,l1=`
751
- <svg
752
- xmlns="http://www.w3.org/2000/svg"
753
- width="24"
754
- height="24"
755
- viewBox="0 0 24 24"
756
- >
757
- <g clip-path="url(#clip0_977_7763)">
758
- <path
759
- d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"
760
- />
761
- </g>
762
- <defs>
763
- <clipPath id="clip0_977_7763">
764
- <rect width="24" height="24" />
765
- </clipPath>
766
- </defs>
767
- </svg>
768
- `,u1=`
769
- <svg
770
- xmlns="http://www.w3.org/2000/svg"
771
- width="24"
772
- height="24"
773
- viewBox="0 0 24 24"
774
- >
775
- <g clip-path="url(#clip0_977_8075)">
776
- <path
777
- d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"
778
- />
779
- </g>
780
- <defs>
781
- <clipPath id="clip0_977_8075">
782
- <rect width="24" height="24" />
783
- </clipPath>
784
- </defs>
785
- </svg>
786
- `,d1=`
787
- <svg
788
- xmlns="http://www.w3.org/2000/svg"
789
- width="24"
790
- height="24"
791
- viewBox="0 0 24 24"
792
- >
793
- <path
794
- d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"
795
- />
796
- </svg>
797
- `,f1=`
798
- <svg
799
- xmlns="http://www.w3.org/2000/svg"
800
- width="24"
801
- height="24"
802
- viewBox="0 0 24 24"
803
- >
804
- <path
805
- d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"
806
- />
807
- </svg>
808
- `,p1=`
809
- <svg
810
- xmlns="http://www.w3.org/2000/svg"
811
- width="24"
812
- height="24"
813
- viewBox="0 0 24 24"
814
- >
815
- <path
816
- fill="currentColor"
817
- d="M3 18v-2h13v2zm0-5v-2h18v2zm0-5V6h18v2zm15 13v-3h-3v-2h3v-3h2v3h3v2h-3v3z"
818
- />
819
- </svg>
820
- `,m1=`
821
- <svg
822
- xmlns="http://www.w3.org/2000/svg"
823
- width="24"
824
- height="24"
825
- viewBox="0 0 24 24"
826
- >
827
- <g clip-path="url(#clip0_971_7680)">
828
- <path
829
- d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"
830
- />
831
- </g>
832
- <defs>
833
- <clipPath id="clip0_971_7680">
834
- <rect width="24" height="24" />
835
- </clipPath>
836
- </defs>
837
- </svg>
838
- `,h1=`
839
- <svg
840
- xmlns="http://www.w3.org/2000/svg"
841
- width="24"
842
- height="24"
843
- viewBox="0 0 24 24"
844
- >
845
- <g clip-path="url(#clip0_977_8067)">
846
- <path
847
- d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"
848
- />
849
- </g>
850
- <defs>
851
- <clipPath id="clip0_977_8067">
852
- <rect width="24" height="24" />
853
- </clipPath>
854
- </defs>
855
- </svg>
856
- `,g1=`
857
- <svg
858
- xmlns="http://www.w3.org/2000/svg"
859
- width="24"
860
- height="24"
861
- viewBox="0 0 24 24"
862
- >
863
- <g clip-path="url(#clip0_971_7676)">
864
- <path
865
- d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"
866
- />
867
- </g>
868
- <defs>
869
- <clipPath id="clip0_971_7676">
870
- <rect width="24" height="24" />
871
- </clipPath>
872
- </defs>
873
- </svg>
874
- `,_1=`
875
- <svg
876
- xmlns="http://www.w3.org/2000/svg"
877
- width="24"
878
- height="24"
879
- viewBox="0 0 24 24"
880
- >
881
- <g clip-path="url(#clip0_977_7897)">
882
- <path
883
- d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"
884
- />
885
- </g>
886
- <defs>
887
- <clipPath id="clip0_977_7897">
888
- <rect width="24" height="24" />
889
- </clipPath>
890
- </defs>
891
- </svg>
892
- `,v1=`
893
- <svg
894
- xmlns="http://www.w3.org/2000/svg"
895
- width="24"
896
- height="24"
897
- viewBox="0 0 24 24"
898
- >
899
- <path
900
- d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"
901
- />
902
- </svg>
903
- `,y1=`
904
- <svg
905
- xmlns="http://www.w3.org/2000/svg"
906
- width="24"
907
- height="24"
908
- viewBox="0 0 24 24"
909
- >
910
- <path
911
- fill="currentColor"
912
- d="M12 20q-3.35 0-5.675-2.325T4 12q0-3.35 2.325-5.675T12 4q1.725 0 3.3.713T18 6.75V4h2v7h-7V9h4.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12q0 2.5 1.75 4.25T12 18q1.925 0 3.475-1.1T17.65 14h2.1q-.7 2.65-2.85 4.325T12 20"
913
- />
914
- </svg>
915
- `,b1=`
916
- <svg
917
- xmlns="http://www.w3.org/2000/svg"
918
- fill="none"
919
- viewBox="0 0 24 24"
920
- stroke-width="1.5"
921
- stroke="currentColor"
922
- class="w-6 h-6"
923
- >
924
- <path
925
- stroke-linecap="round"
926
- stroke-linejoin="round"
927
- d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
928
- />
929
- </svg>
930
- `,x1=`
931
- <svg
932
- xmlns="http://www.w3.org/2000/svg"
933
- width="24"
934
- height="24"
935
- viewBox="0 0 24 24"
936
- >
937
- <path
938
- fill="currentColor"
939
- d="M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z"
940
- />
941
- </svg>
942
- `,S1=`
943
- <svg
944
- xmlns="http://www.w3.org/2000/svg"
945
- width="24"
946
- height="24"
947
- viewBox="0 0 24 24"
948
- >
949
- <path
950
- fill="currentColor"
951
- d="M3 20v-6l8-2l-8-2V4l19 8z"
952
- />
953
- </svg>
954
- `,C1=`
955
- <svg
956
- xmlns="http://www.w3.org/2000/svg"
957
- width="24"
958
- height="24"
959
- viewBox="0 0 24 24"
960
- >
961
- <path
962
- fill="currentColor"
963
- d="M5 13v-2h14v2z"
964
- />
965
- </svg>
966
- `,w1=`
967
- <svg
968
- xmlns="http://www.w3.org/2000/svg"
969
- width="24"
970
- height="24"
971
- viewBox="0 0 24 24"
972
- >
973
- <path
974
- d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"
975
- />
976
- </svg>
977
- `,T1=`
978
- <svg
979
- xmlns="http://www.w3.org/2000/svg"
980
- width="24"
981
- height="24"
982
- viewBox="0 0 24 24"
983
- >
984
- <g clip-path="url(#clip0_977_8078)">
985
- <path
986
- d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"
987
- />
988
- </g>
989
- <defs>
990
- <clipPath id="clip0_977_8078">
991
- <rect width="24" height="24" />
992
- </clipPath>
993
- </defs>
994
- </svg>
995
- `,E1=`
996
- <svg
997
- xmlns="http://www.w3.org/2000/svg"
998
- width="24"
999
- height="24"
1000
- viewBox="0 0 24 24"
1001
- >
1002
- <g clip-path="url(#clip0_992_5547)">
1003
- <path
1004
- d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"
1005
- />
1006
- </g>
1007
- <defs>
1008
- <clipPath id="clip0_992_5547">
1009
- <rect width="24" height="24" />
1010
- </clipPath>
1011
- </defs>
1012
- </svg>
1013
- `,D1=`
1014
- <svg
1015
- xmlns="http://www.w3.org/2000/svg"
1016
- width="24"
1017
- height="24"
1018
- viewBox="0 0 24 24"
1019
- >
1020
- <path
1021
- d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"
1022
- />
1023
- </svg>
1024
- `,O1=`
1025
- <svg
1026
- xmlns="http://www.w3.org/2000/svg"
1027
- width="24"
1028
- height="24"
1029
- viewBox="0 0 24 24"
1030
- >
1031
- <path
1032
- fill="currentColor"
1033
- d="m12.9 16l-2.55-2.5l.05-.05q1.45-1.6 2.262-3.117T13.95 7H16V5h-6V3H8v2H2v2h9.1q-.5 1.2-1.225 2.387T8 11.7q-.6-.6-1.187-1.412T5.85 8.6H3.85q.5 1.4 1.3 2.7T6.95 13.7L2.85 17.75L4.25 19.15L8 15.4L10.55 17.95zM18.5 22h-2L21 10h2l4.5 12h-2l-1.05-3h-4.9zm1.6-5h3.6l-1.8-5.1z"
1034
- />
1035
- </svg>
1036
- `,k1=`
1037
- <svg
1038
- xmlns="http://www.w3.org/2000/svg"
1039
- width="32"
1040
- height="32"
1041
- viewBox="0 0 24 24"
1042
- >
1043
- <path
1044
- fill="currentColor"
1045
- d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"
1046
- />
1047
- </svg>
1048
- `,A1=`
1049
- <svg
1050
- xmlns="http://www.w3.org/2000/svg"
1051
- height="24px"
1052
- viewBox="0 -960 960 960"
1053
- width="24px"
1054
- >
1055
- <path
1056
- d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"
1057
- />
1058
- </svg>
1059
- `,j1={[N$.CodeMirror]:{theme:Da,languages:ua,expandIcon:G$,searchIcon:b1,clearSearchIcon:J$,searchPlaceholder:`Search language`,noResultText:`No result`,previewToggleIcon:e=>e?t1:A1}},M1=Za([],`FeaturesCtx`),N1=Za({},`CrepeCtx`);function P1(e){return e.get(`CrepeCtx`)}function F1(e){return e.use(`FeaturesCtx`)}function I1(e){return t=>{F1(t).update(t=>t.includes(e)?t:[...t,e])}}function L1(e,t){let n=e.get(m_),r=e.get(tv),{state:i}=n,a=r(i.doc),o=``;if(!i.selection.empty){let{from:e,to:t}=i.selection,n=i.doc.slice(e,t),{schema:a}=i.doc.type,s=a.topNodeType.createAndFill(null,n.content);if(!s){let e=a.nodes.paragraph?.createAndFill(null,n.content);e&&(s=a.topNodeType.createAndFill(null,e))}o=s?r(s):i.doc.textBetween(e,t)}return{document:a,selection:o,instruction:t}}var R1=Fv({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},`aiProviderConfig`),z1=Fv({abortController:null,label:``,lastInstruction:``,lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},`aiSession`);function B1(e,t){let n=e.get(R1.key);try{n.onError(t)}catch(e){console.error(`[milkdown/ai] onError handler failed:`,e)}}function V1(e){let t=e.get(z1.key);e.set(z1.key,{...t,abortController:null,label:``})}async function H1(e,t,n,r){try{let i=t(n,r.signal),a=e.get(A);for await(let e of i){if(r.signal.aborted)break;a.call(Fb.key,e)}if(r.signal.aborted)return;let o=e.get(R1.key);if(o.diffReviewOnEnd){let t=e.get(z1.key);e.set(z1.key,{...t,diffOwnedByAI:!0})}let s=a.call(Ib.key,{diffReview:o.diffReviewOnEnd});if(o.diffReviewOnEnd&&!s){let t=e.get(z1.key);e.set(z1.key,{...t,diffOwnedByAI:!1})}}catch(t){if(r.signal.aborted)return;B1(e,Ka(t)),e.get(A).call(Lb.key,{keep:!1})}finally{e.get(z1.key).abortController===r&&V1(e)}}var U1=j(`RunAI`,e=>t=>(n,r)=>{if(!t?.instruction)return!1;let i=e.get(R1.key);if(!i.provider||e.get(z1.key).abortController||Ab.getState(n)?.active||Cy.getState(n)?.active)return!1;if(!r)return!0;let a=new AbortController,{from:o,to:s}=n.selection;e.set(z1.key,{abortController:a,label:t.label??``,lastInstruction:t.instruction,lastLabel:t.label,lastFrom:o,lastTo:s,diffOwnedByAI:!1});let c=e.get(A),l=n.selection.empty?`cursor`:`selection`;if(!c.call(Pb.key,{insertAt:l}))return V1(e),!1;let u;try{u=(i.buildContext??L1)(e,t.instruction)}catch(t){return B1(e,qa(t)),c.call(Lb.key,{keep:!1}),V1(e),!1}return H1(e,i.provider,u,a),!0}),W1=j(`AbortAI`,e=>t=>(n,r)=>{let i=e.get(z1.key);return r?i.abortController?(i.abortController.abort(),V1(e),Ab.getState(n)?.active&&e.get(A).call(Lb.key,t),!0):!1:!!i.abortController}),G1=e=>{throw TypeError(e)},K1=(e,t,n)=>t.has(e)||G1(`Cannot `+n),q1=(e,t,n)=>(K1(e,t,`read from private field`),n?n.call(e):t.get(e)),J1=(e,t,n)=>t.has(e)?G1(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Y1=(e,t,n,r)=>(K1(e,t,`write to private field`),t.set(e,n),n),X1=(e,t,n)=>(K1(e,t,`access private method`),n),Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0=`milkdown-ai-diff-actions`;function m0(e,t){e.innerHTML=nS.sanitize(t.trim())}function h0(e){let t=document.createElement(`span`);return t.className=`${p0}-icon`,m0(t,e),t}var g0=class{constructor(e,t,n){this.ctx=e,J1(this,a0),J1(this,Z1),J1(this,Q1),J1(this,$1),J1(this,e0),J1(this,t0,!1),J1(this,n0,!1),J1(this,r0,null),J1(this,i0,!1),J1(this,l0,()=>{let e=this.ctx.get(z1.key);if(!e.lastInstruction||!q1(this,i0)||!X1(this,a0,u0).call(this))return;let t=this.ctx.get(A);t.call(Iy.key);let n=this.ctx.get(m_),{doc:r}=n.state,i=Math.min(Math.max(e.lastFrom,0),r.content.size),a=Math.min(Math.max(e.lastTo,0),r.content.size);n.dispatch(n.state.tr.setSelection(O.create(n.state.doc,i,a))),t.call(U1.key,{instruction:e.lastInstruction,label:e.lastLabel})}),J1(this,d0,()=>{this.ctx.get(A).call(Iy.key)}),J1(this,f0,()=>{this.ctx.get(A).call(Fy.key)}),Y1(this,e0,n),Y1(this,Q1,X1(this,a0,o0).call(this,t));let r=document.createElement(`div`);r.className=p0,r.dataset.show=`false`,Y1(this,$1,X1(this,a0,s0).call(this,`retry`,n.retryIcon,n.retryLabel,q1(this,l0))),r.appendChild(q1(this,$1)),r.appendChild(X1(this,a0,s0).call(this,`reject`,n.rejectIcon,n.rejectAllLabel,q1(this,d0)));let i=X1(this,a0,s0).call(this,`accept`,n.acceptIcon,n.acceptAllLabel,q1(this,f0));i.appendChild(X1(this,a0,c0).call(this)),r.appendChild(i),Y1(this,Z1,r),q1(this,Q1).appendChild(r),this.update(t)}update(e){let t=!!Cy.getState(e.state)?.active;if(t!==q1(this,n0))if(Y1(this,n0,t),t){let t=this.ctx.get(z1.key);Y1(this,i0,t.diffOwnedByAI),Y1(this,r0,e.state.doc)}else{Y1(this,i0,!1),Y1(this,r0,null);let e=this.ctx.get(z1.key);e.diffOwnedByAI&&this.ctx.set(z1.key,{...e,diffOwnedByAI:!1})}let n=t&&q1(this,i0);if(n!==q1(this,t0)&&(Y1(this,t0,n),q1(this,Z1).dataset.show=n?`true`:`false`),n){let t=this.ctx.get(z1.key),n=!!q1(this,r0)&&e.state.doc.eq(q1(this,r0));q1(this,$1).disabled=!t.lastInstruction||!n}}destroy(){q1(this,Z1).remove()}};Z1=new WeakMap,Q1=new WeakMap,$1=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,i0=new WeakMap,a0=new WeakSet,o0=function(e){return e.dom.closest(`.milkdown`)??document.body},s0=function(e,t,n,r){let i=document.createElement(`button`);i.type=`button`,i.className=`${p0}-btn ${p0}-btn-${e}`,i.appendChild(h0(t));let a=document.createElement(`span`);return a.textContent=n,i.appendChild(a),i.addEventListener(`mousedown`,e=>e.preventDefault()),i.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),r()}),i},c0=function(){let e=document.createElement(`span`);e.className=`${p0}-shortcut`;let t=document.createElement(`span`);t.textContent=q1(this,e0).modSymbol;let n=document.createElement(`span`);return n.className=`${p0}-shortcut-icon`,m0(n,q1(this,e0).enterKeyIcon),e.append(t,n),e},l0=new WeakMap,u0=function(){return q1(this,r0)?this.ctx.get(m_).state.doc.eq(q1(this,r0)):!1},d0=new WeakMap,f0=new WeakMap;var _0=new Ju(`CREPE_AI_DIFF_ACTIONS_PANEL`),v0=`Retry`,y0=`Reject all`,b0=`Accept all`;function x0(){if(typeof navigator>`u`)return`⌘`;let e=navigator,t=e.userAgentData?.platform??e.platform??e.userAgent??``;return/mac|iphone|ipad|ipod/i.test(t)?`⌘`:`Ctrl`}var S0=x0();function C0(e){let{config:t,enterKeyIcon:n}=e;return{retryLabel:t?.retryLabel??v0,rejectAllLabel:t?.rejectAllLabel??y0,acceptAllLabel:t?.acceptAllLabel??b0,retryIcon:t?.retryIcon??y1,rejectIcon:t?.rejectIcon??J$,acceptIcon:t?.acceptIcon??Z$,enterKeyIcon:n??n1,modSymbol:t?.modSymbol??S0}}function w0(e={}){let t=C0(e);return Mv(e=>new Gu({key:_0,view(n){return new g0(e,n,t)},props:{handleKeyDown(t,n){return n.key!==`Enter`||!(n.metaKey||n.ctrlKey)||!Cy.getState(t.state)?.active||!e.get(z1.key).diffOwnedByAI?!1:(n.preventDefault(),e.get(A).call(Fy.key),!0)}}}))}var T0=e=>{throw TypeError(e)},E0=(e,t,n)=>t.has(e)||T0(`Cannot `+n),D0=(e,t,n)=>(E0(e,t,`read from private field`),n?n.call(e):t.get(e)),O0=(e,t,n)=>t.has(e)?T0(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),k0=(e,t,n,r)=>(E0(e,t,`write to private field`),t.set(e,n),n),A0,j0;function M0(e){let t={addItem:(n,r)=>(e.items.set(n,r),t),removeItem:n=>(e.items.delete(n),t),getItem:t=>e.items.get(t),clear:()=>(e.items.clear(),t)};return t}var N0=class{constructor(){O0(this,A0,[]),this.addItem=(e,t)=>(D0(this,j0).call(this,e),D0(this,A0).push({kind:`item`,id:e,item:t}),this),this.addSubmenu=(e,t,n)=>{D0(this,j0).call(this,e);let r={def:t,items:new Map};return n&&n(M0(r)),D0(this,A0).push({kind:`submenu`,id:e,node:r}),this},this.removeItem=e=>(D0(this,j0).call(this,e),this),this.getItem=e=>{let t=D0(this,A0).find(t=>t.kind===`item`&&t.id===e);return t?.kind===`item`?t.item:void 0},this.getSubmenu=e=>{let t=D0(this,A0).find(t=>t.kind===`submenu`&&t.id===e);return t?.kind===`submenu`?M0(t.node):void 0},this.clear=()=>(k0(this,A0,[]),this),this.build=()=>{let e=[],t={};for(let n of D0(this,A0))n.kind===`item`?e.push({kind:`item`,id:n.id,item:n.item}):(e.push({kind:`submenu`,id:n.id,def:n.node.def}),t[n.id]={def:n.node.def,items:Array.from(n.node.items.entries()).map(([e,t])=>({id:e,item:t}))});return{main:e,submenus:t}},O0(this,j0,e=>{k0(this,A0,D0(this,A0).filter(t=>t.id!==e))})}};A0=new WeakMap,j0=new WeakMap;function P0(e){e.addItem(`improve`,{icon:F$,label:`Improve writing`,streamingLabel:`Improving writing`,prompt:`Improve the writing while preserving the original meaning.`}).addItem(`grammar`,{icon:r1,label:`Fix grammar & spelling`,streamingLabel:`Fixing grammar & spelling`,prompt:`Fix any grammar and spelling errors without changing the meaning.`}).addItem(`shorter`,{icon:C1,label:`Make shorter`,streamingLabel:`Making shorter`,prompt:`Make this shorter while preserving the key information.`}).addItem(`longer`,{icon:p1,label:`Make longer`,streamingLabel:`Expanding`,prompt:`Expand this with more detail and examples.`}),e.addSubmenu(`tone`,{icon:t1,label:`Change tone…`,title:`Change tone`,searchPlaceholder:`Search tones…`},e=>{for(let[t,n]of[[`professional`,`Professional`],[`casual`,`Casual`],[`confident`,`Confident`],[`friendly`,`Friendly`],[`direct`,`Direct`],[`formal`,`Formal`]])e.addItem(t,{icon:t1,label:n,streamingLabel:`Adjusting tone`,prompt:`Rewrite this in a ${n.toLowerCase()} tone.`})}),e.addSubmenu(`translate`,{icon:O1,label:`Translate…`,title:`Translate`,searchPlaceholder:`Search languages…`},e=>{for(let[t,n,r]of[[`english`,`English`,`English`],[`chinese`,`Chinese`,`Chinese (Simplified)`],[`japanese`,`Japanese`,`Japanese`],[`korean`,`Korean`,`Korean`],[`spanish`,`Spanish`,`Spanish`],[`french`,`French`,`French`],[`german`,`German`,`German`]])e.addItem(t,{icon:O1,label:n,streamingLabel:`Translating to ${n}`,prompt:`Translate this to ${r}.`})})}function F0(e,t){let n=t.trim();if(!n)return[e];let r=e.toLowerCase(),i=n.toLowerCase(),a=r.indexOf(i);return a===-1?[e]:[e.slice(0,a),F(`mark`,null,e.slice(a,a+n.length)),e.slice(a+n.length)]}var I0=SE({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:i,onCancel:a}){let o=N(``),s=N({kind:`main`}),c=N(0),l=N(null),u=N(null),d=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,f=e=>`${d}-opt-${e}`;mE(t,()=>{o.value=``,s.value={kind:`main`},c.value=0});let p=Pk(()=>{if(s.value.kind===`submenu`){let e=n.submenus[s.value.id];return e?e.items.map(({id:e,item:t})=>({id:e,icon:t.icon,label:t.label,hasSubmenu:!1,prompt:{text:t.prompt,streamingLabel:t.streamingLabel}})):[]}return n.main.map(e=>e.kind===`item`?{id:e.id,icon:e.item.icon,label:e.item.label,hasSubmenu:!1,prompt:{text:e.item.prompt,streamingLabel:e.item.streamingLabel}}:{id:e.id,icon:e.def.icon,label:e.def.label,hasSubmenu:!0})}),m=Pk(()=>s.value.kind===`submenu`?n.submenus[s.value.id]?.def??null:null),h=Pk(()=>{let e=o.value.trim().toLowerCase();return e?p.value.filter(t=>t.label.toLowerCase().includes(e)):p.value}),g=Pk(()=>o.value.trim().length>0),_=Pk(()=>h.value.length+ +!!g.value);mE([h,s,g],()=>{c.value=g.value?h.value.length:0});let v=()=>{yT(()=>l.value?.focus())},y=e=>{s.value={kind:`submenu`,id:e},o.value=``,c.value=0,v()},b=()=>{s.value={kind:`main`},o.value=``,c.value=0,v()},x=e=>{e.hasSubmenu?y(e.id):e.prompt&&(i(e.prompt.text,e.prompt.streamingLabel),o.value=``)},S=()=>{let e=o.value.trim();e&&(i(e),o.value=``)},ee=()=>{let e=c.value,t=h.value;e<t.length?x(t[e]):g.value&&S()},te=()=>{yT(()=>{let e=u.value;e&&e.querySelector(`[data-index="${c.value}"]`)?.scrollIntoView({block:`nearest`})})},ne=e=>{if(e.stopPropagation(),e.key===`ArrowDown`){if(e.preventDefault(),_.value===0)return;c.value=(c.value+1)%_.value,te();return}if(e.key===`ArrowUp`){if(e.preventDefault(),_.value===0)return;c.value=(c.value-1+_.value)%_.value,te();return}if(e.key===`Enter`){e.preventDefault(),ee();return}if(e.key===`Escape`){e.preventDefault(),s.value.kind===`submenu`?b():a();return}e.key===`Backspace`&&o.value===``&&s.value.kind===`submenu`&&(e.preventDefault(),b())},re=e=>{e.preventDefault()};return()=>{let t=h.value,n=g.value,i=m.value;return F(`div`,{class:`ai-instruction`},F(`div`,{class:`ai-instruction-input`},F(`span`,{class:`ai-instruction-input-prefix`},F(NA,{icon:r.aiIcon})),F(`input`,{ref:l,class:`ai-instruction-input-field`,role:`combobox`,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-controls":d,"aria-activedescendant":_.value>0?f(c.value):void 0,placeholder:i?i.searchPlaceholder:e.value,value:o.value,onInput:e=>{o.value=e.target.value},onKeydown:ne}),F(`button`,{type:`button`,class:`ai-instruction-submit`,"aria-label":r.submitButtonLabel,disabled:!n,onMousedown:re,onClick:S},F(NA,{icon:r.sendIcon}))),F(`div`,{class:`ai-instruction-list`,ref:u,id:d,role:`listbox`,"aria-label":r.listboxLabel},i&&F(`button`,{type:`button`,class:`ai-instruction-back`,onMousedown:re,onClick:b},F(`span`,{class:`ai-instruction-back-icon`,"aria-hidden":`true`},F(NA,{icon:r.chevronLeftIcon})),F(`span`,null,i.title)),t.length>0&&F(`div`,{class:`ai-instruction-section`},F(`div`,{class:`ai-instruction-section-header`},r.suggestionsHeaderLabel),t.map((e,t)=>F(`div`,{key:e.id,id:f(t),"data-index":t,role:`option`,"aria-selected":t===c.value,class:[`ai-instruction-item`,t===c.value?`active`:``],onMousedown:re,onClick:()=>x(e),onPointerenter:()=>{c.value=t}},F(`span`,{class:`ai-instruction-item-icon`},F(NA,{icon:e.icon})),F(`span`,{class:`ai-instruction-item-label`},F0(e.label,o.value)),e.hasSubmenu&&F(`span`,{class:`ai-instruction-item-arrow`},F(NA,{icon:r.chevronRightIcon}))))),n&&F(`div`,{class:`ai-instruction-section`},F(`div`,{class:`ai-instruction-section-header`},r.sendAsPromptHeaderLabel),F(`div`,{id:f(t.length),"data-index":t.length,role:`option`,"aria-selected":c.value===t.length,class:[`ai-instruction-item`,`ai-instruction-item-prompt`,c.value===t.length?`active`:``],onMousedown:re,onClick:S,onPointerenter:()=>{c.value=t.length}},F(`span`,{class:`ai-instruction-item-icon`},F(NA,{icon:r.sendPromptIcon})),F(`span`,{class:`ai-instruction-item-label`},r.sendAsPromptLabel,` `,F(`span`,{class:`ai-instruction-item-quote`},`"`,o.value,`"`)),F(`span`,{class:`ai-instruction-item-shortcut`},F(NA,{icon:r.enterKeyIcon}))))))}}}),L0=e=>{throw TypeError(e)},R0=(e,t,n)=>t.has(e)||L0(`Cannot `+n),z0=(e,t,n)=>(R0(e,t,`read from private field`),n?n.call(e):t.get(e)),B0=(e,t,n)=>t.has(e)?L0(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),V0=(e,t,n,r)=>(R0(e,t,`write to private field`),t.set(e,n),n),H0,U0,W0,G0,K0,q0,J0,Y0,X0,Z0,Q0=class{constructor(e,t,n){this.ctx=e,B0(this,H0),B0(this,U0),B0(this,W0),B0(this,G0),B0(this,K0),B0(this,q0,-1),B0(this,J0,-1),B0(this,Y0,!1),B0(this,X0,(e,t)=>{e.trim()&&this.ctx.get(A).call(U1.key,{instruction:e,label:t})&&(V0(this,Y0,!1),z0(this,U0).hide())}),B0(this,Z0,()=>{V0(this,Y0,!1),z0(this,U0).hide()}),this.show=(e,t)=>{V0(this,q0,e),V0(this,J0,t),z0(this,K0).value++,V0(this,Y0,!0);let n=this.ctx.get(m_);z0(this,U0).show({getBoundingClientRect:()=>vf(n,e,t)},n),requestAnimationFrame(()=>{var e;(e=z0(this,H0).querySelector(`input`))==null||e.focus()})},this.update=(e,t)=>{let{selection:n}=e.state,r=n instanceof O,i=n.from!==z0(this,q0)||n.to!==z0(this,J0);if(!r||i){V0(this,Y0,!1),z0(this,U0).hide();return}z0(this,U0).update(e,t)},this.destroy=()=>{z0(this,W0).unmount(),z0(this,U0).destroy(),z0(this,H0).remove()},V0(this,G0,N(n.placeholder)),V0(this,K0,N(0));let r=document.createElement(`div`);r.className=`milkdown-ai-instruction`;let i=DA(I0,{placeholder:z0(this,G0),resetSignal:z0(this,K0),suggestions:n.suggestions,chrome:n.chrome,onConfirm:z0(this,X0),onCancel:z0(this,Z0)});i.mount(r),V0(this,W0,i),V0(this,H0,r),V0(this,U0,new rS({content:r,debounce:0,offset:10,shouldShow:()=>z0(this,Y0),floatingUIOptions:{placement:`bottom`}})),z0(this,U0).onHide=()=>{V0(this,Y0,!1),requestAnimationFrame(()=>{try{let e=z0(this,H0).getRootNode().activeElement;if(!e||!z0(this,H0).contains(e))return;this.ctx.get(m_).dom.focus({preventScroll:!0})}catch{}})},z0(this,U0).update(t)}};H0=new WeakMap,U0=new WeakMap,W0=new WeakMap,G0=new WeakMap,K0=new WeakMap,q0=new WeakMap,J0=new WeakMap,Y0=new WeakMap,X0=new WeakMap,Z0=new WeakMap;var $0=Fv({show:()=>{}},`aiInstructionTooltipAPI`),e2=iS(`CREPE_AI_INSTRUCTION`),t2=`SUGGESTIONS`,n2=`SEND AS PROMPT`,r2=`Ask AI:`,i2=`Send prompt`,a2=`AI suggestions`,o2=`Tell AI what to do with the selection…`;function s2(e){return{aiIcon:e?.aiIcon??F$,sendIcon:e?.sendIcon??x1,sendPromptIcon:e?.sendPromptIcon??S1,enterKeyIcon:e?.enterKeyIcon??n1,chevronLeftIcon:e?.chevronLeftIcon??K$,chevronRightIcon:e?.chevronRightIcon??q$,suggestionsHeaderLabel:e?.suggestionsHeaderLabel??t2,sendAsPromptHeaderLabel:e?.sendAsPromptHeaderLabel??n2,sendAsPromptLabel:e?.sendAsPromptLabel??r2,submitButtonLabel:e?.submitButtonLabel??i2,listboxLabel:e?.listboxLabel??a2}}function c2(e){var t;let n=new N0;return P0(n),(t=e?.buildAISuggestions)==null||t.call(e,n),{placeholder:e?.instructionPlaceholder??o2,chrome:s2(e),suggestions:n.build()}}function l2(e){return t=>{let n=c2(e),r=null;t.update($0.key,e=>({...e,show:(e,t)=>{r?.show(e,t)}})),t.set(e2.key,{view:e=>(r=new Q0(t,e,n),r)})}}var u2=e=>{throw TypeError(e)},d2=(e,t,n)=>t.has(e)||u2(`Cannot `+n),f2=(e,t,n)=>(d2(e,t,`read from private field`),n?n.call(e):t.get(e)),p2=(e,t,n)=>t.has(e)?u2(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),m2=(e,t,n,r)=>(d2(e,t,`write to private field`),t.set(e,n),n),h2,g2,_2,v2,y2,b2,x2,S2=`milkdown-ai-streaming`,C2=800,w2=`Generating`,T2=`Esc to cancel`,E2=new Ju(`CREPE_AI_STREAMING_INDICATOR`),D2=class{constructor(e,t,n){p2(this,h2),p2(this,g2),p2(this,_2),p2(this,v2,performance.now()),p2(this,y2,``),p2(this,b2,0),p2(this,x2,()=>{let e=(performance.now()-f2(this,v2))/C2*360;f2(this,h2).style.transform=`rotate(${e}deg)`,m2(this,b2,requestAnimationFrame(f2(this,x2)))}),m2(this,_2,t);let r=document.createElement(`span`);r.className=`${S2}-indicator`,r.contentEditable=`false`,r.setAttribute(`role`,`status`),r.setAttribute(`aria-live`,`polite`);let i=document.createElement(`span`);i.className=`${S2}-spinner`,i.setAttribute(`aria-hidden`,`true`),r.appendChild(i);let a=document.createElement(`span`);a.className=`${S2}-label`,r.appendChild(a);let o=document.createElement(`span`);o.className=`${S2}-esc`,o.textContent=n,r.appendChild(o),this.dom=r,m2(this,h2,i),m2(this,g2,a),this.setLabel(e),f2(this,x2).call(this)}setLabel(e){let t=`${e.get(z1.key).label||f2(this,_2)}\u2026`;t!==f2(this,y2)&&(m2(this,y2,t),f2(this,g2).textContent=t)}destroy(){f2(this,b2)&&cancelAnimationFrame(f2(this,b2)),m2(this,b2,0)}};h2=new WeakMap,g2=new WeakMap,_2=new WeakMap,v2=new WeakMap,y2=new WeakMap,b2=new WeakMap,x2=new WeakMap;function O2(e={}){let{config:t}=e,n=t?.fallbackLabel??w2,r=t?.cancelHint??T2;return Mv(e=>{let t=null;function i(){return t?t.setLabel(e):t=new D2(e,n,r),t}function a(){t&&=(t.destroy(),null)}function o(e,t){let n=Math.min(t,e.content.size),r=xg.widget(n,i().dom,{side:1,key:`ai-streaming-indicator`});return wg.create(e,[r])}return new Gu({key:E2,state:{init:()=>wg.empty,apply(e,t,n,r){let i=Ab.getState(r);return!i?.active||i.insertEndPos==null?(a(),wg.empty):e.getMeta(Ab)||e.docChanged?o(r.doc,i.insertEndPos):t.map(e.mapping,e.doc)}},view(){return{destroy(){a()}}},props:{decorations(e){return E2.getState(e)??wg.empty},handleKeyDown(t,n){if(n.key!==`Escape`)return!1;let r=e.get(A);return e.get(z1.key).abortController?(n.preventDefault(),r.call(W1.key,{keep:!0}),!0):Ab.getState(t.state)?.active?(n.preventDefault(),r.call(Lb.key,{keep:!0}),!0):!1}}})})}var k2=[`table`,`image-block`,`code_block`],A2={heading:[`id`]},j2=(e,t)=>{let n=t?.diff??{},r=t?.streaming??{};e.config(I1(N$.AI)).config(e=>{e.update(Sy.key,e=>({...e,ignoreAttrs:n.ignoreAttrs??A2}));let{ignoreAttrs:t,...r}=n;e.update(Ky.key,e=>({...e,customBlockTypes:r.customBlockTypes??k2,...r}))}).use(Ly).use(_b).config(e=>{e.update(yb.key,e=>({...e,...r,ignoreAttrs:r.ignoreAttrs??A2,...t?.diffReviewOnEnd===void 0?{}:{diffReviewOnEnd:t.diffReviewOnEnd}}))}).use(Rb).config(e=>{e.update(R1.key,e=>({...e,...t?.provider===void 0?{}:{provider:t.provider},...t?.buildContext===void 0?{}:{buildContext:t.buildContext},diffReviewOnEnd:t?.diffReviewOnEnd??e.diffReviewOnEnd,...t?.onError===void 0?{}:{onError:t.onError},...t?.aiIcon===void 0?{}:{aiIcon:t.aiIcon}}))}).use(R1).use(z1).use(U1).use(W1).config(l2(t)).use($0).use(e2).use(O2({config:t?.streamingIndicator})).use(w0({config:t?.diffActions,enterKeyIcon:t?.enterKeyIcon}))};function M2(e){return e.$from.parent.type.name===`code_block`}function N2(e){return e.$from.node(e.$from.depth-1)?.type?.name===`list_item`}var P2=e=>{throw TypeError(e)},F2=(e,t,n)=>t.has(e)||P2(`Cannot `+n),I2=(e,t,n)=>(F2(e,t,`read from private field`),n?n.call(e):t.get(e)),L2=(e,t,n)=>t.has(e)?P2(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),R2=(e,t,n,r)=>(F2(e,t,`write to private field`),t.set(e,n),n),z2,B2,V2=class{constructor(){L2(this,z2,[]),this.clear=()=>(R2(this,z2,[]),this),L2(this,B2,e=>{let t={group:e,addItem:(n,r)=>{let i={...r,key:n};return e.items.push(i),t},clear:()=>(e.items=[],t)};return t}),this.addGroup=(e,t)=>{let n={key:e,label:t,items:[]};return I2(this,z2).push(n),I2(this,B2).call(this,n)},this.getGroup=e=>{let t=I2(this,z2).find(t=>t.key===e);if(!t)throw Error(`Group with key ${e} not found`);return I2(this,B2).call(this,t)},this.build=()=>I2(this,z2)}};z2=new WeakMap,B2=new WeakMap;function H2(e,t,n){var r;let i=n&&F1(n).get(),a=i?.includes(N$.Latex),o=i?.includes(N$.ImageBlock),s=i?.includes(N$.Table),c=new V2;if(t?.textGroup!==null){let e=c.addGroup(`text`,t?.textGroup?.label??`Text`);t?.textGroup?.text!==null&&e.addItem(`text`,{label:t?.textGroup?.text?.label??`Text`,icon:t?.textGroup?.text?.icon??E1,onRun:e=>{let t=e.get(A),n=Tj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n})}}),t?.textGroup?.h1!==null&&e.addItem(`h1`,{label:t?.textGroup?.h1?.label??`Heading 1`,icon:t?.textGroup?.h1?.icon??i1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:1}})}}),t?.textGroup?.h2!==null&&e.addItem(`h2`,{label:t?.textGroup?.h2?.label??`Heading 2`,icon:t?.textGroup?.h2?.icon??a1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:2}})}}),t?.textGroup?.h3!==null&&e.addItem(`h3`,{label:t?.textGroup?.h3?.label??`Heading 3`,icon:t?.textGroup?.h3?.icon??o1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:3}})}}),t?.textGroup?.h4!==null&&e.addItem(`h4`,{label:t?.textGroup?.h4?.label??`Heading 4`,icon:t?.textGroup?.h4?.icon??s1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:4}})}}),t?.textGroup?.h5!==null&&e.addItem(`h5`,{label:t?.textGroup?.h5?.label??`Heading 5`,icon:t?.textGroup?.h5?.icon??c1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:5}})}}),t?.textGroup?.h6!==null&&e.addItem(`h6`,{label:t?.textGroup?.h6?.label??`Heading 6`,icon:t?.textGroup?.h6?.icon??l1,onRun:e=>{let t=e.get(A),n=Nj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n,attrs:{level:6}})}}),t?.textGroup?.quote!==null&&e.addItem(`quote`,{label:t?.textGroup?.quote?.label??`Quote`,icon:t?.textGroup?.quote?.icon??_1,onRun:e=>{let t=e.get(A),n=zj.type(e);t.call(MM.key),t.call(PM.key,{nodeType:n})}}),t?.textGroup?.divider!==null&&e.addItem(`divider`,{label:t?.textGroup?.divider?.label??`Divider`,icon:t?.textGroup?.divider?.icon??$$,onRun:e=>{let t=e.get(A),n=rM.type(e);t.call(MM.key),t.call(FM.key,{nodeType:n})}})}if(t?.listGroup!==null){let e=c.addGroup(`list`,t?.listGroup?.label??`List`);t?.listGroup?.bulletList!==null&&e.addItem(`bullet-list`,{label:t?.listGroup?.bulletList?.label??`Bullet List`,icon:t?.listGroup?.bulletList?.icon??V$,onRun:e=>{let t=e.get(A),n=sM.type(e);t.call(MM.key),t.call(PM.key,{nodeType:n})}}),t?.listGroup?.orderedList!==null&&e.addItem(`ordered-list`,{label:t?.listGroup?.orderedList?.label??`Ordered List`,icon:t?.listGroup?.orderedList?.icon??h1,onRun:e=>{let t=e.get(A),n=fM.type(e);t.call(MM.key),t.call(PM.key,{nodeType:n})}}),t?.listGroup?.taskList!==null&&e.addItem(`task-list`,{label:t?.listGroup?.taskList?.label??`Task List`,icon:t?.listGroup?.taskList?.icon??D1,onRun:e=>{let t=e.get(A),n=_M.type(e);t.call(MM.key),t.call(PM.key,{nodeType:n,attrs:{checked:!1}})}})}if(t?.advancedGroup!==null){let e=c.addGroup(`advanced`,t?.advancedGroup?.label??`Advanced`);t?.advancedGroup?.image!==null&&o&&e.addItem(`image`,{label:t?.advancedGroup?.image?.label??`Image`,icon:t?.advancedGroup?.image?.icon??u1,onRun:e=>{let t=e.get(A),n=CN.type(e);t.call(MM.key),t.call(FM.key,{nodeType:n})}}),t?.advancedGroup?.codeBlock!==null&&e.addItem(`code`,{label:t?.advancedGroup?.codeBlock?.label??`Code`,icon:t?.advancedGroup?.codeBlock?.icon??Y$,onRun:e=>{let t=e.get(A),n=Wj.type(e);t.call(MM.key),t.call(NM.key,{nodeType:n})}}),t?.advancedGroup?.table!==null&&s&&e.addItem(`table`,{label:t?.advancedGroup?.table?.label??`Table`,icon:t?.advancedGroup?.table?.icon??T1,onRun:e=>{let t=e.get(A),n=e.get(m_);t.call(MM.key);let{from:r}=n.state.selection;t.call(FM.key,{nodeType:uL(e,3,3)}),t.call(IM.key,{pos:r})}}),t?.advancedGroup?.math!==null&&a&&e.addItem(`math`,{label:t?.advancedGroup?.math?.label??`Math`,icon:t?.advancedGroup?.math?.icon??k1,onRun:e=>{let t=e.get(A),n=Wj.type(e);t.call(MM.key),t.call(FM.key,{nodeType:n,attrs:{language:`LaTeX`}})}})}(r=t?.buildMenu)==null||r.call(t,c);let l=c.build();e&&(l=l.map(t=>{let n=t.items.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));return{...t,items:n}}).filter(e=>e.items.length>0));let u=l.flatMap(e=>e.items);return u.forEach((e,t)=>{Object.assign(e,{index:t})}),l.reduce((e,t)=>{let n=e+t.items.length;return Object.assign(t,{range:[e,n]}),n},0),{groups:l,size:u.length}}var U2=SE({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:i}){let a=N(),o=Pk(()=>H2(n.value,i,e)),s=N(0),c=N({x:-999,y:-999}),l=e=>{let{x:t,y:n}=e;c.value={x:t,y:n}};mE([o,t],()=>{let{size:e}=o.value;e===0&&t.value?r():s.value>=e&&(s.value=0)});let u=(e,t)=>{let n=s.value,r=typeof e==`function`?e(n):e;t?.(r),s.value=r},d=e=>{let t=a.value?.querySelector(`[data-index="${e}"]`),n=a.value?.querySelector(`.menu-groups`);!t||!n||(n.scrollTop=t.offsetTop-n.offsetTop)},f=t=>{let n=o.value.groups.flatMap(e=>e.items).at(t);n?.onRun&&e&&n.onRun(e),r()},p=e=>{let{size:t,groups:n}=o.value;if(e.key===`Escape`){e.preventDefault(),r?.();return}if(e.key===`ArrowDown`)return e.preventDefault(),u(e=>e<t-1?e+1:e,d);if(e.key===`ArrowUp`)return e.preventDefault(),u(e=>e<=0?e:e-1,d);if(e.key===`ArrowLeft`)return e.preventDefault(),u(e=>{let t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;let r=n[n.indexOf(t)-1];return r?r.range[1]-1:e},d);if(e.key===`ArrowRight`)return e.preventDefault(),u(e=>{let t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;let r=n[n.indexOf(t)+1];return r?r.range[0]:e},d);e.key===`Enter`&&(e.preventDefault(),f(s.value))},m=e=>t=>{let n=c.value;if(!n)return;let{x:r,y:i}=t;r===n.x&&i===n.y||u(e)};return pE(()=>{t.value?window.addEventListener(`keydown`,p,{capture:!0}):window.removeEventListener(`keydown`,p,{capture:!0})}),HE(()=>{window.removeEventListener(`keydown`,p,{capture:!0})}),()=>F(`div`,{ref:a,onPointerdown:e=>e.preventDefault()},F(`nav`,{class:`tab-group`},F(`ul`,null,o.value.groups.map(e=>F(`li`,{key:e.key,onPointerdown:()=>u(e.range[0],d),class:s.value>=e.range[0]&&s.value<e.range[1]?`selected`:``},e.label)))),F(`div`,{class:`menu-groups`,onPointermove:l},o.value.groups.map(e=>F(`div`,{key:e.key,class:`menu-group`},F(`h6`,null,e.label),F(`ul`,null,e.items.map(e=>F(`li`,{key:e.key,"data-index":e.index,class:s.value===e.index?`hover`:``,onPointerenter:m(e.index),onPointerdown:()=>{var t;(t=a.value?.querySelector(`[data-index="${e.index}"]`))==null||t.classList.add(`active`)},onPointerup:()=>{var t;(t=a.value?.querySelector(`[data-index="${e.index}"]`))==null||t.classList.remove(`active`),f(e.index)}},F(NA,{icon:e.icon}),F(`span`,null,e.label))))))))}}),W2=e=>{throw TypeError(e)},G2=(e,t,n)=>t.has(e)||W2(`Cannot `+n),K2=(e,t,n)=>(G2(e,t,`read from private field`),n?n.call(e):t.get(e)),q2=(e,t,n)=>t.has(e)?W2(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),J2=(e,t,n,r)=>(G2(e,t,`write to private field`),t.set(e,n),n),Y2,X2,Z2,Q2,$2,e4=tN(`CREPE_MENU`),t4=Fv({show:()=>{},hide:()=>{}},`menuAPICtx`);function n4(e,t){e.set(e4.key,{view:n=>new r4(e,n,t)})}var r4=class{constructor(e,t,n){q2(this,Y2),q2(this,X2),q2(this,Z2),q2(this,Q2),q2(this,$2,null),this.update=e=>{K2(this,Q2).update(e)},this.show=e=>{J2(this,$2,e),K2(this,Z2).value=``,K2(this,Q2).show()},this.hide=()=>{J2(this,$2,null),K2(this,Q2).hide()},this.destroy=()=>{K2(this,Q2).destroy(),K2(this,X2).unmount(),K2(this,Y2).remove()};let r=document.createElement(`div`);r.classList.add(`milkdown-slash-menu`);let i=N(!1),a=N(``);J2(this,Z2,a);let o=this.hide,s=DA(U2,{ctx:e,config:n,show:i,filter:a,hide:o});J2(this,X2,s),s.mount(r),J2(this,Y2,r);let c=this;J2(this,Q2,new nN({content:K2(this,Y2),debounce:20,shouldShow(e){if(M2(e.state.selection)||N2(e.state.selection))return!1;let t=this.getContent(e,e=>[`paragraph`,`heading`].includes(e.type.name));if(t==null||!i4(e.state.selection))return!1;let n=K2(c,$2);if(a.value=t.startsWith(`/`)?t.slice(1):t,typeof n==`number`){let t=e.state.doc.nodeSize-2,r=Math.min(n,t);return e.state.doc.resolve(r).node()===e.state.doc.resolve(e.state.selection.from).node()?!0:(J2(c,$2,null),!1)}return!!t.startsWith(`/`)},offset:10})),K2(this,Q2).onShow=()=>{i.value=!0},K2(this,Q2).onHide=()=>{i.value=!1},this.update(t),e.set(t4.key,{show:e=>this.show(e),hide:()=>this.hide()})}};Y2=new WeakMap,X2=new WeakMap,Z2=new WeakMap,Q2=new WeakMap,$2=new WeakMap;function i4(e){if(!(e instanceof O))return!1;let{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}var a4=SE({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){let t=N();return()=>F(NO,null,F(`div`,{ref:t,class:`operation-item`,onPointerdown:e=>{var n;e.preventDefault(),e.stopPropagation(),(n=t.value)==null||n.classList.add(`active`)},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.value)==null||r.classList.remove(`active`),e.onAdd()}},F(NA,{icon:e.addIcon})),F(`div`,{class:`operation-item`},F(NA,{icon:e.handleIcon})))}}),o4=e=>{throw TypeError(e)},s4=(e,t,n)=>t.has(e)||o4(`Cannot `+n),c4=(e,t,n)=>(s4(e,t,`read from private field`),n?n.call(e):t.get(e)),l4=(e,t,n)=>t.has(e)?o4(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),u4=(e,t,n,r)=>(s4(e,t,`write to private field`),t.set(e,n),n),d4,f4,p4,m4,h4=class{constructor(e,t){l4(this,d4),l4(this,f4),l4(this,p4),l4(this,m4),this.update=()=>{c4(this,f4).update()},this.destroy=()=>{c4(this,f4).destroy(),c4(this,d4).remove(),c4(this,p4).unmount()},this.onAdd=()=>{let e=c4(this,m4),t=e.get(m_);t.hasFocus()||t.focus();let{state:n,dispatch:r}=t,i=c4(this,f4).active;if(!i)return;let a=i.$pos.pos+i.node.nodeSize,o=n.tr.insert(a,Tj.type(e).create());o=o.setSelection(O.near(o.doc.resolve(a))),r(o.scrollIntoView()),c4(this,f4).hide(),e.get(t4.key).show(o.selection.from)},u4(this,m4,e);let n=document.createElement(`div`);n.classList.add(`milkdown-block-handle`);let r=DA(a4,{onAdd:this.onAdd,addIcon:t?.handleAddIcon??g1,handleIcon:t?.handleDragIcon??m1});r.mount(n),u4(this,p4,r),u4(this,d4,n);let i=t?.blockHandle??{};u4(this,f4,new WA({ctx:e,content:n,getOffset:()=>16,getPlacement:({active:e,blockDom:t})=>{if(e.node.type.name===`heading`)return`left`;let n=0;e.node.descendants(e=>{n+=e.childCount});let r=e.el,i=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o=window.getComputedStyle(r),s=Number.parseInt(o.paddingTop,10)||0,c=Number.parseInt(o.paddingBottom,10)||0,l=i.height-s-c,u=a.height;return n>2||u<l?`left-start`:`left`},...i})),this.update()}};d4=new WeakMap,f4=new WeakMap,p4=new WeakMap,m4=new WeakMap;function g4(e,t){e.set(FA.key,{filterNodes:e=>!Sf(e=>[`table`,`blockquote`,`math_inline`].includes(e.type.name))(e)}),e.set(GA.key,{view:()=>new h4(e,t)})}var _4=(e,t)=>{e.config(I1(N$.BlockEdit)).config(e=>g4(e,t)).config(e=>n4(e,t)).use(t4).use(GA).use(e4)},v4=(e,t={})=>{e.config(I1(N$.CodeMirror)).config(e=>{let{languages:n=[],theme:r}=t,i=[De.of(CB.concat(wB)),cU];r&&i.push(r),t.extensions&&i.push(...t.extensions),e.update(nV.key,e=>({extensions:i,languages:n,expandIcon:t.expandIcon||G$,searchIcon:t.searchIcon||b1,clearSearchIcon:t.clearSearchIcon||J$,searchPlaceholder:t.searchPlaceholder||`Search language`,copyText:t.copyText||`Copy`,copyIcon:t.copyIcon||Q$,onCopy:t.onCopy||(()=>{}),noResultText:t.noResultText||`No result`,renderLanguage:t.renderLanguage||e.renderLanguage,renderPreview:t.renderPreview||e.renderPreview,previewToggleButton:e=>[t.previewToggleIcon?.call(t,e)||(e?t1:A1),t.previewToggleText?.call(t,e)||(e?`Edit`:`Hide`)].map(e=>e.trim()).join(` `),previewLabel:t.previewLabel||e.previewLabel,previewLoading:t.previewLoading||e.previewLoading,previewOnlyByDefault:t.previewOnlyByDefault??e.previewOnlyByDefault}))}).use(SV)},y4=(e,t)=>{if(e.config(I1(N$.Cursor)).config(e=>{e.update(NU.key,()=>({class:`crepe-drop-cursor`,width:t?.width??4,color:t?.color??!1}))}).use(zU),t?.virtual===!1)return;let n=BU();e.use(Mv(()=>n))},b4=(e,t)=>{e.config(I1(N$.ImageBlock)).config(e=>{e.update(tW.key,e=>({uploadButton:t?.inlineUploadButton??`Upload`,imageIcon:t?.inlineImageIcon??u1,confirmButton:t?.inlineConfirmButton??Z$,uploadPlaceholderText:t?.inlineUploadPlaceholderText??`or paste link`,onUpload:t?.inlineOnUpload??t?.onUpload??e.onUpload,proxyDomURL:t?.proxyDomURL})),e.update(pN.key,e=>({uploadButton:t?.blockUploadButton??`Upload file`,imageIcon:t?.blockImageIcon??u1,captionIcon:t?.blockCaptionIcon??H$,confirmButton:t?.blockConfirmButton??`Confirm`,captionPlaceholderText:t?.blockCaptionPlaceholderText??`Write Image Caption`,uploadPlaceholderText:t?.blockUploadPlaceholderText??`or paste link`,onUpload:t?.blockOnUpload??t?.onUpload??e.onUpload,proxyDomURL:t?.proxyDomURL,onImageLoadError:t?.onImageLoadError??e.onImageLoadError,maxWidth:t?.maxWidth,maxHeight:t?.maxHeight}))}).use(IN).use(sW)},x4=Wj.extendSchema(e=>t=>{let n=e(t);return{...n,toMarkdown:{match:n.toMarkdown.match,runner:(e,t)=>{if((t.attrs.language??``).toLowerCase()===`latex`)e.addNode(`math`,void 0,t.content.firstChild?.text||``);else return n.toMarkdown.runner(e,t)}}}}),S4=`math_inline`,C4=`ToggleLatex`,w4=Iv(S4,()=>({group:`inline`,inline:!0,draggable:!0,atom:!0,attrs:{value:{default:``}},parseDOM:[{tag:`span[data-type="${S4}"]`,getAttrs:e=>({value:e.dataset.value??``})}],toDOM:e=>{let t=e.attrs.value,n=document.createElement(`span`);return n.dataset.type=S4,n.dataset.value=t,fX.render(t,n,{throwOnError:!1}),n},parseMarkdown:{match:e=>e.type===`inlineMath`,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===S4,runner:(e,t)=>{e.addNode(`inlineMath`,void 0,t.attrs.value)}}})),T4=j(`ToggleLatex`,e=>()=>(t,n)=>{let{hasNode:r,pos:i,target:a}=Of(t,w4.type(e)),{selection:o,doc:s,tr:c}=t;if(!r){let t=s.textBetween(o.from,o.to),r=c.replaceSelectionWith(w4.type(e).create({value:t}));return n&&n(r.setSelection(k.create(r.doc,o.from))),!0}let{from:l,to:u}=o;if(!a||i<0)return!1;let d=c.delete(i,i+1),f=a.attrs.value;return d=d.insertText(f,i),n&&n(d.setSelection(O.create(d.doc,l,u+f.length-1))),!0}),E4=iS(`INLINE_LATEX`),D4=SE({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(e){let t=t=>{if(!(!t||!(t instanceof HTMLElement))){for(;t.firstChild;)t.removeChild(t.firstChild);e.innerView.value&&t.appendChild(e.innerView.value.dom)}},n=t=>{t.preventDefault(),e.updateValue.value()};return()=>F(`div`,{class:`container`},e.innerView&&F(`div`,{ref:t}),F(`button`,{type:`button`,onPointerdown:n},F(NA,{icon:e.config.inlineEditConfirm})))}}),O4=e=>{throw TypeError(e)},k4=(e,t,n)=>t.has(e)||O4(`Cannot `+n),A4=(e,t,n)=>(k4(e,t,`read from private field`),n?n.call(e):t.get(e)),j4=(e,t,n)=>t.has(e)?O4(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),M4=(e,t,n,r)=>(k4(e,t,`write to private field`),t.set(e,n),n),N4,P4,F4,I4,L4,R4,z4,B4,V4=class{constructor(e,t,n){this.ctx=e,j4(this,N4),j4(this,P4),j4(this,F4),j4(this,I4,Lw(null)),j4(this,L4,Lw(()=>{})),j4(this,R4),j4(this,z4,()=>{A4(this,I4).value&&(A4(this,I4).value.destroy(),A4(this,I4).value=null)}),j4(this,B4,e=>{let t=(()=>{if(!e.editable)return!1;let{selection:t,schema:n}=e.state;if(t.empty||!(t instanceof k))return!1;let r=t.node;if(r.type.name!==S4)return!1;let i=t.from,a=n.nodes.paragraph.create(null,n.text(r.attrs.value)),o=new i_(A4(this,F4),{state:Uu.create({doc:a,schema:new Vc({nodes:{doc:{content:`block+`},paragraph:{content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM(){return[`p`,0]}},text:{group:`inline`}}}),plugins:[Pf({"Mod-z":qB,"Mod-Z":JB,"Mod-y":JB,Enter:()=>(A4(this,L4).value(),!0)})]})});return A4(this,I4).value=o,A4(this,L4).value=()=>{let{tr:t}=e.state;t.setNodeAttribute(i,`value`,o.state.doc.textContent),e.dispatch(t),requestAnimationFrame(()=>{e.focus()})},!0})();return t||A4(this,z4).call(this),t}),this.update=(e,t)=>{A4(this,P4).update(e,t)},this.destroy=()=>{A4(this,R4).unmount(),A4(this,P4).destroy(),A4(this,N4).remove()};let r=document.createElement(`div`);r.className=`milkdown-latex-inline-edit`,M4(this,N4,r),M4(this,R4,DA(D4,{config:n,innerView:A4(this,I4),updateValue:A4(this,L4)})),A4(this,R4).mount(r),M4(this,P4,new rS({debounce:0,content:A4(this,N4),shouldShow:A4(this,B4),offset:10,floatingUIOptions:{placement:`bottom`}})),A4(this,P4).update(t),M4(this,F4,document.createElement(`div`))}};N4=new WeakMap,P4=new WeakMap,F4=new WeakMap,I4=new WeakMap,L4=new WeakMap,R4=new WeakMap,z4=new WeakMap,B4=new WeakMap;var H4=Ov(e=>sf(/(?:\$)([^$]+)(?:\$)$/,w4.type(e),{getAttr:e=>({value:e[1]??``})})),U4=Ov(e=>Fd(/^\$\$[\s\n]$/,Wj.type(e),()=>({language:`LaTeX`}))),W4=Vv(`remarkMath`,()=>wX);function G4(e){return yt(e,`math`,(e,t,n)=>{let{value:r}=e,i={type:`code`,lang:`LaTeX`,value:r};n.children.splice(t,1,i)})}var K4=Vv(`remarkMathBlock`,()=>()=>G4),q4=(e,t)=>{e.config(I1(N$.Latex)).config(e=>{if(!F1(e).get().includes(N$.CodeMirror))throw Error(`You need to enable CodeMirror to use LaTeX feature`);e.update(nV.key,e=>({...e,renderPreview:(n,r,i)=>{if(n.toLowerCase()===`latex`&&r.length>0)return J4(r,t?.katexOptions);let a=e.renderPreview;return a(n,r,i)}})),e.set(E4.key,{view:n=>new V4(e,n,{inlineEditConfirm:t?.inlineEditConfirm??Z$,...t})})}).use(W4).use(K4).use(w4).use(E4).use(H4).use(U4).use(x4).use(T4)};function J4(e,t){return fX.renderToString(e,{...t,throwOnError:!1,displayMode:!0})}var Y4=(e,t)=>{e.config(I1(N$.LinkTooltip)).config(eQ).config(e=>{e.update(BX.key,e=>({...e,linkIcon:t?.linkIcon??Q$,editButton:t?.editButton??t1,removeButton:t?.removeButton??v1,confirmButton:t?.confirmButton??Z$,inputPlaceholder:t?.inputPlaceholder??`Paste link...`,onCopyLink:t?.onCopyLink??(()=>{})}))}).use(tQ)};function X4(e,t){e.set(lQ.key,{renderLabel:({label:e,listType:n,checked:r})=>r==null?n===`bullet`?t?.bulletIcon??B$:e:r?t?.checkBoxCheckedIcon??U$:t?.checkBoxUncheckedIcon??W$})}var Z4=(e,t)=>{e.config(I1(N$.ListItem)).config(e=>X4(e,t)).use(pQ)};function Q4(e){return e.childCount<=1&&!e.firstChild?.content.size}function $4(e,t){let{selection:n}=e;if(!n.empty)return null;let r=n.$anchor,i=r.parent;if(i.content.size>0||Sf(e=>e.type.name===`table`)(r))return null;let a=r.before();return xg.node(a,a+i.nodeSize,{class:`crepe-placeholder`,"data-placeholder":t})}var e3=Fv({text:`Please enter...`,mode:`block`},`placeholderConfigCtx`),t3=Mv(e=>new Gu({key:new Ju(`CREPE_PLACEHOLDER`),props:{decorations:t=>{if(P1(e).readonly)return null;let n=e.get(e3.key);if(n.mode===`doc`&&!Q4(t.doc)||M2(t.selection)||N2(t.selection))return null;let r=$4(t,n.text??`Please enter...`);return r?wg.create(t.doc,[r]):null}}})),n3=(e,t)=>{e.config(I1(N$.Placeholder)).config(e=>{t&&e.update(e3.key,e=>({...e,...t}))}).use(t3).use(e3)},r3=(e,t)=>{e.config(I1(N$.Table)).config(e=>{e.update(EQ.key,e=>({...e,renderButton:e=>{switch(e){case`add_row`:return t?.addRowIcon??g1;case`add_col`:return t?.addColIcon??g1;case`delete_row`:return t?.deleteRowIcon??v1;case`delete_col`:return t?.deleteColIcon??v1;case`align_col_left`:return t?.alignLeftIcon??L$;case`align_col_center`:return t?.alignCenterIcon??I$;case`align_col_right`:return t?.alignRightIcon??R$;case`col_drag_handle`:return t?.colDragHandleIcon??e1;case`row_drag_handle`:return t?.rowDragHandleIcon??e1}}}))}).use(o$)};function i3(e,t){var n;let r=new V2;r.addGroup(`formatting`,`Formatting`).addItem(`bold`,{icon:e?.boldIcon??z$,active:e=>e.get(A).call(AM.key,cj.type(e)),onRun:e=>{e.get(A).call(lj.key)}}).addItem(`italic`,{icon:e?.italicIcon??d1,active:e=>e.get(A).call(AM.key,nj.type(e)),onRun:e=>{e.get(A).call(rj.key)}}).addItem(`strikethrough`,{icon:e?.strikethroughIcon??w1,active:e=>e.get(A).call(AM.key,eL.type(e)),onRun:e=>{e.get(A).call(tL.key)}});let i=r.addGroup(`function`,`Function`);i.addItem(`code`,{icon:e?.codeIcon??Y$,active:e=>e.get(A).call(AM.key,pj.type(e)),onRun:e=>{e.get(A).call(mj.key)}});let a=t&&F1(t).get();if(a?.includes(N$.Latex)&&i.addItem(`latex`,{icon:e?.latexIcon??k1,active:e=>{let t=e.get(A),n=e.get(j_).nodes[S4];return t.call(jM.key,n)},onRun:e=>{e.get(A).call(C4)}}),i.addItem(`link`,{icon:e?.linkIcon??f1,active:e=>e.get(A).call(AM.key,vj.type(e)),onRun:e=>{e.get(A).call(VX.key)}}),t&&a?.includes(N$.AI)){let n=t.get(R1.key);n.provider&&i.addItem(`ai`,{icon:e?.aiIcon??n.aiIcon??F$,active:()=>!1,onRun:e=>{let t=e.get($0.key),{from:n,to:r}=e.get(m_).state.selection;t.show(n,r)}})}return(n=e?.buildToolbar)==null||n.call(e,r),r.build()}var a3=SE({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){let{ctx:t,config:n}=e,i=e=>n=>{n.preventDefault(),t&&e?.(t)};function a(n){return e.selection.value,t.get(__).status===wv.Created?n(t):!1}let o=Pk(()=>i3(n,t));return()=>F(NO,null,o.value.map(e=>e.items.map(e=>F(`button`,{type:`button`,class:r(`toolbar-item`,t&&a(e.active)&&`active`),onPointerdown:i(e.onRun)},F(NA,{icon:e.icon})))).reduce((e,t,n)=>(n===0?e.push(...t):e.push(F(`div`,{class:`divider`}),...t),e),[]))}}),o3=e=>{throw TypeError(e)},s3=(e,t,n)=>t.has(e)||o3(`Cannot `+n),c3=(e,t,n)=>(s3(e,t,`read from private field`),n?n.call(e):t.get(e)),l3=(e,t,n)=>t.has(e)?o3(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),u3=(e,t,n,r)=>(s3(e,t,`write to private field`),t.set(e,n),n),d3,f3,p3,m3,h3,g3=iS(`CREPE_TOOLBAR`),_3=class{constructor(e,t,n){l3(this,d3),l3(this,f3),l3(this,p3),l3(this,m3),l3(this,h3,N(!1)),this.update=(e,t)=>{c3(this,d3).update(e,t),c3(this,m3).value=e.state.selection},this.destroy=()=>{c3(this,d3).destroy(),c3(this,p3).unmount(),c3(this,f3).remove()},this.hide=()=>{c3(this,d3).hide()};let r=document.createElement(`div`);r.className=`milkdown-toolbar`,u3(this,m3,Lw(t.state.selection));let i=DA(a3,{ctx:e,hide:this.hide,config:n,selection:c3(this,m3),show:c3(this,h3)});i.mount(r),u3(this,f3,r),u3(this,p3,i),u3(this,d3,new rS({content:c3(this,f3),debounce:20,offset:10,shouldShow(e){let{doc:t,selection:n}=e.state,{empty:i,from:a,to:o}=n,s=!t.textBetween(a,o).length&&n instanceof O,c=!(n instanceof O),l=e.dom.getRootNode().activeElement,u=r.contains(l),d=!e.hasFocus()&&!u,f=!e.editable;return!(d||c||i||s||f)}})),c3(this,d3).onShow=()=>{c3(this,h3).value=!0},c3(this,d3).onHide=()=>{c3(this,h3).value=!1},this.update(t)}};d3=new WeakMap,f3=new WeakMap,p3=new WeakMap,m3=new WeakMap,h3=new WeakMap;var v3=(e,t)=>{e.config(I1(N$.Toolbar)).config(e=>{e.set(g3.key,{view:n=>new _3(e,n,t)})}).use(g3)},y3=[{label:`Paragraph`,level:null},{label:`Heading 1`,level:1},{label:`Heading 2`,level:2},{label:`Heading 3`,level:3},{label:`Heading 4`,level:4},{label:`Heading 5`,level:5},{label:`Heading 6`,level:6}];function b3(e,t){let n=t??y3,{$from:r}=e.get(m_).state.selection,i=r.parent,a=n.find(e=>e.level===null)??n[0];if(i.type===Nj.type(e)){let e=i.attrs.level;return n.find(t=>t.level===e)??a}return a}function x3(e,t){let n=e.get(A);if(t==null){let t=Tj.type(e);n.call(NM.key,{nodeType:t})}else{let r=Nj.type(e);n.call(NM.key,{nodeType:r,attrs:{level:t}})}}function S3(e,t){if(e.get(A).call(AM.key,t))return!0;let{state:n}=e.get(m_);if(n.storedMarks)return n.storedMarks.some(e=>e.type===t);if(n.selection instanceof O){let{$cursor:e}=n.selection;if(e)return e.marks().some(e=>e.type===t)}return!1}function C3(e,t){let n=e??y3;return{icon:``,active:()=>!1,selector:{chevronIcon:t??G$,activeLabel:e=>b3(e,n).label,options:n.map(e=>({label:e.label,onSelect:t=>x3(t,e.level)}))}}}function w3(e,t){var n;let r=t&&F1(t).get(),i=r?.includes(N$.Latex),a=r?.includes(N$.ImageBlock),o=r?.includes(N$.Table),s=new V2;s.addGroup(`heading`,`Heading`).addItem(`heading-selector`,{...C3(e?.headingOptions,e?.chevronDownIcon)}),s.addGroup(`formatting`,`Formatting`).addItem(`bold`,{icon:e?.boldIcon??z$,active:e=>S3(e,cj.type(e)),onRun:e=>{e.get(A).call(lj.key)}}).addItem(`italic`,{icon:e?.italicIcon??d1,active:e=>S3(e,nj.type(e)),onRun:e=>{e.get(A).call(rj.key)}}).addItem(`strikethrough`,{icon:e?.strikethroughIcon??w1,active:e=>S3(e,eL.type(e)),onRun:e=>{e.get(A).call(tL.key)}}).addItem(`code`,{icon:e?.codeIcon??Y$,active:e=>S3(e,pj.type(e)),onRun:e=>{let t=e.get(m_),{state:n}=t;if(n.selection.empty){let r=pj.type(e);S3(e,r)?t.dispatch(n.tr.removeStoredMark(r)):t.dispatch(n.tr.addStoredMark(r.create()))}else e.get(A).call(mj.key)}}),s.addGroup(`list`,`List`).addItem(`bullet-list`,{icon:e?.bulletListIcon??V$,active:()=>!1,onRun:e=>{let t=e.get(A),n=sM.type(e);t.call(PM.key,{nodeType:n})}}).addItem(`ordered-list`,{icon:e?.orderedListIcon??h1,active:()=>!1,onRun:e=>{let t=e.get(A),n=fM.type(e);t.call(PM.key,{nodeType:n})}}).addItem(`task-list`,{icon:e?.taskListIcon??D1,active:()=>!1,onRun:e=>{let t=e.get(A),n=_M.type(e);t.call(PM.key,{nodeType:n,attrs:{checked:!1}})}});let c=s.addGroup(`insert`,`Insert`);c.addItem(`link`,{icon:e?.linkIcon??f1,active:e=>S3(e,vj.type(e)),onRun:e=>{let t=e.get(m_),{state:n}=t,r=vj.type(e);if(n.selection.empty&&S3(e,r)){t.dispatch(n.tr.removeStoredMark(r));return}e.get(A).call(VX.key)}}),a&&c.addItem(`image`,{icon:e?.imageIcon??u1,active:()=>!1,onRun:e=>{let t=e.get(A),n=CN.type(e);t.call(FM.key,{nodeType:n})}}),o&&c.addItem(`table`,{icon:e?.tableIcon??T1,active:()=>!1,onRun:e=>{let t=e.get(A),{from:n}=e.get(m_).state.selection;t.call(FM.key,{nodeType:uL(e,3,3)}),t.call(IM.key,{pos:n})}});let l=s.addGroup(`block`,`Block`);return l.addItem(`code-block`,{icon:e?.codeBlockIcon??X$,active:()=>!1,onRun:e=>{let t=e.get(A),n=Wj.type(e);t.call(NM.key,{nodeType:n})}}),i&&l.addItem(`math`,{icon:e?.mathIcon??k1,active:()=>!1,onRun:e=>{let t=e.get(A),n=Wj.type(e);t.call(FM.key,{nodeType:n,attrs:{language:`LaTeX`}})}}),s.addGroup(`more`,`More`).addItem(`quote`,{icon:e?.quoteIcon??_1,active:()=>!1,onRun:e=>{let t=e.get(A),n=zj.type(e);t.call(PM.key,{nodeType:n})}}).addItem(`hr`,{icon:e?.hrIcon??$$,active:()=>!1,onRun:e=>{let t=e.get(A),n=rM.type(e);t.call(FM.key,{nodeType:n})}}),(n=e?.buildTopBar)==null||n.call(e,s),s.build()}var T3=SE({props:{ctx:{type:Object,required:!0},version:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){let{ctx:t,config:n}=e,i=N(null),a=e=>n=>{n.preventDefault(),t&&e(t)};function o(){return t.get(__).status===wv.Created}function s(){e.version.value}function c(e){return s(),o()?e(t):!1}function l(e){return s(),o()?e.activeLabel(t):e.options[0]?.label??``}function u(e,t){t.preventDefault(),t.stopPropagation(),i.value=i.value===e?null:e}let d=e=>{e.target.closest(`.top-bar-heading-selector`)||(i.value=null)};RE(()=>{window.addEventListener(`pointerdown`,d)}),HE(()=>{window.removeEventListener(`pointerdown`,d)});let f=Pk(()=>w3(n,t));function p(e,n){let a=i.value===e,o=l(n);return F(`div`,{key:e,class:`top-bar-heading-selector`},F(`button`,{type:`button`,class:`top-bar-heading-button`,onPointerdown:t=>u(e,t)},F(`span`,{class:`top-bar-heading-label`},o),n.chevronIcon&&F(`span`,{class:`top-bar-chevron`},F(NA,{icon:n.chevronIcon}))),a&&F(`div`,{class:`top-bar-heading-dropdown`},n.options.map((n,a)=>F(`button`,{key:`${e}-${a}`,type:`button`,class:r(`top-bar-heading-option`,o===n.label&&`active`),onPointerdown:e=>{e.preventDefault(),e.stopPropagation(),i.value=null,n.onSelect(t)}},n.label))))}function m(e){return F(`button`,{key:e.key,type:`button`,class:r(`top-bar-item`,c(e.active)&&`active`),onPointerdown:a(e.onRun)},F(NA,{icon:e.icon}))}return()=>{let e=o()?t.get(m_):null;return e&&!e.editable?null:F(`div`,{class:`top-bar-inner`},f.value.map(e=>e.items.map(e=>e.selector?p(e.key,e.selector):e.onRun?m(e):null)).reduce((e,t,n)=>{if(n===0)e.push(...t);else{let r=f.value[n]?.key??n;e.push(F(`div`,{key:`divider-${r}`,class:`top-bar-divider`}),...t)}return e},[]))}}}),E3=e=>{throw TypeError(e)},D3=(e,t,n)=>t.has(e)||E3(`Cannot `+n),O3=(e,t,n)=>(D3(e,t,`read from private field`),n?n.call(e):t.get(e)),k3=(e,t,n)=>t.has(e)?E3(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),A3=(e,t,n,r)=>(D3(e,t,`write to private field`),t.set(e,n),n),j3,M3,N3,P3=new Ju(`CREPE_TOP_BAR`),F3=class{constructor(e,t,n){k3(this,j3),k3(this,M3),k3(this,N3),this.update=(e,t)=>{O3(this,j3).style.display=e.editable?``:`none`,O3(this,N3).value++},this.destroy=()=>{O3(this,M3).unmount(),O3(this,j3).remove()},A3(this,N3,N(0));let r=document.createElement(`div`);r.className=`milkdown-top-bar`;let i=DA(T3,{ctx:e,config:n,version:O3(this,N3)});i.mount(r),A3(this,j3,r),A3(this,M3,i);let a=t.dom.parentElement;a&&a.insertBefore(r,a.firstChild),this.update(t)}};j3=new WeakMap,M3=new WeakMap,N3=new WeakMap;var I3=Fv({view:()=>({update:()=>{},destroy:()=>{}})},`topBarConfig`),L3=Mv(e=>new Gu({key:P3,view:e.get(I3.key).view})),R3=(e,t)=>{e.config(I1(N$.TopBar)).config(e=>{e.set(I3.key,{view:n=>new F3(e,n,t)})}).use(I3).use(L3)};function z3(e,t,n){switch(e){case N$.CodeMirror:return v4(t,n);case N$.ListItem:return Z4(t,n);case N$.LinkTooltip:return Y4(t,n);case N$.ImageBlock:return b4(t,n);case N$.Cursor:return y4(t,n);case N$.BlockEdit:return _4(t,n);case N$.Placeholder:return n3(t,n);case N$.Toolbar:return v3(t,n);case N$.Table:return r3(t,n);case N$.Latex:return q4(t,n);case N$.TopBar:return R3(t,n);case N$.AI:return j2(t,n)}}var B3=e=>{throw TypeError(e)},V3=(e,t,n)=>t.has(e)||B3(`Cannot `+n),H3=(e,t,n)=>(V3(e,t,`read from private field`),n?n.call(e):t.get(e)),U3=(e,t,n)=>t.has(e)?B3(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),W3=(e,t,n,r)=>(V3(e,t,`write to private field`),t.set(e,n),n),G3,K3,q3,J3=class{constructor({root:e,defaultValue:t=``}={}){U3(this,G3),U3(this,K3),U3(this,q3,!0),this.addFeature=(e,t)=>(e(H3(this,G3),t),this),this.create=()=>H3(this,G3).create(),this.destroy=()=>H3(this,G3).destroy(),this.setReadonly=e=>(W3(this,q3,!e),H3(this,G3).action(t=>{H3(this,G3).status===wv.Created&&t.get(m_).setProps({editable:()=>!e})}),this),this.getMarkdown=()=>H3(this,G3).action(Hv()),this.on=e=>H3(this,G3).status===wv.Created?(H3(this,G3).action(t=>{e(t.get(C$))}),this):(H3(this,G3).config(t=>{e(t.get(C$))}),this),W3(this,K3,(typeof e==`string`?document.querySelector(e):e)??document.body),W3(this,G3,Tv.make().config(e=>{e.inject(N1,this),e.inject(M1,[])}).config(e=>{e.set(_v,H3(this,K3)),e.set(rv,t),e.set(gv,{editable:()=>H3(this,q3)}),e.update(y$.key,e=>({...e,size:4})),e.update(A$.key,e=>({...e,uploader:async(e,t,n)=>{let r=F1(n).get().includes(N$.ImageBlock),i=r?t.nodes[`image-block`]:t.nodes.image;if(!i)return[];let a=r?n.get(pN.key).onUpload:void 0,o=[];for(let t=0;t<e.length;t++){let n=e.item(t);n&&n.type.includes(`image`)&&o.push(n)}return await Promise.all(o.map(async e=>{let t=a?await a(e):URL.createObjectURL(e);return i.createAndFill({src:t})}))}}))}).use(eN).use(T$).use(_$).use(x$).use(O$).use(u$).use(M$).use($L))}get editor(){return H3(this,G3)}get readonly(){return!H3(this,q3)}};G3=new WeakMap,K3=new WeakMap,q3=new WeakMap;var Y3=class extends J3{constructor({features:e={},featureConfigs:t={},...n}={}){super(n);let r=aa(t,j1);Object.entries({...P$,...e}).filter(([,e])=>e).map(([e])=>e).forEach(e=>{let t=r[e];z3(e,this.editor,t)})}};Y3.Feature=N$;var X3=i(),Z3=`/home/grigorii/Projects/GitHub/grigorii-horos/coffer/packages/web/MarkdownEditor.tsx`;function Q3({value:e,onChange:t,placeholder:n,readonly:r}){let i=(0,ca.useRef)(null),a=(0,ca.useRef)(t);a.current=t;let o=(0,ca.useRef)(e),s=(0,ca.useRef)(n??``),c=(0,ca.useRef)(!!r);return(0,ca.useEffect)(()=>{let e=i.current;if(!e)return;let t=c.current,n=new Y3({root:e,defaultValue:o.current,features:{[Y3.Feature.ListItem]:!1,...t?{[Y3.Feature.Toolbar]:!1,[Y3.Feature.BlockEdit]:!1,[Y3.Feature.Placeholder]:!1,[Y3.Feature.Cursor]:!1}:{}},featureConfigs:{[Y3.Feature.Placeholder]:{text:s.current,mode:`block`}}});t||n.on(e=>{e.markdownUpdated((e,t)=>a.current?.(t))});let r=n.create();return t&&r.then(()=>n.setReadonly(!0)).catch(()=>{}),()=>{r.then(()=>n.destroy()).catch(()=>{})}},[]),(0,X3.jsxDEV)(`div`,{ref:i,className:`crepe-host`},void 0,!1,{fileName:Z3,lineNumber:73,columnNumber:10},this)}export{Q3 as default};