@shumai-one/shumai 0.4.2 → 0.4.3

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 (250) hide show
  1. package/bin/{chunk-adekdctx.css → chunk-0ccg9ddn.css} +1 -1
  2. package/bin/chunk-0e4wawpq.js +2 -0
  3. package/bin/chunk-185qefn1.js +2 -0
  4. package/bin/chunk-1kw2mbqb.js +1 -0
  5. package/bin/chunk-1wm6ptdx.js +1 -0
  6. package/bin/chunk-1yacmegc.js +2 -0
  7. package/bin/chunk-2291ehh5.js +3 -0
  8. package/bin/chunk-2520aq8j.js +2 -0
  9. package/bin/chunk-29zdp63z.js +3 -0
  10. package/bin/chunk-2yxj593j.js +2 -0
  11. package/bin/chunk-32pcmaqm.js +3 -0
  12. package/bin/chunk-3a13dcs1.js +1 -0
  13. package/bin/chunk-3cyrcgm5.js +13 -0
  14. package/bin/chunk-3swpwb9v.js +1 -0
  15. package/bin/chunk-3wmcx2bv.js +2 -0
  16. package/bin/chunk-4r81ghg8.js +2 -0
  17. package/bin/chunk-4v5n0ayb.js +2 -0
  18. package/bin/chunk-5a8nt4me.js +1 -0
  19. package/bin/chunk-66hsjnw6.js +2 -0
  20. package/bin/chunk-6bhn1p8v.js +211 -0
  21. package/bin/chunk-6gg1ymer.js +2 -0
  22. package/bin/chunk-70c3xrgd.js +2 -0
  23. package/bin/chunk-7esm0hqb.js +2 -0
  24. package/bin/chunk-7fst8kdw.js +12 -0
  25. package/bin/chunk-83e12sjg.js +3 -0
  26. package/bin/chunk-87zxtf66.js +3 -0
  27. package/bin/chunk-8fmy5jtp.js +2 -0
  28. package/bin/chunk-8zqgaxvv.js +1 -0
  29. package/bin/chunk-9t1ne8xr.js +2 -0
  30. package/bin/chunk-a32vreya.js +2 -0
  31. package/bin/chunk-a3dmtt2j.js +1 -0
  32. package/bin/chunk-abt0azmv.js +2 -0
  33. package/bin/chunk-ag6p3mbf.js +2 -0
  34. package/bin/chunk-aqbrzx9z.js +1 -0
  35. package/bin/chunk-av1a8fqp.js +3 -0
  36. package/bin/chunk-awfwk64v.js +2 -0
  37. package/bin/chunk-b235azv4.js +45 -0
  38. package/bin/chunk-b9yrw9et.js +10 -0
  39. package/bin/chunk-bay038pj.js +2 -0
  40. package/bin/chunk-c007p0t8.js +299 -0
  41. package/bin/chunk-cak32x57.js +2 -0
  42. package/bin/chunk-ce8m4zeg.js +3 -0
  43. package/bin/chunk-ck8azecb.js +12 -0
  44. package/bin/chunk-cnxwmycy.js +6 -0
  45. package/bin/chunk-cqb415s6.js +5 -0
  46. package/bin/chunk-e2mvmq2m.js +1 -0
  47. package/bin/chunk-e7mqtkzn.js +2 -0
  48. package/bin/chunk-e99dv20z.js +3 -0
  49. package/bin/chunk-ea79xnn3.js +2 -0
  50. package/bin/chunk-ehc9adfz.js +2 -0
  51. package/bin/chunk-ejbvfj4r.js +1 -0
  52. package/bin/chunk-ekfem7kf.js +1 -0
  53. package/bin/chunk-etwkk0xh.js +1 -0
  54. package/bin/chunk-evrdd32b.js +2 -0
  55. package/bin/chunk-f15qyp41.js +1 -0
  56. package/bin/chunk-f3ehv01n.js +54 -0
  57. package/bin/chunk-fm6p03ad.js +2 -0
  58. package/bin/chunk-fxswt9hc.js +3 -0
  59. package/bin/chunk-fyha3r13.js +2 -0
  60. package/bin/chunk-g0vs7k2x.js +1 -0
  61. package/bin/chunk-g84z2w7v.js +16 -0
  62. package/bin/chunk-gk3eqd50.js +2 -0
  63. package/bin/chunk-h3tbf521.js +2 -0
  64. package/bin/chunk-h837fyed.js +2 -0
  65. package/bin/chunk-hfh0c082.js +2 -0
  66. package/bin/chunk-j20e0qsw.js +7 -0
  67. package/bin/chunk-j8fxp8ej.js +2 -0
  68. package/bin/chunk-jje8nj8h.js +3 -0
  69. package/bin/chunk-jy006gcv.js +7 -0
  70. package/bin/chunk-k7hss0bd.js +4 -0
  71. package/bin/chunk-m7m9d4fb.js +2 -0
  72. package/bin/chunk-n1jwdb0a.js +1 -0
  73. package/bin/chunk-p5gf1zdm.js +4 -0
  74. package/bin/chunk-pb1zf0vb.js +2 -0
  75. package/bin/chunk-pfgxggaj.js +11 -0
  76. package/bin/chunk-q16490pv.js +2 -0
  77. package/bin/chunk-q2bvyv39.js +8 -0
  78. package/bin/chunk-qf24e71w.js +2 -0
  79. package/bin/chunk-qh81zhg1.js +1 -0
  80. package/bin/chunk-qwp3kwbz.js +2 -0
  81. package/bin/chunk-qwqvt9v6.js +2 -0
  82. package/bin/chunk-qydeqgyj.js +5 -0
  83. package/bin/chunk-r7dty1tg.js +2 -0
  84. package/bin/chunk-rbj4fad9.js +32 -0
  85. package/bin/chunk-rhdxwebf.js +2 -0
  86. package/bin/chunk-rhh716z0.js +42 -0
  87. package/bin/chunk-rpywcvg1.js +3 -0
  88. package/bin/chunk-rza4ae5z.js +3 -0
  89. package/bin/chunk-sfx2588q.js +3 -0
  90. package/bin/chunk-sk4e6rb1.js +1 -0
  91. package/bin/chunk-t2n1dbgx.js +4 -0
  92. package/bin/chunk-tf28796q.js +2 -0
  93. package/bin/chunk-twdxayky.js +3 -0
  94. package/bin/chunk-v9b3w8q5.js +3 -0
  95. package/bin/chunk-v9w25rp2.js +2 -0
  96. package/bin/chunk-vgn5zcpv.js +3 -0
  97. package/bin/chunk-wfzqnpc1.js +3 -0
  98. package/bin/chunk-wry2hvrq.js +24 -0
  99. package/bin/chunk-x8f4defx.js +3 -0
  100. package/bin/chunk-xp59apdb.js +2 -0
  101. package/bin/chunk-xtf3c29c.css +1 -0
  102. package/bin/chunk-z3gkt8w1.js +3 -0
  103. package/bin/chunk-zehyn6vd.js +2 -0
  104. package/bin/chunk-zh6fqq44.js +1 -0
  105. package/bin/chunk-zmv8cg4s.js +8 -0
  106. package/bin/chunk-zqv0zhfb.js +3 -0
  107. package/bin/{pdf.worker.min-szxdj13d.mjs → pdf.worker.min-vf48er29.mjs} +14423 -13889
  108. package/bin/shumai-app.html +1 -1
  109. package/bin/shumai-app.js +626 -460
  110. package/package.json +18 -18
  111. package/prisma/migrations/20260904022457_add_agent_id_to_assets_and_audit_logs/migration.sql +17 -0
  112. package/prisma/migrations/20260906081230_default_denied_tools_delete_asset/migration.sql +15 -0
  113. package/prisma/schema.prisma +9 -0
  114. package/bin/chunk-07h4b77v.js +0 -2
  115. package/bin/chunk-0t4n4d5w.js +0 -4
  116. package/bin/chunk-1611z9jg.js +0 -2
  117. package/bin/chunk-1phqxp6z.js +0 -3
  118. package/bin/chunk-23hckrrz.js +0 -2
  119. package/bin/chunk-30z44j1g.js +0 -2
  120. package/bin/chunk-3j463k1g.js +0 -1
  121. package/bin/chunk-4181tdds.js +0 -14
  122. package/bin/chunk-480jtqng.js +0 -4
  123. package/bin/chunk-4c3g146q.js +0 -2
  124. package/bin/chunk-4ca0zt5e.js +0 -1
  125. package/bin/chunk-4d9bgmf2.js +0 -2
  126. package/bin/chunk-4ev56fss.js +0 -9
  127. package/bin/chunk-4gk52tjq.js +0 -45
  128. package/bin/chunk-4mdqkj4d.js +0 -1
  129. package/bin/chunk-4r91fggc.js +0 -2
  130. package/bin/chunk-50fb1x3w.js +0 -1
  131. package/bin/chunk-59gj1njz.js +0 -1
  132. package/bin/chunk-5pr0t7fb.js +0 -2
  133. package/bin/chunk-5vewxmz7.js +0 -3
  134. package/bin/chunk-62zx96pe.js +0 -2
  135. package/bin/chunk-63y0eb07.js +0 -2
  136. package/bin/chunk-6d5xrgfx.js +0 -2
  137. package/bin/chunk-6gbtz5bf.js +0 -67
  138. package/bin/chunk-6gjg5egq.js +0 -3
  139. package/bin/chunk-6m4jz9s1.js +0 -44
  140. package/bin/chunk-6s4x525w.js +0 -2
  141. package/bin/chunk-6w2wmvqs.js +0 -3
  142. package/bin/chunk-77d23vcn.js +0 -2
  143. package/bin/chunk-77m5p188.js +0 -2
  144. package/bin/chunk-7bvx087f.js +0 -1
  145. package/bin/chunk-7pfjfrjg.js +0 -5
  146. package/bin/chunk-7q10s127.js +0 -4
  147. package/bin/chunk-7thx8ctx.js +0 -3
  148. package/bin/chunk-8t4s91gh.js +0 -2
  149. package/bin/chunk-98ey5p2e.js +0 -3
  150. package/bin/chunk-9amndcyh.js +0 -6
  151. package/bin/chunk-9bk23g9x.js +0 -1
  152. package/bin/chunk-9mkcfy43.js +0 -1
  153. package/bin/chunk-9t3nsq5n.js +0 -2
  154. package/bin/chunk-9tjq99ds.js +0 -2
  155. package/bin/chunk-9wm9rwh1.js +0 -2
  156. package/bin/chunk-ab16fyg4.js +0 -4
  157. package/bin/chunk-arv0g2av.js +0 -1
  158. package/bin/chunk-aytj4zxg.js +0 -3
  159. package/bin/chunk-b1ypjqgp.js +0 -2
  160. package/bin/chunk-bdjv0ykq.js +0 -2
  161. package/bin/chunk-c1k86mfa.js +0 -10
  162. package/bin/chunk-caa96dgd.js +0 -2
  163. package/bin/chunk-ce4v2yjy.js +0 -1
  164. package/bin/chunk-cqh60y54.js +0 -3
  165. package/bin/chunk-cvq7zgw7.js +0 -1
  166. package/bin/chunk-d9mjbtp2.js +0 -2
  167. package/bin/chunk-dn7sbjws.js +0 -3
  168. package/bin/chunk-dxyq9h8n.js +0 -3
  169. package/bin/chunk-e3cabksx.js +0 -3
  170. package/bin/chunk-egcrbj94.js +0 -2
  171. package/bin/chunk-ev17v1mv.js +0 -2
  172. package/bin/chunk-evtpwg71.js +0 -2
  173. package/bin/chunk-f3e0nsv2.js +0 -2
  174. package/bin/chunk-f40gjqpq.js +0 -2
  175. package/bin/chunk-fe7822ak.js +0 -299
  176. package/bin/chunk-g8tkhw9j.js +0 -2
  177. package/bin/chunk-g9r0p4t8.js +0 -2
  178. package/bin/chunk-gbjyh9ms.js +0 -1
  179. package/bin/chunk-gtbsb39v.js +0 -3
  180. package/bin/chunk-gytz1q13.js +0 -13
  181. package/bin/chunk-h0fxysxs.js +0 -7
  182. package/bin/chunk-h8bdvsqt.js +0 -2
  183. package/bin/chunk-hag024w8.js +0 -2
  184. package/bin/chunk-hc6w5nw4.js +0 -7
  185. package/bin/chunk-j69dqc48.js +0 -2
  186. package/bin/chunk-jbtw1zym.js +0 -8
  187. package/bin/chunk-jc1vb7rj.js +0 -5
  188. package/bin/chunk-jdv78w9r.js +0 -2
  189. package/bin/chunk-jjs70y9v.js +0 -3
  190. package/bin/chunk-jmdar2gz.js +0 -2
  191. package/bin/chunk-jvwz10n4.js +0 -2
  192. package/bin/chunk-k47md1g4.js +0 -2
  193. package/bin/chunk-k4v0brcb.js +0 -2
  194. package/bin/chunk-k6n7c07e.js +0 -1
  195. package/bin/chunk-kk2cstsg.js +0 -2
  196. package/bin/chunk-knz4h56q.js +0 -12
  197. package/bin/chunk-kqqtt6bd.js +0 -3
  198. package/bin/chunk-kvyp1t4j.js +0 -7
  199. package/bin/chunk-kxskpgsq.js +0 -5
  200. package/bin/chunk-m6srbjcs.js +0 -2
  201. package/bin/chunk-mcc1scxs.js +0 -12
  202. package/bin/chunk-mq83a0kk.js +0 -2
  203. package/bin/chunk-mxm8g4q0.js +0 -1
  204. package/bin/chunk-nhpgdqq5.js +0 -2
  205. package/bin/chunk-nne496aa.js +0 -2
  206. package/bin/chunk-nqpb0r9h.js +0 -11
  207. package/bin/chunk-ns0zww9g.js +0 -2
  208. package/bin/chunk-ps4xfp23.js +0 -2
  209. package/bin/chunk-pz2ec6xt.js +0 -2
  210. package/bin/chunk-q163k309.js +0 -2
  211. package/bin/chunk-q1da61ps.js +0 -1
  212. package/bin/chunk-qrf0ady6.js +0 -68
  213. package/bin/chunk-qy28f25e.js +0 -2
  214. package/bin/chunk-r7s4ypw1.js +0 -2
  215. package/bin/chunk-ran23vm9.js +0 -1
  216. package/bin/chunk-rfvdc4n0.js +0 -2
  217. package/bin/chunk-rgthkvgx.js +0 -3
  218. package/bin/chunk-s39n3yw3.js +0 -2
  219. package/bin/chunk-s7wdd0g7.js +0 -8
  220. package/bin/chunk-s88ha5kx.js +0 -3
  221. package/bin/chunk-sf91bt9m.js +0 -2
  222. package/bin/chunk-sjwbjf9j.js +0 -2
  223. package/bin/chunk-t62076pv.js +0 -1
  224. package/bin/chunk-tbbwss3v.js +0 -3
  225. package/bin/chunk-tjcc7a6y.js +0 -24
  226. package/bin/chunk-tp6ab26e.js +0 -2
  227. package/bin/chunk-v2wxk9p5.js +0 -4
  228. package/bin/chunk-vbk6y4hk.js +0 -2
  229. package/bin/chunk-vfgfg5fk.js +0 -2
  230. package/bin/chunk-vm6c3xx9.js +0 -2
  231. package/bin/chunk-vsx96mt6.js +0 -3
  232. package/bin/chunk-wbyw1shz.js +0 -6
  233. package/bin/chunk-whh2vh50.css +0 -1
  234. package/bin/chunk-wjkcq65s.js +0 -2
  235. package/bin/chunk-wkefwkfp.js +0 -41
  236. package/bin/chunk-x7bsnk1e.js +0 -2
  237. package/bin/chunk-xbhw6bpz.js +0 -3
  238. package/bin/chunk-xg5yrcj5.js +0 -2
  239. package/bin/chunk-xg9xscqz.js +0 -1
  240. package/bin/chunk-xw2gpcsh.js +0 -3
  241. package/bin/chunk-ycq8ank7.js +0 -2
  242. package/bin/chunk-yp9hvkc5.js +0 -73
  243. package/bin/chunk-ytypyfkc.js +0 -65
  244. package/bin/chunk-z1kjmf60.js +0 -2
  245. package/bin/chunk-z36bx86r.js +0 -2
  246. package/bin/chunk-z7hdnecp.js +0 -3
  247. package/bin/chunk-zeby1cq7.js +0 -2
  248. package/bin/chunk-zs5e8z1w.js +0 -1
  249. package/bin/chunk-zxnyefg5.js +0 -2
  250. /package/bin/{chunk-24ke0th1.css → chunk-kegybs91.css} +0 -0
@@ -1,41 +0,0 @@
1
- import{h as US}from"./chunk-s39n3yw3.js";import{ca as Hf}from"./chunk-kxskpgsq.js";import{$f as WS,ag as HS}from"./chunk-5vewxmz7.js";import{ng as PS}from"./chunk-62zx96pe.js";import{og as zS}from"./chunk-63y0eb07.js";import{hh as BS}from"./chunk-qrf0ady6.js";import{ih as AS}from"./chunk-k47md1g4.js";import{ri as kS}from"./chunk-b1ypjqgp.js";import{Gi as ui,ui as DS,xi as Ra,zi as wS}from"./chunk-h0fxysxs.js";import{Bl as TS,Dk as fS,Ek as gS,Fk as hS,Il as ES,Jk as pS,Jl as bS,Pk as _S,Rk as mS,Sk as CS,Tk as xS,Tl as FS,Uk as IS,Wj as uS,aj as Bt,bj as qo,bk as $S,cj as w,dj as Tt,ij as $a,jj as ob,lk as dS,ll as yS,ml as SS,pl as NS,rl as zf,rm as LS,um as Fn,vj as RS}from"./chunk-yp9hvkc5.js";import{sn as Dt,tn as TO,un as at}from"./chunk-dxyq9h8n.js";var uf=TO((lR,Sa)=>{var EO=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},H=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function g(_){if(_ instanceof s)return new s(_.type,g(_.content),_.alias);else if(Array.isArray(_))return _.map(g);else return _.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(g){return Object.prototype.toString.call(g).slice(8,-1)},objId:function(g){if(!g.__id)Object.defineProperty(g,"__id",{value:++n});return g.__id},clone:function g(_,m){m=m||{};var C,x;switch(r.util.type(_)){case"Object":if(x=r.util.objId(_),m[x])return m[x];C={},m[x]=C;for(var N in _)if(_.hasOwnProperty(N))C[N]=g(_[N],m);return C;case"Array":if(x=r.util.objId(_),m[x])return m[x];return C=[],m[x]=C,_.forEach(function(T,y){C[y]=g(T,m)}),C;default:return _}},getLanguage:function(g){while(g){var _=e.exec(g.className);if(_)return _[1].toLowerCase();g=g.parentElement}return"none"},setLanguage:function(g,_){g.className=g.className.replace(RegExp(e,"gi"),""),g.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(C){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(g){var _=document.getElementsByTagName("script");for(var m in _)if(_[m].src==g)return _[m]}return null}},isActive:function(g,_,m){var C="no-"+_;while(g){var x=g.classList;if(x.contains(_))return!0;if(x.contains(C))return!1;g=g.parentElement}return!!m}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(g,_){var m=r.util.clone(r.languages[g]);for(var C in _)m[C]=_[C];return m},insertBefore:function(g,_,m,C){C=C||r.languages;var x=C[g],N={};for(var T in x)if(x.hasOwnProperty(T)){if(T==_){for(var y in m)if(m.hasOwnProperty(y))N[y]=m[y]}if(!m.hasOwnProperty(T))N[T]=x[T]}var S=C[g];return C[g]=N,r.languages.DFS(r.languages,function(E,O){if(O===S&&E!=g)this[E]=N}),N},DFS:function g(_,m,C,x){x=x||{};var N=r.util.objId;for(var T in _)if(_.hasOwnProperty(T)){m.call(_,T,_[T],C||T);var y=_[T],S=r.util.type(y);if(S==="Object"&&!x[N(y)])x[N(y)]=!0,g(y,m,null,x);else if(S==="Array"&&!x[N(y)])x[N(y)]=!0,g(y,m,T,x)}}},plugins:{},highlightAll:function(g,_){r.highlightAllUnder(document,g,_)},highlightAllUnder:function(g,_,m){var C={callback:m,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var x=0,N;N=C.elements[x++];)r.highlightElement(N,_===!0,C.callback)},highlightElement:function(g,_,m){var C=r.util.getLanguage(g),x=r.languages[C];r.util.setLanguage(g,C);var N=g.parentElement;if(N&&N.nodeName.toLowerCase()==="pre")r.util.setLanguage(N,C);var T=g.textContent,y={element:g,language:C,grammar:x,code:T};function S(O){y.highlightedCode=O,r.hooks.run("before-insert",y),y.element.innerHTML=y.highlightedCode,r.hooks.run("after-highlight",y),r.hooks.run("complete",y),m&&m.call(y.element)}if(r.hooks.run("before-sanity-check",y),N=y.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex"))N.setAttribute("tabindex","0");if(!y.code){r.hooks.run("complete",y),m&&m.call(y.element);return}if(r.hooks.run("before-highlight",y),!y.grammar){S(r.util.encode(y.code));return}if(_&&t.Worker){var E=new Worker(r.filename);E.onmessage=function(O){S(O.data)},E.postMessage(JSON.stringify({language:y.language,code:y.code,immediateClose:!0}))}else S(r.highlight(y.code,y.grammar,y.language))},highlight:function(g,_,m){var C={code:g,grammar:_,language:m};if(r.hooks.run("before-tokenize",C),!C.grammar)throw Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),s.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(g,_){var m=_.rest;if(m){for(var C in m)_[C]=m[C];delete _.rest}var x=new a;return c(x,x.head,g),l(g,x,_,x.head,0),d(x)},hooks:{all:{},add:function(g,_){var m=r.hooks.all;m[g]=m[g]||[],m[g].push(_)},run:function(g,_){var m=r.hooks.all[g];if(!m||!m.length)return;for(var C=0,x;x=m[C++];)x(_)}},Token:s};t.Prism=r;function s(g,_,m,C){this.type=g,this.content=_,this.alias=m,this.length=(C||"").length|0}s.stringify=function g(_,m){if(typeof _=="string")return _;if(Array.isArray(_)){var C="";return _.forEach(function(S){C+=g(S,m)}),C}var x={type:_.type,content:g(_.content,m),tag:"span",classes:["token",_.type],attributes:{},language:m},N=_.alias;if(N)if(Array.isArray(N))Array.prototype.push.apply(x.classes,N);else x.classes.push(N);r.hooks.run("wrap",x);var T="";for(var y in x.attributes)T+=" "+y+'="'+(x.attributes[y]||"").replace(/"/g,"&quot;")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+T+">"+x.content+"</"+x.tag+">"};function i(g,_,m,C){g.lastIndex=_;var x=g.exec(m);if(x&&C&&x[1]){var N=x[1].length;x.index+=N,x[0]=x[0].slice(N)}return x}function l(g,_,m,C,x,N){for(var T in m){if(!m.hasOwnProperty(T)||!m[T])continue;var y=m[T];y=Array.isArray(y)?y:[y];for(var S=0;S<y.length;++S){if(N&&N.cause==T+","+S)return;var E=y[S],O=E.inside,$=!!E.lookbehind,I=!!E.greedy,k=E.alias;if(I&&!E.pattern.global){var L=E.pattern.toString().match(/[imsuy]*$/)[0];E.pattern=RegExp(E.pattern.source,L+"g")}var z=E.pattern||E;for(var M=C.next,Z=x;M!==_.tail;Z+=M.value.length,M=M.next){if(N&&Z>=N.reach)break;var ot=M.value;if(_.length>g.length)return;if(ot instanceof s)continue;var gt=1,rt;if(I){if(rt=i(z,Z,g,$),!rt||rt.index>=g.length)break;var Mt=rt.index,$e=rt.index+rt[0].length,ae=Z;ae+=M.value.length;while(Mt>=ae)M=M.next,ae+=M.value.length;if(ae-=M.value.length,Z=ae,M.value instanceof s)continue;for(var j=M;j!==_.tail&&(ae<$e||typeof j.value==="string");j=j.next)gt++,ae+=j.value.length;gt--,ot=g.slice(Z,ae),rt.index-=Z}else if(rt=i(z,0,ot,$),!rt)continue;var Mt=rt.index,vt=rt[0],Ie=ot.slice(0,Mt),ce=ot.slice(Mt+vt.length),Ce=Z+ot.length;if(N&&Ce>N.reach)N.reach=Ce;var ue=M.prev;if(Ie)ue=c(_,ue,Ie),Z+=Ie.length;u(_,ue,gt);var Fe=new s(T,O?r.tokenize(vt,O):vt,k,vt);if(M=c(_,ue,Fe),ce)c(_,M,ce);if(gt>1){var Je={cause:T+","+S,reach:Ce};if(l(g,_,m,M.prev,Z,Je),N&&Je.reach>N.reach)N.reach=Je.reach}}}}}function a(){var g={value:null,prev:null,next:null},_={value:null,prev:g,next:null};g.next=_,this.head=g,this.tail=_,this.length=0}function c(g,_,m){var C=_.next,x={value:m,prev:_,next:C};return _.next=x,C.prev=x,g.length++,x}function u(g,_,m){var C=_.next;for(var x=0;x<m&&C!==g.tail;x++)C=C.next;_.next=C,C.prev=_,g.length-=x}function d(g){var _=[],m=g.head.next;while(m!==g.tail)_.push(m.value),m=m.next;return _}if(!t.document){if(!t.addEventListener)return r;if(!r.disableWorkerMessageHandler)t.addEventListener("message",function(g){var _=JSON.parse(g.data),m=_.language,C=_.code,x=_.immediateClose;if(t.postMessage(r.highlight(C,r.languages[m],m)),x)t.close()},!1);return r}var f=r.util.currentScript();if(f){if(r.filename=f.src,f.hasAttribute("data-manual"))r.manual=!0}function h(){if(!r.manual)r.highlightAll()}if(!r.manual){var p=document.readyState;if(p==="loading"||p==="interactive"&&f&&f.defer)document.addEventListener("DOMContentLoaded",h);else if(window.requestAnimationFrame)window.requestAnimationFrame(h);else window.setTimeout(h,16)}return r}(EO);if(typeof Sa<"u"&&Sa.exports)Sa.exports=H;if(typeof global<"u")global.Prism=H;H.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};H.languages.markup.tag.inside["attr-value"].inside.entity=H.languages.markup.entity;H.languages.markup.doctype.inside["internal-subset"].inside=H.languages.markup;H.hooks.add("wrap",function(t){if(t.type==="entity")t.attributes.title=t.content.replace(/&amp;/,"&")});Object.defineProperty(H.languages.markup.tag,"addInlined",{value:function(e,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:H.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:H.languages[n]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},H.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(H.languages.markup.tag,"addAttribute",{value:function(t,e){H.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:H.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});H.languages.html=H.languages.markup;H.languages.mathml=H.languages.markup;H.languages.svg=H.languages.markup;H.languages.xml=H.languages.extend("markup",{});H.languages.ssml=H.languages.xml;H.languages.atom=H.languages.xml;H.languages.rss=H.languages.xml;(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(H);H.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};H.languages.javascript=H.languages.extend("clike",{"class-name":[H.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});H.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;H.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:H.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:H.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:H.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:H.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:H.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});H.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:H.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});H.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(H.languages.markup)H.languages.markup.tag.addInlined("script","javascript"),H.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");H.languages.js=H.languages.javascript;(function(){if(typeof H>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var t="Loading…",e=function(f,h){return"✖ Error "+f+" while fetching file: "+h},n="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",s="loading",i="loaded",l="failed",a="pre[data-src]:not(["+r+'="'+i+'"]):not(['+r+'="'+s+'"])';function c(f,h,p){var g=new XMLHttpRequest;g.open("GET",f,!0),g.onreadystatechange=function(){if(g.readyState==4)if(g.status<400&&g.responseText)h(g.responseText);else if(g.status>=400)p(e(g.status,g.statusText));else p(n)},g.send(null)}function u(f){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(f||"");if(h){var p=Number(h[1]),g=h[2],_=h[3];if(!g)return[p,p];if(!_)return[p,void 0];return[p,Number(_)]}return}H.hooks.add("before-highlightall",function(f){f.selector+=", "+a}),H.hooks.add("before-sanity-check",function(f){var h=f.element;if(h.matches(a)){f.code="",h.setAttribute(r,s);var p=h.appendChild(document.createElement("CODE"));p.textContent=t;var g=h.getAttribute("data-src"),_=f.language;if(_==="none"){var m=(/\.(\w+)$/.exec(g)||[,"none"])[1];_=o[m]||m}H.util.setLanguage(p,_),H.util.setLanguage(h,_);var C=H.plugins.autoloader;if(C)C.loadLanguages(_);c(g,function(x){h.setAttribute(r,i);var N=u(h.getAttribute("data-range"));if(N){var T=x.split(/\r\n?|\n/g),y=N[0],S=N[1]==null?T.length:N[1];if(y<0)y+=T.length;if(y=Math.max(0,Math.min(y-1,T.length)),S<0)S+=T.length;if(S=Math.max(0,Math.min(S,T.length)),x=T.slice(y,S).join(`
2
- `),!h.hasAttribute("data-start"))h.setAttribute("data-start",String(y+1))}p.textContent=x,H.highlightElement(p)},function(x){h.setAttribute(r,l),p.textContent=x})}}),H.plugins.fileHighlight={highlight:function(h){var p=(h||document).querySelectorAll(a);for(var g=0,_;_=p[g++];)H.highlightElement(_)}};var d=!1;H.fileHighlight=function(){if(!d)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),d=!0;H.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var di=Dt(Bt(),1);var Kt=Dt(Bt(),1);var rs=Dt(Bt(),1);var La={};at(La,{useLexicalComposerContext:()=>XS,createLexicalComposerContext:()=>VS,LexicalComposerContext:()=>Uf});var fi=Dt(Bt(),1),Uf=fi.createContext(null);function VS(t,e){let n=null;return t!=null&&(n=t[1]),{getTheme:function(){return e!=null?e:n!=null?n.getTheme():null}}}function XS(){let t=fi.useContext(Uf);return t==null&&function(e,...n){let o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(let s of n)r.append("v",s);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t}var ka=La,Yf=ka.LexicalComposerContext,Gf=ka.createLexicalComposerContext,mt=ka.useLexicalComposerContext;var du={};at(du,{toggleTextFormatType:()=>Ns,shallowMergeConfig:()=>ZT,setNodeIndentFromDOM:()=>fp,setDOMUnmanaged:()=>IT,safeCast:()=>qT,resetRandomKey:()=>NT,removeFromParent:()=>oo,removeClassNamesFromElement:()=>jT,normalizeClassNames:()=>$s,mergeRegister:()=>yp,makeStepwiseIterator:()=>lu,isSelectionWithinEditor:()=>Ms,isSelectionCapturedInDecoratorInput:()=>Yc,isModifierMatch:()=>op,isLexicalEditor:()=>Ji,isInlineDomNode:()=>dp,isHTMLElement:()=>de,isHTMLAnchorElement:()=>wT,isExactShortcutMatch:()=>dt,isDocumentFragment:()=>up,isDOMUnmanaged:()=>gp,isDOMTextNode:()=>pn,isDOMNode:()=>Er,isDOMDocumentNode:()=>qh,isCurrentlyReadOnlyMode:()=>Sr,isBlockDomNode:()=>_c,getTransformSetFromKlass:()=>Jh,getTextDirection:()=>ET,getStaticNodeConfig:()=>ws,getRegisteredNodeOrThrow:()=>Hc,getRegisteredNode:()=>Uc,getNearestEditorFromDOMNode:()=>Gc,getEditorPropertyFromDOMNode:()=>As,getDOMTextNode:()=>$o,getDOMSelectionFromTarget:()=>cp,getDOMSelection:()=>nn,getDOMOwnerDocument:()=>Qc,flipDirection:()=>co,defineExtension:()=>JT,declarePeerDependency:()=>XT,createState:()=>ON,createSharedNodeState:()=>Jg,createEditor:()=>yT,createCommand:()=>V,configExtension:()=>VT,buildImportMap:()=>VN,addClassNamesToElement:()=>QT,UNDO_COMMAND:()=>wc,TextNode:()=>ko,TabNode:()=>yr,TEXT_TYPE_TO_FORMAT:()=>ne,SKIP_SELECTION_FOCUS_TAG:()=>fc,SKIP_SCROLL_INTO_VIEW_TAG:()=>Ah,SKIP_DOM_SELECTION_TAG:()=>vh,SKIP_COLLAB_TAG:()=>QN,SELECT_ALL_COMMAND:()=>ic,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>$N,SELECTION_CHANGE_COMMAND:()=>bc,RootNode:()=>Nr,REMOVE_TEXT_COMMAND:()=>sc,REDO_COMMAND:()=>Rc,ParagraphNode:()=>Tr,PASTE_TAG:()=>ZN,PASTE_COMMAND:()=>Dc,OUTDENT_CONTENT_COMMAND:()=>LN,NODE_STATE_KEY:()=>SN,MOVE_TO_START:()=>oh,MOVE_TO_END:()=>eh,LineBreakNode:()=>xr,KEY_TAB_COMMAND:()=>uh,KEY_SPACE_COMMAND:()=>ih,KEY_MODIFIER_COMMAND:()=>mh,KEY_ESCAPE_COMMAND:()=>ah,KEY_ENTER_COMMAND:()=>Di,KEY_DOWN_COMMAND:()=>$c,KEY_DELETE_COMMAND:()=>ch,KEY_BACKSPACE_COMMAND:()=>lh,KEY_ARROW_UP_COMMAND:()=>rh,KEY_ARROW_RIGHT_COMMAND:()=>th,KEY_ARROW_LEFT_COMMAND:()=>nh,KEY_ARROW_DOWN_COMMAND:()=>sh,IS_UNDERLINE:()=>rN,IS_SUPERSCRIPT:()=>lN,IS_SUBSCRIPT:()=>iN,IS_STRIKETHROUGH:()=>oN,IS_ITALIC:()=>nN,IS_HIGHLIGHT:()=>yc,IS_CODE:()=>sN,IS_BOLD:()=>eN,IS_ALL_FORMATTING:()=>aN,INTERNAL_$isBlock:()=>Wn,INSERT_TAB_COMMAND:()=>IN,INSERT_PARAGRAPH_COMMAND:()=>rc,INSERT_LINE_BREAK_COMMAND:()=>as,INPUT_COMMAND:()=>Mc,INDENT_CONTENT_COMMAND:()=>FN,HISTORY_PUSH_TAG:()=>qN,HISTORY_MERGE_TAG:()=>Si,HISTORIC_TAG:()=>XN,FORMAT_TEXT_COMMAND:()=>to,FORMAT_ELEMENT_COMMAND:()=>kN,FOCUS_COMMAND:()=>ph,ElementNode:()=>Bo,DecoratorNode:()=>Gi,DROP_COMMAND:()=>dh,DRAGSTART_COMMAND:()=>fh,DRAGOVER_COMMAND:()=>gh,DRAGEND_COMMAND:()=>hh,DELETE_WORD_COMMAND:()=>xs,DELETE_LINE_COMMAND:()=>ys,DELETE_CHARACTER_COMMAND:()=>Cs,CUT_COMMAND:()=>Fc,COPY_COMMAND:()=>Ic,CONTROLLED_TEXT_INSERTION_COMMAND:()=>fr,COMPOSITION_START_TAG:()=>Dh,COMPOSITION_START_COMMAND:()=>Ac,COMPOSITION_END_TAG:()=>wh,COMPOSITION_END_COMMAND:()=>vc,COMMAND_PRIORITY_NORMAL:()=>mT,COMMAND_PRIORITY_LOW:()=>_T,COMMAND_PRIORITY_HIGH:()=>CT,COMMAND_PRIORITY_EDITOR:()=>ur,COMMAND_PRIORITY_CRITICAL:()=>xT,COLLABORATION_TAG:()=>Mh,CLICK_COMMAND:()=>jg,CLEAR_HISTORY_COMMAND:()=>KN,CLEAR_EDITOR_COMMAND:()=>PN,CAN_UNDO_COMMAND:()=>WN,CAN_REDO_COMMAND:()=>BN,BLUR_COMMAND:()=>_h,BEFORE_INPUT_COMMAND:()=>Oc,ArtificialNode__DO_NOT_USE:()=>Wc,$updateRangeSelectionFromCaretRange:()=>hs,$splitNode:()=>DT,$splitAtPointCaretNext:()=>GT,$setState:()=>AN,$setSelectionFromCaretRange:()=>_p,$setSelection:()=>ye,$setPointFromCaret:()=>Cr,$setCompositionKey:()=>Ht,$selectAll:()=>OT,$rewindSiblingCaret:()=>br,$removeTextFromCaretRange:()=>mp,$parseSerializedNode:()=>gT,$onUpdate:()=>ip,$normalizeSelection__EXPERIMENTAL:()=>bi,$normalizeCaret:()=>Xe,$nodesOfType:()=>MT,$isTokenOrTab:()=>no,$isTokenOrSegmented:()=>Kn,$isTextPointCaretSlice:()=>zT,$isTextPointCaret:()=>Hn,$isTextNode:()=>B,$isTabNode:()=>kc,$isSiblingCaret:()=>Lo,$isRootOrShadowRoot:()=>ke,$isRootNode:()=>Zt,$isRangeSelection:()=>G,$isParagraphNode:()=>Yh,$isNodeSelection:()=>bs,$isNodeCaret:()=>PT,$isLineBreakNode:()=>vo,$isLeafNode:()=>bT,$isInlineElementOrDecoratorNode:()=>vT,$isExtendableTextPointCaret:()=>Cp,$isElementNode:()=>D,$isEditorState:()=>hT,$isDecoratorNode:()=>Ct,$isChildCaret:()=>Qe,$isBlockElementNode:()=>iT,$insertNodes:()=>cT,$hasUpdateTag:()=>AT,$hasAncestor:()=>ki,$getWritableNodeState:()=>Ec,$getTextPointCaretSlice:()=>Cc,$getTextPointCaret:()=>so,$getTextNodeOffset:()=>je,$getTextContent:()=>uT,$getStateChange:()=>MN,$getState:()=>Ei,$getSiblingCaret:()=>Gt,$getSelection:()=>ct,$getRoot:()=>Me,$getPreviousSelection:()=>Ko,$getNodeFromDOMNode:()=>Jc,$getNodeByKeyOrThrow:()=>ap,$getNodeByKey:()=>Ft,$getNearestRootOrShadowRoot:()=>lp,$getNearestNodeFromDOMNode:()=>Xi,$getEditor:()=>eu,$getCommonAncestorResultBranchOrder:()=>cu,$getCommonAncestor:()=>gs,$getCollapsedCaretRange:()=>pp,$getChildCaretOrSelf:()=>hp,$getChildCaretAtIndex:()=>xp,$getChildCaret:()=>Un,$getCharacterOffsets:()=>gc,$getCaretRangeInDirection:()=>uu,$getCaretRange:()=>io,$getCaretInDirection:()=>ao,$getAdjacentSiblingOrParentSiblingCaret:()=>HT,$getAdjacentNode:()=>rp,$getAdjacentChildCaret:()=>mr,$findMatchingParent:()=>fs,$extendCaretToRange:()=>iu,$createTextNode:()=>Wt,$createTabNode:()=>zi,$createRangeSelectionFromDom:()=>lT,$createRangeSelection:()=>Ph,$createPoint:()=>tn,$createParagraphNode:()=>zn,$createNodeSelection:()=>Pc,$createLineBreakNode:()=>pr,$create:()=>FT,$copyNode:()=>tu,$comparePointCaretNext:()=>au,$cloneWithPropertiesEphemeral:()=>$T,$cloneWithProperties:()=>nu,$caretRangeFromSelection:()=>xc,$caretFromPoint:()=>lo,$applyNodeReplacement:()=>Ds,$addUpdateTag:()=>qi});function R(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Pg(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);n.search=o.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var en=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qS=en&&"documentMode"in document?document.documentMode:null,Ve=en&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ro=en&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ti=!(!en||!("InputEvent"in window)||qS)&&"getTargetRanges"in new window.InputEvent("input"),Pi=en&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Es=en&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZS=en&&/Android/.test(navigator.userAgent),Kg=en&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Va=en&&ZS&&Kg,Ki=en&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ve&&!Kg,QS=0,jS=1,tN=2,eN=1,nN=2,oN=4,rN=8,sN=16,iN=32,lN=64,yc=128,aN=2047,cN=1,uN=2,dN=3,fN=4,gN=5,hN=6,ps=Pi||Es||Ki?" ":"​",Bi=`
3
-
4
- `,Sc=ro?" ":ps,Bg="֑-߿יִ-﷽ﹰ-ﻼ",Wg="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",pN=new RegExp("^[^"+Wg+"]*["+Bg+"]"),_N=new RegExp("^[^"+Bg+"]*["+Wg+"]"),ne={bold:1,capitalize:1024,code:16,highlight:yc,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},mN={directionless:1,unmergeable:2},Xa={center:2,end:6,justify:4,left:1,right:3,start:5},CN={[uN]:"center",[hN]:"end",[fN]:"justify",[cN]:"left",[dN]:"right",[gN]:"start"},xN={normal:0,segmented:2,token:1},yN={[QS]:"normal",[tN]:"segmented",[jS]:"token"},SN="$",Jf="$config";function zg(t,e,n,o,r,s){let i=t.getFirstChild();for(;i!==null;){let l=i.__key;i.__parent===e&&(D(i)&&zg(i,l,n,o,r,s),n.has(l)||s.delete(l),r.push(l)),i=i.getNextSibling()}}var qa=!1,Nc=0;function NN(t){Nc=t.timeStamp}function Pa(t,e,n){let o=t.nodeName==="BR",r=e.__lexicalLineBreak;return r&&(t===r||o&&t.previousSibling===r)||o&&Vi(t,n)!==void 0}function TN(t,e,n){let o=nn(Ae(n)),r=null,s=null;o!==null&&o.anchorNode===t&&(r=o.anchorOffset,s=o.focusOffset);let i=t.nodeValue;i!==null&&qc(e,i,r,s,!1)}function EN(t,e,n){if(G(t)){let o=t.anchor.getNode();if(o.is(n)&&t.format!==o.getFormat())return!1}return pn(e)&&n.isAttached()}function bN(t,e,n,o){for(let r=t;r&&!gp(r);r=vs(r)){let s=Vi(r,e);if(s!==void 0){let i=Ft(s,n);if(i)return Ct(i)||!de(r)?void 0:[r,i]}else if(r===o)return[o,jh(n)]}}function Hg(t,e,n){qa=!0;let o=performance.now()-Nc>100;try{hn(t,()=>{let r=ct()||function(f){return f.getEditorState().read(()=>{let h=ct();return h!==null?h.clone():null})}(t),s=new Map,i=t.getRootElement(),l=t._editorState,a=t._blockCursorElement,c=!1,u="";for(let f=0;f<e.length;f++){let h=e[f],p=h.type,g=h.target,_=bN(g,t,l,i);if(!_)continue;let[m,C]=_;if(p==="characterData")o&&B(C)&&pn(g)&&EN(r,g,C)&&TN(g,C,t);else if(p==="childList"){c=!0;let x=h.addedNodes;for(let y=0;y<x.length;y++){let S=x[y],E=Jc(S),O=S.parentNode;if(O!=null&&S!==a&&E===null&&!Pa(S,O,t)){if(ro){let $=(de(S)?S.innerText:null)||S.nodeValue;$&&(u+=$)}O.removeChild(S)}}let N=h.removedNodes,T=N.length;if(T>0){let y=0;for(let S=0;S<T;S++){let E=N[S];(Pa(E,g,t)||a===E)&&(g.appendChild(E),y++)}T!==y&&s.set(m,C)}}}if(s.size>0)for(let[f,h]of s)h.reconcileObservedMutation(f,t);let d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let h=d[f],p=h.addedNodes,g=h.target;for(let _=0;_<p.length;_++){let m=p[_],C=m.parentNode;C==null||m.nodeName!=="BR"||Pa(m,g,t)||C.removeChild(m)}}n.takeRecords()}r!==null&&(c&&ye(r),ro&&sp(t)&&r.insertRawText(u))})}finally{qa=!1}}function Ug(t){let e=t._observer;if(e!==null)Hg(t,e.takeRecords(),e)}function Yg(t){(function(e){Nc===0&&Ae(e).addEventListener("textInput",NN,!0)})(t),t._observer=new MutationObserver((e,n)=>{Hg(t,e,n)})}class Gg{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(t,e){this.key=t,this.parse=e.parse.bind(e),this.unparse=(e.unparse||vN).bind(e),this.isEqual=(e.isEqual||Object.is).bind(e),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=e.resetOnCopyNode||!1}}function ON(t,e){return new Gg(t,e)}function Ei(t,e,n="latest"){let o=(n==="latest"?t.getLatest():t).__state;return o?o.getValue(e):e.defaultValue}function MN(t,e,n){let o=Ei(t,n,"direct"),r=Ei(e,n,"direct");return n.isEqual(o,r)?null:[o,r]}function AN(t,e,n){let o;if(zt(),typeof n=="function"){let s=t.getLatest(),i=Ei(s,e);if(o=n(i),e.isEqual(i,o))return s}else o=n;let r=t.getWritable();return Ec(r).updateFromKnown(e,o),r}function Jg(t){let e=new Map,n=new Set;for(let o=typeof t=="function"?t:t.replace;o.prototype&&o.prototype.getType!==void 0;o=Object.getPrototypeOf(o)){let{ownNodeConfig:r}=ws(o);if(r&&r.stateConfigs)for(let s of r.stateConfigs){let i;"stateConfig"in s?(i=s.stateConfig,s.flat&&n.add(i.key)):i=s,e.set(i.key,i)}}return{flatKeys:n,sharedConfigMap:e}}class Tc{node;knownState;unknownState;sharedNodeState;size;constructor(t,e,n=void 0,o=new Map,r=void 0){this.node=t,this.sharedNodeState=e,this.unknownState=n,this.knownState=o;let{sharedConfigMap:s}=this.sharedNodeState,i=r!==void 0?r:function(l,a,c){let u=c.size;if(a)for(let d in a){let f=l.get(d);f&&c.has(f)||u++}return u}(s,n,o);this.size=i}getValue(t){let e=this.knownState.get(t);if(e!==void 0)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){let o=this.unknownState[t.key];o!==void 0&&(n=t.parse(o)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let t={...this.unknownState},e={};for(let[n,o]of this.knownState)n.isEqual(o,n.defaultValue)?delete t[n.key]:t[n.key]=n.unparse(o);for(let n of this.sharedNodeState.flatKeys)n in t&&(e[n]=t[n],delete t[n]);return Vf(t)&&(e.$=t),e}getWritable(t){if(this.node===t)return this;let{sharedNodeState:e,unknownState:n}=this,o=new Map(this.knownState);return new Tc(t,e,function(r,s,i){let l;if(i)for(let[a,c]of Object.entries(i)){let u=r.get(a);u?s.has(u)||s.set(u,u.parse(c)):(l=l||{},l[a]=c)}return l}(e.sharedConfigMap,o,n),o,this.size)}resetOnCopyNode(){for(let t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,e){let n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);let{knownState:o,unknownState:r}=this;o.has(t)||r&&n in r||(r&&(delete r[n],this.unknownState=Vf(r)),this.size++),o.set(t,e)}updateFromUnknown(t,e){let n=this.sharedNodeState.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},(t in this.unknownState)||this.size++,this.unknownState[t]=e)}updateFromJSON(t){let{knownState:e}=this;for(let n of e.keys())e.set(n,n.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(let[n,o]of Object.entries(t))this.updateFromUnknown(n,o)}}function Ec(t){let e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Tc(e,Vg(e));return e.__state=n,n}function Vg(t){return t.__state?t.__state.sharedNodeState:Hc(eu(),t.getType()).sharedNodeState}function Vf(t){if(t)for(let e in t)return t}function vN(t){return t}function Xf(t,e,n){for(let[o,r]of e.knownState){if(t.has(o.key))continue;t.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function qf(t,e,n){let{unknownState:o}=e,r=n?n.unknownState:void 0;if(o)for(let[s,i]of Object.entries(o)){if(t.has(s))continue;if(t.add(s),i!==(r?r[s]:void 0))return!0}return!1}function Zf(t,e){let n=t.__state;return n&&n.node===t?n.getWritable(e):n}function Qf(t,e){let{__mode:n,__format:o,__style:r}=t,s=e.__mode,i=e.__format,l=e.__style,a=t.__state,c=e.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===l)&&(t.__state===null||a===c||function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;let f=new Set;return!(u&&Xf(f,u,d)||d&&Xf(f,d,u)||u&&qf(f,u,d)||d&&qf(f,d,u))}(a,c))}function jf(t,e){let n=t.mergeWithSibling(e),o=_t()._normalizedNodes;return o.add(t.__key),o.add(e.__key),n}function tg(t){let e,n,o=t;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(e=o.getPreviousSibling())!==null&&B(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Qf(e,o)){o=jf(e,o);break}break}e.remove()}for(;(n=o.getNextSibling())!==null&&B(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Qf(o,n)){o=jf(o,n);break}break}n.remove()}}else o.remove()}function bi(t){return eg(t.anchor),eg(t.focus),t}function eg(t){for(;t.type==="element";){let e=t.getNode(),n=t.offset,o,r;if(n===e.getChildrenSize()?(o=e.getChildAtIndex(n-1),r=!0):(o=e.getChildAtIndex(n),r=!1),B(o)){t.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!D(o))break;t.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Do,Qt,_s,Wi,Za,Qa,wo,qe,ja,ms,It="",gn=null,Mo=null,ar=!1,Oi=!1;function Mi(t,e){let n=wo.get(t);if(e!==null){let o=oc(t);o.parentNode===e&&e.removeChild(o)}if(qe.has(t)||Qt._keyToDOMMap.delete(t),D(n)){let o=vi(n,wo);tc(o,0,o.length-1,null)}n!==void 0&&Zc(ms,_s,Wi,n,"destroyed")}function tc(t,e,n,o){for(let r=e;r<=n;++r){let s=t[r];s!==void 0&&Mi(s,o)}}function Oo(t,e){t.setProperty("text-align",e)}var DN="40px";function Xg(t,e){let n=Do.theme.indent;if(typeof n=="string"){let r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}if(e===0)return void t.style.setProperty("padding-inline-start","");let o=getComputedStyle(Qt._rootElement||t).getPropertyValue("--lexical-indent-base-value")||DN;t.style.setProperty("padding-inline-start",`calc(${e} * ${o})`)}function qg(t,e){let n=t.style;e===0?Oo(n,""):e===1?Oo(n,"left"):e===2?Oo(n,"center"):e===3?Oo(n,"right"):e===4?Oo(n,"justify"):e===5?Oo(n,"start"):e===6&&Oo(n,"end")}function ec(t,e){let n=function(o){let r=o.__dir;if(r!==null)return r;if(Zt(o))return null;let s=o.getParentOrThrow();return Zt(s)&&s.__dir===null?"auto":null}(e);n!==null?t.dir=n:t.removeAttribute("dir")}function Ai(t,e){let n=qe.get(t);n===void 0&&R(60);let o=n.createDOM(Do,Qt);if(function(r,s,i){let l=i._keyToDOMMap;(function(a,c,u){let d=`__lexicalKey_${c._key}`;a[d]=u})(s,i,r),l.set(r,s)}(t,o,Qt),B(n)?o.setAttribute("data-lexical-text","true"):Ct(n)&&o.setAttribute("data-lexical-decorator","true"),D(n)){let{__indent:r,__size:s}=n;if(ec(o,n),r!==0&&Xg(o,r),s!==0){let l=s-1;nc(vi(n,qe),n,0,l,n.getDOMSlot(o))}let i=n.__format;i!==0&&qg(o,i),n.isInline()||Zg(null,n,o)}else{let r=n.getTextContent();if(Ct(n)){let s=n.decorate(Qt,Do);s!==null&&Qg(t,s),o.contentEditable="false"}It+=r}return e!==null&&e.insertChild(o),Zc(ms,_s,Wi,n,"created"),o}function nc(t,e,n,o,r){let s=It;It="";let i=n;for(;i<=o;++i){Ai(t[i],r);let l=qe.get(t[i]);l!==null&&B(l)?gn===null&&(gn=l.getFormat(),Mo=l.getStyle()):D(l)&&i<o&&!l.isInline()&&(It+=Bi)}r.element.__lexicalTextContent=It,It=s+It}function ng(t,e){if(t){let n=t.__last;if(n){let o=e.get(n);if(o)return vo(o)?"line-break":Ct(o)&&o.isInline()?"decorator":null}return"empty"}return null}function Zg(t,e,n){let o=ng(t,wo),r=ng(e,qe);o!==r&&e.getDOMSlot(n).setManagedLineBreak(r)}function wN(t,e,n){var o;gn=null,Mo=null,function(r,s,i){let l=It,a=r.__size,c=s.__size;It="";let u=i.element;if(a===1&&c===1){let d=r.__first,f=s.__first;if(d===f)mi(d,u);else{let p=oc(d),g=Ai(f,null);try{u.replaceChild(g,p)}catch(_){if(typeof _=="object"&&_!=null){let m=`${_.toString()} Parent: ${u.tagName}, new child: {tag: ${g.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${d}}.`;throw Error(m)}throw _}Mi(d,null)}let h=qe.get(f);B(h)&&gn===null&&(gn=h.getFormat(),Mo=h.getStyle())}else{let d=vi(r,wo),f=vi(s,qe);if(d.length!==a&&R(227),f.length!==c&&R(228),a===0)c!==0&&nc(f,0,0,c-1,i);else if(c===0){if(a!==0){let h=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;tc(d,0,a-1,h?null:u),h&&(u.textContent="")}}else(function(h,p,g,_,m,C){let x=_-1,N=m-1,T,y,S=C.getFirstChild(),E=0,O=0;for(;E<=x&&O<=N;){let k=p[E],L=g[O];if(k===L)S=Ka(mi(L,C.element)),E++,O++;else{if(y===void 0&&(y=og(g,O)),T===void 0)T=og(p,E);else if(!T.has(k)){E++;continue}if(!y.has(k)){S=Ka(oc(k)),Mi(k,C.element),E++,T.delete(k);continue}if(T.has(L)){let M=_r(Qt,L);M!==S&&C.withBefore(S).insertChild(M),S=Ka(mi(L,C.element)),E++,O++}else Ai(L,C.withBefore(S)),O++}let z=qe.get(L);z!==null&&B(z)?gn===null&&(gn=z.getFormat(),Mo=z.getStyle()):D(z)&&O<=N&&!z.isInline()&&(It+=Bi)}let $=E>x,I=O>N;if($&&!I){let k=g[N+1],L=k===void 0?null:Qt.getElementByKey(k);nc(g,0,O,N,C.withBefore(L))}else I&&!$&&tc(p,E,x,C.element)})(0,d,f,a,c,i)}u.__lexicalTextContent=It,It=l+It}(t,e,e.getDOMSlot(n)),o=e,gn==null||gn===o.__textFormat||Oi||o.setTextFormat(gn),function(r){Mo==null||Mo===r.__textStyle||Oi||r.setTextStyle(Mo)}(e)}function vi(t,e){let n=[],o=t.__first;for(;o!==null;){let r=e.get(o);r===void 0&&R(101),n.push(o),o=r.__next}return n}function mi(t,e){let n=wo.get(t),o=qe.get(t);n!==void 0&&o!==void 0||R(61);let r=ar||Qa.has(t)||Za.has(t),s=_r(Qt,t);if(n===o&&!r){let i;if(D(n)){let l=s.__lexicalTextContent;typeof l=="string"?i=l:(i=n.getTextContent(),s.__lexicalTextContent=i)}else i=n.getTextContent();return It+=i,s}if(n!==o&&r&&Zc(ms,_s,Wi,o,"updated"),o.updateDOM(n,s,Do)){let i=Ai(t,null);return e===null&&R(62),e.replaceChild(i,s),Mi(t,null),i}if(D(n)){D(o)||R(334,t);let i=o.__indent;(ar||i!==n.__indent)&&Xg(s,i);let l=o.__format;if((ar||l!==n.__format)&&qg(s,l),r)wN(n,o,s),Zt(o)||o.isInline()||Zg(n,o,s);else{let a=s.__lexicalTextContent,c;typeof a=="string"?c=a:(c=n.getTextContent(),s.__lexicalTextContent=c),It+=c}if((ar||o.__dir!==n.__dir)&&(ec(s,o),Zt(o)&&!ar)){for(let a of o.getChildren())if(D(a))ec(_r(Qt,a.getKey()),a)}}else{let i=o.getTextContent();if(Ct(o)){let l=o.decorate(Qt,Do);l!==null&&Qg(t,l)}It+=i}if(!Oi&&Zt(o)&&o.__cachedText!==It){let i=o.getWritable();i.__cachedText=It,o=i}return s}function Qg(t,e){let{_pendingDecorators:n,_decorators:o}=Qt;if(n===null){if(o[t]===e)return;n=Qh(Qt)}n[t]=e}function Ka(t){let e=t.nextSibling;return e!==null&&e===Qt._blockCursorElement&&(e=e.nextSibling),e}function og(t,e){let n=new Set;for(let o=e;o<t.length;o++)n.add(t[o]);return n}function RN(t,e,n,o,r,s){It="",ar=o===2,Qt=n,Do=n._config,_s=n._nodes,Wi=Qt._listeners.mutation,Za=r,Qa=s,wo=t._nodeMap,qe=e._nodeMap,Oi=e._readOnly,ja=new Map(n._keyToDOMMap);let i=new Map;return ms=i,mi("root",null),Qt=void 0,_s=void 0,Za=void 0,Qa=void 0,wo=void 0,qe=void 0,Do=void 0,ja=void 0,ms=void 0,i}function oc(t){let e=ja.get(t);return e===void 0&&R(75,t),e}function V(t){return{type:t}}var bc=V("SELECTION_CHANGE_COMMAND"),$N=V("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),jg=V("CLICK_COMMAND"),Oc=V("BEFORE_INPUT_COMMAND"),Mc=V("INPUT_COMMAND"),Ac=V("COMPOSITION_START_COMMAND"),vc=V("COMPOSITION_END_COMMAND"),Cs=V("DELETE_CHARACTER_COMMAND"),as=V("INSERT_LINE_BREAK_COMMAND"),rc=V("INSERT_PARAGRAPH_COMMAND"),fr=V("CONTROLLED_TEXT_INSERTION_COMMAND"),Dc=V("PASTE_COMMAND"),sc=V("REMOVE_TEXT_COMMAND"),xs=V("DELETE_WORD_COMMAND"),ys=V("DELETE_LINE_COMMAND"),to=V("FORMAT_TEXT_COMMAND"),wc=V("UNDO_COMMAND"),Rc=V("REDO_COMMAND"),$c=V("KEYDOWN_COMMAND"),th=V("KEY_ARROW_RIGHT_COMMAND"),eh=V("MOVE_TO_END"),nh=V("KEY_ARROW_LEFT_COMMAND"),oh=V("MOVE_TO_START"),rh=V("KEY_ARROW_UP_COMMAND"),sh=V("KEY_ARROW_DOWN_COMMAND"),Di=V("KEY_ENTER_COMMAND"),ih=V("KEY_SPACE_COMMAND"),lh=V("KEY_BACKSPACE_COMMAND"),ah=V("KEY_ESCAPE_COMMAND"),ch=V("KEY_DELETE_COMMAND"),uh=V("KEY_TAB_COMMAND"),IN=V("INSERT_TAB_COMMAND"),FN=V("INDENT_CONTENT_COMMAND"),LN=V("OUTDENT_CONTENT_COMMAND"),dh=V("DROP_COMMAND"),kN=V("FORMAT_ELEMENT_COMMAND"),fh=V("DRAGSTART_COMMAND"),gh=V("DRAGOVER_COMMAND"),hh=V("DRAGEND_COMMAND"),Ic=V("COPY_COMMAND"),Fc=V("CUT_COMMAND"),ic=V("SELECT_ALL_COMMAND"),PN=V("CLEAR_EDITOR_COMMAND"),KN=V("CLEAR_HISTORY_COMMAND"),BN=V("CAN_REDO_COMMAND"),WN=V("CAN_UNDO_COMMAND"),ph=V("FOCUS_COMMAND"),_h=V("BLUR_COMMAND"),mh=V("KEY_MODIFIER_COMMAND"),Ln=Object.freeze({}),lc=[["keydown",function(t,e){if(Ss=t.timeStamp,Ch=t.key,e.isComposing())return;P(e,$c,t)}],["pointerdown",function(t,e){let{target:n,pointerType:o}=t;Er(n)&&o!=="touch"&&o!=="pen"&&t.button===0&&hn(e,()=>{Xh(n)||(uc=!0)})}],["compositionstart",function(t,e){P(e,Ac,t)}],["compositionend",function(t,e){ro?ls=!0:Es||!Pi&&!Ki?P(e,vc,t):(Ci=!0,xi=t.data)}],["input",function(t,e){t.stopPropagation(),hn(e,()=>{e.dispatchCommand(Mc,t)},{event:t}),cr=null}],["click",function(t,e){hn(e,()=>{let n=ct(),o=nn(Ae(e)),r=Ko();if(o){if(G(n)){let s=n.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&n.isCollapsed()&&!Zt(i)&&Me().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r))o.removeAllRanges(),n.dirty=!0;else if(t.detail===3&&!n.isCollapsed()){if(i!==n.focus.getNode()){let l=fs(i,(a)=>D(a)&&!a.isInline());D(l)&&l.select(0)}}}else if(t.pointerType==="touch"||t.pointerType==="pen"){let s=o.anchorNode;if(de(s)||pn(s))ye(Ui(r,o,e,t))}}P(e,jg,t)})}],["cut",Ln],["copy",Ln],["dragstart",Ln],["dragover",Ln],["dragend",Ln],["paste",Ln],["focus",Ln],["blur",Ln],["drop",Ln]];Ti&&lc.push(["beforeinput",(t,e)=>function(n,o){let r=n.inputType;if(r==="deleteCompositionText"||ro&&sp(o))return;if(r==="insertCompositionText")return;P(o,Oc,n)}(t,e)]);var Ss=0,Ch=null,xh=0,cr=null,ac=new WeakMap,wi=new WeakMap,cc=!1,uc=!1,cs=!1,ls=!1,Ci=!1,xi="",Ao=null,yh=[0,"",0,"root",0];function Sh(t,e,n,o,r){let{anchor:s,focus:i}=t,l=s.getNode(),a=_t(),c=nn(Ae(a)),u=c!==null?c.anchorNode:null,d=s.key,f=a.getElementByKey(d),h=n.length;return d!==i.key||!B(l)||(!r&&(!Ti||xh<o+50)||l.isDirty()&&h<2||tp(n))&&s.offset!==i.offset&&!l.isComposing()||Kn(l)||l.isDirty()&&h>1||(r||!Ti)&&f!==null&&!l.isComposing()&&u!==$o(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==t.format||l.getStyle()!==t.style)||function(p,g){if(g.isSegmented())return!0;if(!p.isCollapsed())return!1;let _=p.anchor.offset,m=g.getParentOrThrow(),C=no(g);return _===0?!g.canInsertTextBefore()||!m.canInsertTextBefore()&&!g.isComposing()||C||function(x){let N=x.getPreviousSibling();return(B(N)||D(N)&&N.isInline())&&!N.canInsertTextAfter()}(g):_===g.getTextContentSize()&&(!g.canInsertTextAfter()||!m.canInsertTextAfter()&&!g.isComposing()||C)}(t,l)}function rg(t,e){return pn(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function sg(t,e,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=t;cc&&(cc=!1,rg(o,r)&&rg(s,i)&&!Ao)||hn(e,()=>{if(!n)return void ye(null);if(!Ms(e,o,s))return;let l=ct();if(Ao&&G(l)&&l.isCollapsed()){let a=l.anchor,c=Ao.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ao.clone(),ye(l))}if(Ao=null,G(l)){let a=l.anchor,c=a.getNode();if(l.isCollapsed()){t.type==="Range"&&t.anchorNode===t.focusNode&&(l.dirty=!0);let u=Ae(e).event,d=u?u.timeStamp:performance.now(),[f,h,p,g,_]=yh,m=Me(),C=e.isComposing()===!1&&m.getTextContent()==="";if(d<_+200&&a.offset===p&&a.key===g)yi(l,f,h);else if(a.type==="text")B(c)||R(141),Nh(l,c);else if(a.type==="element"&&!C){D(c)||R(259);let x=a.getNode();x.isEmpty()?function(N,T){let y=T.getTextFormat(),S=T.getTextStyle();yi(N,y,S)}(l,x):yi(l,l.format,"")}}else{let u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,p=l.isBackward(),g=p?i:r,_=p?r:i,m=p?d:u,C=p?u:d,x=2047,N=!1;for(let T=0;T<h;T++){let y=f[T],S=y.getTextContentSize();if(B(y)&&S!==0&&!(T===0&&y.__key===m&&g===S||T===h-1&&y.__key===C&&_===0)&&(N=!0,x&=y.getFormat(),x===0))break}l.format=N?x:0}}P(e,bc,void 0)})}function yi(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function Nh(t,e){yi(t,e.getFormat(),e.getStyle())}function Th(t){if(!t.getTargetRanges)return null;let e=t.getTargetRanges();return e.length===0?null:e[0]}function zN(t){let e=t.inputType,n=Th(t),o=_t(),r=ct();if(e==="deleteContentBackward"){if(r===null){let d=Ko();if(!G(d))return!0;ye(d.clone())}if(G(r)){let d=r.anchor.key===r.focus.key;if(s=t.timeStamp,Ch==="MediaLast"&&s<Ss+30&&o.isComposing()&&d){if(Ht(null),Ss=0,setTimeout(()=>{hn(o,()=>{Ht(null)})},30),G(r)){let f=r.anchor.getNode();f.markDirty(),B(f)||R(142),Nh(r,f)}}else{Ht(null),t.preventDefault();let f=r.anchor.getNode(),h=f.getTextContent(),p=f.canInsertTextAfter(),g=r.anchor.offset===0&&r.focus.offset===h.length,_=Va&&d&&!g&&p;if(_&&r.isCollapsed()&&(_=!Ct(rp(r.anchor,!0))),!_){P(o,Cs,!0);let m=ct();Va&&G(m)&&m.isCollapsed()&&(Ao=m,setTimeout(()=>Ao=null))}}return!0}}var s;if(!G(r))return!0;let i=t.data;cr!==null&&Xc(!1,o,cr),r.dirty&&cr===null||!r.isCollapsed()||Zt(r.anchor.getNode())||n===null||r.applyDOMRange(n),cr=null;let{anchor:l,focus:a}=r,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===`
5
- `)t.preventDefault(),P(o,as,!1);else if(i===Bi)t.preventDefault(),P(o,rc,void 0);else if(i==null&&t.dataTransfer){let d=t.dataTransfer.getData("text/plain");t.preventDefault(),r.insertRawText(d)}else i!=null&&Sh(r,n,i,t.timeStamp,!0)?(t.preventDefault(),P(o,fr,i)):cr=i;return xh=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":P(o,fr,t);break;case"insertFromComposition":Ht(null),P(o,fr,t);break;case"insertLineBreak":Ht(null),P(o,as,!1);break;case"insertParagraph":Ht(null),cs&&!Es?(cs=!1,P(o,as,!1)):P(o,rc,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":P(o,Dc,t);break;case"deleteByComposition":(function(d,f){return d!==f||D(d)||D(f)||!no(d)||!no(f)})(c,u)&&P(o,sc,t);break;case"deleteByDrag":case"deleteByCut":P(o,sc,t);break;case"deleteContent":P(o,Cs,!1);break;case"deleteWordBackward":P(o,xs,!0);break;case"deleteWordForward":P(o,xs,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":P(o,ys,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":P(o,ys,!1);break;case"formatStrikeThrough":P(o,to,"strikethrough");break;case"formatBold":P(o,to,"bold");break;case"formatItalic":P(o,to,"italic");break;case"formatUnderline":P(o,to,"underline");break;case"historyUndo":P(o,wc,void 0);break;case"historyRedo":P(o,Rc,void 0)}return!0}function HN(t){if(de(t.target)&&Xh(t.target))return!0;let e=_t(),n=ct(),o=t.data,r=Th(t);if(o!=null&&G(n)&&Sh(n,r,o,t.timeStamp,!1)){ls&&(Ri(e,o),ls=!1);let s=n.anchor.getNode(),i=nn(Ae(e));if(i===null)return!0;let l=n.isBackward(),a=l?n.anchor.offset:n.focus.offset,c=l?n.focus.offset:n.anchor.offset;Ti&&!n.isCollapsed()&&B(s)&&i.anchorNode!==null&&s.getTextContent().slice(0,a)+o+s.getTextContent().slice(a+c)===np(i.anchorNode)||P(e,fr,o);let u=o.length;ro&&u>1&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(n.anchor.offset-=u),Va&&e.isComposing()&&(Ss=0,Ht(null))}else Xc(!1,e,o!==null?o:void 0),ls&&(Ri(e,o||void 0),ls=!1);return function(){zt();let s=_t();Ug(s)}(),!0}function UN(t){let e=_t(),n=ct();if(G(n)&&!e.isComposing()){let o=n.anchor,r=n.anchor.getNode();Ht(o.key),qi(Dh),(t.timeStamp<Ss+30||o.type==="element"||!n.isCollapsed()||r.getFormat()!==n.format||B(r)&&r.getStyle()!==n.style)&&P(e,fr,Sc)}return!0}function YN(t){return Ri(_t(),t.data),qi(wh),!0}function Ri(t,e){let n=t._compositionKey;if(Ht(null),n!==null&&e!=null){if(e===""){let o=Ft(n),r=$o(t.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&B(o)){let s=nn(Ae(t)),i=null,l=null;s!==null&&s.anchorNode===r&&(i=s.anchorOffset,l=s.focusOffset),qc(o,r.nodeValue,i,l,!0)}return}if(e[e.length-1]===`
6
- `){let o=ct();if(G(o)||bs(o)){if(G(o)){let r=o.focus;o.anchor.set(r.key,r.offset,r.type)}return void P(t,Di,null)}}}Xc(!0,t,e)}function GN(t){let e=_t();if(t.key==null)return!0;if(Ci){if(Rg(t))return hn(e,()=>{Ri(e,xi)}),Ci=!1,xi="",!0;Ci=!1,xi=""}if(function(n){return dt(n,"ArrowRight",{shiftKey:"any"})}(t))P(e,th,t);else if(function(n){return dt(n,"ArrowRight",Pn)}(t))P(e,eh,t);else if(function(n){return dt(n,"ArrowLeft",{shiftKey:"any"})}(t))P(e,nh,t);else if(function(n){return dt(n,"ArrowLeft",Pn)}(t))P(e,oh,t);else if(function(n){return dt(n,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))P(e,rh,t);else if(function(n){return dt(n,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))P(e,sh,t);else if(function(n){return dt(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))cs=!0,P(e,Di,t);else if(function(n){return n.key===" "}(t))P(e,ih,t);else if(function(n){return Ve&&dt(n,"o",{ctrlKey:!0})}(t))t.preventDefault(),cs=!0,P(e,as,!0);else if(function(n){return dt(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))cs=!1,P(e,Di,t);else if(function(n){return dt(n,"Backspace",{shiftKey:"any"})||Ve&&dt(n,"h",{ctrlKey:!0})}(t))Rg(t)?P(e,lh,t):(t.preventDefault(),P(e,Cs,!0));else if(function(n){return n.key==="Escape"}(t))P(e,ah,t);else if(function(n){return dt(n,"Delete",{})||Ve&&dt(n,"d",{ctrlKey:!0})}(t))!function(n){return n.key==="Delete"}(t)?(t.preventDefault(),P(e,Cs,!1)):P(e,ch,t);else if(function(n){return dt(n,"Backspace",wg)}(t))t.preventDefault(),P(e,xs,!0);else if(function(n){return dt(n,"Delete",wg)}(t))t.preventDefault(),P(e,xs,!1);else if(function(n){return Ve&&dt(n,"Backspace",{metaKey:!0})}(t))t.preventDefault(),P(e,ys,!0);else if(function(n){return Ve&&(dt(n,"Delete",{metaKey:!0})||dt(n,"k",{ctrlKey:!0}))}(t))t.preventDefault(),P(e,ys,!1);else if(function(n){return dt(n,"b",Pn)}(t))t.preventDefault(),P(e,to,"bold");else if(function(n){return dt(n,"u",Pn)}(t))t.preventDefault(),P(e,to,"underline");else if(function(n){return dt(n,"i",Pn)}(t))t.preventDefault(),P(e,to,"italic");else if(function(n){return dt(n,"Tab",{shiftKey:"any"})}(t))P(e,uh,t);else if(function(n){return dt(n,"z",Pn)}(t))t.preventDefault(),P(e,wc,void 0);else if(function(n){if(Ve)return dt(n,"z",{metaKey:!0,shiftKey:!0});return dt(n,"y",{ctrlKey:!0})||dt(n,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),P(e,Rc,void 0);else{let n=e._editorState._selection;n===null||G(n)?$g(t)&&(t.preventDefault(),P(e,ic,t)):!function(o){return dt(o,"c",Pn)}(t)?!function(o){return dt(o,"x",Pn)}(t)?$g(t)&&(t.preventDefault(),P(e,ic,t)):(t.preventDefault(),P(e,Fc,t)):(t.preventDefault(),P(e,Ic,t))}return function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey}(t)&&e.dispatchCommand(mh,t),!0}function Eh(t){let e=t.__lexicalEventHandles;return e===void 0&&(e=[],t.__lexicalEventHandles=e),e}var gr=new Map;function bh(t){let e=cp(t.target);if(e===null)return;let n=Gc(e.anchorNode);if(n===null)return;uc&&(uc=!1,hn(n,()=>{let a=Ko(),c=e.anchorNode;if(de(c)||pn(c))ye(Ui(a,e,n,t))}));let o=Vc(n),r=o[o.length-1],s=r._key,i=gr.get(s),l=i||r;l!==n&&sg(e,l,!1),sg(e,n,!0),n!==r?gr.set(s,n):i&&gr.delete(s)}function ig(t){t._lexicalHandled=!0}function lg(t){return t._lexicalHandled===!0}var ag=()=>{};function JN(t){let e=ac.get(t);if(e===void 0)return void ag();let n=wi.get(e);if(n===void 0)return void ag();let o=n-1;o>=0||R(164),ac.delete(t),wi.set(e,o),o===0&&e.removeEventListener("selectionchange",bh);let r=As(t);Ji(r)?(function(i){if(i._parentEditor!==null){let l=Vc(i),a=l[l.length-1]._key;gr.get(a)===i&&gr.delete(a)}else gr.delete(i._key)}(r),t.__lexicalEditor=null):r&&R(198);let s=Eh(t);for(let i=0;i<s.length;i++)s[i]();t.__lexicalEventHandles=[]}function dc(t,e,n){zt();let o=t.__key,r=t.getParent();if(r===null)return;let s=function(l){let a=ct();if(!G(a)||!D(l))return a;let{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return ki(d,l)&&c.set(l.__key,0,"element"),ki(f,l)&&u.set(l.__key,0,"element"),a}(t),i=!1;if(G(s)&&e){let{anchor:l,focus:a}=s;l.key===o&&(Fi(l,t,r,t.getPreviousSibling(),t.getNextSibling()),i=!0),a.key===o&&(Fi(a,t,r,t.getPreviousSibling(),t.getNextSibling()),i=!0)}else bs(s)&&e&&t.isSelected()&&t.selectPrevious();if(G(s)&&e&&!i){let l=t.getIndexWithinParent();oo(t),Ii(s,r,l,-1)}else oo(t);n||ke(r)||r.canBeEmpty()||!r.isEmpty()||dc(r,e),e&&s&&Zt(r)&&r.isEmpty()&&r.selectEnd()}function VN(t){return t}var Oh=Symbol.for("ephemeral");function $i(t){return t[Oh]||!1}class Ze{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:t}=ws(this);return t===void 0&&R(64,this.name),t}static clone(t){R(65,this.name)}$config(){return{}}config(t,e){let n=e.extends||Object.getPrototypeOf(this.constructor);return Object.assign(e,{extends:n,type:t}),{[t]:e}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}resetOnCopyNodeFrom(t){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Zh(this,t)}getType(){return this.__type}isInline(){R(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;let e=Ft(t);if(e===null)break;t=e.__parent}return!1}isSelected(t){let e=t||ct();if(e==null)return!1;let n=e.getNodes().some((o)=>o.__key===this.__key);if(B(this))return n;if(G(e)&&e.anchor.type==="element"&&e.focus.type==="element"){if(e.isCollapsed())return!1;let o=this.getParent();if(Ct(this)&&this.isInline()&&o){let r=e.isBackward()?e.focus:e.anchor;if(o.is(r.getNode())&&r.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let t=this.getParent();if(t===null)return-1;let e=t.getFirstChild(),n=0;for(;e!==null;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){let t=this.getLatest().__parent;return t===null?null:Ft(t)}getParentOrThrow(){let t=this.getParent();return t===null&&R(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){let e=t.getParent();if(ke(e))return D(t)||t===this&&Ct(t)||R(194),t;t=e}return null}getTopLevelElementOrThrow(){let t=this.getTopLevelElement();return t===null&&R(67,this.__key),t}getParents(){let t=[],e=this.getParent();for(;e!==null;)t.push(e),e=e.getParent();return t}getParentKeys(){let t=[],e=this.getParent();for(;e!==null;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){let t=this.getLatest().__prev;return t===null?null:Ft(t)}getPreviousSiblings(){let t=[],e=this.getParent();if(e===null)return t;let n=e.getFirstChild();for(;n!==null&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){let t=this.getLatest().__next;return t===null?null:Ft(t)}getNextSiblings(){let t=[],e=this.getNextSibling();for(;e!==null;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){let e=D(this)?this:this.getParent(),n=D(t)?t:t.getParent(),o=e&&n?gs(e,n):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){let e=gs(this,t);return e!==null&&(e.type==="descendant"||(e.type==="branch"?cu(e)===-1:(e.type!=="same"&&e.type!=="ancestor"&&R(279),!1)))}isParentOf(t){let e=gs(this,t);return e!==null&&e.type==="ancestor"}getNodesBetween(t){let e=this.isBefore(t),n=[],o=new Set,r=this;for(;r!==null;){let s=r.__key;if(o.has(s)||(o.add(s),n.push(r)),r===t)break;let i=D(r)?e?r.getFirstChild():r.getLastChild():null;if(i!==null){r=i;continue}let l=e?r.getNextSibling():r.getPreviousSibling();if(l!==null){r=l;continue}let a=r.getParentOrThrow();if(o.has(a.__key)||n.push(a),a===t)break;let c=null,u=a;do{if(u===null&&R(68),c=e?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;c!==null||o.has(u.__key)||n.push(u)}while(c===null);r=c}return e||n.reverse(),n}isDirty(){let t=_t()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if($i(this))return this;let t=Ft(this.__key);return t===null&&R(113),t}getWritable(){if($i(this))return this;zt();let t=Yn(),e=_t(),n=t._nodeMap,o=this.__key,r=this.getLatest(),s=e._cloneNotNeeded,i=ct();if(i!==null&&i.setCachedNodes(null),s.has(o))return Li(r),r;let l=nu(r);return s.add(o),Li(l),n.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,e){R(70)}updateDOM(t,e,n){R(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){let t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){R(18,this.name)}updateFromJSON(t){return function(e,n){let o=e.getWritable(),r=n.$,s=r;for(let i of Vg(o).flatKeys)i in n&&(s!==void 0&&s!==r||(s={...r}),s[i]=n[i]);return(o.__state||s)&&Ec(e).updateFromJSON(s),o}(this,t)}static transform(){return null}remove(t){dc(this,!0,t)}replace(t,e){zt();let n=ct();n!==null&&(n=n.clone()),Ya(this,t);let o=this.getLatest(),r=this.__key,s=t.__key,i=t.getWritable(),l=this.getParentOrThrow().getWritable(),a=l.__size;oo(i);let c=o.getPreviousSibling(),u=o.getNextSibling(),d=o.__prev,f=o.__next,h=o.__parent;if(dc(o,!1,!0),c===null)l.__first=s;else c.getWritable().__next=s;if(i.__prev=d,u===null)l.__last=s;else u.getWritable().__prev=s;if(i.__next=f,i.__parent=h,l.__size=a,e&&(D(this)&&D(i)||R(139),this.getChildren().forEach((p)=>{i.append(p)})),G(n)){ye(n);let{anchor:p,focus:g}=n;p.key===r&&fg(p,i),g.key===r&&fg(g,i)}return eo()===r&&Ht(s),i}insertAfter(t,e=!0){zt(),Ya(this,t);let n=this.getWritable(),o=t.getWritable(),r=o.getParent(),s=ct(),i=!1,l=!1;if(r!==null){let f=t.getIndexWithinParent();if(oo(o),G(s)){let h=r.__key,p=s.anchor,g=s.focus;i=p.type==="element"&&p.key===h&&p.offset===f+1,l=g.type==="element"&&g.key===h&&g.offset===f+1}}let a=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=o.__key,d=n.__next;if(a===null)c.__last=u;else a.getWritable().__prev=u;if(c.__size++,n.__next=u,o.__next=d,o.__prev=n.__key,o.__parent=n.__parent,e&&G(s)){let f=this.getIndexWithinParent();Ii(s,c,f+1);let h=c.__key;i&&s.anchor.set(h,f+2,"element"),l&&s.focus.set(h,f+2,"element")}return t}insertBefore(t,e=!0){zt(),Ya(this,t);let n=this.getWritable(),o=t.getWritable(),r=o.__key;oo(o);let s=this.getPreviousSibling(),i=this.getParentOrThrow().getWritable(),l=n.__prev,a=this.getIndexWithinParent();if(s===null)i.__first=r;else s.getWritable().__next=r;i.__size++,n.__prev=r,o.__prev=l,o.__next=n.__key,o.__parent=n.__parent;let c=ct();if(e&&G(c))Ii(c,this.getParentOrThrow(),a);return t}isParentRequired(){return!1}createParentElementNode(){return zn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){zt();let n=this.getPreviousSibling(),o=this.getParentOrThrow();if(n===null)return o.select(0,0);if(D(n))return n.select();if(!B(n)){let r=n.getIndexWithinParent()+1;return o.select(r,r)}return n.select(t,e)}selectNext(t,e){zt();let n=this.getNextSibling(),o=this.getParentOrThrow();if(n===null)return o.select();if(D(n))return n.select(0,0);if(!B(n)){let r=n.getIndexWithinParent();return o.select(r,r)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}var XN="historic",qN="history-push",Si="history-merge",ZN="paste",Mh="collaboration",QN="skip-collab",Ah="skip-scroll-into-view",vh="skip-dom-selection",fc="skip-selection-focus",Dh="composition-start",wh="composition-end";class xr extends Ze{static getType(){return"linebreak"}static clone(t){return new xr(t.__key)}constructor(t){super(t)}getTextContent(){return`
7
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:(t)=>function(e){let n=e.parentElement;if(n!==null&&_c(n)){let o=n.firstChild;if(o===e||o.nextSibling===e&&gi(o)){let r=n.lastChild;if(r===e||r.previousSibling===e&&gi(r))return!0}}return!1}(t)||function(e){let n=e.parentElement;if(n!==null&&_c(n)){let o=n.firstChild;if(o===e||o.nextSibling===e&&gi(o))return!1;let r=n.lastChild;if(r===e||r.previousSibling===e&&gi(r))return!0}return!1}(t)?null:{conversion:jN,priority:0}}}static importJSON(t){return pr().updateFromJSON(t)}}function jN(t){return{node:pr()}}function pr(){return Ds(new xr)}function vo(t){return t instanceof xr}function gi(t){return pn(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Ba(t,e){return 16&e?"code":e&yc?"mark":32&e?"sub":64&e?"sup":null}function Wa(t,e){return 1&e?"strong":2&e?"em":"span"}function Rh(t,e,n,o,r){let s=o.classList,i=hr(r,"base");i!==void 0&&s.add(...i),i=hr(r,"underlineStrikethrough");let l=!1,a=8&e&&4&e;i!==void 0&&(8&n&&4&n?(l=!0,a||s.add(...i)):a&&s.remove(...i));for(let c in ne){let u=ne[c];if(i=hr(r,c),i!==void 0)if(n&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...i);continue}((e&u)===0||a&&c==="underline"||c==="strikethrough")&&s.add(...i)}else e&u&&s.remove(...i)}}function $h(t,e,n){let o=e.firstChild,r=n.isComposing(),s=t+(r?ps:"");if(o==null)e.textContent=s;else{let i=o.nodeValue;if(i!==s)if(r||ro){let[l,a,c]=function(u,d){let f=u.length,h=d.length,p=0,g=0;for(;p<f&&p<h&&u[p]===d[p];)p++;for(;g+p<f&&g+p<h&&u[f-g-1]===d[h-g-1];)g++;return[p,f-p-g,d.slice(p,h-g)]}(i,s);a!==0&&o.deleteData(l,a),o.insertData(l,c)}else o.nodeValue=s}}function cg(t,e,n,o,r,s){$h(r,t,e);let i=s.theme.text;i!==void 0&&Rh(0,0,o,t,i)}function hi(t,e){let n=document.createElement(e);return n.appendChild(t),n}class ko extends Ze{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new ko(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",e){super(e),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let t=this.getLatest();return yN[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===eo()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){let e=ne[t];return(this.getFormat()&e)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return Ns(this.getLatest().__format,t,e)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,e){let n=this.__format,o=Ba(0,n),r=Wa(0,n),s=o===null?r:o,i=document.createElement(s),l=i;this.hasFormat("code")&&i.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(r),i.appendChild(l)),cg(l,this,0,n,this.__text,t);let a=this.__style;return a!==""&&(i.style.cssText=a),i}updateDOM(t,e,n){let o=this.__text,r=t.__format,s=this.__format,i=Ba(0,r),l=Ba(0,s),a=Wa(0,r),c=Wa(0,s);if((i===null?a:i)!==(l===null?c:l))return!0;if(i===l&&a!==c){let p=e.firstChild;p==null&&R(48);let g=document.createElement(c);return cg(g,this,0,s,o,n),e.replaceChild(g,p),!1}let u=e;l!==null&&i!==null&&(u=e.firstChild,u==null&&R(49)),$h(o,u,this);let d=n.theme.text;d!==void 0&&r!==s&&Rh(0,r,s,u,d);let f=t.__style,h=this.__style;return f!==h&&(e.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:oT,priority:0}),b:()=>({conversion:eT,priority:0}),code:()=>({conversion:kn,priority:0}),em:()=>({conversion:kn,priority:0}),i:()=>({conversion:kn,priority:0}),mark:()=>({conversion:kn,priority:0}),s:()=>({conversion:kn,priority:0}),span:()=>({conversion:tT,priority:0}),strong:()=>({conversion:kn,priority:0}),sub:()=>({conversion:kn,priority:0}),sup:()=>({conversion:kn,priority:0}),u:()=>({conversion:kn,priority:0})}}static importJSON(t){return Wt().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:e}=super.exportDOM(t);return de(e)||R(132),e.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?e.style.textTransform="lowercase":this.hasFormat("uppercase")?e.style.textTransform="uppercase":this.hasFormat("capitalize")&&(e.style.textTransform="capitalize"),this.hasFormat("bold")&&(e=hi(e,"b")),this.hasFormat("italic")&&(e=hi(e,"i")),this.hasFormat("strikethrough")&&(e=hi(e,"s")),this.hasFormat("underline")&&(e=hi(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,e){}setFormat(t){let e=this.getWritable();return e.__format=typeof t=="string"?ne[t]:t,e}setDetail(t){let e=this.getWritable();return e.__detail=typeof t=="string"?mN[t]:t,e}setStyle(t){let e=this.getWritable();return e.__style=t,e}toggleFormat(t){let e=Ns(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){let t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){let t=this.getWritable();return t.__detail^=2,t}setMode(t){let e=xN[t];if(this.__mode===e)return this;let n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;let e=this.getWritable();return e.__text=t,e}select(t,e){zt();let n=t,o=e,r=ct(),s=this.getTextContent(),i=this.__key;if(typeof s=="string"){let l=s.length;n===void 0&&(n=l),o===void 0&&(o=l)}else n=0,o=0;if(!G(r))return kh(i,n,i,o,"text","text");{let l=eo();l!==r.anchor.key&&l!==r.focus.key||Ht(i),r.setTextNodeRange(this,n,this,o)}return r}selectStart(){return this.select(0,0)}selectEnd(){let t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,o){let r=this.getWritable(),s=r.__text,i=n.length,l=t;l<0&&(l=i+l,l<0&&(l=0));let a=ct();if(o&&G(a)){let u=t+i;a.setTextNodeRange(r,u,r,u)}let c=s.slice(0,l)+n+s.slice(l+e);return r.__text=c,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){zt();let e=this.getLatest(),n=e.getTextContent();if(n==="")return[];let o=e.__key,r=eo(),s=n.length;t.sort((S,E)=>S-E),t.push(s);let i=[],l=t.length;for(let S=0,E=0;S<s&&E<=l;E++){let O=t[E];O>S&&(i.push(n.slice(S,O)),S=O)}let a=i.length;if(a===1)return[e];let c=i[0],u=e.getParent(),d,f=e.getFormat(),h=e.getStyle(),p=e.__detail,g=!1,_=null,m=null,C=ct();if(G(C)){let[S,E]=C.isBackward()?[C.focus,C.anchor]:[C.anchor,C.focus];S.type==="text"&&S.key===o&&(_=S),E.type==="text"&&E.key===o&&(m=E)}e.isSegmented()?(d=Wt(c),d.__format=f,d.__style=h,d.__detail=p,d.__state=Zf(e,d),g=!0):d=e.setTextContent(c);let x=[d];for(let S=1;S<a;S++){let E=Wt(i[S]);E.__format=f,E.__style=h,E.__detail=p,E.__state=Zf(e,E);let O=E.__key;r===o&&Ht(O),x.push(E)}let N=_?_.offset:null,T=m?m.offset:null,y=0;for(let S of x){if(!_&&!m)break;let E=y+S.getTextContentSize();if(_!==null&&N!==null&&N<=E&&N>=y&&(_.set(S.getKey(),N-y,"text"),N<E&&(_=null)),m!==null&&T!==null&&T<=E&&T>=y){m.set(S.getKey(),T-y,"text");break}y=E}if(u!==null){(function(O){let $=O.getPreviousSibling(),I=O.getNextSibling();$!==null&&Li($),I!==null&&Li(I)})(this);let S=u.getWritable(),E=this.getIndexWithinParent();g?(S.splice(E,0,x),this.remove()):S.splice(E,1,x),G(C)&&Ii(C,u,E,a-1)}return x}mergeWithSibling(t){let e=t===this.getPreviousSibling();e||t===this.getNextSibling()||R(50);let n=this.__key,o=t.__key,r=this.__text,s=r.length;eo()===o&&Ht(n);let i=ct();if(G(i)){let{anchor:u,focus:d}=i;u!==null&&u.key===o&&xg(u,e,n,t,s),d!==null&&d.key===o&&xg(d,e,n,t,s)}let l=t.__text,a=e?l+r:r+l;this.setTextContent(a);let c=this.getWritable();return t.remove(),c}isTextEntity(){return!1}}function tT(t){return{forChild:Lc(t.style),node:null}}function eT(t){let e=t,n=e.style.fontWeight==="normal";return{forChild:Lc(e.style,n?void 0:"bold"),node:null}}var ug=new WeakMap;function nT(t){if(!de(t))return!1;if(t.nodeName==="PRE")return!0;let e=t.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function oT(t){let e=t;t.parentElement===null&&R(129);let n=e.textContent||"";if(function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=ug.get(s))===void 0&&!nT(s);)i.push(s),s=s.parentNode;let l=r===void 0?s:r;for(let a=0;a<i.length;a++)ug.set(i[a],l);return l}(e)!==null){let o=n.split(/(\r?\n|\t)/),r=[],s=o.length;for(let i=0;i<s;i++){let l=o[i];l===`
8
- `||l===`\r
9
- `?r.push(pr()):l==="\t"?r.push(zi()):l!==""&&r.push(Wt(l))}return{node:r}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=e,r=!0;for(;o!==null&&(o=dg(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=e,r=!0;for(;o!==null&&(o=dg(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Wt(n)}}function dg(t,e){let n=t;for(;;){let o;for(;(o=e?n.nextSibling:n.previousSibling)===null;){let s=n.parentElement;if(s===null)return null;n=s}if(n=o,de(n)){let s=n.style.display;if(s===""&&!dp(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=e?n.firstChild:n.lastChild)!==null;)n=r;if(pn(n))return n;if(n.nodeName==="BR")return null}}var rT={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function kn(t){let e=rT[t.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Lc(t.style,e),node:null}}function Wt(t=""){return Ds(new ko(t))}function B(t){return t instanceof ko}function Lc(t,e){let n=t.fontWeight,o=t.textDecoration.split(" "),r=n==="700"||n==="bold",s=o.includes("line-through"),i=t.fontStyle==="italic",l=o.includes("underline"),a=t.verticalAlign;return(c)=>B(c)?(r&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),i&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e),c):c}class yr extends ko{static getType(){return"tab"}static clone(t){return new yr(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){let e=super.createDOM(t),n=hr(t.theme,"tab");if(n!==void 0)e.classList.add(...n);return e}static importJSON(t){return zi().updateFromJSON(t)}setTextContent(t){return t!=="\t"&&t!==""&&Pg(126),super.setTextContent("\t")}spliceText(t,e,n,o){return n===""&&e===0||n==="\t"&&e===1||R(286),this}setDetail(t){return t!==2&&R(127),this}setMode(t){return t!=="normal"&&R(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function zi(){return Ds(new yr)}function kc(t){return t instanceof yr}class Ih{key;offset;type;_selection;constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){if(this.key===t.key)return this.offset<t.offset;return au(Xe(lo(this,"next")),Xe(lo(t,"next")))<0}getNode(){let t=Ft(this.key);return t===null&&R(20),t}set(t,e,n,o){let r=this._selection,s=this.key;o&&this.key===t&&this.offset===e&&this.type===n||(this.key=t,this.offset=e,this.type=n,Sr()||(eo()===s&&Ht(t),r!==null&&(r.setCachedNodes(null),r.dirty=!0)))}}function tn(t,e,n){return new Ih(t,e,n)}function za(t,e){let n=e.__key,o=t.offset,r="element";if(B(e)){r="text";let s=e.getTextContentSize();o>s&&(o=s)}else if(!D(e)){let s=e.getNextSibling();if(B(s))n=s.__key,o=0,r="text";else{let i=e.getParent();i&&(n=i.__key,o=e.getIndexWithinParent()+1)}}t.set(n,o,r)}function fg(t,e){if(D(e)){let n=e.getLastDescendant();D(n)||B(n)?za(t,n):za(t,e)}else za(t,e)}class Hi{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!bs(t))return!1;let e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every((o)=>n.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Hi(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let e=this.getNodes(),n=e.length,o=e[n-1],r;if(B(o))r=o.select();else{let s=o.getIndexWithinParent()+1;r=o.getParentOrThrow().select(s,s)}r.insertNodes(t);for(let s=0;s<n;s++)e[s].remove()}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let e=this._nodes,n=[];for(let o of e){let r=Ft(o);r!==null&&n.push(r)}return Sr()||(this._cachedNodes=n),n}getTextContent(){let t=this.getNodes(),e="";for(let n=0;n<t.length;n++)e+=t[n].getTextContent();return e}deleteNodes(){let t=this.getNodes();if((ct()||Ko())===this&&t[0]){let e=Gt(t[0],"next");_p(io(e,e))}for(let e of t)e.remove()}}function G(t){return t instanceof Po}class Po{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,e,n,o){this.anchor=t,this.focus=e,t._selection=this,e._selection=this,this._cachedNodes=null,this.format=n,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!G(t)&&(this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let e=function(n){let o=[],[r,s]=n.getTextSlices();r&&o.push(r.caret.origin);let i=new Set,l=new Set;for(let a of n)if(Qe(a)){let{origin:c}=a;o.length===0?i.add(c):(l.add(c),o.push(c))}else{let{origin:c}=a;D(c)&&l.has(c)||o.push(c)}if(s&&o.push(s.caret.origin),Lo(n.focus)&&D(n.focus.origin)&&n.focus.getNodeAtCaret()===null)for(let a=Un(n.focus.origin,"previous");Qe(a)&&i.has(a.origin)&&!a.origin.isEmpty()&&a.origin.is(o[o.length-1]);a=mr(a))i.delete(a.origin),o.pop();for(;o.length>1;){let a=o[o.length-1];if(!D(a)||l.has(a)||a.isEmpty()||i.has(a))break;o.pop()}if(o.length===0&&n.isCollapsed()){let a=Xe(n.anchor),c=Xe(n.anchor.getFlipped()),u=(f)=>Hn(f)?f.origin:f.getNodeAtCaret(),d=u(a)||u(c)||(n.anchor.getNodeAtCaret()?a.origin:c.origin);o.push(d)}return o}(uu(xc(this),"next"));return Sr()||(this._cachedNodes=e),e}setTextNodeRange(t,e,n,o){this.anchor.set(t.__key,e,"text"),this.focus.set(n.__key,o,"text")}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let e=t[0],n=t[t.length-1],o=this.anchor,r=this.focus,s=o.isBefore(r),[i,l]=gc(this),a="",c=!0;for(let u=0;u<t.length;u++){let d=t[u];if(D(d)&&!d.isInline())c||(a+=`
10
- `),c=!d.isEmpty();else if(c=!1,B(d)){let f=d.getTextContent();d===e?d===n?o.type==="element"&&r.type==="element"&&r.offset!==o.offset||(f=i<l?f.slice(i,l):f.slice(l,i)):f=s?f.slice(i):f.slice(l):d===n&&(f=s?f.slice(0,l):f.slice(0,i)),a+=f}else!Ct(d)&&!vo(d)||d===n&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(t){let e=_t(),n=e.getEditorState()._selection,o=Lh(t.startContainer,t.startOffset,t.endContainer,t.endOffset,e,n);if(o===null)return;let[r,s]=o;this.anchor.set(r.key,r.offset,r.type,!0),this.focus.set(s.key,s.offset,s.type,!0),bi(this)}clone(){let t=this.anchor,e=this.focus;return new Po(tn(t.key,t.offset,t.type),tn(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=Ns(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){let e=ne[t];return(this.format&e)!==0}insertRawText(t){let e=t.split(/(\r?\n|\t)/),n=[],o=e.length;for(let r=0;r<o;r++){let s=e[r];s===`
11
- `||s===`\r
12
- `?n.push(pr()):s==="\t"?n.push(zi()):n.push(Wt(s))}this.insertNodes(n)}insertText(t){let e=this.anchor,n=this.focus,o=this.format,r=this.style,s=e,i=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,i=e),s.type==="element"&&function(g,_,m,C){let x=g.getNode(),N=x.getChildAtIndex(g.offset),T=Wt();if(T.setFormat(m),T.setStyle(C),Yh(N))N.splice(0,0,[T]);else{let y=Zt(x)?zn().append(T):T;N===null?x.append(y):N.insertBefore(y)}g.is(_)&&_.set(T.__key,0,"text"),g.set(T.__key,0,"text")}(s,i,o,r),i.type==="element"&&Cr(i,Xe(lo(i,"next")));let l=s.offset,a=i.offset,c=this.getNodes(),u=c.length,d=c[0];B(d)||R(26);let f=d.getTextContent().length,h=d.getParentOrThrow(),p=c[u-1];if(u===1&&i.type==="element"&&(a=f,i.set(s.key,a,"text")),this.isCollapsed()&&l===f&&(Kn(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let g=d.getNextSibling();if(B(g)&&g.canInsertTextBefore()&&!Kn(g)||(g=Wt(),g.setFormat(o),g.setStyle(r),h.canInsertTextAfter()?d.insertAfter(g):h.insertAfter(g)),g.select(0,0),d=g,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(Kn(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let g=d.getPreviousSibling();if(B(g)&&!Kn(g)||(g=Wt(),g.setFormat(o),h.canInsertTextBefore()?d.insertBefore(g):h.insertBefore(g)),g.select(),d=g,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==f){let g=Wt(d.getTextContent());g.setFormat(o),d.replace(g),d=g}else if(!this.isCollapsed()&&t!==""){let g=p.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||D(g)&&(!g.canInsertTextBefore()||!g.canInsertTextAfter()))return this.insertText(""),Fh(this.anchor,this.focus),void this.insertText(t)}if(u===1){if(no(d)){let C=Wt(t);return C.select(),void d.replace(C)}let g=d.getFormat(),_=d.getStyle();if(l!==a||g===o&&_===r){if(kc(d)){let C=Wt(t);return C.setFormat(o),C.setStyle(r),C.select(),void d.replace(C)}}else{if(d.getTextContent()!==""){let C=Wt(t);if(C.setFormat(o),C.setStyle(r),C.select(),l===0)d.insertBefore(C,!1);else{let[x]=d.splitText(l);x.insertAfter(C,!1)}return void(C.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(r)}let m=a-l;d=d.spliceText(l,m,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=g,this.style=_,d.isComposing()&&(this.anchor.offset-=t.length))}else{let g=new Set([...d.getParentKeys(),...p.getParentKeys()]),_=D(d)?d:d.getParentOrThrow(),m=D(p)?p:p.getParentOrThrow(),C=p;if(!_.is(m)&&m.isInline())do C=m,m=m.getParentOrThrow();while(m.isInline());if(i.type==="text"&&(a!==0||p.getTextContent()==="")||i.type==="element"&&p.getIndexWithinParent()<a)if(B(p)&&!no(p)&&a!==p.getTextContentSize()){if(p.isSegmented()){let S=Wt(p.getTextContent());p.replace(S),p=S}Zt(i.getNode())||i.type!=="text"||(p=p.spliceText(0,a,"")),g.add(p.__key)}else{let S=p.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?p.remove():S.remove()}else g.add(p.__key);let x=m.getChildren(),N=new Set(c),T=_.is(m),y=_.isInline()&&d.getNextSibling()===null?_:d;for(let S=x.length-1;S>=0;S--){let E=x[S];if(E.is(d)||D(E)&&E.isParentOf(d))break;E.isAttached()&&(!N.has(E)||E.is(C)?T||y.insertAfter(E,!1):E.remove())}if(!T){let S=m,E=null;for(;S!==null;){let O=S.getChildren(),$=O.length;($===0||O[$-1].is(E))&&(g.delete(S.__key),E=S),S=S.getParent()}}if(no(d))if(l===f)d.select();else{let S=Wt(t);S.select(),d.replace(S)}else d=d.spliceText(l,f-l,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=t.length));for(let S=1;S<u;S++){let E=c[S],O=E.__key;g.has(O)||E.remove()}}}removeText(){let t=ct()===this;hs(this,mp(xc(this))),t&&ct()!==this&&ye(this)}formatText(t,e=null){if(this.isCollapsed())return this.toggleFormat(t),void Ht(null);let n=this.getNodes(),o=[];for(let x of n)B(x)&&o.push(x);let r=(x)=>{n.forEach((N)=>{if(D(N)){let T=N.getFormatFlags(t,x);N.setTextFormat(T)}})},s=o.length;if(s===0)return this.toggleFormat(t),Ht(null),void r(e);let i=this.anchor,l=this.focus,a=this.isBackward(),c=a?l:i,u=a?i:l,d=0,f=o[0],h=c.type==="element"?0:c.offset;if(c.type==="text"&&h===f.getTextContentSize()&&(d=1,f=o[1],h=0),f==null)return;let p=f.getFormatFlags(t,e);r(p);let g=s-1,_=o[g],m=u.type==="text"?u.offset:_.getTextContentSize();if(f.is(_)){if(h===m)return;if(Kn(f)||h===0&&m===f.getTextContentSize())f.setFormat(p);else{let x=f.splitText(h,m),N=h===0?x[0]:x[1];N.setFormat(p),c.type==="text"&&c.set(N.__key,0,"text"),u.type==="text"&&u.set(N.__key,m-h,"text")}return void(this.format=p)}h===0||Kn(f)||([,f]=f.splitText(h),h=0),f.setFormat(p);let C=_.getFormatFlags(t,p);m>0&&(m===_.getTextContentSize()||Kn(_)||([_]=_.splitText(m)),_.setFormat(C));for(let x=d+1;x<g;x++){let N=o[x],T=N.getFormatFlags(t,C);N.setFormat(T)}c.type==="text"&&c.set(f.__key,h,"text"),u.type==="text"&&u.set(_.__key,m,"text"),this.format=p|C}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let h=ct();return G(h)||R(134),h.insertNodes(t)}let e=(this.isBackward()?this.focus:this.anchor).getNode(),n=fs(e,Wn),o=t[t.length-1];if(D(n)&&"__language"in n){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let h=Ha(this);n.splice(h,0,t),o.selectEnd()}return}if(!t.some((h)=>(D(h)||Ct(h))&&!h.isInline())){D(n)||R(211,e.constructor.name,e.getType());let h=Ha(this);return n.splice(h,0,t),void o.selectEnd()}let r=function(h){let p=zn(),g=null;for(let _=0;_<h.length;_++){let m=h[_],C=vo(m);if(C||Ct(m)&&m.isInline()||D(m)&&m.isInline()||B(m)||m.isParentRequired()){if(g===null&&(g=m.createParentElementNode(),p.append(g),C))continue;g!==null&&g.append(m)}else p.append(m),g=null}return p}(t),s=r.getLastDescendant(),i=r.getChildren(),l=!D(n)||!n.isEmpty()?this.insertParagraph():null,a=i[i.length-1],c=i[0];var u;D(u=c)&&Wn(u)&&!u.isEmpty()&&D(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(D(n)||R(211,e.constructor.name,e.getType()),n.append(...c.getChildren()),c=i[1]),c&&(n===null&&R(212,e.constructor.name,e.getType()),function(h,p){let g=p.getParentOrThrow().getLastChild(),_=p,m=[p];for(;_!==g;)_.getNextSibling()||R(140),_=_.getNextSibling(),m.push(_);let C=h;for(let x of m)C=C.insertAfter(x)}(n,c));let d=fs(s,Wn);l&&D(d)&&(l.canMergeWhenEmpty()||Wn(a))&&(d.append(...l.getChildren()),l.remove()),D(n)&&n.isEmpty()&&n.remove(),s.selectEnd();let f=D(n)?n.getLastChild():null;vo(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=zn();return Me().splice(this.anchor.offset,0,[s]),s.select(),s}let t=Ha(this),e=fs(this.anchor.getNode(),Wn);D(e)||R(213);let n=e.getChildAtIndex(t),o=n?[n,...n.getNextSiblings()]:[],r=e.insertNewAfter(this,!1);return r?(r.append(...o),r.selectStart(),r):null}insertLineBreak(t){let e=pr();if(this.insertNodes([e]),t){let n=e.getParentOrThrow(),o=e.getIndexWithinParent();n.select(o,o)}}extract(){let t=[...this.getNodes()],e=t.length,n=t[0],o=t[e-1],[r,s]=gc(this),i=this.isBackward(),[l,a]=i?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=i?[s,r]:[r,s];if(e===0)return[];if(e===1){if(B(n)&&!this.isCollapsed()){let d=n.splitText(c,u),f=c===0?d[0]:d[1];return f?(l.set(f.getKey(),0,"text"),a.set(f.getKey(),f.getTextContentSize(),"text"),[f]):[]}return[n]}if(B(n)&&(c===n.getTextContentSize()?t.shift():c!==0&&([,n]=n.splitText(c),t[0]=n,l.set(n.getKey(),0,"text"))),B(o)){let d=o.getTextContent().length;u===0?t.pop():u!==d&&([o]=o.splitText(u),t[t.length-1]=o,a.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,e,n){if(Sg(this,t,e,n))return;let o=t==="move",r=_t(),s=nn(Ae(r));if(!s)return;let{_blockCursorElement:i,_rootElement:l}=r,a=this.focus.getNode();if(l===null||i===null||!D(a)||a.isInline()||a.canBeEmpty()||pc(i,r,l),this.dirty){let c=_r(r,this.anchor.key),u=_r(r,this.focus.key);this.anchor.type==="text"&&(c=$o(c)),this.focus.type==="text"&&(u=$o(u)),c&&u&&Kh(s,c,this.anchor.offset,u,this.focus.offset)}if(function(c,u,d,f){c.modify(u,d,f)}(s,t,e?"backward":"forward",n),s.rangeCount>0){let c=s.getRangeAt(0),u=this.anchor.getNode(),d=Zt(u)?u:lp(u);if(this.applyDOMRange(c),this.dirty=!0,!o){let f=this.getNodes(),h=[],p=!1;for(let g=0;g<f.length;g++){let _=f[g];ki(_,d)?h.push(_):p=!0}if(p&&h.length>0)if(e){let g=h[0];D(g)?g.selectStart():g.getParentOrThrow().selectStart()}else{let g=h[h.length-1];D(g)?g.selectEnd():g.getParentOrThrow().selectEnd()}s.anchorNode===c.startContainer&&s.anchorOffset===c.startOffset||function(g){let{focus:_,anchor:m}=g,C=m.key,x=m.offset,N=m.type;m.set(_.key,_.offset,_.type,!0),_.set(C,x,N,!0)}(this)}}n==="lineboundary"&&Sg(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&(t.type==="element"&&D(e)&&t.offset===e.getChildrenSize()||t.type==="text"&&t.offset===e.getTextContentSize())){let o=e.getParent(),r=e.getNextSibling()||(o===null?null:o.getNextSibling());if(D(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(t){let e=this.isCollapsed();if(this.isCollapsed()){let n=this.anchor,o=n.getNode();if(this.forwardDeletion(n,o,t))return;let r=iu(lo(n,t?"previous":"next"));if(r.getTextSlices().every((i)=>i===null||i.distance===0)){let i={type:"initial"};for(let l of r.iterNodeCarets("shadowRoot"))if(Qe(l))if(l.origin.isInline());else{if(l.origin.isShadowRoot()){if(i.type==="merge-block")break;if(D(r.anchor.origin)&&r.anchor.origin.isEmpty()){let a=Xe(l);hs(this,io(a,a)),r.anchor.origin.remove()}return}i.type!=="merge-next-block"&&i.type!=="merge-block"||(i={block:i.block,caret:l,type:"merge-block"})}else{if(i.type==="merge-block")break;if(Lo(l)){if(D(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(r.anchor.origin))break}else i={block:l.origin,type:"merge-next-block"};continue}if(Ct(l.origin)){if(l.origin.isIsolated());else if(i.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&D(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let a=Pc();a.add(l.origin.getKey()),ye(a)}else l.origin.remove();return}break}}if(i.type==="merge-block"){let{caret:l,block:a}=i;return hs(this,io(!l.origin.isEmpty()&&a.isEmpty()?br(Gt(a,l.direction)):r.anchor,l)),this.removeText()}}let s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&n.offset===0&&hg(this,n.getNode()))return}else{let i=s.type==="text"?s.getNode():null;if(o=n.type==="text"?n.getNode():null,i!==null&&i.isSegmented()){let l=s.offset,a=i.getTextContentSize();if(i.is(o)||t&&l!==a||!t&&l!==0)return void pg(i,t,l)}else if(o!==null&&o.isSegmented()){let l=n.offset,a=o.getTextContentSize();if(o.is(i)||t&&l!==0||!t&&l!==a)return void pg(o,t,l)}(function(l,a){let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();if(d===f&&c.type==="text"&&u.type==="text"){let h=c.offset,p=u.offset,g=h<p,_=g?h:p,m=g?p:h,C=m-1;if(_!==C)(function(x){return!(tp(x)||sT(x))})(d.getTextContent().slice(_,m))&&(a?u.set(u.key,C,u.type):c.set(c.key,C,c.type))}})(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let n=this.anchor.getNode();n.isEmpty()&&Zt(n.getParent())&&n.getPreviousSibling()===null&&hg(this,n)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){let e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.isCollapsed()?this.deleteCharacter(t):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function bs(t){return t instanceof Hi}function gg(t){let e=t.offset;if(t.type==="text")return e;let n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function gc(t){let e=t.getStartEndPoints();if(e===null)return[0,0];let[n,o]=e;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[gg(n),gg(o)]}function hg(t,e){for(let n=e;n;n=n.getParent()){if(D(n)){if(n.collapseAtStart(t))return!0;if(ke(n))break}if(n.getPreviousSibling())break}return!1}var sT=(()=>{try{let t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("❤️")&&e("#️⃣")&&e("\uD83D\uDC4D"))return e}catch(t){}return()=>!1})();function pg(t,e,n){let o=t,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,l=0;for(let c=0;c<s;c++){let u=c===s-1;if(l=i,i+=r[c].length,e&&i===n||i>n||u){r.splice(c,1),u&&(l=void 0);break}}let a=r.join("").trim();a===""?o.remove():(o.setTextContent(a),o.select(l,l))}function _g(t,e,n,o){let r,s=e;if(de(t)){let i=!1,l=t.childNodes,a=l.length,c=o._blockCursorElement;s===a&&(i=!0,s=a-1);let u=l[s],d=!1;if(u===c)u=l[s+1],d=!0;else if(c!==null){let f=c.parentNode;if(t===f)e>Array.prototype.indexOf.call(f.children,c)&&s--}if(r=dr(u),B(r))s=je(r,i?"next":"previous");else{let f=dr(t);if(f===null)return null;if(D(f)){let h=o.getElementByKey(f.getKey());h===null&&R(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,t,e),D(f)||R(215),i&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let g=f.getChildAtIndex(s);if(D(g)&&function(_,m,C){let x=_.getParent();return C===null||x===null||!x.canBeEmpty()||x!==C.getNode()}(g,0,n)){let _=i?g.getLastDescendant():g.getFirstDescendant();_===null?f=g:(g=_,f=D(g)?g:g.getParentOrThrow()),s=0}B(g)?(r=g,f=null,s=je(g,i?"next":"previous")):g!==f&&i&&!d&&(D(f)||R(216),s=Math.min(f.getChildrenSize(),s+1))}else{let h=f.getIndexWithinParent();s=e===0&&Ct(f)&&dr(t)===f?h:h+1,f=f.getParentOrThrow()}if(D(f))return tn(f.__key,s,"element")}}else r=dr(t);return B(r)?tn(r.__key,je(r,s,"clamp"),"text"):null}function mg(t,e,n){let o=t.offset,r=t.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(e){if((n||!e)&&s===null&&D(i)&&i.isInline()){let l=i.getPreviousSibling();B(l)&&t.set(l.__key,l.getTextContent().length,"text")}}else D(s)&&!n&&s.isInline()?t.set(s.__key,s.getChildrenSize(),"element"):B(s)&&t.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(e&&D(s)&&s.isInline())t.set(s.__key,0,"element");else if((n||e)&&s===null&&D(i)&&i.isInline()&&!i.canInsertTextAfter()){let l=i.getNextSibling();B(l)&&t.set(l.__key,0,"text")}}}function Fh(t,e,n){if(t.type==="text"&&e.type==="text"){let o=t.isBefore(e),r=t.is(e);mg(t,o,r),mg(e,!o,r),r&&e.set(t.key,t.offset,t.type)}}function Lh(t,e,n,o,r,s){if(t===null||n===null||!Ms(r,t,n))return null;let i=_g(t,e,G(s)?s.anchor:null,r);if(i===null)return null;let l=_g(n,o,G(s)?s.focus:null,r);if(l===null)return null;if(i.type==="element"&&l.type==="element"){let a=dr(t),c=dr(n);if(Ct(a)&&Ct(c))return null}return Fh(i,l),[i,l]}function iT(t){return D(t)&&!t.isInline()}function kh(t,e,n,o,r,s){let i=Yn(),l=new Po(tn(t,e,r),tn(n,o,s),0,"");return l.dirty=!0,i._selection=l,l}function Ph(){let t=tn("root",0,"element"),e=tn("root",0,"element");return new Po(t,e,0,"")}function Pc(){return new Hi(new Set)}function lT(t,e){return Ui(null,t,e,null)}function Ui(t,e,n,o){let r=n._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,l=i==="selectionchange",a=!qa&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(G(t)&&!a)return t.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||i===void 0)&&G(t)&&!Ms(n,c,u))return t.clone();let h=Lh(c,d,u,f,n,t);if(h===null)return null;let[p,g]=h,_=0,m="";if(G(t)){let C=t.anchor;if(p.key===C.key)_=t.format,m=t.style;else{let x=p.getNode();B(x)?(_=x.getFormat(),m=x.getStyle()):D(x)&&(_=x.getTextFormat(),m=x.getTextStyle())}}return new Po(p,g,_,m)}function ct(){return Yn()._selection}function Ko(){return _t()._editorState._selection}function Ii(t,e,n,o=1){let{anchor:r,focus:s}=t,i=r.getNode(),l=s.getNode();if(!e.is(i)&&!e.is(l))return;let a=e.__key;if(t.isCollapsed()){let c=r.offset;if(n<=c&&o>0||n<c&&o<0){let u=Math.max(0,c+o);r.set(a,u,"element"),s.set(a,u,"element"),Cg(t)}}else{let c=t.isBackward(),u=c?s:r,d=u.getNode(),f=c?r:s,h=f.getNode();if(e.is(d)){let p=u.offset;(n<=p&&o>0||n<p&&o<0)&&u.set(a,Math.max(0,p+o),"element")}if(e.is(h)){let p=f.offset;(n<=p&&o>0||n<p&&o<0)&&f.set(a,Math.max(0,p+o),"element")}}Cg(t)}function Cg(t){let e=t.anchor,n=e.offset,o=t.focus,r=o.offset,s=e.getNode(),i=o.getNode();if(t.isCollapsed()){if(!D(s))return;let l=s.getChildrenSize(),a=n>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(B(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),o.set(c.__key,u,"text")}return}if(D(s)){let l=s.getChildrenSize(),a=n>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(n);if(B(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(D(i)){let l=i.getChildrenSize(),a=r>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(r);if(B(c)){let u=0;a&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function Fi(t,e,n,o,r){let s=null,i=0,l=null;o!==null?(s=o.__key,B(o)?(i=o.getTextContentSize(),l="text"):D(o)&&(i=o.getChildrenSize(),l="element")):r!==null&&(s=r.__key,B(r)?l="text":D(r)&&(l="element")),s!==null&&l!==null?t.set(s,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=n.getChildrenSize()),t.set(n.__key,i,"element"))}function xg(t,e,n,o,r){t.type==="text"?t.set(n,t.offset+(e?0:r),"text"):t.offset>o.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function Kh(t,e,n,o,r){try{t.setBaseAndExtent(e,n,o,r)}catch(s){}}function yg(t,e,n){let o=_r(t,e.getKey());if(D(e)){let r=e.getDOMSlot(o);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function aT(t,e,n,o,r,s,i){let{anchorNode:l,focusNode:a,anchorOffset:c,focusOffset:u}=o,d=document.activeElement;if(r.has(Mh)&&d!==s||d!==null&&Yc(d))return;if(!G(e))return void(t!==null&&Ms(n,l,a)&&o.removeAllRanges());let{anchor:f,focus:h}=e,p=f.getNode(),g=h.getNode(),[_,m]=yg(n,p,f.offset),[C,x]=yg(n,g,h.offset),N=e.format,T=e.style,y=e.isCollapsed(),S=_,E=C,O=!1;var $,I,k,L,z;if((f.type==="text"?(S=$o(_),O=p.getFormat()!==N||p.getStyle()!==T):G(t)&&t.anchor.type==="text"&&(O=!0),h.type==="text"&&(E=$o(C)),S!==null&&E!==null)&&(y&&(t===null||O||G(t)&&(t.format!==N||t.style!==T))&&($=N,I=T,k=m,L=f.key,z=performance.now(),yh=[$,I,k,L,z]),c!==m||u!==x||l!==S||a!==E||o.type==="Range"&&y||(d!==null&&s.contains(d)||r.has(fc)||s.focus({preventScroll:!0}),f.type==="element"))){if(Kh(o,S,m,E,x),!ro||!e.isCollapsed()||s===null||r.has(fc)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!r.has(Ah)&&e.isCollapsed()&&s!==null&&s===document.activeElement){let M=G(e)&&e.anchor.type==="element"?S.childNodes[m]||null:o.rangeCount>0?o.getRangeAt(0):null;if(M!==null){let Z;if(M instanceof Text){let ot=document.createRange();ot.selectNode(M),Z=ot.getBoundingClientRect()}else Z=M.getBoundingClientRect();(function(ot,gt,rt){let $e=Qc(rt),ae=jc($e);if($e===null||ae===null)return;let{top:j,bottom:Mt}=gt,vt=0,Ie=0,ce=rt;for(;ce!==null;){let Ce=ce===$e.body;if(Ce){vt=0,Ie=Ae(ot).innerHeight;let Fe=ae.getComputedStyle($e.documentElement),Je=parseFloat(Fe.scrollPaddingTop),Le=parseFloat(Fe.scrollPaddingBottom);isFinite(Je)&&(vt+=Je),isFinite(Le)&&(Ie-=Le)}else{let Fe=ce.getBoundingClientRect();vt=Fe.top,Ie=Fe.bottom}let ue=0;if(j<vt?ue=-(vt-j):Mt>Ie&&(ue=Mt-Ie),ue!==0)if(Ce)ae.scrollBy(0,ue);else{let Fe=ce.scrollTop;ce.scrollTop+=ue;let Je=ce.scrollTop-Fe;j-=Je,Mt-=Je}if(Ce)break;ce=vs(ce)}})(n,Z,s)}}cc=!0}}function cT(t){let e=ct()||Ko();e===null&&(e=Me().selectEnd()),e.insertNodes(t)}function uT(){let t=ct();return t===null?"":t.getTextContent()}function Ha(t){let e=t;t.isCollapsed()||e.removeText();let n=ct();G(n)&&(e=n),G(e)||R(161);let o=e.anchor,r=o.getNode(),s=o.offset;for(;!Wn(r);){let i=r;if([r,s]=dT(r,s),i.is(r))break}return s}function dT(t,e){let n=t.getParent();if(!n){let r=zn();return Me().append(r),r.select(),[Me(),0]}if(B(t)){let r=t.splitText(e);if(r.length===0)return[n,t.getIndexWithinParent()];let s=e===0?0:1;return[n,r[0].getIndexWithinParent()+s]}if(!D(t)||e===0)return[n,t.getIndexWithinParent()];let o=t.getChildAtIndex(e);if(o){let r=new Po(tn(t.__key,e,"element"),tn(t.__key,e,"element"),0,""),s=t.insertNewAfter(r);s&&s.append(o,...o.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function Sg(t,e,n,o,r="decorators-and-blocks"){if(e==="move"&&o==="character"&&!t.isCollapsed()){let[u,d]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return d.set(u.key,u.offset,u.type),!0}let s=lo(t.focus,n?"previous":"next"),i=o==="lineboundary",l=e==="move",a=s,c=r==="decorators-and-blocks";if(!Cp(a)){for(let u of a){c=!1;let{origin:d}=u;if(!Ct(d)||d.isIsolated()||(a=u,!i||!d.isInline()))break}if(c)for(let u of iu(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(Qe(u))u.origin.isInline()||(a=u);else{if(D(u.origin))continue;Ct(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===s)return!1;if(l&&!i&&Ct(a.origin)&&a.origin.isKeyboardSelectable()){let u=Pc();return u.add(a.origin.getKey()),ye(u),!0}return a=Xe(a),l&&Cr(t.anchor,a),Cr(t.focus,a),c||!i}var Ut=null,Yt=null,xe=!1,Ua=!1,Ni=0,Ng={characterData:!0,childList:!0,subtree:!0};function Sr(){return xe||Ut!==null&&Ut._readOnly}function zt(){xe&&R(13)}function Bh(){Ni>99&&R(14)}function Yn(){return Ut===null&&R(195,Wh()),Ut}function _t(){return Yt===null&&R(196,Wh()),Yt}function Wh(){let t=0,e=new Set,n=Ro.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let s=As(r);if(Ji(s))t++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===n&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let o=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(o+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),o}function fT(){return Yt}function Tg(t,e,n){let o=e.__type,r=Hc(t,o),s=n.get(o);s===void 0&&(s=Array.from(r.transforms),n.set(o,s));let i=s.length;for(let l=0;l<i&&(s[l](e),e.isAttached());l++);}function Eg(t,e){return t!==void 0&&t.__key!==e&&t.isAttached()}function zh(t,e){if(!e)return;let n=t._updateTags,o=e;Array.isArray(e)||(o=[e]);for(let r of o)n.add(r)}function gT(t){return Kc(t,_t()._nodes)}function Kc(t,e){let n=t.type,o=e.get(n);o===void 0&&R(17,n);let r=o.klass;t.type!==r.getType()&&R(18,r.name);let s=r.importJSON(t),i=t.children;if(D(s)&&Array.isArray(i))for(let l=0;l<i.length;l++){let a=Kc(i[l],e);s.append(a)}return s}function bg(t,e,n){let o=Ut,r=xe,s=Yt;Ut=e,xe=!0,Yt=t;try{return n()}finally{Ut=o,xe=r,Yt=s}}function Bn(t,e){let{_pendingEditorState:n,_rootElement:o}=t,r=t._headless||o===null;if(n===null)return;let s=t._editorState,i=s._selection,l=n._selection,a=t._dirtyType!==0,c=Ut,u=xe,d=Yt,f=t._updating,h=t._observer,p=null;if(t._pendingEditorState=null,t._editorState=n,!r&&a&&h!==null){Yt=t,Ut=n,xe=!1,t._updating=!0;try{let{_dirtyType:y,_dirtyElements:S,_dirtyLeaves:E}=t;h.disconnect(),p=RN(s,n,t,y,S,E)}catch(y){if(y instanceof Error&&t._onError(y),Ua)throw y;return Gh(t,null,o,n),Yg(t),t._dirtyType=2,Ua=!0,Bn(t,s),void(Ua=!1)}finally{h.observe(o,Ng),t._updating=f,Ut=c,xe=u,Yt=d}}n._readOnly||(n._readOnly=!0);let{_dirtyLeaves:g,_dirtyElements:_,_normalizedNodes:m,_updateTags:C,_deferred:x}=t;a&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),function(y,S){let E=y._decorators,O=y._pendingDecorators||E,$=S._nodeMap,I;for(I in O)$.has(I)||(O===E&&(O=Qh(y)),delete O[I])}(t,n);let N=r?null:nn(Ae(t));if(t._editable&&N!==null&&(a||l===null||l.dirty||!l.is(i))&&o!==null&&!C.has(vh)){Yt=t,Ut=n;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){let y=t._blockCursorElement;y!==null&&pc(y,t,o),aT(i,l,t,N,C,o)}(function(y,S,E){let O=y._blockCursorElement;if(G(E)&&E.isCollapsed()&&E.anchor.type==="element"&&S.contains(document.activeElement)){let $=E.anchor,I=$.getNode(),k=$.offset,L=!1,z=null;if(k===I.getChildrenSize())Ga(I.getChildAtIndex(k-1))&&(L=!0);else{let M=I.getChildAtIndex(k);if(M!==null&&Ga(M)){let Z=M.getPreviousSibling();(Z===null||Ga(Z))&&(L=!0,z=y.getElementByKey(M.__key))}}if(L){let M=y.getElementByKey(I.__key);return O===null&&(y._blockCursorElement=O=function(Z){let ot=Z.theme,gt=document.createElement("div");gt.contentEditable="false",gt.setAttribute("data-lexical-cursor","true");let rt=ot.blockCursor;if(rt!==void 0){if(typeof rt=="string"){let $e=$s(rt);rt=ot.blockCursor=$e}rt!==void 0&&gt.classList.add(...rt)}return gt}(y._config)),S.style.caretColor="transparent",void(z===null?M.appendChild(O):M.insertBefore(O,z))}}O!==null&&pc(O,y,S)})(t,o,l)}finally{h!==null&&h.observe(o,Ng),Yt=d,Ut=c}}p!==null&&function(y,S,E,O,$){let I=Array.from(y._listeners.mutation),k=I.length;for(let L=0;L<k;L++){let[z,M]=I[L];for(let Z of M){let ot=S.get(Z);ot!==void 0&&z(ot,{dirtyLeaves:O,prevEditorState:$,updateTags:E})}}}(t,p,C,g,s),G(l)||l===null||i!==null&&i.is(l)||t.dispatchCommand(bc,void 0);let T=t._pendingDecorators;T!==null&&(t._decorators=T,t._pendingDecorators=null,us("decorator",t,!0,T)),function(y,S,E){let O=vg(S),$=vg(E);O!==$&&us("textcontent",y,!0,$)}(t,e||s,n),us("update",t,!0,{dirtyElements:_,dirtyLeaves:g,editorState:n,mutatedNodes:p,normalizedNodes:m,prevEditorState:e||s,tags:C}),function(y,S){if(y._deferred=[],S.length!==0){let E=y._updating;y._updating=!0;try{for(let O=0;O<S.length;O++)S[O]()}finally{y._updating=E}}}(t,x),function(y){let S=y._updates;if(S.length!==0){let E=S.shift();if(E){let[O,$]=E;Yi(y,O,$)}}}(t)}function us(t,e,n,...o){let r=e._updating;e._updating=n;try{let s=e._listeners[t],i=Array.from(s);for(let[l,a]of i){a&&a();let c=l(...o);s.has(l)?s.set(l,c):c&&c()}}finally{e._updating=r}}function Og(t,e){let n=t._updates,o=e||!1;for(;n.length!==0;){let r=n.shift();if(r){let[s,i]=r,l=t._pendingEditorState,a;i!==void 0&&(a=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(l===null&&R(191),l._flushSync=!0),a&&t._deferred.push(a),zh(t,i.tag)),l==null?Yi(t,s,i):s()}}return o}function Yi(t,e,n){let o=t._updateTags,r,s=!1,i=!1;n!==void 0&&(r=n.onUpdate,zh(t,n.tag),s=n.skipTransforms||!1,i=n.discrete||!1),r&&t._deferred.push(r);let{_editorState:l,_pendingEditorState:a}=t,c=!1;(a===null||a._readOnly)&&(a=t._pendingEditorState=Hh(a||l),c=!0),a._flushSync=i;let u=Ut,d=xe,f=Yt,h=t._updating;Ut=a,xe=!1,t._updating=!0,Yt=t;let p=t._headless||t.getRootElement()===null;zc(null);try{c&&(p?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=function(C,x){let N=C.getEditorState()._selection,T=nn(Ae(C));return G(N)||N==null?Ui(N,T,C,x):N.clone()}(t,n&&n.event||null));let _=t._compositionKey;e(),s=Og(t,s),function(C,x){let N=x.getEditorState()._selection,T=C._selection;if(G(T)){let{anchor:y,focus:S}=T,E;if(y.type==="text"&&(E=y.getNode(),E.selectionTransform(N,T)),S.type==="text"){let O=S.getNode();E!==O&&O.selectionTransform(N,T)}}}(a,t),t._dirtyType!==0&&(s?function(C,x){let N=x._dirtyLeaves,T=C._nodeMap;for(let y of N){let S=T.get(y);B(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&tg(S)}}(a,t):function(C,x){let{_dirtyLeaves:N,_dirtyElements:T}=x,y=C._nodeMap,S=eo(),E=new Map,O=N,$=O.size,I=T,k=I.size;for(;$>0||k>0;){if($>0){x._dirtyLeaves=new Set;for(let L of O){let z=y.get(L);B(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&tg(z),z!==void 0&&Eg(z,S)&&Tg(x,z,E),N.add(L)}if(O=x._dirtyLeaves,$=O.size,$>0){Ni++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,I.delete("root")&&I.set("root",!0);for(let L of I){let z=L[0],M=L[1];if(T.set(z,M),!M)continue;let Z=y.get(z);Z!==void 0&&Eg(Z,S)&&Tg(x,Z,E)}O=x._dirtyLeaves,$=O.size,I=x._dirtyElements,k=I.size,Ni++}x._dirtyLeaves=N,x._dirtyElements=T}(a,t),Og(t),function(C,x,N,T){let y=C._nodeMap,S=x._nodeMap,E=[];for(let[O]of T){let $=S.get(O);$!==void 0&&($.isAttached()||(D($)&&zg($,O,y,S,E,T),y.has(O)||T.delete(O),E.push(O)))}for(let O of E)S.delete(O);for(let O of N){let $=S.get(O);$===void 0||$.isAttached()||(y.has(O)||N.delete(O),S.delete(O))}}(l,a,t._dirtyLeaves,t._dirtyElements)),_!==t._compositionKey&&(a._flushSync=!0);let m=a._selection;if(G(m)){let C=a._nodeMap,x=m.anchor.key,N=m.focus.key;C.get(x)!==void 0&&C.get(N)!==void 0||R(19)}else bs(m)&&m._nodes.size===0&&(a._selection=null)}catch(_){return _ instanceof Error&&t._onError(_),t._pendingEditorState=l,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void Bn(t)}finally{Ut=u,xe=d,Yt=f,t._updating=h,Ni=0}t._dirtyType!==0||t._deferred.length>0||function(_,m){let C=m.getEditorState()._selection,x=_._selection;if(x!==null){if(x.dirty||!x.is(C))return!0}else if(C!==null)return!0;return!1}(a,t)?a._flushSync?(a._flushSync=!1,Bn(t)):c&&TT(()=>{Bn(t)}):(a._flushSync=!1,c&&(o.clear(),t._deferred=[],t._pendingEditorState=null))}function hn(t,e,n){Yt===t&&n===void 0?e():Yi(t,e,n)}class ds{element;before;after;constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new ds(this.element,t,this.after)}withAfter(t){return new ds(this.element,this.before,t)}withElement(t){return this.element===t?this:new ds(t,this.before,this.after)}insertChild(t){let e=this.before||this.getManagedLineBreak();return e!==null&&e.parentElement!==this.element&&R(222),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&R(223),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&R(224),this.element.replaceChild(t,e),this}getFirstChild(){let t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{let e=t==="decorator"&&(Ki||Es||Pi);this.insertManagedLineBreak(e)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let e=this.element,n=t.nodeName==="IMG"?t.nextSibling:null;n&&e.removeChild(n),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let e=this.getManagedLineBreak();if(e){if(t===(e.nodeName==="IMG"))return;this.removeManagedLineBreak()}let n=this.element,o=this.before,r=document.createElement("br");if(n.insertBefore(r,o),t){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",n.insertBefore(s,r),n.__lexicalLineBreak=s}else n.__lexicalLineBreak=r}getFirstChildOffset(){let t=0;for(let e=this.after;e!==null;e=e.previousSibling)t++;return t}resolveChildIndex(t,e,n,o){if(n===this.element){let l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}let r=Mg(e,n);r.push(o);let s=Mg(e,this.element),i=t.getIndexWithinParent();for(let l=0;l<s.length;l++){let a=r[l],c=s[l];if(a===void 0||a<c)break;if(a>c){i+=1;break}}return[t.getParentOrThrow(),i]}}function Mg(t,e){let n=[],o=e;for(;o!==t&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;n.push(r)}return o!==t&&R(225),n.reverse()}class Bo extends Ze{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let t=this.getFormat();return CN[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let t=[],e=this.getFirstChild();for(;e!==null;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){let t=[],e=this.getFirstChild();for(;e!==null;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let t=_t()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){let t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return e!==null&&e.is(t)}getAllTextNodes(){let t=[],e=this.getFirstChild();for(;e!==null;){if(B(e)&&t.push(e),D(e)){let n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;D(t);){let e=t.getFirstChild();if(e===null)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;D(t);){let e=t.getLastChild();if(e===null)break;t=e}return t}getDescendantByIndex(t){let e=this.getChildren(),n=e.length;if(t>=n){let r=e[n-1];return D(r)&&r.getLastDescendant()||r||null}let o=e[t];return D(o)&&o.getFirstDescendant()||o||null}getFirstChild(){let t=this.getLatest().__first;return t===null?null:Ft(t)}getFirstChildOrThrow(){let t=this.getFirstChild();return t===null&&R(45,this.__key),t}getLastChild(){let t=this.getLatest().__last;return t===null?null:Ft(t)}getLastChildOrThrow(){let t=this.getLastChild();return t===null&&R(96,this.__key),t}getChildAtIndex(t){let e=this.getChildrenSize(),n,o;if(t<e/2){for(n=this.getFirstChild(),o=0;n!==null&&o<=t;){if(o===t)return n;n=n.getNextSibling(),o++}return null}for(n=this.getLastChild(),o=e-1;n!==null&&o>=t;){if(o===t)return n;n=n.getPreviousSibling(),o--}return null}getTextContent(){let t="",e=this.getChildren(),n=e.length;for(let o=0;o<n;o++){let r=e[o];t+=r.getTextContent(),D(r)&&o!==n-1&&!r.isInline()&&(t+=Bi)}return t}getTextContentSize(){let t=0,e=this.getChildren(),n=e.length;for(let o=0;o<n;o++){let r=e[o];t+=r.getTextContentSize(),D(r)&&o!==n-1&&!r.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){let e=Xa[t];return(this.getFormat()&e)!==0}return!1}hasTextFormat(t){let e=ne[t];return(this.getTextFormat()&e)!==0}getFormatFlags(t,e){return Ns(this.getLatest().__textFormat,t,e)}getTextStyle(){return this.getLatest().__textStyle}select(t,e){zt();let n=ct(),o=t,r=e,s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&e===0){let l=this.getFirstChild();if(B(l)||D(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||e!==void 0&&e!==s)){let l=this.getLastChild();if(B(l)||D(l))return l.select()}}o===void 0&&(o=s),r===void 0&&(r=s);let i=this.__key;return G(n)?(n.anchor.set(i,o,"element"),n.focus.set(i,r,"element"),n.dirty=!0,n):kh(i,o,i,r,"element","element")}selectStart(){let t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){let t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){let t=this.getWritable();return this.getChildren().forEach((e)=>e.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){let e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=t!==""?Xa[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){let e=this.getWritable();return e.__textFormat=t,e}setTextStyle(t){let e=this.getWritable();return e.__textStyle=t,e}setIndent(t){return this.getWritable().__indent=t,this}splice(t,e,n){$i(this)&&R(324,this.__key,this.__type);let o=this.getChildrenSize(),r=this.getWritable();t+e<=o||R(226,String(t),String(e),String(o));let s=r.__key,i=[],l=[],a=this.getChildAtIndex(t+e),c=null,u=o-e+n.length;if(t!==0)if(t===o)c=this.getLastChild();else{let f=this.getChildAtIndex(t);f!==null&&(c=f.getPreviousSibling())}if(e>0){let f=c===null?this.getFirstChild():c.getNextSibling();for(let h=0;h<e;h++){f===null&&R(100);let p=f.getNextSibling(),g=f.__key;oo(f.getWritable()),l.push(g),f=p}}let d=c;for(let f of n){d!==null&&f.is(d)&&(c=d=d.getPreviousSibling());let h=f.getWritable();h.__parent===s&&u--,oo(h);let p=f.__key;if(d===null)r.__first=p,h.__prev=null;else{let g=d.getWritable();g.__next=p,h.__prev=g.__key}f.__key===s&&R(76),h.__parent=s,i.push(p),d=f}if(t+e===o){if(d!==null)d.getWritable().__next=null,r.__last=d.__key}else if(a!==null){let f=a.getWritable();if(d!==null){let h=d.getWritable();f.__prev=d.__key,h.__next=a.__key}else f.__prev=null}if(r.__size=u,l.length){let f=ct();if(G(f)){let h=new Set(l),p=new Set(i),{anchor:g,focus:_}=f;Ag(g,h,p)&&Fi(g,g.getNode(),this,c,a),Ag(_,h,p)&&Fi(_,_.getNode(),this,c,a),u!==0||this.canBeEmpty()||ke(this)||this.remove()}}return r}getDOMSlot(t){return new ds(t)}exportDOM(t){let{element:e}=super.exportDOM(t);if(de(e)){let n=this.getIndent();n>0&&(e.style.paddingInlineStart=40*n+"px");let o=this.getDirection();o&&(e.dir=o)}return{element:e}}exportJSON(){let t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e=this.getTextFormat(),n=this.getTextStyle();return e===0&&n===""||ke(this)||this.getChildren().some(B)||(e!==0&&(t.textFormat=e),n!==""&&(t.textStyle=n)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,e){let n=this.getDOMSlot(t),o=n.getFirstChild();for(let r=this.getFirstChild();r;r=r.getNextSibling()){let s=e.getElementByKey(r.getKey());s!==null&&(o==null?(n.insertChild(s),o=s):o!==s&&n.replaceChild(s,o),o=o.nextSibling)}}}function D(t){return t instanceof Bo}function Ag(t,e,n){let o=t.getNode();for(;o;){let r=o.__key;if(e.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}class Gi extends Ze{decorate(t,e){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Ct(t){return t instanceof Gi}class Nr extends Bo{__cachedText;static getType(){return"root"}static clone(){return new Nr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){R(51)}getTextContent(){let t=this.__cachedText;return!Sr()&&_t()._dirtyType!==0||t===null?super.getTextContent():t}remove(){R(52)}replace(t){R(53)}insertBefore(t){R(54)}insertAfter(t){R(55)}updateDOM(t,e){return!1}splice(t,e,n){for(let o of n)D(o)||Ct(o)||R(282);return super.splice(t,e,n)}static importJSON(t){return Me().updateFromJSON(t)}collapseAtStart(){return!0}}function Zt(t){return t instanceof Nr}function Hh(t){return new Os(new Map(t._nodeMap))}function Bc(){return new Os(new Map([["root",new Nr]]))}function Uh(t){let e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&R(130,n.name),D(t)){let o=e.children;Array.isArray(o)||R(59,n.name);let r=t.getChildren();for(let s=0;s<r.length;s++){let i=Uh(r[s]);o.push(i)}}return e}function hT(t){return t instanceof Os}class Os{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,e){this._nodeMap=t,this._selection=e||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,e){return bg(e&&e.editor||null,this,t)}clone(t){let e=new Os(this._nodeMap,t===void 0?this._selection:t);return e._readOnly=!0,e}toJSON(){return bg(null,this,()=>({root:Uh(Me())}))}}class Wc extends Bo{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Tr extends Bo{static getType(){return"paragraph"}static clone(t){return new Tr(t.__key)}createDOM(t){let e=document.createElement("p"),n=hr(t.theme,"paragraph");if(n!==void 0)e.classList.add(...n);return e}updateDOM(t,e,n){return!1}static importDOM(){return{p:(t)=>({conversion:pT,priority:0})}}exportDOM(t){let{element:e}=super.exportDOM(t);if(de(e)){this.isEmpty()&&e.append(document.createElement("br"));let n=this.getFormatType();n&&(e.style.textAlign=n)}return{element:e}}static importJSON(t){return zn().updateFromJSON(t)}exportJSON(){let t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){let e=this.getChildren().find(B);e?(t.textFormat=e.getFormat(),t.textStyle=e.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,e){let n=zn();n.setTextFormat(t.format),n.setTextStyle(t.style);let o=this.getDirection();return n.setDirection(o),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,e),n}collapseAtStart(){let t=this.getChildren();if(t.length===0||B(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function pT(t){let e=zn();if(t.style&&(e.setFormat(t.style.textAlign),fp(t,e)),e.getFormatType()===""){let n=t.getAttribute("align");n&&n&&n in Xa&&e.setFormat(n)}return{node:e}}function zn(){return Ds(new Tr)}function Yh(t){return t instanceof Tr}var ur=0,_T=1,mT=2,CT=3,xT=4;function Gh(t,e,n,o){let r=t._keyToDOMMap;r.clear(),t._editorState=Bc(),t._pendingEditorState=o,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;let s=t._observer;s!==null&&(s.disconnect(),t._observer=null),e!==null&&(e.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function Jh(t){let e=new Set,n=new Set,o=t;for(;o;){let{ownNodeConfig:r}=ws(o),s=o.transform;if(!n.has(s)){n.add(s);let i=o.transform();i&&e.add(i)}if(r){let i=r.$transform;i&&e.add(i),o=r.extends}else{let i=Object.getPrototypeOf(o);o=i.prototype instanceof Ze&&i!==Ze?i:void 0}}return e}function yT(t){let e=t||{},n=fT(),o=e.theme||{},r=t===void 0?n:e.parentEditor||null,s=e.disableEvents||!1,i=Bc(),l=e.namespace||(r!==null?r._config.namespace:ep()),a=e.editorState,c=[Nr,ko,xr,yr,Tr,Wc,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable,h;if(t===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let g=0;g<c.length;g++){let _=c[g],m=null,C=null;if(typeof _!="function"){let T=_;_=T.replace,m=T.with,C=T.withKlass||null}ws(_);let x=_.getType(),N=Jh(_);h.set(x,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:m,replaceWithKlass:C,sharedNodeState:Jg(c[g]),transforms:N})}}let p=new Ro(i,r,h,{disableEvents:s,namespace:l,theme:o},u||console.error,function(g,_){let m=new Map,C=new Set,x=(N)=>{Object.keys(N).forEach((T)=>{let y=m.get(T);y===void 0&&(y=[],m.set(T,y)),y.push(N[T])})};return g.forEach((N)=>{let T=N.klass.importDOM;if(T==null||C.has(T))return;C.add(T);let y=T.call(N.klass);y!==null&&x(y)}),_&&x(_),m}(h,d?d.import:void 0),f,t);return a!==void 0&&(p._pendingEditorState=a,p._dirtyType=2),function(g){g.registerCommand(Oc,zN,ur),g.registerCommand(Mc,HN,ur),g.registerCommand(Ac,UN,ur),g.registerCommand(vc,YN,ur),g.registerCommand($c,GN,ur)}(p),p}function ST(t,e){let n=t.get(e);t.delete(e),n&&n()}function ss(t,e,n){return t.set(e,n),ST.bind(null,t,e)}class Ro{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,e,n,o,r,s,i,l){this._createEditorArgs=l,this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=o,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ep(),this._onError=r,this._htmlConversions=s,this._editable=i,this._headless=e!==null&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){return ss(this._listeners.update,t)}registerEditableListener(t){return ss(this._listeners.editable,t)}registerDecoratorListener(t){return ss(this._listeners.decorator,t)}registerTextContentListener(t){return ss(this._listeners.textcontent,t)}registerRootListener(t){let e=this._listeners.root;return yp(ss(e,t,t(this._rootElement,null)||void 0),()=>function(n,o,r){let s=n.get(o);s&&s(),n.set(o,o(...r)||void 0)}(e,t,[null,this._rootElement]))}registerCommand(t,e,n){n===void 0&&R(35);let o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);let r=o.get(t);r===void 0&&R(36,String(t));let s=r[n];return s.add(e),()=>{s.delete(e),r.every((i)=>i.size===0)&&o.delete(t)}}registerMutationListener(t,e,n){let o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,r=this._listeners.mutation,s=r.get(e);s===void 0&&(s=new Set,r.set(e,s)),s.add(o);let i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(e,o),()=>{s.delete(o),s.size===0&&r.delete(e)}}getRegisteredNode(t){let e=this._nodes.get(t.getType());return e===void 0&&R(37,t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){let n=this._editorState,o=mc(n).get(e.getType());if(!o)return;let r=new Map;for(let s of o.keys())r.set(s,"created");r.size>0&&t(r,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){let n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){let n=this.registerNodeTransformToKlass(t,e),o=[n],r=n.replaceWithKlass;if(r!=null){let s=this.registerNodeTransformToKlass(r,e);o.push(s)}return function(s,i){let l=mc(s.getEditorState()),a=[];for(let c of i){let u=l.get(c);u&&a.push(u)}if(a.length===0)return;s.update(()=>{for(let c of a)for(let u of c.keys()){let d=Ft(u);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Si}:void 0)}(this,o.map((s)=>s.klass.getType())),()=>{o.forEach((s)=>s.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return P(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let e=this._rootElement;if(t!==e){let n=hr(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,Gh(this,e,t,o),e!==null&&(this._config.disableEvents||JN(e),n!=null&&e.classList.remove(...n)),t!==null){let r=jc(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=2,Yg(this),this._updateTags.add(Si),Bn(this),this._config.disableEvents||function(i,l){let a=i.ownerDocument;ac.set(i,a);let c=wi.get(a)??0;c<1&&a.addEventListener("selectionchange",bh),wi.set(a,c+1),i.__lexicalEditor=l;let u=Eh(i);for(let d=0;d<lc.length;d++){let[f,h]=lc[d],p=typeof h=="function"?(g)=>{lg(g)||(ig(g),(l.isEditable()||f==="click")&&h(g,l))}:(g)=>{if(lg(g))return;ig(g);let _=l.isEditable();switch(f){case"cut":return _&&P(l,Fc,g);case"copy":return P(l,Ic,g);case"paste":return _&&P(l,Dc,g);case"dragstart":return _&&P(l,fh,g);case"dragover":return _&&P(l,gh,g);case"dragend":return _&&P(l,hh,g);case"focus":return _&&P(l,ph,g);case"blur":return _&&P(l,_h,g);case"drop":return _&&P(l,dh,g)}};i.addEventListener(f,p),u.push(()=>{i.removeEventListener(f,p)})}}(t,this),n!=null&&t.classList.add(...n)}else this._window=null,this._updateTags.add(Si),Bn(this);us("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&R(38);let n=t;n._readOnly&&(n=Hh(t),n._selection=t._selection?t._selection.clone():null),Ug(this);let o=this._pendingEditorState,r=this._updateTags,s=e!==void 0?e.tag:null;o===null||o.isEmpty()||(s!=null&&r.add(s),Bn(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&r.add(s),this._updating||Bn(this)}parseEditorState(t,e){return function(n,o,r){let s=Bc(),i=Ut,l=xe,a=Yt,c=o._dirtyElements,u=o._dirtyLeaves,d=o._cloneNotNeeded,f=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Ut=s,xe=!1,Yt=o,zc(null);try{let h=o._nodes;Kc(n.root,h),r&&r(),s._readOnly=!0}catch(h){h instanceof Error&&o._onError(h)}finally{o._dirtyElements=c,o._dirtyLeaves=u,o._cloneNotNeeded=d,o._dirtyType=f,Ut=i,xe=l,Yt=a}return s}(typeof t=="string"?JSON.parse(t):t,this,e)}read(t){return Bn(this),this.getEditorState().read(t,{editor:this})}update(t,e){(function(n,o,r){n._updating?n._updates.push([o,r]):Yi(n,o,r)})(this,t,e)}focus(t,e={}){let n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),hn(this,()=>{let o=ct(),r=Me();o!==null?o.dirty||ye(o.clone()):r.getChildrenSize()!==0&&(e.defaultSelection==="rootStart"?r.selectStart():r.selectEnd()),qi("focus"),ip(()=>{n.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let e=nn(this._window);e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,us("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ro.version="0.42.0+prod.esm";var hc=null;function zc(t){hc=t}var Vh=1;function NT(){Vh=1}function Hc(t,e){let n=Uc(t,e);return n===void 0&&R(30,e),n}function Uc(t,e){return t._nodes.get(e)}var TT=typeof queueMicrotask=="function"?queueMicrotask:(t)=>{Promise.resolve().then(t)};function Xh(t){return Ct(Xi(t))}function Yc(t){let e=document.activeElement;if(!de(e))return!1;let n=e.nodeName;return Ct(Xi(t))&&(n==="INPUT"||n==="TEXTAREA"||e.contentEditable==="true"&&As(e)==null)}function Ms(t,e,n){let o=t.getRootElement();try{return o!==null&&o.contains(e)&&o.contains(n)&&e!==null&&!Yc(e)&&Gc(e)===t}catch(r){return!1}}function Ji(t){return t instanceof Ro}function Gc(t){let e=t;for(;e!=null;){let n=As(e);if(Ji(n))return n;e=vs(e)}return null}function As(t){return t?t.__lexicalEditor:null}function ET(t){return pN.test(t)?"rtl":_N.test(t)?"ltr":null}function no(t){return kc(t)||t.isToken()}function Kn(t){return no(t)||t.isSegmented()}function pn(t){return Er(t)&&t.nodeType===3}function qh(t){return Er(t)&&t.nodeType===9}function $o(t){let e=t;for(;e!=null;){if(pn(e))return e;e=e.firstChild}return null}function Ns(t,e,n){let o=ne[e];if(n!==null&&(t&o)===(n&o))return t;let r=t^o;return e==="subscript"?r&=~ne.superscript:e==="superscript"?r&=~ne.subscript:e==="lowercase"?(r&=~ne.uppercase,r&=~ne.capitalize):e==="uppercase"?(r&=~ne.lowercase,r&=~ne.capitalize):e==="capitalize"&&(r&=~ne.lowercase,r&=~ne.uppercase),r}function bT(t){return B(t)||vo(t)||Ct(t)}function Zh(t,e){let n=function(){let i=hc;return hc=null,i}();if((e=e||n&&n.__key)!=null)return void(t.__key=e);zt(),Bh();let o=_t(),r=Yn(),s=""+Vh++;r._nodeMap.set(s,t),D(t)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.add(s),o._dirtyType=1,t.__key=s}function oo(t){let e=t.getParent();if(e!==null){let n=t.getWritable(),o=e.getWritable(),r=t.getPreviousSibling(),s=t.getNextSibling(),i=s!==null?s.__key:null,l=r!==null?r.__key:null,a=r!==null?r.getWritable():null,c=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=l),a!==null&&(a.__next=i),c!==null&&(c.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}function Li(t){Bh(),$i(t)&&R(323,t.__key,t.__type);let e=t.getLatest(),n=e.__parent,o=Yn(),r=_t(),s=o._nodeMap,i=r._dirtyElements;n!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;let f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(n,s,i);let l=e.__key;r._dirtyType=1,D(t)?i.set(l,!0):r._dirtyLeaves.add(l)}function Ht(t){zt();let e=_t(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,n!==null){let o=Ft(n);o!==null&&o.getWritable()}if(t!==null){let o=Ft(t);o!==null&&o.getWritable()}}}function eo(){if(Sr())return null;return _t()._compositionKey}function Ft(t,e){let n=(e||Yn())._nodeMap.get(t);return n===void 0?null:n}function Jc(t,e){let n=Vi(t,_t());return n!==void 0?Ft(n,e):null}function Vi(t,e){return t[`__lexicalKey_${e._key}`]}function Xi(t,e){let n=t;for(;n!=null;){let o=Jc(n,e);if(o!==null)return o;n=vs(n)}return null}function Qh(t){let e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function vg(t){return t.read(()=>Me().getTextContent())}function Me(){return jh(Yn())}function jh(t){return t._nodeMap.get("root")}function ye(t){zt();let e=Yn();t!==null&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function dr(t){let e=_t(),n=function(o,r){let s=o;for(;s!=null;){let i=Vi(s,r);if(i!==void 0)return i;s=vs(s)}return null}(t,e);if(n===null)return t===e.getRootElement()?Ft("root"):null;return Ft(n)}function tp(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function Vc(t){let e=[];for(let n=t;n!==null;n=n._updating?null:n._parentEditor)e.push(n);return e}function ep(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function np(t){return pn(t)?t.nodeValue:null}function Xc(t,e,n){let o=nn(Ae(e));if(o===null)return;let r=o.anchorNode,{anchorOffset:s,focusOffset:i}=o;if(r!==null){let l=np(r),a=Xi(r);if(l!==null&&B(a)){if((l===ps||l===Sc)&&n){let c=n.length;l=n,s=c,i=c}l!==null&&qc(a,l,s,i,t)}}}function qc(t,e,n,o,r){let s=t;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing(),l=e;if((i||r)&&(e.endsWith(ps)&&(l=e.slice(0,-ps.length)),r)){let c=Sc,u;for(;(u=l.indexOf(c))!==-1;)l=l.slice(0,u)+l.slice(u+c.length),n!==null&&n>u&&(n=Math.max(u,n-c.length)),o!==null&&o>u&&(o=Math.max(u,o-c.length))}let a=s.getTextContent();if(r||l!==a){if(l===""){if(Ht(null),Pi||Es||Ki)s.remove();else{let g=_t();setTimeout(()=>{g.update(()=>{s.isAttached()&&s.remove()})},20)}return}let c=s.getParent(),u=Ko(),d=s.getTextContentSize(),f=eo(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!i||G(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===t.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===t.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i))return void s.markDirty();let p=ct();if(!G(p)||n===null||o===null)return void Dg(s,l,p);if(p.setTextNodeRange(s,n,s,o),s.isSegmented()){let g=Wt(s.getTextContent());s.replace(g),s=g}Dg(s,l,p)}}}function Dg(t,e,n){if(t.setTextContent(e),G(n)){let o=t.getKey();for(let r of["anchor","focus"]){let s=n[r];s.type==="text"&&s.key===o&&(s.offset=je(t,s.offset,"clamp"))}}}function pi(t,e,n){let o=e[n]||!1;return o==="any"||o===t[n]}function op(t,e){return pi(t,e,"altKey")&&pi(t,e,"ctrlKey")&&pi(t,e,"shiftKey")&&pi(t,e,"metaKey")}function dt(t,e,n){if(!op(t,n))return!1;if(t.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1)return!1;if(t.key.length===1&&t.key.charCodeAt(0)<=127)return!1;let o="Key"+e.toUpperCase();return t.code===o}var Pn={ctrlKey:!Ve,metaKey:Ve},wg={altKey:Ve,ctrlKey:!Ve};function Rg(t){return t.key==="Backspace"}function $g(t){return dt(t,"a",Pn)}function OT(t){let e=Me();if(G(t)){let{anchor:n,focus:o}=t,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),bi(t),t}{let n=e.select(0,e.getChildrenSize());return ye(bi(n)),n}}function hr(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});let n=t.__lexicalClassNameCache,o=n[e];if(o!==void 0)return o;let r=t[e];if(typeof r=="string"){let s=$s(r);return n[e]=s,s}return r}function Zc(t,e,n,o,r){if(n.size===0)return;let{__type:s,__key:i}=o,l=e.get(s);l===void 0&&R(33,s);let a=l.klass,c=t.get(a);c===void 0&&(c=new Map,t.set(a,c));let u=c.get(i),d=u==="destroyed"&&r==="created";(u===void 0||d)&&c.set(i,d?"updated":r)}function MT(t){let e=t.getType(),n=Yn();if(n._readOnly){let s=mc(n).get(e);return s?Array.from(s.values()):[]}let o=n._nodeMap,r=[];for(let[,s]of o)s instanceof t&&s.__type===e&&s.isAttached()&&r.push(s);return r}function Ig(t,e,n){let o=t.getParent(),r=n,s=t;return o!==null&&(e&&n===0?(r=s.getIndexWithinParent(),s=o):e||n!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(e?r-1:r)}function rp(t,e){let n=t.offset;if(t.type==="element")return Ig(t.getNode(),e,n);{let o=t.getNode();if(e&&n===0||!e&&n===o.getTextContentSize()){let r=e?o.getPreviousSibling():o.getNextSibling();return r===null?Ig(o.getParentOrThrow(),e,o.getIndexWithinParent()+(e?0:1)):r}}return null}function sp(t){let e=Ae(t).event,n=e&&e.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function P(t,e,n){return function(o,r,s){let i=Vc(o);for(let l=4;l>=0;l--)for(let a=0;a<i.length;a++){let c=i[a],u=c._commands.get(r);if(u!==void 0){let d=u[l];if(d!==void 0){let f=Array.from(d),h=f.length,p=!1;if(hn(c,()=>{for(let g=0;g<h;g++)if(f[g](s,o))return void(p=!0)}),p)return p}}}return!1}(t,e,n)}function _r(t,e){let n=t._keyToDOMMap.get(e);return n===void 0&&R(75,e),n}function vs(t){let e=t.assignedSlot||t.parentElement;return up(e)?e.host:e}function Qc(t){return qh(t)?t:de(t)?t.ownerDocument:null}function AT(t){return _t()._updateTags.has(t)}function qi(t){zt(),_t()._updateTags.add(t)}function ip(t){zt(),_t()._deferred.push(t)}function ki(t,e){let n=t.getParent();for(;n!==null;){if(n.is(e))return!0;n=n.getParent()}return!1}function jc(t){let e=Qc(t);return e?e.defaultView:null}function Ae(t){let e=t._window;return e===null&&R(78),e}function vT(t){return D(t)&&t.isInline()||Ct(t)&&t.isInline()}function lp(t){let e=t.getParentOrThrow();for(;e!==null;){if(ke(e))return e;e=e.getParentOrThrow()}return e}function ke(t){return Zt(t)||D(t)&&t.isShadowRoot()}function tu(t,e=!1){let n=t.constructor.clone(t);return Zh(n,null),n.afterCloneFrom(t),e||n.resetOnCopyNodeFrom(t),n}function Ds(t){let e=_t(),n=t.getType(),o=Uc(e,n);o===void 0&&R(200,t.constructor.name,n);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(t),l=i.constructor;return s!==null?i instanceof s||R(201,s.name,s.getType(),l.name,l.getType(),t.constructor.name,n):i instanceof t.constructor&&l!==t.constructor||R(202,l.name,l.getType(),t.constructor.name,n),i.__key===t.__key&&R(203,t.constructor.name,n,l.name,l.getType()),i}return t}function Ya(t,e){!Zt(t.getParent())||D(e)||Ct(e)||R(99)}function ap(t){let e=Ft(t);return e===null&&R(63,t),e}function Ga(t){return(Ct(t)||D(t)&&!t.canBeEmpty())&&!t.isInline()}function pc(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;let o=t.parentElement;o!==null&&o.removeChild(t)}function nn(t){return en?(t||window).getSelection():null}function cp(t){let e=jc(t);return e?e.getSelection():null}function DT(t,e){let n=t.getChildAtIndex(e);n==null&&(n=t),ke(t)&&R(102);let o=(i)=>{let l=i.getParentOrThrow(),a=ke(l),c=i!==n||a?tu(i):i;if(a)return D(i)&&D(c)||R(133),i.insertAfter(c),[i,c,c];{let[u,d,f]=o(l),h=i.getNextSiblings();return f.append(c,...h),[u,d,c]}},[r,s]=o(n);return[r,s]}function wT(t){return de(t)&&t.tagName==="A"}function de(t){return Er(t)&&t.nodeType===1}function Er(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"}function up(t){return Er(t)&&t.nodeType===11}function dp(t){let e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return t.nodeName.match(e)!==null}function _c(t){let e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return t.nodeName.match(e)!==null}function Wn(t){if(Ct(t)&&!t.isInline())return!0;if(!D(t)||ke(t))return!1;let e=t.getFirstChild(),n=e===null||vo(e)||B(e)||e.isInline();return!t.isInline()&&t.canBeEmpty()!==!1&&n}function eu(){return _t()}var Fg=new WeakMap,RT=new Map;function mc(t){if(!t._readOnly&&t.isEmpty())return RT;t._readOnly||R(192);let e=Fg.get(t);return e||(e=function(n){let o=new Map;for(let[r,s]of n._nodeMap){let i=s.__type,l=o.get(i);l||(l=new Map,o.set(i,l)),l.set(r,s)}return o}(t),Fg.set(t,e)),e}function nu(t){let e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function $T(t){return(e=nu(t))[Oh]=!0,e;var e}function fp(t,e){let n=parseInt(t.style.paddingInlineStart,10)||0,o=Math.round(n/40);e.setIndent(o)}function IT(t){t.__lexicalUnmanaged=!0}function gp(t){return t.__lexicalUnmanaged===!0}function is(t,e){return function(n,o){return Object.prototype.hasOwnProperty.call(n,o)}(t,e)&&t[e]!==Ze[e]}function ws(t){let e=Jf in t.prototype?t.prototype[Jf]():void 0,n=function(i){if(!(i===Ze||i.prototype instanceof Ze)){let l="<unknown>",a="<unknown>";try{l=i.getType()}catch(c){}try{Ro.version&&(a=JSON.parse(Ro.version))}catch(c){}R(290,i.name,l,a)}return i===Gi||i===Bo||i===Ze}(t),o=!n&&is(t,"getType")?t.getType():void 0,r,s=o;if(e)if(o)r=e[o];else for(let[i,l]of Object.entries(e))s=i,r=l;if(!n&&s&&(is(t,"getType")||(t.getType=()=>s),is(t,"clone")||(t.clone=(i)=>(zc(i),new t)),is(t,"importJSON")||(t.importJSON=r&&r.$importJSON||((i)=>new t().updateFromJSON(i))),!is(t,"importDOM")&&r)){let{importDOM:i}=r;i&&(t.importDOM=()=>i)}return{ownNodeConfig:r,ownNodeType:s}}function FT(t){let e=eu();return zt(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t))).klass}var fs=(t,e)=>{let n=t;for(;n!=null&&!Zt(n);){if(e(n))return n;n=n.getParent()}return null},LT={next:"previous",previous:"next"};class Rs{origin;constructor(t){this.origin=t}[Symbol.iterator](){return lu({hasNext:Lo,initial:this.getAdjacentCaret(),map:(t)=>t,step:(t)=>t.getAdjacentCaret()})}getAdjacentCaret(){return Gt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Gt(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,e){let n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(n===null?this.insert(t):n.replace(t,e)),this}splice(t,e,n="next"){let o=n===this.direction?e:Array.from(e).reverse(),r=this,s=this.getParentAtCaret(),i=new Map;for(let l=r.getAdjacentCaret();l!==null&&i.size<t;l=l.getAdjacentCaret()){let a=l.origin.getWritable();i.set(a.getKey(),a)}for(let l of o){if(i.size>0){let a=r.getNodeAtCaret();if(a)if(i.delete(a.getKey()),i.delete(l.getKey()),a.is(l)||r.origin.is(l));else{let c=l.getParent();c&&c.is(s)&&l.remove(),a.replace(l)}else a===null&&R(263,Array.from(i).join(" "))}else r.insert(l);r=Gt(l,this.direction)}for(let l of i.values())l.remove();return this}}class Ts extends Rs{type="child";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:Un(t,this.direction)}getParentCaret(t="root"){return Gt(ou(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=co(this.direction);return Gt(this.getNodeAtCaret(),t)||Un(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Ts&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}var kT={root:Zt,shadowRoot:ke};function co(t){return LT[t]}function ou(t,e="root"){return kT[e](t)?null:t}class Io extends Rs{type="sibling";getLatest(){let t=this.origin.getLatest();return t===this.origin?this:Gt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return D(this.origin)?Un(this.origin,this.direction):null}getParentCaret(t="root"){return Gt(ou(this.getParentAtCaret(),t),this.direction)}getFlipped(){let t=co(this.direction);return Gt(this.getNodeAtCaret(),t)||Un(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Io&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Io||t instanceof Fo)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Fo extends Rs{type="text";offset;constructor(t,e){super(t),this.offset=e}getLatest(){let t=this.origin.getLatest();return t===this.origin?this:so(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Gt(ou(this.getParentAtCaret(),t),this.direction)}getFlipped(){return so(this.origin,co(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Fo&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Io||t instanceof Fo)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Gt(this.origin,this.direction)}}function Hn(t){return t instanceof Fo}function PT(t){return t instanceof Rs}function Lo(t){return t instanceof Io}function Qe(t){return t instanceof Ts}var KT={next:class extends Fo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Fo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},BT={next:class extends Io{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Io{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},WT={next:class extends Ts{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends Ts{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Gt(t,e){return t?new BT[e](t):null}function so(t,e,n){return t?new KT[e](t,je(t,n)):null}function je(t,e,n="error"){let o=t.getTextContentSize(),r=e==="next"?o:e==="previous"?0:e;return(r<0||r>o)&&(n!=="clamp"&&Pg(284,String(e),String(o),t.getKey()),r=r<0?0:o),r}function Cc(t,e){return new su(t,e)}function Un(t,e){return D(t)?new WT[e](t):null}function hp(t){return t&&t.getChildCaret()||t}function mr(t){return t&&hp(t.getAdjacentCaret())}class ru{type="node-caret-range";direction;anchor;focus;constructor(t,e,n){this.anchor=t,this.focus=e,this.direction=n}getLatest(){let t=this.anchor.getLatest(),e=this.focus.getLatest();return t===this.anchor&&e===this.focus?this:new ru(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let t=(o)=>{let r=this[o].getLatest();return Hn(r)?function(s,i){let{direction:l,origin:a}=s,c=je(a,i==="focus"?co(l):l);return Cc(s,c-s.offset)}(r,o):null},e=t("anchor"),n=t("focus");if(e&&n){let{caret:o}=e,{caret:r}=n;if(o.isSameNodeCaret(r))return[Cc(o,r.offset-o.offset),null]}return[e,n]}iterNodeCarets(t="root"){let e=Hn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),o=Hn(n),r=(s)=>s.isSameNodeCaret(n)?null:mr(s)||s.getParentCaret(t);return lu({hasNext:(s)=>s!==null&&!(o&&n.isSameNodeCaret(s)),initial:e.isSameNodeCaret(n)?null:r(e),map:(s)=>s,step:r})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class su{type="slice";caret;distance;constructor(t,e){this.caret=t,this.distance=e}getSliceIndices(){let{distance:t,caret:{offset:e}}=this,n=e+t;return n<e?[n,e]:[e,n]}getTextContent(){let[t,e]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,e)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:e}}=this,[n,o]=this.getSliceIndices(),r=t.getTextContent();return so(t.setTextContent(r.slice(0,n)+r.slice(o)),e,n)}}function zT(t){return t instanceof su}function iu(t){return io(t,Gt(Me(),t.direction))}function pp(t){return io(t,t)}function io(t,e){return t.direction!==e.direction&&R(265),new ru(t,e,t.direction)}function lu(t){let{initial:e,hasNext:n,step:o,map:r}=t,s=e;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function au(t,e){let n=gs(t.origin,e.origin);switch(n===null&&R(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{let o=t.type==="text",r=e.type==="text";return o&&r?function(s,i){return Math.sign(s-i)}(t.offset,e.offset):t.type===e.type?0:o?-1:r?1:t.type==="child"?-1:1}case"ancestor":return t.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return cu(n)}}function cu(t){let{a:e,b:n}=t,o=e.__key,r=n.__key,s=e,i=n;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function _i(t,e){return e.is(t)}function Lg(t){return D(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function gs(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};let n=new Map;for(let[o,r]=Lg(t);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=Lg(e);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(_i(t,o)||R(276),{commonAncestor:o,type:"ancestor"}):r===null?(_i(e,o)||R(277),{commonAncestor:o,type:"descendant"}):((D(s)||_i(t,s))&&(D(r)||_i(e,r))&&o.is(s.getParent())&&o.is(r.getParent())||R(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function lo(t,e){let{type:n,key:o,offset:r}=t,s=ap(t.key);return n==="text"?(B(s)||R(266,s.getType(),o),so(s,e,r)):(D(s)||R(267,s.getType(),o),xp(s,t.offset,e))}function Cr(t,e){let{origin:n,direction:o}=e,r=o==="next";Hn(e)?t.set(n.getKey(),e.offset,"text"):Lo(e)?B(n)?t.set(n.getKey(),je(n,o),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Qe(e)&&D(n)||R(268),t.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function _p(t){let e=ct(),n=G(e)?e:Ph();return hs(n,t),ye(n),n}function hs(t,e){Cr(t.anchor,e.anchor),Cr(t.focus,e.focus)}function xc(t){let{anchor:e,focus:n}=t,o=lo(e,"next"),r=lo(n,"next"),s=au(o,r)<=0?"next":"previous";return io(ao(o,s),ao(r,s))}function br(t){let{direction:e,origin:n}=t,o=Gt(n,co(e)).getNodeAtCaret();return o?Gt(o,e):Un(n.getParentOrThrow(),e)}function kg(t,e="root"){let n=[t];for(let o=Qe(t)?t.getParentCaret(e):t.getSiblingCaret();o!==null;o=o.getParentCaret(e))n.push(br(o));return n}function Ja(t){return!!t&&t.origin.isAttached()}function mp(t,e="removeEmptySlices"){if(t.isCollapsed())return t;let n="root",o="next",r=e,s=uu(t,o),i=kg(s.anchor,n),l=kg(s.focus.getFlipped(),n),a=new Set,c=[];for(let p of s.iterNodeCarets(n))if(Qe(p))a.add(p.origin.getKey());else if(Lo(p)){let{origin:g}=p;D(g)&&!a.has(g.getKey())||c.push(g)}for(let p of c)p.remove();for(let p of s.getTextSlices()){if(!p)continue;let{origin:g}=p.caret,_=g.getTextContentSize(),m=br(Gt(g,o)),C=g.getMode();if(Math.abs(p.distance)===_&&r==="removeEmptySlices"||C==="token"&&p.distance!==0)m.remove();else if(p.distance!==0){r="removeEmptySlices";let x=p.removeTextSlice(),N=p.caret.origin;if(C==="segmented"){let T=x.origin,y=Wt(T.getTextContent()).setStyle(T.getStyle()).setFormat(T.getFormat());m.replaceOrInsert(y),x=so(y,o,x.offset)}N.is(i[0].origin)&&(i[0]=x),N.is(l[0].origin)&&(l[0]=x.getFlipped())}}let u,d;for(let p of i)if(Ja(p)){u=Xe(p);break}for(let p of l)if(Ja(p)){d=Xe(p);break}let f=function(p,g,_){if(!p||!g)return null;let m=p.getParentAtCaret(),C=g.getParentAtCaret();if(!m||!C)return null;let x=m.getParents().reverse();x.push(m);let N=C.getParents().reverse();N.push(C);let T=Math.min(x.length,N.length),y;for(y=0;y<T&&x[y]===N[y];y++);let S=($,I)=>{let k;for(let L=y;L<$.length;L++){let z=$[L];if(ke(z))return;!k&&I(z)&&(k=z)}return k},E=S(x,Wn),O=E&&S(N,($)=>_.has($.getKey())&&Wn($));return E&&O?[E,O]:null}(u,d,a);if(f){let[p,g]=f;Un(p,"previous").splice(0,g.getChildren());let _=g.getParent();for(g.remove(!0);_&&_.isEmpty();){let m=_;_=_.getParent(),m.remove(!0)}}let h=[u,d,...i,...l].find(Ja);if(h)return pp(ao(Xe(h),t.direction));R(269,JSON.stringify(i.map((p)=>p.origin.__key)))}function Xe(t){let e=function(r){let s=r;for(;Qe(s);){let i=mr(s);if(!Qe(i))break;s=i}return s}(t.getLatest()),{direction:n}=e;if(B(e.origin))return Hn(e)?e:so(e.origin,n,n);let o=e.getAdjacentCaret();return Lo(o)&&B(o.origin)?so(o.origin,n,co(n)):e}function Cp(t){return Hn(t)&&t.offset!==je(t.origin,t.direction)}function ao(t,e){return t.direction===e?t:t.getFlipped()}function uu(t,e){return t.direction===e?t:io(ao(t.focus,e),ao(t.anchor,e))}function xp(t,e,n){let o=Un(t,"next");for(let r=0;r<e;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return ao(o,n)}function HT(t,e="root"){let n=0,o=t,r=mr(o);for(;r===null;){if(n--,r=o.getParentCaret(e),!r)return null;o=r,r=mr(o)}return r&&[r,n]}function UT(t){let{origin:e,offset:n,direction:o}=t;if(n===je(e,o))return t.getSiblingCaret();if(n===je(e,co(o)))return br(t.getSiblingCaret());let[r]=e.splitText(n);return B(r)||R(281),ao(Gt(r,"next"),o)}function YT(t,e){return!0}function GT(t,{$copyElementNode:e=tu,$splitTextPointCaretNext:n=UT,rootMode:o="shadowRoot",$shouldSplit:r=YT}={}){if(Hn(t))return n(t);let s=t.getParentCaret(o);if(s){let{origin:i}=s;if(Qe(t)&&(!i.canBeEmpty()||!r(i,"first")))return br(s);let l=function(a){let c=[];for(let u=a.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c}(t);(l.length>0||i.canBeEmpty()&&r(i,"last"))&&s.insert(e(i).splice(0,0,l))}return s}function JT(t){return t}function VT(...t){return t}function XT(t,e){return[t,e]}function qT(t){return t}function ZT(t,e){if(!e||t===e)return t;for(let n in e)if(t[n]!==e[n])return{...t,...e};return t}function $s(...t){let e=[];for(let n of t)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))e.push(o);return e}function QT(t,...e){let n=$s(...e);n.length>0&&t.classList.add(...n)}function jT(t,...e){let n=$s(...e);n.length>0&&t.classList.remove(...n)}function yp(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}var b=du,fu=b.$addUpdateTag,fe=b.$applyNodeReplacement,_n=b.$caretFromPoint,Zi=b.$caretRangeFromSelection,Qi=b.$cloneWithProperties,Sp=b.$cloneWithPropertiesEphemeral,IM=b.$comparePointCaretNext,Jt=b.$copyNode,ji=b.$create,Pe=b.$createLineBreakNode,Np=b.$createNodeSelection,X=b.$createParagraphNode,mn=b.$createPoint,Cn=b.$createRangeSelection,Tp=b.$createRangeSelectionFromDom,Se=b.$createTabNode,wt=b.$createTextNode,Is=b.$extendCaretToRange,on=b.$findMatchingParent,Fs=b.$getAdjacentChildCaret,gu=b.$getAdjacentNode,Wo=b.$getAdjacentSiblingOrParentSiblingCaret,hu=b.$getCaretInDirection,Or=b.$getCaretRange,tl=b.$getCaretRangeInDirection,Ep=b.$getCharacterOffsets,ge=b.$getChildCaret,FM=b.$getChildCaretAtIndex,pu=b.$getChildCaretOrSelf,bp=b.$getCollapsedCaretRange,LM=b.$getCommonAncestor,kM=b.$getCommonAncestorResultBranchOrder,Gn=b.$getEditor,Lt=b.$getNearestNodeFromDOMNode,PM=b.$getNearestRootOrShadowRoot,Vt=b.$getNodeByKey,Ls=b.$getNodeByKeyOrThrow,Op=b.$getNodeFromDOMNode,Ke=b.$getPreviousSelection,xt=b.$getRoot,v=b.$getSelection,oe=b.$getSiblingCaret,zo=b.$getState,KM=b.$getStateChange,BM=b.$getTextContent,WM=b.$getTextNodeOffset,Mp=b.$getTextPointCaret,zM=b.$getTextPointCaretSlice,HM=b.$getWritableNodeState,Ap=b.$hasAncestor,UM=b.$hasUpdateTag,el=b.$insertNodes,Mr=b.$isBlockElementNode,uo=b.$isChildCaret,Be=b.$isDecoratorNode,vp=b.$isEditorState,F=b.$isElementNode,nl=b.$isExtendableTextPointCaret,Dp=b.$isInlineElementOrDecoratorNode,ks=b.$isLeafNode,yt=b.$isLineBreakNode,YM=b.$isNodeCaret,Xt=b.$isNodeSelection,rn=b.$isParagraphNode,A=b.$isRangeSelection,Jn=b.$isRootNode,jt=b.$isRootOrShadowRoot,ol=b.$isSiblingCaret,he=b.$isTabNode,K=b.$isTextNode,Ps=b.$isTextPointCaret,GM=b.$isTextPointCaretSlice,_u=b.$isTokenOrSegmented,JM=b.$isTokenOrTab,VM=b.$nodesOfType,We=b.$normalizeCaret,xn=b.$normalizeSelection__EXPERIMENTAL,XM=b.$onUpdate,wp=b.$parseSerializedNode,Rp=b.$removeTextFromCaretRange,rl=b.$rewindSiblingCaret,sl=b.$selectAll,qM=b.$setCompositionKey,yn=b.$setPointFromCaret,St=b.$setSelection,Ks=b.$setSelectionFromCaretRange,Vn=b.$setState,mu=b.$splitAtPointCaretNext,$p=b.$splitNode,ZM=b.$updateRangeSelectionFromCaretRange,Cu=b.ArtificialNode__DO_NOT_USE,QM=b.BEFORE_INPUT_COMMAND,jM=b.BLUR_COMMAND,Ho=b.CAN_REDO_COMMAND,Uo=b.CAN_UNDO_COMMAND,il=b.CLEAR_EDITOR_COMMAND,Ip=b.CLEAR_HISTORY_COMMAND,Ar=b.CLICK_COMMAND,Fp=b.COLLABORATION_TAG,vr=b.COMMAND_PRIORITY_CRITICAL,Q=b.COMMAND_PRIORITY_EDITOR,ve=b.COMMAND_PRIORITY_HIGH,st=b.COMMAND_PRIORITY_LOW,tA=b.COMMAND_PRIORITY_NORMAL,eA=b.COMPOSITION_END_COMMAND,Lp=b.COMPOSITION_END_TAG,nA=b.COMPOSITION_START_COMMAND,kp=b.COMPOSITION_START_TAG,ll=b.CONTROLLED_TEXT_INSERTION_COMMAND,al=b.COPY_COMMAND,cl=b.CUT_COMMAND,Dr=b.DELETE_CHARACTER_COMMAND,Bs=b.DELETE_LINE_COMMAND,ul=b.DELETE_WORD_COMMAND,oA=b.DRAGEND_COMMAND,Pp=b.DRAGOVER_COMMAND,Kp=b.DRAGSTART_COMMAND,Bp=b.DROP_COMMAND,dl=b.DecoratorNode,re=b.ElementNode,Wp=b.FOCUS_COMMAND,fl=b.FORMAT_ELEMENT_COMMAND,ze=b.FORMAT_TEXT_COMMAND,wr=b.HISTORIC_TAG,fo=b.HISTORY_MERGE_TAG,zp=b.HISTORY_PUSH_TAG,He=b.INDENT_CONTENT_COMMAND,rA=b.INPUT_COMMAND,xu=b.INSERT_LINE_BREAK_COMMAND,go=b.INSERT_PARAGRAPH_COMMAND,Yo=b.INSERT_TAB_COMMAND,Ws=b.INTERNAL_$isBlock,sA=b.IS_ALL_FORMATTING,iA=b.IS_BOLD,lA=b.IS_CODE,aA=b.IS_HIGHLIGHT,cA=b.IS_ITALIC,uA=b.IS_STRIKETHROUGH,dA=b.IS_SUBSCRIPT,fA=b.IS_SUPERSCRIPT,gA=b.IS_UNDERLINE,Xn=b.KEY_ARROW_DOWN_COMMAND,Rr=b.KEY_ARROW_LEFT_COMMAND,gl=b.KEY_ARROW_RIGHT_COMMAND,sn=b.KEY_ARROW_UP_COMMAND,hl=b.KEY_BACKSPACE_COMMAND,pl=b.KEY_DELETE_COMMAND,hA=b.KEY_DOWN_COMMAND,_l=b.KEY_ENTER_COMMAND,$r=b.KEY_ESCAPE_COMMAND,pA=b.KEY_MODIFIER_COMMAND,ml=b.KEY_SPACE_COMMAND,ho=b.KEY_TAB_COMMAND,Hp=b.LineBreakNode,yu=b.MOVE_TO_END,Cl=b.MOVE_TO_START,_A=b.NODE_STATE_KEY,Sn=b.OUTDENT_CONTENT_COMMAND,xl=b.PASTE_COMMAND,Up=b.PASTE_TAG,Yp=b.ParagraphNode,yl=b.REDO_COMMAND,Gp=b.REMOVE_TEXT_COMMAND,Jp=b.RootNode,Nn=b.SELECTION_CHANGE_COMMAND,Sl=b.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Nl=b.SELECT_ALL_COMMAND,mA=b.SKIP_COLLAB_TAG,Vp=b.SKIP_DOM_SELECTION_TAG,CA=b.SKIP_SCROLL_INTO_VIEW_TAG,Xp=b.SKIP_SELECTION_FOCUS_TAG,Tl=b.TEXT_TYPE_TO_FORMAT,qp=b.TabNode,Ue=b.TextNode,El=b.UNDO_COMMAND,Tn=b.addClassNamesToElement,Su=b.buildImportMap,bl=b.configExtension,Ne=b.createCommand,Ol=b.createEditor,xA=b.createSharedNodeState,zs=b.createState,Zp=b.declarePeerDependency,it=b.defineExtension,yA=b.flipDirection,SA=b.getDOMOwnerDocument,po=b.getDOMSelection,NA=b.getDOMSelectionFromTarget,Qp=b.getDOMTextNode,TA=b.getEditorPropertyFromDOMNode,Ml=b.getNearestEditorFromDOMNode,jp=b.getRegisteredNode,EA=b.getRegisteredNodeOrThrow,bA=b.getStaticNodeConfig,t_=b.getTextDirection,OA=b.getTransformSetFromKlass,e_=b.isBlockDomNode,n_=b.isCurrentlyReadOnlyMode,o_=b.isDOMDocumentNode,ln=b.isDOMNode,MA=b.isDOMTextNode,AA=b.isDOMUnmanaged,Nu=b.isDocumentFragment,vA=b.isExactShortcutMatch,r_=b.isHTMLAnchorElement,qn=b.isHTMLElement,Hs=b.isInlineDomNode,DA=b.isLexicalEditor,wA=b.isModifierMatch,s_=b.isSelectionCapturedInDecoratorInput,i_=b.isSelectionWithinEditor,Tu=b.makeStepwiseIterator,se=b.mergeRegister,Us=b.normalizeClassNames,Ir=b.removeClassNamesFromElement,RA=b.removeFromParent,$A=b.resetRandomKey,Rt=b.safeCast,l_=b.setDOMUnmanaged,Eu=b.setNodeIndentFromDOM,_o=b.shallowMergeConfig,bu=b.toggleTextFormatType;var Ou={};at(Ou,{LexicalComposer:()=>e0});var Fr=Dt(Bt(),1);var a_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,t0=a_?Fr.useLayoutEffect:Fr.useEffect,Al={tag:fo};function e0({initialConfig:t,children:e}){let n=Fr.useMemo(()=>{let{theme:o,namespace:r,nodes:s,onError:i,editorState:l,html:a}=t,c=Gf(null,o),u=Ol({editable:t.editable,html:a,namespace:r,nodes:s,onError:(d)=>i(d,u),theme:o});return function(d,f){if(f===null)return;if(f===void 0)d.update(()=>{let h=xt();if(h.isEmpty()){let p=X();h.append(p);let g=a_?document.activeElement:null;(v()!==null||g!==null&&g===d.getRootElement())&&p.select()}},Al);else if(f!==null)switch(typeof f){case"string":{let h=d.parseEditorState(f);d.setEditorState(h,Al);break}case"object":d.setEditorState(f,Al);break;case"function":d.update(()=>{xt().isEmpty()&&f(d)},Al)}}(u,l),[u,c]},[]);return t0(()=>{let o=t.editable,[r]=n;r.setEditable(o===void 0||o)},[]),w(Yf.Provider,{value:n,children:e})}var n0=Ou,c_=n0.LexicalComposer;var Mu={};at(Mu,{useLexicalEditable:()=>s0});var En=Dt(Bt(),1),o0=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?En.useLayoutEffect:En.useEffect;function r0(t){return{initialValueFn:()=>t.isEditable(),subscribe:(e)=>t.registerEditableListener(e)}}function s0(){return function(t){let[e]=mt(),n=En.useMemo(()=>t(e),[e,t]),[o,r]=En.useState(()=>n.initialValueFn()),s=En.useRef(o);return o0(()=>{let{initialValueFn:i,subscribe:l}=n,a=i();return s.current!==a&&(s.current=a,r(a)),l((c)=>{s.current=c,r(c)})},[n,t]),o}(r0)}var i0=Mu,u_=i0.useLexicalEditable;var $u={};at($u,{trimTextContentFromAnchor:()=>S0,getStyleObjectFromCSS:()=>wl,getCSSFromStyleObject:()=>p_,createRectsFromDOMRange:()=>a0,createDOMRange:()=>l0,$wrapNodes:()=>_0,$trimTextContentFromAnchor:()=>__,$sliceSelectedTextNodeContent:()=>u0,$shouldOverrideDefaultCharacterSelection:()=>m0,$setBlocksType:()=>h0,$selectAll:()=>sl,$patchStyleText:()=>g0,$moveCharacter:()=>C0,$moveCaretSelection:()=>N_,$isParentRTL:()=>c0,$isParentElementRTL:()=>Ru,$isAtNodeEnd:()=>d0,$getSelectionStyleValueForProperty:()=>y0,$getComputedStyleForParent:()=>wu,$getComputedStyleForElement:()=>Du,$forEachSelectedTextNode:()=>m_,$ensureForwardRangeSelection:()=>C_,$copyBlockFormatIndent:()=>x_,$cloneWithProperties:()=>Qi,$addNodeStyle:()=>f0});function vu(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Dl=new Map;function d_(t){let e=t;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function f_(t){let e=t.parentNode;if(e==null)throw Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(t)]}function l0(t,e,n,o,r){let s=e.getKey(),i=o.getKey(),l=document.createRange(),a=t.getElementByKey(s),c=t.getElementByKey(i),u=n,d=r;if(K(e)&&(a=d_(a)),K(o)&&(c=d_(c)),e===void 0||o===void 0||a===null||c===null)return null;a.nodeName==="BR"&&([a,u]=f_(a)),c.nodeName==="BR"&&([c,d]=f_(c));let f=a.firstChild;a===c&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{l.setStart(a,u),l.setEnd(c,d)}catch(h){return null}return!l.collapsed||u===d&&s===i||(l.setStart(c,d),l.setEnd(a,u)),l}function a0(t,e){let n=t.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(e.getClientRects()),l,a=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<a;c++){let u=i[c],d=l&&l.top<=u.top&&l.top+l.height>u.top&&l.left+l.width>u.left,f=u.width+s===o.width;d||f?(i.splice(c--,1),a--):l=u}return i}function h_(t){let e={};if(!t)return e;let n=t.split(";");for(let o of n)if(o!==""){let[r,s]=o.split(/:([^]+)/);r&&s&&(e[r.trim()]=s.trim())}return e}function wl(t){let e=Dl.get(t);return e===void 0&&(e=h_(t),Dl.set(t,e)),e}function p_(t){let e="";for(let n in t)n&&(e+=`${n}: ${t[n]};`);return e}function Du(t){let e=Gn().getElementByKey(t.getKey());if(e===null)return null;let n=e.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(e)}function wu(t){return Du(Jn(t)?t:t.getParentOrThrow())}function c0(t){let e=wu(t);return e!==null&&e.direction==="rtl"}function u0(t,e,n="self"){let o=t.getStartEndPoints();if(e.isSelected(t)&&!_u(e)&&o!==null){let[r,s]=o,i=t.isBackward(),l=r.getNode(),a=s.getNode(),c=e.is(l),u=e.is(a);if(c||u){let[d,f]=Ep(t),h=l.is(a),p=e.is(i?a:l),g=e.is(i?l:a),_,m=0;if(h)m=d>f?f:d,_=d>f?d:f;else if(p)m=i?f:d,_=void 0;else if(g)m=0,_=i?d:f;let C=e.__text.slice(m,_);C!==e.__text&&(n==="clone"&&(e=Sp(e)),e.__text=C)}}return e}function d0(t){if(t.type==="text")return t.offset===t.getNode().getTextContentSize();let e=t.getNode();return F(e)||vu(177),t.offset===e.getChildrenSize()}function __(t,e,n){let o=e.getNode(),r=n;if(F(o)){let s=o.getDescendantByIndex(e.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(F(o)){let c=o.getLastDescendant();c!==null&&(o=c)}let s=o.getPreviousSibling(),i=0;if(s===null){let c=o.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let l=o.getTextContent();l===""&&F(o)&&!o.isInline()&&(l=`
13
-
14
- `);let a=l.length;if(!K(o)||r>=a){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||Jn(c)||c.remove(),r-=a+i,o=s}else{let c=o.getKey(),u=t.getEditorState().read(()=>{let h=Vt(c);return K(h)&&h.isSimpleText()?h.getTextContent():null}),d=a-r,f=l.slice(0,d);if(u!==null&&u!==l){let h=Ke(),p=o;if(o.isSimpleText())o.setTextContent(u);else{let g=wt(u);o.replace(g),p=g}if(A(h)&&h.isCollapsed()){let g=h.anchor.offset;p.select(g,g)}}else if(o.isSimpleText()){let h=e.key===c,p=e.offset;p<r&&(p=a);let g=h?p-r:0,_=h?p:d;if(h&&g===0){let[m]=o.splitText(g,_);m.remove()}else{let[,m]=o.splitText(g,_);m.remove()}}else{let h=wt(f);o.replace(h)}r=0}}}function f0(t){let e=t.getStyle(),n=h_(e);Dl.set(e,n)}function vl(t,e){(A(t)?t.isCollapsed():K(t)||F(t))||vu(280);let n=wl(A(t)?t.style:K(t)?t.getStyle():t.getTextStyle()),o=Object.entries(e).reduce((s,[i,l])=>(typeof l=="function"?s[i]=l(n[i],t):l===null?delete s[i]:s[i]=l,s),{...n}),r=p_(o);A(t)||K(t)?t.setStyle(r):t.setTextStyle(r),Dl.set(r,o)}function g0(t,e){if(A(t)&&t.isCollapsed()){vl(t,e);let o=t.anchor.getNode();F(o)&&o.isEmpty()&&vl(o,e)}m_((o)=>{vl(o,e)});let n=t.getNodes();if(n.length>0){let o=new Set;for(let r of n){if(!F(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();o.has(s)||(o.add(s),vl(r,e))}}}function m_(t){let e=v();if(!e)return;let n=new Map,o=(s)=>n.get(s.getKey())||[0,s.getTextContentSize()];if(A(e))for(let s of Zi(e).getTextSlices())s&&n.set(s.caret.origin.getKey(),s.getSliceIndices());let r=e.getNodes();for(let s of r){if(!K(s)||!s.canHaveFormat())continue;let[i,l]=o(s);if(l!==i)if(_u(s)||i===0&&l===s.getTextContentSize())t(s);else t(s.splitText(i,l)[i===0?0:1])}A(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&C_(e)}function C_(t){if(t.isBackward()){let{anchor:e,focus:n}=t,{key:o,offset:r,type:s}=e;e.set(n.key,n.offset,n.type),n.set(o,r,s)}}function x_(t,e){let n=t.getFormatType(),o=t.getIndent();n!==e.getFormatType()&&e.setFormat(n),o!==e.getIndent()&&e.setIndent(o)}function h0(t,e,n=x_){if(t===null)return;let o=t.getStartEndPoints(),r=new Map,s=null;if(o){let[i,l]=o;s=Cn(),s.anchor.set(i.key,i.offset,i.type),s.focus.set(l.key,l.offset,l.type);let a=on(i.getNode(),Ws),c=on(l.getNode(),Ws);F(a)&&r.set(a.getKey(),a),F(c)&&r.set(c.getKey(),c)}for(let i of t.getNodes())if(F(i)&&Ws(i))r.set(i.getKey(),i);else if(o===null){let l=on(i,Ws);F(l)&&r.set(l.getKey(),l)}for(let[i,l]of r){let a=e();n(l,a),l.replace(a,!0),s&&(i===s.anchor.key&&s.anchor.set(a.getKey(),s.anchor.offset,s.anchor.type),i===s.focus.key&&s.focus.set(a.getKey(),s.focus.offset,s.focus.type))}s&&t.is(v())&&St(s)}function g_(t){return t.getNode().isAttached()}function p0(t){let e=t;for(;e!==null&&!jt(e);){let n=e.getLatest(),o=e.getParent();n.getChildrenSize()===0&&e.remove(!0),e=o}}function _0(t,e,n=null){let o=t.getStartEndPoints(),r=o?o[0]:null,s=t.getNodes(),i=s.length;if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let c=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=c.getChildren(),d=e();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach((f)=>d.append(f)),n&&(d=n.append(d)),void c.replace(d)}let l=null,a=[];for(let c=0;c<i;c++){let u=s[c];jt(u)?(Au(t,a,a.length,e,n),a=[],l=u):l===null||l!==null&&Ap(u,l)?a.push(u):(Au(t,a,a.length,e,n),a=[u])}Au(t,a,a.length,e,n)}function Au(t,e,n,o,r=null){if(e.length===0)return;let s=e[0],i=new Map,l=[],a=F(s)?s:s.getParentOrThrow();a.isInline()&&(a=a.getParentOrThrow());let c=!1;for(;a!==null;){let p=a.getPreviousSibling();if(p!==null){a=p,c=!0;break}if(a=a.getParentOrThrow(),jt(a))break}let u=new Set;for(let p=0;p<n;p++){let g=e[p];F(g)&&g.getChildrenSize()===0&&u.add(g.getKey())}let d=new Set;for(let p=0;p<n;p++){let g=e[p],_=g.getParent();if(_!==null&&_.isInline()&&(_=_.getParent()),_!==null&&ks(g)&&!d.has(g.getKey())){let m=_.getKey();if(i.get(m)===void 0){let C=o();C.setFormat(_.getFormatType()),C.setIndent(_.getIndent()),l.push(C),i.set(m,C),_.getChildren().forEach((x)=>{C.append(x),d.add(x.getKey()),F(x)&&x.getChildrenKeys().forEach((N)=>d.add(N))}),p0(_)}}else if(u.has(g.getKey())){F(g)||vu(179);let m=o();m.setFormat(g.getFormatType()),m.setIndent(g.getIndent()),l.push(m),g.remove(!0)}}if(r!==null)for(let p=0;p<l.length;p++){let g=l[p];r.append(g)}let f=null;if(jt(a))if(c)if(r!==null)a.insertAfter(r);else for(let p=l.length-1;p>=0;p--){let g=l[p];a.insertAfter(g)}else{let p=a.getFirstChild();if(F(p)&&(a=p),p===null)if(r)a.append(r);else for(let g=0;g<l.length;g++){let _=l[g];a.append(_),f=_}else if(r!==null)p.insertBefore(r);else for(let g=0;g<l.length;g++){let _=l[g];p.insertBefore(_),f=_}}else if(r)a.insertAfter(r);else for(let p=l.length-1;p>=0;p--){let g=l[p];a.insertAfter(g),f=g}let h=Ke();A(h)&&g_(h.anchor)&&g_(h.focus)?St(h.clone()):f!==null?f.selectEnd():t.dirty=!0}function y_(t){let e=S_(t);return e!==null&&e.writingMode==="vertical-rl"}function S_(t){let e=t.anchor.getNode();return F(e)?Du(e):wu(e)}function m0(t,e){let n=y_(t)?!e:e;Ru(t)&&(n=!n);let o=_n(t.focus,n?"previous":"next");if(nl(o))return!1;for(let r of Is(o)){if(uo(r))return!r.origin.isInline();if(!F(r.origin)){if(Be(r.origin))return!0;break}}return!1}function N_(t,e,n,o){t.modify(e?"extend":"move",n,o)}function Ru(t){let e=S_(t);return e!==null&&e.direction==="rtl"}function C0(t,e,n){let o=Ru(t),r;r=y_(t)||o?!n:n,N_(t,e,r,"character")}function x0(t,e,n){let o=wl(t.getStyle());return o!==null&&o[e]||n}function y0(t,e,n=""){let o=null,r=t.getNodes(),s=t.anchor,i=t.focus,l=t.isBackward(),a=l?i.offset:s.offset,c=l?i.getNode():s.getNode();if(A(t)&&t.isCollapsed()&&t.style!==""){let u=wl(t.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<r.length;u++){let d=r[u];if((u===0||a!==0||!d.is(c))&&K(d)){let f=x0(d,e,n);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?n:o}var S0=__;var Nt=$u,T_=Nt.$addNodeStyle,HA=Nt.$cloneWithProperties,UA=Nt.$copyBlockFormatIndent,YA=Nt.$ensureForwardRangeSelection,GA=Nt.$forEachSelectedTextNode,JA=Nt.$getComputedStyleForElement,VA=Nt.$getComputedStyleForParent,XA=Nt.$getSelectionStyleValueForProperty,Iu=Nt.$isAtNodeEnd,qA=Nt.$isParentElementRTL,Fu=Nt.$isParentRTL,ZA=Nt.$moveCaretSelection,Lu=Nt.$moveCharacter,QA=Nt.$patchStyleText,jA=Nt.$selectAll,Lr=Nt.$setBlocksType,ku=Nt.$shouldOverrideDefaultCharacterSelection,Rl=Nt.$sliceSelectedTextNodeContent,tv=Nt.$trimTextContentFromAnchor,ev=Nt.$wrapNodes,nv=Nt.createDOMRange,E_=Nt.createRectsFromDOMRange,ov=Nt.getCSSFromStyleObject,Pu=Nt.getStyleObjectFromCSS,rv=Nt.trimTextContentFromAnchor;var zu={};at(zu,{selectionAlwaysOnDisplay:()=>w0,removeClassNamesFromElement:()=>Ir,registerNestedElementResolver:()=>V0,positionNodeOnRange:()=>v_,objectKlassEquals:()=>j0,mergeRegister:()=>se,mediaFileReader:()=>B0,markSelection:()=>D_,makeStateWrapper:()=>cE,isMimeType:()=>$_,isInlineDomNode:()=>Hs,isHTMLElement:()=>qn,isHTMLAnchorElement:()=>r_,isBlockDomNode:()=>e_,calculateZoomLevel:()=>oE,addClassNamesToElement:()=>Tn,IS_SAFARI:()=>K0,IS_IOS:()=>P0,IS_FIREFOX:()=>R_,IS_CHROME:()=>k0,IS_APPLE_WEBKIT:()=>L0,IS_APPLE:()=>F0,IS_ANDROID_CHROME:()=>I0,IS_ANDROID:()=>$0,CAN_USE_DOM:()=>w_,CAN_USE_BEFORE_INPUT:()=>R0,$wrapNodeInElement:()=>Q0,$unwrapNode:()=>aE,$unwrapAndFilterDescendants:()=>sE,$splitNode:()=>$p,$reverseDfsIterator:()=>k_,$reverseDfs:()=>H0,$restoreEditorState:()=>X0,$lastToFirstIterator:()=>Wu,$isEditorIsNestedEditor:()=>rE,$insertNodeToNearestRootAtCaret:()=>P_,$insertNodeToNearestRoot:()=>q0,$insertNodeIntoLeaf:()=>Z0,$insertFirst:()=>nE,$handleIndentAndOutdent:()=>eE,$getNextSiblingOrParentSibling:()=>U0,$getNextRightPreorderNode:()=>Y0,$getNearestNodeOfType:()=>G0,$getNearestBlockElementAncestorOrThrow:()=>J0,$getDepth:()=>L_,$getAdjacentSiblingOrParentSiblingCaret:()=>Wo,$getAdjacentCaret:()=>z0,$firstToLastIterator:()=>lE,$findMatchingParent:()=>on,$filter:()=>tE,$dfsIterator:()=>I_,$dfs:()=>W0,$descendantsMatching:()=>iE});function $l(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var an=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,N0=an&&"documentMode"in document?document.documentMode:null,M_=an&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),T0=an&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),E0=!(!an||!("InputEvent"in window)||N0)&&"getTargetRanges"in new window.InputEvent("input"),b0=an&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),O0=an&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,A_=an&&/Android/.test(navigator.userAgent),Bu=an&&/^(?=.*Chrome).*/i.test(navigator.userAgent),M0=an&&A_&&Bu,A0=an&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&M_&&!Bu;function bn(t){return`${t}px`}var v0={attributes:!0,characterData:!0,childList:!0,subtree:!0};function v_(t,e,n){let o=null,r=null,s=null,i=[],l=document.createElement("div");function a(){o===null&&$l(182),r===null&&$l(183);let{left:d,top:f}=r.getBoundingClientRect(),h=E_(t,e);var p,g;l.isConnected||(g=l,(p=r).insertBefore(g,p.firstChild));let _=!1;for(let m=0;m<h.length;m++){let C=h[m],x=i[m]||document.createElement("div"),N=x.style;N.position!=="absolute"&&(N.position="absolute",_=!0);let T=bn(C.left-d);N.left!==T&&(N.left=T,_=!0);let y=bn(C.top-f);N.top!==y&&(x.style.top=y,_=!0);let S=bn(C.width);N.width!==S&&(x.style.width=S,_=!0);let E=bn(C.height);N.height!==E&&(x.style.height=E,_=!0),x.parentNode!==l&&(l.append(x),_=!0),i[m]=x}for(;i.length>h.length;)i.pop();_&&n(i)}function c(){r=null,o=null,s!==null&&s.disconnect(),s=null,l.remove();for(let d of i)d.remove();i=[]}l.style.position="relative";let u=t.registerRootListener(function d(){let f=t.getRootElement();if(f===null)return c();let h=f.parentElement;if(!qn(h))return c();c(),o=f,r=h,s=new MutationObserver((p)=>{let g=t.getRootElement(),_=g&&g.parentElement;if(g!==o||_!==r)return d();for(let m of p)if(!l.contains(m.target))return a()}),s.observe(h,v0),a()});return()=>{u(),c()}}function b_(t,e,n){if(t.type!=="text"&&F(e)){let o=e.getDOMSlot(n);return[o.element,o.getFirstChildOffset()+t.offset]}return[Qp(n)||n,t.offset]}function D0(t){for(let e of t){let n=e.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==bn(-1.5)&&(n.marginTop=bn(-1.5)),n.paddingTop!==bn(4)&&(n.paddingTop=bn(4)),n.paddingBottom!==bn(0)&&(n.paddingBottom=bn(0))}}function D_(t,e=D0){let n=null,o=null,r=null,s=null,i=null,l=null,a=()=>{};function c(u){u.read(()=>{let d=v();if(!A(d))return n=null,r=null,s=null,l=null,a(),void(a=()=>{});let[f,h]=function(E){let O=E.getStartEndPoints();return E.isBackward()?[O[1],O[0]]:O}(d),p=f.getNode(),g=p.getKey(),_=f.offset,m=h.getNode(),C=m.getKey(),x=h.offset,N=t.getElementByKey(g),T=t.getElementByKey(C),y=n===null||N!==o||_!==r||g!==n.getKey(),S=s===null||T!==i||x!==l||C!==s.getKey();if((y||S)&&N!==null&&T!==null){let E=function(O,$,I,k,L,z,M){let Z=(O._window?O._window.document:document).createRange();return Z.setStart(...b_($,I,k)),Z.setEnd(...b_(L,z,M)),Z}(t,f,p,N,h,m,T);a(),a=v_(t,E,e)}n=p,o=N,r=_,s=m,i=T,l=x})}return c(t.getEditorState()),se(t.registerUpdateListener(({editorState:u})=>c(u)),()=>{a()})}function w0(t,e){let n=null,o=()=>{let r=getSelection(),s=r&&r.anchorNode,i=t.getRootElement();s!==null&&i!==null&&i.contains(s)?n!==null&&(n(),n=null):n===null&&(n=D_(t,e))};return t.registerRootListener((r)=>{if(r){let s=r.ownerDocument;return s.addEventListener("selectionchange",o),o(),()=>{n!==null&&n(),s.removeEventListener("selectionchange",o)}}})}var R0=E0,w_=an,$0=A_,I0=M0,F0=M_,L0=A0,k0=Bu,R_=T0,P0=O0,K0=b0;function $_(t,e){for(let n of e)if(t.type.startsWith(n))return!0;return!1}function B0(t,e){let n=t[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:l,value:a}=n.next();if(l)return o(s);let c=new FileReader;c.addEventListener("error",r),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:a,result:u}),i()}),$_(a,e)?c.readAsDataURL(a):i()};i()})}function W0(t,e){return Array.from(I_(t,e))}function z0(t){return t?t.getAdjacentCaret():null}function H0(t,e){return Array.from(k_(t,e))}function I_(t,e){return F_("next",t,e)}function O_(t,e){let n=Wo(oe(t,e));return n&&n[0]}function F_(t,e,n){let o=xt(),r=e||o,s=F(r)?ge(r,t):oe(r,t),i=L_(r),l=n?Fs(pu(oe(n,t)))||O_(n,t):O_(r,t),a=i;return Tu({hasNext:(c)=>c!==null,initial:s,map:(c)=>({depth:a,node:c.origin}),step:(c)=>{if(c.isSameNodeCaret(l))return null;uo(c)&&a++;let u=Wo(c);return!u||u[0].isSameNodeCaret(l)?null:(a+=u[1],u[0])}})}function U0(t){let e=Wo(oe(t,"next"));return e&&[e[0].origin,e[1]]}function L_(t){let e=-1;for(let n=t;n!==null;n=n.getParent())e++;return e}function Y0(t){let e=pu(oe(t,"previous")),n=Wo(e,"root");return n&&n[0].origin}function k_(t,e){return F_("previous",t,e)}function G0(t,e){let n=t;for(;n!=null;){if(n instanceof e)return n;n=n.getParent()}return null}function J0(t){let e=on(t,(n)=>F(n)&&!n.isInline());return F(e)||$l(4,t.__key),e}function V0(t,e,n,o){let r=(s)=>s instanceof e;return t.registerNodeTransform(e,(s)=>{let i=((l)=>{let a=l.getChildren();for(let d=0;d<a.length;d++){let f=a[d];if(r(f))return null}let c=l,u=l;for(;c!==null;)if(u=c,c=c.getParent(),r(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:l,parent:a}=i;if(l.is(s)){o(a,s);let c=l.getNextSiblings(),u=c.length;if(a.insertAfter(l),u!==0){let d=n(a);l.insertAfter(d);for(let f=0;f<u;f++)d.append(c[f])}a.canBeEmpty()||a.getChildrenSize()!==0||a.remove()}}})}function X0(t,e){let n=new Map,o=t._pendingEditorState;for(let[s,i]of e._nodeMap)n.set(s,Qi(i));o&&(o._nodeMap=n),t._dirtyType=2;let r=e._selection;St(r===null?null:r.clone())}function q0(t){let e=v()||Ke(),n;if(A(e))n=_n(e.focus,"next");else{if(e!=null){let i=e.getNodes(),l=i[i.length-1];l&&(n=oe(l,"next"))}n=n||ge(xt(),"previous").getFlipped().insert(X())}let o=P_(t,n),r=Fs(o),s=uo(r)?We(r):o;return Ks(bp(s)),t.getLatest()}function P_(t,e,n){let o=hu(e,"next");for(let r=o;r;r=mu(r,n))o=r;return Ps(o)&&$l(283),o.insert(t.isInline()?X().append(t):t),hu(oe(t.getLatest(),"next"),e.direction)}function Z0(t){let e=v();if(!A(e))return;let n=Zi(e),o=tl(Rp(n),"next").anchor;if(Ps(o)){let s=mu(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(t),Ks(Or(r,r))}function Q0(t,e){let n=e();return t.replace(n),n.append(t),n}function j0(t,e){return t!==null&&Object.getPrototypeOf(t).constructor.name===e.name}function tE(t,e){let n=[];for(let o=0;o<t.length;o++){let r=e(t[o]);r!==null&&n.push(r)}return n}function eE(t){let e=v();if(!A(e))return!1;let n=new Set,o=e.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(n.has(i))continue;let l=on(s,(c)=>F(c)&&!c.isInline());if(l===null)continue;let a=l.getKey();l.canIndent()&&!n.has(a)&&(n.add(a),t(l))}return n.size>0}function nE(t,e){ge(t,"next").insert(e)}var Ku=!(R_||!w_)&&void 0;function oE(t,e=!1){let n=1;if(function(){if(Ku===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),Ku=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Ku}()||e)for(;t;)n*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return n}function rE(t){return t._parentEditor!==null}function sE(t,e){return K_(t,e,null)}function K_(t,e,n){let o=!1;for(let r of Wu(t))e(r)?n!==null&&n(r):(o=!0,F(r)&&K_(r,e,n||((s)=>r.insertAfter(s))),r.remove());return o}function iE(t,e){let n=[],o=Array.from(t).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(e(r))n.push(r);else if(F(r))for(let s of Wu(r))o.push(s);return n}function lE(t){return B_(ge(t,"next"))}function Wu(t){return B_(ge(t,"previous"))}function B_(t){return Tu({hasNext:ol,initial:t.getAdjacentCaret(),map:(e)=>e.origin.getLatest(),step:(e)=>e.getAdjacentCaret()})}function aE(t){rl(oe(t,"next")).splice(1,t.getChildren())}function cE(t){let e=(o)=>zo(o,t),n=(o,r)=>Vn(o,t,r);return{$get:e,$set:n,accessors:[e,n],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:t}}var J=zu,Hu=J.$descendantsMatching,W_=J.$dfs,cv=J.$dfsIterator,uv=J.$filter,q=J.$findMatchingParent,dv=J.$firstToLastIterator,fv=J.$getAdjacentCaret,gv=J.$getAdjacentSiblingOrParentSiblingCaret,hv=J.$getDepth,Il=J.$getNearestBlockElementAncestorOrThrow,Fl=J.$getNearestNodeOfType,pv=J.$getNextRightPreorderNode,_v=J.$getNextSiblingOrParentSibling,Ys=J.$handleIndentAndOutdent,z_=J.$insertFirst,mv=J.$insertNodeIntoLeaf,Ll=J.$insertNodeToNearestRoot,H_=J.$insertNodeToNearestRootAtCaret,Cv=J.$isEditorIsNestedEditor,xv=J.$lastToFirstIterator,yv=J.$restoreEditorState,Sv=J.$reverseDfs,Nv=J.$reverseDfsIterator,Tv=J.$splitNode,Uu=J.$unwrapAndFilterDescendants,Ev=J.$unwrapNode,bv=J.$wrapNodeInElement,Ov=J.CAN_USE_BEFORE_INPUT,Mv=J.CAN_USE_DOM,Av=J.IS_ANDROID,vv=J.IS_ANDROID_CHROME,Dv=J.IS_APPLE,wv=J.IS_APPLE_WEBKIT,Rv=J.IS_CHROME,$v=J.IS_FIREFOX,Iv=J.IS_IOS,Fv=J.IS_SAFARI,kt=J.addClassNamesToElement,U_=J.calculateZoomLevel,Yu=J.isBlockDomNode,kl=J.isHTMLAnchorElement,ie=J.isHTMLElement,Lv=J.isInlineDomNode,kv=J.isMimeType,Pv=J.makeStateWrapper,Kv=J.markSelection,Bv=J.mediaFileReader,$t=J.mergeRegister,De=J.objectKlassEquals,Wv=J.positionNodeOnRange,zv=J.registerNestedElementResolver,On=J.removeClassNamesFromElement,Y_=J.selectionAlwaysOnDisplay;var rd={};at(rd,{watchedSignal:()=>nd,untracked:()=>Zu,signal:()=>Kr,shallowMergeConfig:()=>_o,safeCast:()=>Rt,registerTabIndentation:()=>pm,registerClearEditor:()=>om,namedSignals:()=>Br,getPeerDependencyFromEditorOrThrow:()=>OE,getPeerDependencyFromEditor:()=>dm,getKnownTypesAndNodes:()=>hE,getExtensionDependencyFromEditor:()=>bE,effect:()=>Mn,defineExtension:()=>it,declarePeerDependency:()=>Zp,configExtension:()=>bl,computed:()=>tm,buildEditorFromExtensions:()=>TE,batch:()=>Z_,applyFormatToDom:()=>_E,applyFormatFromStyle:()=>pE,TabIndentationExtension:()=>RE,SelectionAlwaysOnDisplayExtension:()=>wE,NodeSelectionExtension:()=>td,NestedEditorExtension:()=>DE,LexicalBuilder:()=>Zn,InitialStateExtension:()=>um,INSERT_HORIZONTAL_RULE_COMMAND:()=>fm,HorizontalRuleNode:()=>Jo,HorizontalRuleExtension:()=>vE,EditorStateExtension:()=>Wl,DecoratorTextNode:()=>Hl,DecoratorTextExtension:()=>xE,ClearEditorExtension:()=>gE,AutoFocusExtension:()=>fE,$isHorizontalRuleNode:()=>gm,$isDecoratorTextNode:()=>sm,$createHorizontalRuleNode:()=>Ul});var uE=Symbol.for("preact-signals");function zl(){if(mo>1)return void mo--;let t,e=!1;for(;Js!==void 0;){let n=Js;for(Js=void 0,Qu++;n!==void 0;){let o=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Q_(n))try{n.c()}catch(r){e||(t=r,e=!0)}n=o}}if(Qu=0,mo--,e)throw t}function Z_(t){if(mo>0)return t();mo++;try{return t()}finally{zl()}}var ft,Js;function Zu(t){let e=ft;ft=void 0;try{return t()}finally{ft=e}}var mo=0,Qu=0,Bl=0;function G_(t){if(ft===void 0)return;let e=t.n;return e===void 0||e.t!==ft?(e={i:0,S:t,p:ft.s,n:void 0,t:ft,e:void 0,x:void 0,r:e},ft.s!==void 0&&(ft.s.n=e),ft.s=e,t.n=e,32&ft.f&&t.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ft.s,e.n=void 0,ft.s.n=e,ft.s=e),e):void 0}function pe(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}function Kr(t,e){return new pe(t,e)}function Q_(t){for(let e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function J_(t){for(let e=t.s;e!==void 0;e=e.n){let n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function j_(t){let e,n=t.s;for(;n!==void 0;){let o=n.p;n.i===-1?(n.S.U(n),o!==void 0&&(o.n=n.n),n.n!==void 0&&(n.n.p=o)):e=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=o}t.s=e}function Go(t,e){pe.call(this,void 0),this.x=t,this.s=void 0,this.g=Bl-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched,this.name=e==null?void 0:e.name}function tm(t,e){return new Go(t,e)}function em(t){let e=t.u;if(t.u=void 0,typeof e=="function"){mo++;let n=ft;ft=void 0;try{e()}catch(o){throw t.f&=-2,t.f|=8,ed(t),o}finally{ft=n,zl()}}}function ed(t){for(let e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,em(t)}function dE(t){if(ft!==this)throw Error("Out-of-order effect");j_(this),ft=t,this.f&=-2,8&this.f&&ed(this),zl()}function Pr(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e==null?void 0:e.name}function Mn(t,e){let n=new Pr(t,e);try{n.c()}catch(r){throw n.d(),r}let o=n.d.bind(n);return o[Symbol.dispose]=o,o}function Br(t,e={}){let n={};for(let o in t){let r=e[o],s=Kr(r===void 0?t[o]:r);n[o]=s}return n}pe.prototype.brand=uE,pe.prototype.h=function(){return!0},pe.prototype.S=function(t){let e=this.t;e!==t&&t.e===void 0&&(t.x=e,this.t=t,e!==void 0?e.e=t:Zu(()=>{var n;(n=this.W)==null||n.call(this)}))},pe.prototype.U=function(t){if(this.t!==void 0){let{e,x:n}=t;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&Zu(()=>{var o;(o=this.Z)==null||o.call(this)}))}},pe.prototype.subscribe=function(t){return Mn(()=>{let e=this.value,n=ft;ft=void 0;try{t(e)}finally{ft=n}},{name:"sub"})},pe.prototype.valueOf=function(){return this.value},pe.prototype.toString=function(){return this.value+""},pe.prototype.toJSON=function(){return this.value},pe.prototype.peek=function(){let t=ft;ft=void 0;try{return this.value}finally{ft=t}},Object.defineProperty(pe.prototype,"value",{get(){let t=G_(this);return t!==void 0&&(t.i=this.i),this.v},set(t){if(t!==this.v){if(Qu>100)throw Error("Cycle detected");this.v=t,this.i++,Bl++,mo++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{zl()}}}}),Go.prototype=new pe,Go.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===Bl)return!0;if(this.g=Bl,this.f|=1,this.i>0&&!Q_(this))return this.f&=-2,!0;let t=ft;try{J_(this),ft=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ft=t,j_(this),this.f&=-2,!0},Go.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}pe.prototype.S.call(this,t)},Go.prototype.U=function(t){if(this.t!==void 0&&(pe.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Go.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(Go.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let t=G_(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),Pr.prototype.c=function(){let t=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},Pr.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,em(this),J_(this),mo++;let t=ft;return ft=this,dE.bind(this,t)},Pr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Js,Js=this)},Pr.prototype.d=function(){this.f|=8,1&this.f||ed(this)},Pr.prototype.dispose=function(){this.d()};var fE=it({build:(t,e,n)=>Br(e),config:Rt({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(t,e,n){let o=n.getOutput();return Mn(()=>o.disabled.value?void 0:t.registerRootListener((r)=>{t.focus(()=>{let s=document.activeElement;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function nm(){let t=xt(),e=v(),n=X();t.clear(),t.append(n),e!==null&&n.select(),A(e)&&(e.format=0)}function om(t,e=nm){return t.registerCommand(il,(n)=>(t.update(e),!0),Q)}var gE=it({build:(t,e,n)=>Br(e),config:Rt({$onClear:nm}),name:"@lexical/extension/ClearEditor",register(t,e,n){let{$onClear:o}=n.getOutput();return Mn(()=>om(t,o.value))}});function hE(t){let e=new Set,n=new Set;for(let o of rm(t)){let r=typeof o=="function"?o:o.replace;e.add(r.getType()),n.add(r)}return{nodes:n,types:e}}function rm(t){return(typeof t.nodes=="function"?t.nodes():t.nodes)||[]}var Gu=zs("format",{parse:(t)=>typeof t=="number"?t:0});class Hl extends dl{$config(){return this.config("decorator-text",{extends:dl,stateConfigs:[{flat:!0,stateConfig:Gu}]})}getFormat(){return zo(this,Gu)}getFormatFlags(t,e){return bu(this.getFormat(),t,e)}hasFormat(t){let e=Tl[t];return(this.getFormat()&e)!==0}setFormat(t){return Vn(this,Gu,t)}toggleFormat(t){let e=this.getFormat(),n=bu(e,t,null);return this.setFormat(n)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}}function sm(t){return t instanceof Hl}function pE(t,e,n){let o=e.fontWeight,r=e.textDecoration.split(" "),s=o==="700"||o==="bold",i=r.includes("line-through"),l=e.fontStyle==="italic",a=r.includes("underline"),c=e.verticalAlign;return s&&!t.hasFormat("bold")&&t.toggleFormat("bold"),i&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),l&&!t.hasFormat("italic")&&t.toggleFormat("italic"),a&&!t.hasFormat("underline")&&t.toggleFormat("underline"),c!=="sub"||t.hasFormat("subscript")||t.toggleFormat("subscript"),c!=="super"||t.hasFormat("superscript")||t.toggleFormat("superscript"),n&&!t.hasFormat(n)&&t.toggleFormat(n),t}function _E(t,e,n=CE){for(let[o,r]of Object.entries(n))t.hasFormat(r)&&(e=mE(e,o));return e}function mE(t,e){let n=document.createElement(e);return n.appendChild(t),n}var CE={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},xE=it({name:"@lexical/extension/DecoratorText",nodes:()=>[Hl],register:(t,e,n)=>t.registerCommand(ze,(o)=>{let r=v();if(Xt(r)||A(r))for(let s of r.getNodes())sm(s)&&s.toggleFormat(o);return!1},st)});function nd(t,e){let n;return Kr(t(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=t(),n=e(this)}})}var Wl=it({build:(t)=>nd(()=>t.getEditorState(),(e)=>t.registerUpdateListener((n)=>{e.value=n.editorState})),name:"@lexical/extension/EditorState"});function ht(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function im(t,e){if(t&&e&&!Array.isArray(e)&&typeof t=="object"&&typeof e=="object"){let n=t,o=e;for(let r in o)n[r]=im(n[r],o[r]);return t}return e}var od=0,ju=1,lm=2,Ju=3,Pl=4,kr=5,Vu=6,Gs=7;function Xu(t){return t.id===od}function am(t){return t.id===lm}function yE(t){return function(e){return e.id===ju}(t)||ht(305,String(t.id),String(ju)),Object.assign(t,{id:lm})}var SE=new Set;class cm{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,e){this.builder=t,this.extension=e,this.configs=new Set,this.state={id:od}}mergeConfigs(){let t=this.extension.config||{},e=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):_o;for(let n of this.configs)t=e(t,n);return t}init(t){let e=this.state;am(e)||ht(306,String(e.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},r=function(i,l,a){return Object.assign(i,{config:l,id:Ju,registerState:a})}(e,this.mergeConfigs(),n),s;this.state=r,this.extension.init&&(s=this.extension.init(t,r.config,n)),this.state=function(i,l,a){return Object.assign(i,{id:Pl,initResult:l,registerState:a})}(r,s,o)}build(t){let e=this.state,n;e.id!==Pl&&ht(307,String(e.id),String(kr)),this.extension.build&&(n=this.extension.build(t,e.config,e.registerState));let o={...e.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(r,s,i){return Object.assign(r,{id:kr,output:s,registerState:i})}(e,n,o)}register(t,e){this._signal=e;let n=this.state;n.id!==kr&&ht(308,String(n.id),String(kr));let o=this.extension.register&&this.extension.register(t,n.config,n.registerState);return this.state=function(r){return Object.assign(r,{id:Vu})}(n),()=>{let r=this.state;r.id!==Gs&&ht(309,String(n.id),String(Gs)),this.state=function(s){return Object.assign(s,{id:kr})}(r),o&&o()}}afterRegistration(t){let e=this.state,n;return e.id!==Vu&&ht(310,String(e.id),String(Vu)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(t,e.config,e.registerState)),this.state=function(o){return Object.assign(o,{id:Gs})}(e),n}getSignal(){return this._signal===void 0&&ht(311),this._signal}getInitResult(){this.extension.init===void 0&&ht(312,this.extension.name);let t=this.state;return function(e){return e.id>=Pl}(t)||ht(313,String(t.id),String(Pl)),t.initResult}getInitPeer(t){let e=this.builder.extensionNameMap.get(t);return e?e.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return function(e){return e.id>=Ju}(t)||ht(314,String(t.id),String(Ju)),{config:t.config}}getPeer(t){let e=this.builder.extensionNameMap.get(t);return e?e.getExtensionDependency():void 0}getInitDependency(t){let e=this.builder.getExtensionRep(t);return e===void 0&&ht(315,this.extension.name,t.name),e.getExtensionInitDependency()}getDependency(t){let e=this.builder.getExtensionRep(t);return e===void 0&&ht(315,this.extension.name,t.name),e.getExtensionDependency()}getState(){let t=this.state;return function(e){return e.id>=Gs}(t)||ht(316,String(t.id),String(Gs)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||SE}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(e){return e.id>=kr})(t)||ht(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}}var V_={tag:fo};function NE(){let t=xt();t.isEmpty()&&t.append(X())}var um=it({config:Rt({setOptions:V_,updateOptions:V_}),init:({$initialEditorState:t=NE})=>({$initialEditorState:t,initialized:!1}),afterRegistration(t,{updateOptions:e,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(vp(s))t.setEditorState(s,n);else if(typeof s=="function")t.update(()=>{s(t)},e);else if(s&&(typeof s=="string"||typeof s=="object")){let i=t.parseEditorState(s);t.setEditorState(i,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Jp,Ue,Hp,qp,Yp]}),X_=Symbol.for("@lexical/extension/LexicalBuilder");function TE(...t){return Zn.fromExtensions(t).buildEditor()}function q_(){}function EE(t){throw t}function Kl(t){return Array.isArray(t)?t:[t]}var qu="0.42.0+prod.esm";class Zn{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=qu,this.roots=t;for(let e of t)this.addExtension(e)}static fromExtensions(t){let e=[Kl(um)];for(let n of t)e.push(Kl(n));return new Zn(e)}static maybeFromEditor(t){let e=t[X_];return e&&(e.PACKAGE_VERSION!==qu&&ht(292,e.PACKAGE_VERSION,qu),e instanceof Zn||ht(293)),e}static fromEditor(t){let e=Zn.maybeFromEditor(t);return e===void 0&&ht(294),e}constructEditor(){let{$initialEditorState:t,onError:e,...n}=this.buildCreateEditorArgs(),o=Object.assign(Ol({...n,...e?{onError:(r)=>{e(r,o)}}:{}}),{[X_]:this});for(let r of this.sortedExtensionReps())r.build(o);return o}buildEditor(){let t=q_;function e(){try{t()}finally{t=q_}}let n=Object.assign(this.constructEditor(),{dispose:e,[Symbol.dispose]:e});return t=se(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let e=this.extensionNameMap.get(t.name);if(e)return e.extension!==t&&ht(295,t.name),e}addEdge(t,e,n){let o=this.outgoingConfigEdges.get(t);o?o.set(e,n):this.outgoingConfigEdges.set(t,new Map([[e,n]]));let r=this.incomingEdges.get(e);r?r.add(t):this.incomingEdges.set(e,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&ht(296);let e=Kl(t),[n]=e;typeof n.name!="string"&&ht(297,typeof n.name);let o=this.extensionNameMap.get(n.name);if(o!==void 0&&o.extension!==n&&ht(298,n.name),!o){o=new cm(this,n),this.extensionNameMap.set(n.name,o);let r=this.conflicts.get(n.name);typeof r=="string"&&ht(299,n.name,r);for(let s of n.conflictsWith||[])this.extensionNameMap.has(s)&&ht(299,n.name,s),this.conflicts.set(s,n.name);for(let s of n.dependencies||[]){let i=Kl(s);this.addEdge(n.name,i[0].name,i.slice(1)),this.addExtension(i)}for(let[s,i]of n.peerDependencies||[])this.addEdge(n.name,s,i?[i]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],e=(n,o)=>{let r=n.state;if(am(r))return;let s=n.extension.name;var i;Xu(r)||ht(300,s,o||"[unknown]"),Xu(i=r)||ht(304,String(i.id),String(od)),r=Object.assign(i,{id:ju}),n.state=r;let l=this.outgoingConfigEdges.get(s);if(l)for(let a of l.keys()){let c=this.extensionNameMap.get(a);c&&e(c,s)}r=yE(r),n.state=r,t.push(n)};for(let n of this.extensionNameMap.values())Xu(n.state)&&e(n);for(let n of t)for(let[o,r]of this.outgoingConfigEdges.get(n.extension.name)||[])if(r.length>0){let s=this.extensionNameMap.get(o);if(s)for(let i of r)s.configs.add(i)}for(let[n,...o]of this.roots)if(o.length>0){let r=this.extensionNameMap.get(n.name);r===void 0&&ht(301,n.name);for(let s of o)r.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let e=this.sortedExtensionReps(),n=new AbortController,o=[()=>n.abort()],r=n.signal;for(let s of e){let i=s.register(t,r);i&&o.push(i)}for(let s of e){let i=s.afterRegistration(t);i&&o.push(i)}return se(...o)}buildCreateEditorArgs(){let t={},e=new Set,n=new Map,o=new Map,r={},s={},i=this.sortedExtensionReps();for(let c of i){let{extension:u}=c;if(u.onError!==void 0&&(t.onError=u.onError),u.disableEvents!==void 0&&(t.disableEvents=u.disableEvents),u.parentEditor!==void 0&&(t.parentEditor=u.parentEditor),u.editable!==void 0&&(t.editable=u.editable),u.namespace!==void 0&&(t.namespace=u.namespace),u.$initialEditorState!==void 0&&(t.$initialEditorState=u.$initialEditorState),u.nodes)for(let d of rm(u)){if(typeof d!="function"){let f=n.get(d.replace);f&&ht(302,u.name,d.replace.name,f.extension.name),n.set(d.replace,c)}e.add(d)}if(u.html){if(u.html.export)for(let[d,f]of u.html.export.entries())o.set(d,f);u.html.import&&Object.assign(r,u.html.import)}u.theme&&im(s,u.theme)}Object.keys(s).length>0&&(t.theme=s),e.size&&(t.nodes=[...e]);let l=Object.keys(r).length>0,a=o.size>0;(l||a)&&(t.html={},l&&(t.html.import=r),a&&(t.html.export=o));for(let c of i)c.init(t);return t.onError||(t.onError=EE),t}}function bE(t,e){let n=Zn.fromEditor(t).getExtensionRep(e);return n===void 0&&ht(303,e.name),n.getExtensionDependency()}function dm(t,e){let n=Zn.fromEditor(t).extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}function OE(t,e){let n=dm(t,e);return n===void 0&&ht(291,e),n}var ME=new Set,td=it({build(t,e,n){let o=n.getDependency(Wl).output,r=Kr({watchedNodeKeys:new Map}),s=nd(()=>{},()=>Mn(()=>{let i=s.peek(),{watchedNodeKeys:l}=r.value,a,c=!1;o.value.read(()=>{if(v())for(let[u,d]of l.entries()){if(d.size===0){l.delete(u);continue}let f=Vt(u),h=f&&f.isSelected()||!1;c=c||h!==(!!i&&i.has(u)),h&&(a=a||new Set,a.add(u))}}),!c&&a&&i&&a.size===i.size||(s.value=a)}));return{watchNodeKey:function(i){let l=tm(()=>(s.value||ME).has(i)),{watchedNodeKeys:a}=r.peek(),c=a.get(i),u=c!==void 0;return c=c||new Set,c.add(l),u||(a.set(i,c),r.value={watchedNodeKeys:a}),l}}},dependencies:[Wl],name:"@lexical/extension/NodeSelection"}),fm=Ne("INSERT_HORIZONTAL_RULE_COMMAND");class Jo extends dl{static getType(){return"horizontalrule"}static clone(t){return new Jo(t.__key)}static importJSON(t){return Ul().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:AE,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let e=document.createElement("hr");return Tn(e,t.theme.hr),e}getTextContent(){return`
15
- `}isInline(){return!1}updateDOM(){return!1}}function AE(){return{node:Ul()}}function Ul(){return ji(Jo)}function gm(t){return t instanceof Jo}var vE=it({dependencies:[Wl,td],name:"@lexical/extension/HorizontalRule",nodes:()=>[Jo],register(t,e,n){let{watchNodeKey:o}=n.getDependency(td).output,r=Kr({nodeSelections:new Map}),s=t._config.theme.hrSelected??"selected";return se(t.registerCommand(fm,(i)=>{let l=v();if(!A(l))return!1;if(l.focus.getNode()!==null){let a=Ul();Ll(a)}return!0},Q),t.registerCommand(Ar,(i)=>{if(ln(i.target)){let l=Op(i.target);if(gm(l))return function(a,c=!1){let u=v(),d=a.isSelected(),f=a.getKey(),h;c&&Xt(u)?h=u:(h=Np(),St(h)),d?h.delete(f):h.add(f)}(l,i.shiftKey),!0}return!1},st),t.registerMutationListener(Jo,(i,l)=>{Z_(()=>{let a=!1,{nodeSelections:c}=r.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),a=!0;else{let f=c.get(u),h=t.getElementByKey(u);f?f.domNode.value=h:(a=!0,c.set(u,{domNode:Kr(h),selectedSignal:o(u)}))}a&&(r.value={nodeSelections:c})})}),Mn(()=>{let i=[];for(let{domNode:l,selectedSignal:a}of r.value.nodeSelections.values())i.push(Mn(()=>{let c=l.value;if(c)a.value?Tn(c,s):Ir(c,s)}));return se(...i)}))}}),DE=it({build:(t,e)=>Br({inheritEditableFromParent:e.inheritEditableFromParent}),config:Rt({$getParentEditor:function(){let t=Gn();return Zn.fromEditor(t),t},inheritEditableFromParent:!1}),init:(t,e,n)=>{let o=e.$getParentEditor();t.parentEditor=o,t.theme=t.theme||o._config.theme},name:"@lexical/extension/NestedEditor",register:(t,e,n)=>Mn(()=>{let o=t._parentEditor;if(o&&n.getOutput().inheritEditableFromParent.value)return t.setEditable(o.isEditable()),o.registerEditableListener(t.setEditable.bind(t))})}),wE=it({build:(t,e,n)=>Br(e),config:Rt({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(t,e,n)=>{let o=n.getOutput();return Mn(()=>{if(!o.disabled.value)return Y_(t,o.onReposition.value)})}});function hm(t){return t.canBeEmpty()}function pm(t,e,n=hm){return se(t.registerCommand(ho,(o)=>{let r=v();if(!A(r))return!1;o.preventDefault();let s=function(i){if(i.getNodes().filter((f)=>Mr(f)&&f.canIndent()).length>0)return!0;let{anchor:l,focus:a}=i,c=a.isBefore(l)?a:l,u=c.getNode(),d=Il(u);if(d.canIndent()){let f=d.getKey(),h=Cn();if(h.anchor.set(f,0,"element"),h.focus.set(f,0,"element"),h=xn(h),h.anchor.is(c))return!0}return!1}(r)?o.shiftKey?Sn:He:Yo;return t.dispatchCommand(s,void 0)},Q),t.registerCommand(He,()=>{let o=typeof e=="number"?e:e?e.peek():null,r=v();if(!A(r))return!1;let s=typeof n=="function"?n:n.peek();return Ys((i)=>{if(s(i)){let l=i.getIndent()+1;(!o||l<o)&&i.setIndent(l)}})},vr))}var RE=it({build:(t,e,n)=>Br(e),config:Rt({$canIndent:hm,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(t,e,n){let{disabled:o,maxIndent:r,$canIndent:s}=n.getOutput();return Mn(()=>{if(!o.value)return pm(t,r,s)})}});var nt=rd,_m=nt.$createHorizontalRuleNode,Jv=nt.$isDecoratorTextNode,mm=nt.$isHorizontalRuleNode,Vv=nt.AutoFocusExtension,Xv=nt.ClearEditorExtension,qv=nt.DecoratorTextExtension,Zv=nt.DecoratorTextNode,Qv=nt.EditorStateExtension,jv=nt.HorizontalRuleExtension,Cm=nt.HorizontalRuleNode,tD=nt.INSERT_HORIZONTAL_RULE_COMMAND,eD=nt.InitialStateExtension,xm=nt.LexicalBuilder,nD=nt.NestedEditorExtension,oD=nt.NodeSelectionExtension,rD=nt.SelectionAlwaysOnDisplayExtension,sD=nt.TabIndentationExtension,iD=nt.applyFormatFromStyle,lD=nt.applyFormatToDom,ym=nt.batch,aD=nt.buildEditorFromExtensions,cD=nt.computed,uD=nt.configExtension,dD=nt.declarePeerDependency,fD=nt.defineExtension,_e=nt.effect,gD=nt.getExtensionDependencyFromEditor,hD=nt.getKnownTypesAndNodes,Sm=nt.getPeerDependencyFromEditor,pD=nt.getPeerDependencyFromEditorOrThrow,me=nt.namedSignals,_D=nt.registerClearEditor,Yl=nt.registerTabIndentation,mD=nt.safeCast,CD=nt.shallowMergeConfig,Nm=nt.signal,xD=nt.untracked,yD=nt.watchedSignal;var sd={};at(sd,{ReactProviderExtension:()=>$E});var $E=it({name:"@lexical/react/ReactProvider"});var IE=sd,Tm=IE.ReactProviderExtension;var ld={};at(ld,{registerLexicalTextEntity:()=>KE,$rootTextContent:()=>Em,$isRootTextContentEmptyCurry:()=>FE,$isRootTextContentEmpty:()=>id,$findTextIntersectionFromCharacters:()=>kE,$canShowPlaceholderCurry:()=>LE,$canShowPlaceholder:()=>bm});function Em(){return xt().getTextContent()}function id(t,e=!0){if(t)return!1;let n=Em();return e&&(n=n.trim()),n===""}function FE(t,e){return()=>id(t,e)}function bm(t){if(!id(t,!1))return!1;let e=xt().getChildren(),n=e.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=e[o];if(Be(r))return!1;if(F(r)){if(!rn(r))return!1;if(r.__indent!==0)return!1;let s=r.getChildren(),i=s.length;for(let l=0;l<i;l++){let a=s[o];if(!K(a))return!1}}}return!0}function LE(t){return()=>bm(t)}function kE(t,e){let n=t.getFirstChild(),o=0;t:for(;n!==null;){if(F(n)){let i=n.getFirstChild();if(i!==null){n=i;continue}}else if(K(n)){let i=n.getTextContentSize();if(o+i>e)return{node:n,offset:e-o};o+=i}let r=n.getNextSibling();if(r!==null){n=r;continue}let s=n.getParent();for(;s!==null;){let i=s.getNextSibling();if(i!==null){n=i;continue t}s=s.getParent()}break}return null}function PE(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function KE(t,e,n,o){let r=(i)=>i instanceof n,s=(i)=>{let l=wt(i.getTextContent());l.setFormat(i.getFormat()),i.replace(l)};return[t.registerNodeTransform(Ue,(i)=>{if(!i.isSimpleText())return;let l,a=i.getPreviousSibling(),c=i.getTextContent(),u=i;if(K(a)){let f=a.getTextContent(),h=e(f+c);if(r(a)){if(h===null||((p)=>p.getLatest().__mode)(a)!==0)return void s(a);{let p=h.end-f.length;if(p>0){let g=f+c.slice(0,p);if(a.select(),a.setTextContent(g),p===c.length)i.remove();else{let _=c.slice(p);i.setTextContent(_)}return}}}else if(h===null||h.start<f.length)return}let d=0;for(;;){l=e(c);let f,h=l===null?"":c.slice(l.end);if(c=h,h===""){let g=u.getNextSibling();if(K(g)){h=u.getTextContent()+g.getTextContent();let _=e(h);if(_===null)return void(r(g)?s(g):g.markDirty());if(_.start!==0)return}}if(l===null)return;if(l.start===0&&K(a)&&a.isTextEntity()){d+=l.end;continue}l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start+d,l.end+d),f===void 0&&PE(165,"nodeToReplace");let p=o(f);if(p.setFormat(f.getFormat()),f.replace(p),u==null)return;d=0,a=p}}),t.registerNodeTransform(n,(i)=>{let l=i.getTextContent(),a=e(l);if(a===null||a.start!==0)return void s(i);if(l.length>a.end)return void i.splitText(a.end);let c=i.getPreviousSibling();K(c)&&c.isTextEntity()&&(s(c),s(i));let u=i.getNextSibling();K(u)&&u.isTextEntity()&&(s(u),r(i)&&s(i))})]}var Vo=ld,bD=Vo.$canShowPlaceholder,Gl=Vo.$canShowPlaceholderCurry,OD=Vo.$findTextIntersectionFromCharacters,MD=Vo.$isRootTextContentEmpty,AD=Vo.$isRootTextContentEmptyCurry,vD=Vo.$rootTextContent,DD=Vo.registerLexicalTextEntity;var ad={};at(ad,{registerDragonSupport:()=>Om,DragonExtension:()=>BE});function Om(t){let e=window.location.origin,n=(o)=>{if(o.origin!==e)return;let r=t.getRootElement();if(document.activeElement!==r)return;let s=o.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch(l){return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){let l=i.payload;if(l&&l.functionId==="makeChanges"){let a=l.args;if(a){let[c,u,d,f,h]=a;t.update(()=>{let p=v();if(A(p)){let g=p.anchor,_=g.getNode(),m=0,C=0;if(K(_)&&c>=0&&u>=0&&(m=c,C=c+u,p.setTextNodeRange(_,m,_,C)),m===C&&d===""||(p.insertRawText(d),_=g.getNode()),K(_)){m=f,C=f+h;let x=_.getTextContentSize();m=m>x?x:m,C=C>x?x:C,p.setTextNodeRange(_,m,_,C)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}var BE=it({build:(t,e,n)=>me(e),config:Rt({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(t,e,n)=>_e(()=>n.getOutput().disabled.value?void 0:Om(t))});var Mm=ad,Am=Mm.DragonExtension,vm=Mm.registerDragonSupport;var cd={};at(cd,{$generateNodesFromDOM:()=>WE,$generateHtmlFromNodes:()=>zE});function WE(t,e){let n=o_(e)?e.body.childNodes:e.childNodes,o=[],r=[];for(let s of n)if(!wm.has(s.nodeName)){let i=Rm(s,t,r,!1);i!==null&&(o=o.concat(i))}return function(s){for(let i of s)i.getNextSibling()instanceof Cu&&i.insertAfter(Pe());for(let i of s){let l=i.getChildren();for(let a of l)i.insertBefore(a);i.remove()}}(r),o}function zE(t,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),o=xt().getChildren();for(let r=0;r<o.length;r++)Dm(t,o[r],n,e);return n.innerHTML}function Dm(t,e,n,o=null){let r=o===null||e.isSelected(o),s=F(e)&&e.excludeFromCopy("html"),i=e;o!==null&&K(e)&&(i=Rl(o,e,"clone"));let l=F(i)?i.getChildren():[],a=jp(t,i.getType()),c;c=a&&a.exportDOM!==void 0?a.exportDOM(t,i):i.exportDOM(t);let{element:u,after:d}=c;if(!u)return!1;let f=document.createDocumentFragment();for(let h=0;h<l.length;h++){let p=l[h],g=Dm(t,p,f,o);!r&&F(e)&&g&&e.extractWithChild(p,o,"html")&&(r=!0)}if(r&&!s){if((ie(u)||Nu(u))&&u.append(f),n.append(u),d){let h=d.call(i,u);h&&(Nu(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(f);return r}var wm=new Set(["STYLE","SCRIPT"]);function Rm(t,e,n,o,r=new Map,s){let i=[];if(wm.has(t.nodeName))return i;let l=null,a=function(p,g){let{nodeName:_}=p,m=g._htmlConversions.get(_.toLowerCase()),C=null;if(m!==void 0)for(let x of m){let N=x(p);N!==null&&(C===null||(C.priority||0)<=(N.priority||0))&&(C=N)}return C!==null?C.conversion:null}(t,e),c=a?a(t):null,u=null;if(c!==null){u=c.after;let p=c.node;if(l=Array.isArray(p)?p[p.length-1]:p,l!==null){for(let[,g]of r)if(l=g(l,s),!l)break;l&&i.push(...Array.isArray(p)?p:[l])}c.forChild!=null&&r.set(t.nodeName,c.forChild)}let d=t.childNodes,f=[],h=(l==null||!jt(l))&&(l!=null&&Mr(l)||o);for(let p=0;p<d.length;p++)f.push(...Rm(d[p],e,n,h,new Map(r),l));return u!=null&&(f=u(f)),Yu(t)&&(f=HE(t,f,h?()=>{let p=new Cu;return n.push(p),p}:X)),l==null?f.length>0?i=i.concat(f):Yu(t)&&function(p){if(p.nextSibling==null||p.previousSibling==null)return!1;return Hs(p.nextSibling)&&Hs(p.previousSibling)}(t)&&(i=i.concat(Pe())):F(l)&&l.append(...f),i}function HE(t,e,n){let o=t.style.textAlign,r=[],s=[];for(let i=0;i<e.length;i++){let l=e[i];if(Mr(l))o&&!l.getFormat()&&l.setFormat(o),r.push(l);else if(s.push(l),i===e.length-1||i<e.length-1&&Mr(e[i+1])){let a=n();a.setFormat(o),a.append(...s),r.push(a),s=[]}}return r}var $m=cd,Im=$m.$generateHtmlFromNodes,Fm=$m.$generateNodesFromDOM;var dd={};at(dd,{setLexicalClipboardDataTransfer:()=>Um,copyToClipboard:()=>GE,$insertGeneratedNodes:()=>ud,$insertDataTransferForRichText:()=>YE,$insertDataTransferForPlainText:()=>UE,$getLexicalContent:()=>Pm,$getHtmlContent:()=>km,$getClipboardDataFromSelection:()=>Hm,$generateNodesFromSerializedNodes:()=>Wm,$generateJSONFromSelectedNodes:()=>Bm});function Jl(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function km(t,e=v()){return e==null&&Jl(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?"":Im(t,e)}function Pm(t,e=v()){return e==null&&Jl(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Bm(t,e))}function UE(t,e){let n=t.getData("text/plain")||t.getData("text/uri-list");n!=null&&e.insertRawText(n)}function YE(t,e,n){let o=t.getData("application/x-lexical-editor");if(o)try{let l=JSON.parse(o);if(l.namespace===n._config.namespace&&Array.isArray(l.nodes))return ud(n,Wm(l.nodes),e)}catch(l){console.error(l)}let r=t.getData("text/html"),s=t.getData("text/plain");if(r&&s!==r)try{let l=new DOMParser().parseFromString(function(a){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(c)=>c}).createHTML(a);return a}(r),"text/html");return ud(n,Fm(n,l),e)}catch(l){console.error(l)}let i=s||t.getData("text/uri-list");if(i!=null)if(A(e)){let l=i.split(/(\r?\n|\t)/);l[l.length-1]===""&&l.pop();for(let a=0;a<l.length;a++){let c=v();if(A(c)){let u=l[a];u===`
16
- `||u===`\r
17
- `?c.insertParagraph():u==="\t"?c.insertNodes([Se()]):c.insertText(u)}}}else e.insertRawText(i)}function ud(t,e,n){t.dispatchCommand(Sl,{nodes:e,selection:n})||(n.insertNodes(e),function(o){if(A(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=_n(r,"previous");if(i)if(Ps(i))s=i.origin;else{let l=Or(i,ge(xt(),"next").getFlipped());for(let a of l){if(K(a.origin)){s=a.origin;break}if(F(a.origin)&&!a.origin.isInline())break}}if(s&&K(s)){let l=s.getFormat(),a=s.getStyle();o.format===l&&o.style===a||(o.format=l,o.style=a,o.dirty=!0)}}}(n))}function Km(t,e,n,o=[]){let r=e===null||n.isSelected(e),s=F(n)&&n.excludeFromCopy("html"),i=n;e!==null&&K(i)&&(i=Rl(e,i,"clone"));let l=F(i)?i.getChildren():[],a=function(c){let u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Jl(58,d.name),F(c)){let f=u.children;Array.isArray(f)||Jl(59,d.name)}return u}(i);K(i)&&i.getTextContentSize()===0&&(r=!1);for(let c=0;c<l.length;c++){let u=l[c],d=Km(t,e,u,a.children);!r&&F(n)&&d&&n.extractWithChild(u,e,"clone")&&(r=!0)}if(r&&!s)o.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){let u=a.children[c];o.push(u)}return r}function Bm(t,e){let n=[],o=xt().getChildren();for(let r=0;r<o.length;r++)Km(t,e,o[r],n);return{namespace:t._config.namespace,nodes:n}}function Wm(t){let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=wp(o);K(r)&&T_(r),e.push(r)}return e}var Wr=null;async function GE(t,e,n){if(Wr!==null)return!1;if(e!==null)return new Promise((c,u)=>{t.update(()=>{c(Lm(t,e,n))})});let o=t.getRootElement(),r=t._window||window,s=r.document,i=po(r);if(o===null||i===null)return!1;let l=s.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(s.createTextNode("#")),o.append(l);let a=new Range;return a.setStart(l,0),a.setEnd(l,1),i.removeAllRanges(),i.addRange(a),new Promise((c,u)=>{let d=t.registerCommand(al,(f)=>(De(f,ClipboardEvent)&&(d(),Wr!==null&&(r.clearTimeout(Wr),Wr=null),c(Lm(t,f,n))),!0),vr);Wr=r.setTimeout(()=>{d(),Wr=null,c(!1)},50),s.execCommand("copy"),l.remove()})}function Lm(t,e,n){if(n===void 0){let r=po(t._window),s=v();if(!s||s.isCollapsed())return!1;if(!r)return!1;let{anchorNode:i,focusNode:l}=r;if(i!==null&&l!==null&&!i_(t,i,l))return!1;n=Hm(s)}e.preventDefault();let o=e.clipboardData;return o!==null&&(Um(o,n),!0)}var zm=[["text/html",km],["application/x-lexical-editor",Pm]];function Hm(t=v()){let e={"text/plain":t?t.getTextContent():""};if(t){let n=Gn();for(let[o,r]of zm){let s=r(n,t);s!==null&&(e[o]=s)}}return e}function Um(t,e){for(let[n]of zm)e[n]===void 0&&t.setData(n,"");for(let n in e){let o=e[n];o!==void 0&&t.setData(n,o)}}var An=dd,HD=An.$generateJSONFromSelectedNodes,UD=An.$generateNodesFromSerializedNodes,Ym=An.$getClipboardDataFromSelection,YD=An.$getHtmlContent,GD=An.$getLexicalContent,JD=An.$insertDataTransferForPlainText,fd=An.$insertDataTransferForRichText,VD=An.$insertGeneratedNodes,Vs=An.copyToClipboard,XD=An.setLexicalClipboardDataTransfer;var _d={};at(_d,{registerRichText:()=>qm,eventFiles:()=>Xs,RichTextExtension:()=>nb,QuoteNode:()=>Ur,HeadingNode:()=>Yr,DRAG_DROP_PASTE:()=>hd,$isQuoteNode:()=>jE,$isHeadingNode:()=>eb,$createQuoteNode:()=>pd,$createHeadingNode:()=>Hr});function Gm(t,e){if(document.caretRangeFromPoint!==void 0){let n=document.caretRangeFromPoint(t,e);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){let n=document.caretPositionFromPoint(t,e);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}var Xo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,JE=Xo&&"documentMode"in document?document.documentMode:null,VE=Xo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),XE=!(!Xo||!("InputEvent"in window)||JE)&&"getTargetRanges"in new window.InputEvent("input"),qE=Xo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Jm=Xo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZE=Xo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),QE=Xo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&VE&&!ZE,hd=Ne("DRAG_DROP_PASTE_FILE");class Ur extends re{static getType(){return"quote"}static clone(t){return new Ur(t.__key)}createDOM(t){let e=document.createElement("blockquote");return kt(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:(t)=>({conversion:tb,priority:0})}}exportDOM(t){let{element:e}=super.exportDOM(t);if(ie(e)){this.isEmpty()&&e.append(document.createElement("br"));let n=this.getFormatType();n&&(e.style.textAlign=n);let o=this.getDirection();o&&(e.dir=o)}return{element:e}}static importJSON(t){return pd().updateFromJSON(t)}insertNewAfter(t,e){let n=X(),o=this.getDirection();return n.setDirection(o),this.insertAfter(n,e),n}collapseAtStart(){let t=X();return this.getChildren().forEach((e)=>t.append(e)),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function pd(){return fe(new Ur)}function jE(t){return t instanceof Ur}class Yr extends re{__tag;static getType(){return"heading"}static clone(t){return new Yr(t.__tag,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__tag=t.__tag}constructor(t="h1",e){super(e),this.__tag=t}getTag(){return this.getLatest().__tag}setTag(t){let e=this.getWritable();return e.__tag=t,e}createDOM(t){let e=this.__tag,n=document.createElement(e),o=t.theme.heading;if(o!==void 0){let r=o[e];kt(n,r)}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:(t)=>({conversion:zr,priority:0}),h2:(t)=>({conversion:zr,priority:0}),h3:(t)=>({conversion:zr,priority:0}),h4:(t)=>({conversion:zr,priority:0}),h5:(t)=>({conversion:zr,priority:0}),h6:(t)=>({conversion:zr,priority:0}),p:(t)=>{let e=t.firstChild;return e!==null&&Vm(e)?{conversion:()=>({node:null}),priority:3}:null},span:(t)=>Vm(t)?{conversion:(e)=>({node:Hr("h1")}),priority:3}:null}}exportDOM(t){let{element:e}=super.exportDOM(t);if(ie(e)){this.isEmpty()&&e.append(document.createElement("br"));let n=this.getFormatType();n&&(e.style.textAlign=n);let o=this.getDirection();o&&(e.dir=o)}return{element:e}}static importJSON(t){return Hr(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){let n=t?t.anchor.offset:0,o=this.getLastDescendant(),r=!o||t&&t.anchor.key===o.getKey()&&n===o.getTextContentSize()||!t?X():Hr(this.getTag()),s=this.getDirection();if(r.setDirection(s),this.insertAfter(r,e),n===0&&!this.isEmpty()&&t){let i=X();i.select(),this.replace(i,!0)}return r}collapseAtStart(){let t=this.isEmpty()?X():Hr(this.getTag());return this.getChildren().forEach((e)=>t.append(e)),this.replace(t),!0}extractWithChild(){return!0}}function Vm(t){return t.nodeName.toLowerCase()==="span"&&t.style.fontSize==="26pt"}function zr(t){let e=t.nodeName.toLowerCase(),n=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(n=Hr(e),t.style!==null&&(Eu(t,n),n.setFormat(t.style.textAlign))),{node:n}}function tb(t){let e=pd();return t.style!==null&&(e.setFormat(t.style.textAlign),Eu(t,e)),{node:e}}function Hr(t="h1"){return fe(new Yr(t))}function eb(t){return t instanceof Yr}function Xs(t){let e=null;if(De(t,DragEvent)?e=t.dataTransfer:De(t,ClipboardEvent)&&(e=t.clipboardData),e===null)return[!1,[],!1];let n=e.types,o=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[o,Array.from(e.files),r]}function Xm(t){let e=Lt(t);return Be(e)}function gd(t){for(let e of["lowercase","uppercase","capitalize"])t.hasFormat(e)&&t.toggleFormat(e)}function qm(t){return $t(t.registerCommand(Ar,(e)=>{let n=v();return!!Xt(n)&&(n.clear(),!0)},Q),t.registerCommand(Dr,(e)=>{let n=v();return A(n)?(n.deleteCharacter(e),!0):!!Xt(n)&&(n.deleteNodes(),!0)},Q),t.registerCommand(ul,(e)=>{let n=v();return!!A(n)&&(n.deleteWord(e),!0)},Q),t.registerCommand(Bs,(e)=>{let n=v();return!!A(n)&&(n.deleteLine(e),!0)},Q),t.registerCommand(ll,(e)=>{let n=v();if(typeof e=="string")n!==null&&n.insertText(e);else{if(n===null)return!1;let o=e.dataTransfer;if(o!=null)fd(o,n,t);else if(A(n)){let r=e.data;return r&&n.insertText(r),!0}}return!0},Q),t.registerCommand(Gp,()=>{let e=v();return!!A(e)&&(e.removeText(),!0)},Q),t.registerCommand(ze,(e)=>{let n=v();return!!A(n)&&(n.formatText(e),!0)},Q),t.registerCommand(fl,(e)=>{let n=v();if(!A(n)&&!Xt(n))return!1;let o=n.getNodes();for(let r of o){let s=q(r,(i)=>F(i)&&!i.isInline());s!==null&&s.setFormat(e)}return!0},Q),t.registerCommand(xu,(e)=>{let n=v();return!!A(n)&&(n.insertLineBreak(e),!0)},Q),t.registerCommand(go,()=>{let e=v();return!!A(e)&&(e.insertParagraph(),!0)},Q),t.registerCommand(Yo,()=>{let e=Se(),n=v();return A(n)&&(e.setFormat(n.format),e.setStyle(n.style)),el([e]),!0},Q),t.registerCommand(He,()=>Ys((e)=>{let n=e.getIndent();e.setIndent(n+1)}),Q),t.registerCommand(Sn,()=>Ys((e)=>{let n=e.getIndent();n>0&&e.setIndent(Math.max(0,n-1))}),Q),t.registerCommand(sn,(e)=>{let n=v();if(Xt(n)){let o=n.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectPrevious(),!0}else if(A(n)){let o=gu(n.focus,!0);if(!e.shiftKey&&Be(o)&&!o.isIsolated()&&!o.isInline())return o.selectPrevious(),e.preventDefault(),!0}return!1},Q),t.registerCommand(Xn,(e)=>{let n=v();if(Xt(n)){let o=n.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}else if(A(n)){if(function(r){let s=r.focus;return s.key==="root"&&s.offset===xt().getChildrenSize()}(n))return e.preventDefault(),!0;let o=gu(n.focus,!1);if(!e.shiftKey&&Be(o)&&!o.isIsolated()&&!o.isInline())return o.selectNext(),e.preventDefault(),!0}return!1},Q),t.registerCommand(Rr,(e)=>{let n=v();if(Xt(n)){let o=n.getNodes();if(o.length>0)return e.preventDefault(),Fu(o[0])?o[0].selectNext(0,0):o[0].selectPrevious(),!0}if(!A(n))return!1;if(ku(n,!0)){let o=e.shiftKey;return e.preventDefault(),Lu(n,o,!0),!0}return!1},Q),t.registerCommand(gl,(e)=>{let n=v();if(Xt(n)){let r=n.getNodes();if(r.length>0)return e.preventDefault(),Fu(r[0])?r[0].selectPrevious():r[0].selectNext(0,0),!0}if(!A(n))return!1;let o=e.shiftKey;return!!ku(n,!1)&&(e.preventDefault(),Lu(n,o,!1),!0)},Q),t.registerCommand(hl,(e)=>{if(Xm(e.target))return!1;let n=v();if(A(n)){if(function(o){if(!o.isCollapsed())return!1;let{anchor:r}=o;if(r.offset!==0)return!1;let s=r.getNode();if(Jn(s))return!1;let i=Il(s);return i.getIndent()>0&&(i.is(s)||s.is(i.getFirstDescendant()))}(n))return e.preventDefault(),t.dispatchCommand(Sn,void 0);if(Jm&&navigator.language==="ko-KR")return!1}else if(!Xt(n))return!1;return e.preventDefault(),t.dispatchCommand(Dr,!0)},Q),t.registerCommand(pl,(e)=>{if(Xm(e.target))return!1;let n=v();return!(!A(n)&&!Xt(n))&&(e.preventDefault(),t.dispatchCommand(Dr,!1))},Q),t.registerCommand(_l,(e)=>{let n=v();if(!A(n))return!1;if(gd(n),e!==null){if((Jm||qE||QE)&&XE)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(xu,!1)}return t.dispatchCommand(go,void 0)},Q),t.registerCommand($r,()=>{let e=v();return!!A(e)&&(t.blur(),!0)},Q),t.registerCommand(Bp,(e)=>{let[,n]=Xs(e);if(n.length>0){let r=Gm(e.clientX,e.clientY);if(r!==null){let{offset:s,node:i}=r,l=Lt(i);if(l!==null){let a=Cn();if(K(l))a.anchor.set(l.getKey(),s,"text"),a.focus.set(l.getKey(),s,"text");else{let u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}let c=xn(a);St(c)}t.dispatchCommand(hd,n)}return e.preventDefault(),!0}let o=v();return!!A(o)},Q),t.registerCommand(Kp,(e)=>{let[n]=Xs(e),o=v();return!(n&&!A(o))},Q),t.registerCommand(Pp,(e)=>{let[n]=Xs(e),o=v();if(n&&!A(o))return!1;let r=Gm(e.clientX,e.clientY);if(r!==null){let s=Lt(r.node);Be(s)&&e.preventDefault()}return!0},Q),t.registerCommand(Nl,()=>(sl(),!0),Q),t.registerCommand(al,(e)=>(Vs(t,De(e,ClipboardEvent)?e:null),!0),Q),t.registerCommand(cl,(e)=>(async function(n,o){await Vs(o,De(n,ClipboardEvent)?n:null),o.update(()=>{let r=v();A(r)?r.removeText():Xt(r)&&r.getNodes().forEach((s)=>s.remove())})}(e,t),!0),Q),t.registerCommand(xl,(e)=>{let[,n,o]=Xs(e);if(n.length>0&&!o)return t.dispatchCommand(hd,n),!0;if(ln(e.target)&&s_(e.target))return!1;return v()!==null&&(function(r,s){r.preventDefault(),s.update(()=>{let i=v(),l=De(r,InputEvent)||De(r,KeyboardEvent)?null:r.clipboardData;l!=null&&i!==null&&fd(l,i,s)},{tag:Up})}(e,t),!0)},Q),t.registerCommand(ml,(e)=>{let n=v();return A(n)&&gd(n),!1},Q),t.registerCommand(ho,(e)=>{let n=v();return A(n)&&gd(n),!1},Q))}var nb=it({conflictsWith:["@lexical/plain-text"],dependencies:[Am],name:"@lexical/rich-text",nodes:()=>[Yr,Ur],register:qm});var vn=_d,Vl=vn.$createHeadingNode,Xl=vn.$createQuoteNode,ql=vn.$isHeadingNode,Zl=vn.$isQuoteNode,n1=vn.DRAG_DROP_PASTE,Ql=vn.HeadingNode,jl=vn.QuoteNode,o1=vn.RichTextExtension,r1=vn.eventFiles,Zm=vn.registerRichText;var Cd={};at(Cd,{RichTextPlugin:()=>lb});var Ye=Dt(Bt(),1),ta=Dt(ob(),1);function rb(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var md=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ye.useLayoutEffect:Ye.useEffect;function sb({editor:t,ErrorBoundary:e}){return function(n,o){let[r,s]=Ye.useState(()=>n.getDecorators());return md(()=>n.registerDecoratorListener((i)=>{ta.flushSync(()=>{s(i)})}),[n]),Ye.useEffect(()=>{s(n.getDecorators())},[n]),Ye.useMemo(()=>{let i=[],l=Object.keys(r);for(let a=0;a<l.length;a++){let c=l[a],u=w(o,{onError:(f)=>n._onError(f),children:w(Ye.Suspense,{fallback:null,children:r[c]})}),d=n.getElementByKey(c);d!==null&&i.push(ta.createPortal(u,d,c))}return i},[o,r,n])}(t,e)}function ib({editor:t,ErrorBoundary:e}){return function(n){let o=xm.maybeFromEditor(n);if(o&&o.hasExtensionByName(Tm.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&rb(320,r);return!0}return!1}(t)?null:w(sb,{editor:t,ErrorBoundary:e})}function Qm(t){return t.getEditorState().read(Gl(t.isComposing()))}function lb({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){let[o]=mt();return function(r){md(()=>$t(Zm(r),vm(r)),[r])}(o),Tt(qo,{children:[t,w(ab,{content:e}),w(ib,{editor:o,ErrorBoundary:n})]})}function ab({content:t}){let[e]=mt(),n=function(r){let[s,i]=Ye.useState(()=>Qm(r));return md(()=>{function l(){let a=Qm(r);i(a)}return l(),$t(r.registerUpdateListener(()=>{l()}),r.registerEditableListener(()=>{l()}))},[r]),s}(e),o=u_();return n?typeof t=="function"?t(o):t:null}var cb=Cd,jm=cb.RichTextPlugin;var xd={};at(xd,{ContentEditableElement:()=>nC,ContentEditable:()=>db});var le=Dt(Bt(),1);var eC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?le.useLayoutEffect:le.useEffect;function ub({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:s,ariaExpanded:i,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:p,id:g,role:_="textbox",spellCheck:m=!0,style:C,tabIndex:x,"data-testid":N,...T},y){let[S,E]=le.useState(t.isEditable()),O=le.useCallback((I)=>{I&&I.ownerDocument&&I.ownerDocument.defaultView?t.setRootElement(I):t.setRootElement(null)},[t]),$=le.useMemo(()=>function(...I){return(k)=>{for(let L of I)typeof L=="function"?L(k):L!=null&&(L.current=k)}}(y,O),[O,y]);return eC(()=>(E(t.isEditable()),t.registerEditableListener((I)=>{E(I)})),[t]),w("div",{"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?n:"none","aria-controls":S?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":S&&_==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":c,"aria-multiline":u,"aria-owns":S?d:void 0,"aria-readonly":!S||void 0,"aria-required":f,autoCapitalize:h,className:p,contentEditable:S,"data-testid":N,id:g,ref:$,role:_,spellCheck:m,style:C,tabIndex:x,...T})}var nC=le.forwardRef(ub);function tC(t){return t.getEditorState().read(Gl(t.isComposing()))}var db=le.forwardRef(fb);function fb(t,e){let{placeholder:n,...o}=t,[r]=mt();return Tt(qo,{children:[w(nC,{editor:r,...o,ref:e}),n!=null&&w(gb,{editor:r,content:n})]})}function gb({content:t,editor:e}){let n=function(i){let[l,a]=le.useState(()=>tC(i));return eC(()=>{function c(){let u=tC(i);a(u)}return c(),$t(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),l}(e),[o,r]=le.useState(e.isEditable());if(le.useLayoutEffect(()=>(r(e.isEditable()),e.registerEditableListener((i)=>{r(i)})),[e]),!n)return null;let s=null;return typeof t=="function"?s=t(o):t!==null&&(s=t),s===null?null:w("div",{"aria-hidden":!0,children:s})}var oC=xd,rC=oC.ContentEditable,y1=oC.ContentEditableElement;var yd={};at(yd,{registerHistory:()=>iC,createEmptyHistoryState:()=>lC,SharedHistoryExtension:()=>_b,HistoryExtension:()=>ea});function hb(t,e,n,o,r){if(t===null||n.size===0&&o.size===0&&!r)return 0;let s=e._selection,i=t._selection;if(r)return 1;if(!(A(s)&&A(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let l=function(m,C,x){let N=m._nodeMap,T=[];for(let y of C){let S=N.get(y);S!==void 0&&T.push(S)}for(let[y,S]of x){if(!S)continue;let E=N.get(y);E===void 0||Jn(E)||T.push(E)}return T}(e,n,o);if(l.length===0)return 0;if(l.length>1){let m=e._nodeMap,C=m.get(s.anchor.key),x=m.get(i.anchor.key);return C&&x&&!t._nodeMap.has(C.__key)&&K(C)&&C.__text.length===1&&s.anchor.offset===1?2:0}let a=l[0],c=t._nodeMap.get(a.__key);if(!K(c)||!K(a)||c.__mode!==a.__mode)return 0;let u=c.__text,d=a.__text;if(u===d)return 0;let f=s.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return 0;let p=f.offset,g=h.offset,_=d.length-u.length;return _===1&&g===p-1?2:_===-1&&g===p+1?3:_===-1&&g===p?4:0}function pb(t,e,n){let o=n(),r=0,s=o,i=0,l=null;return(a,c,u,d,f,h)=>{let p=n();if(h.has(kp)&&(s=o,i=r,l=a),h.has(wr))return r=0,o=p,2;h.has(Lp)&&l&&(o=s,r=i,a=l);let g=hb(a,c,d,f,t.isComposing()),_=(()=>{let m=u===null||u.editor===t,C=h.has(zp);if(!C&&m&&h.has(fo))return 0;if(g===1)return 2;if(a===null)return 1;let x=c._selection;if(!(d.size>0||f.size>0))return x!==null?0:2;let N=typeof e=="number"?e:e.peek();if(C===!1&&g!==0&&g===r&&p<o+N&&m)return 0;if(d.size===1){if(function(T,y,S){let E=y._nodeMap.get(T),O=S._nodeMap.get(T),$=y._selection,I=S._selection;return!(A($)&&A(I)&&$.anchor.type==="element"&&$.focus.type==="element"&&I.anchor.type==="text"&&I.focus.type==="text"||!K(E)||!K(O)||E.__parent!==O.__parent)&&JSON.stringify(y.read(()=>E.exportJSON()))===JSON.stringify(S.read(()=>O.exportJSON()))}(Array.from(d)[0],a,c))return 0}return 1})();return o=p,r=g,_}}function sC(t){t.undoStack=[],t.redoStack=[],t.current=null}function iC(t,e,n,o=Date.now){let r=pb(t,n,o);return $t(t.registerCommand(El,()=>(function(s,i){let{redoStack:l,undoStack:a}=i;if(a.length!==0){let c=i.current,u=a.pop();c!==null&&(l.push(c),s.dispatchCommand(Ho,!0)),a.length===0&&s.dispatchCommand(Uo,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:wr})}}(t,e),!0),Q),t.registerCommand(yl,()=>(function(s,i){let{redoStack:l,undoStack:a}=i;if(l.length!==0){let c=i.current;c!==null&&(a.push(c),s.dispatchCommand(Uo,!0));let u=l.pop();l.length===0&&s.dispatchCommand(Ho,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:wr})}}(t,e),!0),Q),t.registerCommand(il,()=>(sC(e),!1),Q),t.registerCommand(Ip,()=>(sC(e),t.dispatchCommand(Ho,!1),t.dispatchCommand(Uo,!1),!0),Q),t.registerUpdateListener(({editorState:s,prevEditorState:i,dirtyLeaves:l,dirtyElements:a,tags:c})=>{let{current:u,redoStack:d,undoStack:f}=e,h=u===null?null:u.editorState;if(u!==null&&s===h)return;let p=r(i,s,u,l,a,c);if(p===1)d.length!==0&&(e.redoStack=[],t.dispatchCommand(Ho,!1)),u!==null&&(f.push({...u}),t.dispatchCommand(Uo,!0));else if(p===2)return;e.current={editor:t,editorState:s}}))}function lC(){return{current:null,redoStack:[],undoStack:[]}}var ea=it({build:(t,{delay:e,createInitialHistoryState:n,disabled:o,now:r})=>me({delay:e,disabled:o,historyState:n(t),now:r}),config:Rt({createInitialHistoryState:lC,delay:300,disabled:typeof window>"u",now:Date.now}),name:"@lexical/history/History",register:(t,e,n)=>{let o=n.getOutput();return _e(()=>o.disabled.value?void 0:iC(t,o.historyState.value,o.delay,()=>o.now.peek()()))}}),_b=it({build:(t,{disabled:e,parentEditor:n})=>me({disabled:e,parentEditor:n||t._parentEditor}),config:Rt({disabled:!1,parentEditor:null}),dependencies:[bl(ea,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(t,e,n)=>_e(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(ea),i=function(a){return a?Sm(a,ea.name):null}(r.value);if(!i)return;let l=i.output;ym(()=>{s.delay.value=l.delay.value,s.historyState.value=l.historyState.value,s.now.value=l.now.value,s.disabled.value=l.disabled.value})}})});var na=yd,b1=na.HistoryExtension,O1=na.SharedHistoryExtension,oa=na.createEmptyHistoryState,aC=na.registerHistory;var Sd={};at(Sd,{createEmptyHistoryState:()=>oa,HistoryPlugin:()=>mb});var ra=Dt(Bt(),1);function mb({delay:t,externalHistoryState:e}){let[n]=mt();return function(o,r,s=1000){let i=ra.useMemo(()=>r||oa(),[r]);ra.useEffect(()=>aC(o,i,s),[s,o,i])}(n,e,t),null}var cC=Sd,uC=cC.HistoryPlugin,w1=cC.createEmptyHistoryState;var Od={};at(Od,{removeList:()=>Eb,registerListStrictIndentTransform:()=>vC,registerList:()=>AC,registerCheckList:()=>TC,insertList:()=>Tb,UPDATE_LIST_START_COMMAND:()=>EC,REMOVE_LIST_COMMAND:()=>MC,ListNode:()=>Gr,ListItemNode:()=>Qo,ListExtension:()=>DC,INSERT_UNORDERED_LIST_COMMAND:()=>bC,INSERT_ORDERED_LIST_COMMAND:()=>OC,INSERT_CHECK_LIST_COMMAND:()=>NC,CheckListExtension:()=>bb,$removeList:()=>bd,$isListNode:()=>tt,$isListItemNode:()=>et,$insertList:()=>qs,$handleListInsertParagraph:()=>SC,$getListDepth:()=>sa,$createListNode:()=>xo,$createListItemNode:()=>jo});function Co(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sa(t){let e=1,n=t.getParent();for(;n!=null;){if(et(n)){let o=n.getParent();if(tt(o)){e++,n=o.getParent();continue}Co(40)}return e}return e}function Nd(t){let e=t.getParent();tt(e)||Co(40);let n=e;for(;n!==null;)n=n.getParent(),tt(n)&&(e=n);return e}function CC(t){let e=[],n=t.getChildren().filter(et);for(let o=0;o<n.length;o++){let r=n[o],s=r.getFirstChild();tt(s)?e=e.concat(CC(s)):e.push(r)}return e}function Dn(t){return et(t)&&tt(t.getFirstChild())}function dC(t){return jo().append(t)}function xC(t,e){return et(t)&&(e.length===0||e.length===1&&t.is(e[0])&&t.getChildrenSize()===0)}function qs(t){let e=v();if(e!==null){let n=e.getNodes();if(A(e)){let r=e.getStartEndPoints();r===null&&Co(143);let[s]=r,i=s.getNode(),l=i.getParent();if(jt(i)){let a=i.getFirstChild();if(a)n=a.selectStart().getNodes();else{let c=X();i.append(c),n=c.select().getNodes()}}else if(xC(i,n)){let a=xo(t);if(jt(l)){i.replace(a);let c=jo();F(i)&&(c.setFormat(i.getFormatType()),c.setIndent(i.getIndent())),a.append(c)}else if(et(i)){let c=i.getParentOrThrow();Zo(a,c.getChildren()),c.replace(a)}return}}let o=new Set;for(let r=0;r<n.length;r++){let s=n[r];if(F(s)&&s.isEmpty()&&!et(s)&&!o.has(s.getKey())){fC(s,t);continue}let i=ks(s)?s.getParent():et(s)&&s.isEmpty()?s:null;for(;i!=null;){let l=i.getKey();if(tt(i)){if(!o.has(l)){let a=xo(t);Zo(a,i.getChildren()),i.replace(a),o.add(l)}break}{let a=i.getParent();if(jt(a)&&!o.has(l)){o.add(l),fC(i,t);break}i=a}}}}}function Zo(t,e){t.splice(t.getChildrenSize(),0,e)}function fC(t,e){if(tt(t))return t;let n=t.getPreviousSibling(),o=t.getNextSibling(),r=jo(),s;if(Zo(r,t.getChildren()),tt(n)&&e===n.getListType())n.append(r),tt(o)&&e===o.getListType()&&(Zo(n,o.getChildren()),o.remove()),s=n;else if(tt(o)&&e===o.getListType())o.getFirstChildOrThrow().insertBefore(r),s=o;else{let l=xo(e);l.append(r),t.replace(l),s=l}r.setFormat(t.getFormatType()),r.setIndent(t.getIndent());let i=v();return A(i)&&(s.getKey()===i.anchor.key&&i.anchor.set(r.getKey(),i.anchor.offset,"element"),s.getKey()===i.focus.key&&i.focus.set(r.getKey(),i.focus.offset,"element")),t.remove(),s}function Ed(t,e){let n=t.getLastChild(),o=e.getFirstChild();n&&o&&Dn(n)&&Dn(o)&&(Ed(n.getFirstChild(),o.getFirstChild()),o.remove());let r=e.getChildren();r.length>0&&t.append(...r),e.remove()}function bd(){let t=v();if(A(t)){let e=new Set,n=t.getNodes(),o=t.anchor.getNode();if(xC(o,n))e.add(Nd(o));else for(let r=0;r<n.length;r++){let s=n[r];if(ks(s)){let i=Fl(s,Qo);i!=null&&e.add(Nd(i))}}for(let r of e){let s=r,i=CC(r);for(let l of i){let a=X().setTextStyle(t.style).setTextFormat(t.format);Zo(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===t.anchor.key&&yn(t.anchor,We(ge(a,"next"))),l.__key===t.focus.key&&yn(t.focus,We(ge(a,"next"))),l.remove()}r.remove()}}}function yC(t){let e=t.getListType()!=="check",n=t.getStart();for(let o of t.getChildren())et(o)&&(o.getValue()!==n&&o.setValue(n),e&&o.getLatest().__checked!=null&&o.setChecked(void 0),tt(o.getFirstChild())||n++)}function Cb(t){let e=new Set;if(Dn(t)||e.has(t.getKey()))return;let n=t.getParent(),o=t.getNextSibling(),r=t.getPreviousSibling();if(Dn(o)&&Dn(r)){let s=r.getFirstChild();if(tt(s)){s.append(t);let i=o.getFirstChild();if(tt(i))Zo(s,i.getChildren()),o.remove(),e.add(o.getKey())}}else if(Dn(o)){let s=o.getFirstChild();if(tt(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(t)}}else if(Dn(r)){let s=r.getFirstChild();tt(s)&&s.append(t)}else if(tt(n)){let s=Jt(t),i=Jt(n);s.append(i),i.append(t),r?r.insertAfter(s):o?o.insertBefore(s):n.append(s)}}function xb(t){if(Dn(t))return;let e=t.getParent(),n=e?e.getParent():void 0;if(tt(n?n.getParent():void 0)&&et(n)&&tt(e)){let o=e?e.getFirstChild():void 0,r=e?e.getLastChild():void 0;if(t.is(o))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(r))n.insertAfter(t),e.isEmpty()&&n.remove();else{let s=Jt(t),i=Jt(e);s.append(i),t.getPreviousSiblings().forEach((c)=>i.append(c));let l=Jt(t),a=Jt(e);l.append(a),Zo(a,t.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(t)}}}function SC(t=!1){let e=v();if(!A(e)||!e.isCollapsed())return!1;let n=e.anchor.getNode(),o=null;if(et(n)&&n.getChildrenSize()===0)o=n;else if(K(n)){let c=n.getParent();et(c)&&c.getChildren().every((u)=>K(u)&&u.getTextContent().trim()==="")&&(o=c)}if(o===null)return!1;let r=Nd(o),s=o.getParent();tt(s)||Co(40);let i=s.getParent(),l;if(jt(i))l=X(),r.insertAfter(l);else{if(!et(i))return!1;l=Jt(i),i.insertAfter(l)}l.setTextStyle(e.style).setTextFormat(e.format).select();let a=o.getNextSiblings();if(a.length>0){let c=t?function(d,f){return d.getStart()+f.getIndexWithinParent()}(s,o):1,u=Jt(s).setStart(c);if(et(l)){let d=Jt(l);d.append(u),l.insertAfter(d)}else l.insertAfter(u);u.append(...a)}return function(c){let u=c;for(;u.getNextSibling()==null&&u.getPreviousSibling()==null;){let d=u.getParent();if(d==null||!et(d)&&!tt(d))break;u=d}u.remove()}(o),!0}class Qo extends re{__value;__checked;$config(){return this.config("listitem",{$transform:(t)=>{if(t.__checked==null)return;let e=t.getParent();tt(e)&&e.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:re,importDOM:Su({li:()=>({conversion:yb,priority:0})})})}constructor(t=1,e=void 0,n){super(n),this.__value=t===void 0?1:t,this.__checked=e}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){let e=document.createElement("li");return this.updateListItemDOM(null,e,t),e}updateListItemDOM(t,e,n){(function(s,i,l){let a=i.getParent();!tt(a)||a.getListType()!=="check"||tt(i.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&i.__checked===l.__checked||s.setAttribute("aria-checked",i.getChecked()?"true":"false"))})(e,this,t),e.value=this.__value,function(s,i,l){let a=[],c=[],u=i.list,d=u?u.listitem:void 0,f;if(u&&u.nested&&(f=u.nested.listitem),d!==void 0&&a.push(...Us(d)),u){let h=l.getParent(),p=tt(h)&&h.getListType()==="check",g=l.getChecked();p&&!g||c.push(u.listitemUnchecked),p&&g||c.push(u.listitemChecked),p&&a.push(g?u.listitemChecked:u.listitemUnchecked)}if(f!==void 0){let h=Us(f);l.getChildren().some((p)=>tt(p))?a.push(...h):c.push(...h)}c.length>0&&On(s,...c),a.length>0&&kt(s,...a)}(e,n.theme,this);let o=t?t.__style:"",r=this.__style;o!==r&&(r===""?e.removeAttribute("style"):e.style.cssText=r),function(s,i,l){let a=Pu(i.__textStyle);for(let c in a)s.style.setProperty(`--listitem-marker-${c}`,a[c]);if(l)for(let c in Pu(l.__textStyle))c in a||s.style.removeProperty(`--listitem-marker-${c}`)}(e,this,t)}updateDOM(t,e,n){let o=e;return this.updateListItemDOM(t,o,n),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){let e=this.createDOM(t._config),n=this.getFormatType();n&&(e.style.textAlign=n);let o=this.getDirection();return o&&(e.dir=o),{element:e}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let e=0;e<t.length;e++){let n=t[e];if(F(n)&&this.canMergeWith(n)){let o=n.getChildren();this.append(...o),n.remove()}else super.append(n)}return this}replace(t,e){if(et(t))return super.replace(t);this.setIndent(0);let n=this.getParentOrThrow();if(!tt(n))return t;if(n.__first===this.getKey())n.insertBefore(t);else if(n.__last===this.getKey())n.insertAfter(t);else{let o=Jt(n),r=this.getNextSibling();for(;r;){let s=r;r=r.getNextSibling(),o.append(s)}n.insertAfter(t),t.insertAfter(o)}return e&&(F(t)||Co(139),this.getChildren().forEach((o)=>{t.append(o)})),this.remove(),n.getChildrenSize()===0&&n.remove(),t}insertAfter(t,e=!0){let n=this.getParentOrThrow();if(tt(n)||Co(39),et(t))return super.insertAfter(t,e);let o=this.getNextSiblings();if(n.insertAfter(t,e),o.length!==0){let r=Jt(n);o.forEach((s)=>r.append(s)),t.insertAfter(r,e)}return t}remove(t){let e=this.getPreviousSibling(),n=this.getNextSibling();super.remove(t),e&&n&&Dn(e)&&Dn(n)&&(Ed(e.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(t){super.resetOnCopyNodeFrom(t),t.getChecked()&&this.setChecked(!1)}insertNewAfter(t,e=!0){let n=Jt(this);return this.insertAfter(n,e),n}collapseAtStart(t){let e=X();this.getChildren().forEach((s)=>e.append(s));let n=this.getParentOrThrow(),o=n.getParentOrThrow(),r=et(o);if(n.getChildrenSize()===1)if(r)n.remove(),o.select();else{n.insertBefore(e),n.remove();let{anchor:s,focus:i}=t,l=e.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element")}else n.insertBefore(e),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){let e=this.getWritable();return e.__value=t,e}getChecked(){let t=this.getLatest(),e,n=this.getParent();return tt(n)&&(e=n.getListType()),e==="check"?Boolean(t.__checked):void 0}setChecked(t){let e=this.getWritable();return e.__checked=t,e}toggleChecked(){let t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){let t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let e=t.getParentOrThrow(),n=0;for(;et(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(t){typeof t!="number"&&Co(117),(t=Math.floor(t))>=0||Co(199);let e=this.getIndent();for(;e!==t;)e<t?(Cb(this),e++):(xb(this),e--);return this}canInsertAfter(t){return et(t)}canReplaceWith(t){return et(t)}canMergeWith(t){return et(t)||rn(t)}extractWithChild(t,e){if(!A(e))return!1;let n=e.anchor.getNode(),o=e.focus.getNode();return this.isParentOf(n)&&this.isParentOf(o)&&this.getTextContent().length===e.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return xo("bullet")}canMergeWhenEmpty(){return!0}}function yb(t){if(t.classList.contains("task-list-item")){for(let n of t.children)if(n.tagName==="INPUT")return gC(n)}if(t.classList.contains("joplin-checkbox")){for(let n of t.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return gC(n.children[0])}let e=t.getAttribute("aria-checked");return{node:jo(e==="true"||e!=="false"&&void 0)}}function gC(t){if(t.getAttribute("type")!=="checkbox")return{node:null};return{node:jo(t.hasAttribute("checked"))}}function jo(t){return fe(new Qo(void 0,t))}function et(t){return t instanceof Qo}class Gr extends re{__tag;__start;__listType;$config(){return this.config("list",{$transform:(t)=>{(function(e){let n=e.getNextSibling();tt(n)&&e.getListType()===n.getListType()&&Ed(e,n)})(t),yC(t)},extends:re,importDOM:Su({ol:()=>({conversion:pC,priority:0}),ul:()=>({conversion:pC,priority:0})})})}constructor(t="number",e=1,n){super(n);let o=Nb[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=e}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){let e=this.getWritable();return e.__listType=t,e.__tag=t==="number"?"ol":"ul",e}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){let e=this.getWritable();return e.__start=t,e}createDOM(t,e){let n=this.__tag,o=document.createElement(n);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,hC(o,t.theme,this),o}updateDOM(t,e,n){return t.__tag!==this.__tag||t.__listType!==this.__listType||(hC(e,n.theme,this),t.__start!==this.__start&&e.setAttribute("start",String(this.__start)),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){let e=this.createDOM(t._config,t);return ie(e)&&(this.__start!==1&&e.setAttribute("start",String(this.__start)),this.__listType==="check"&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,e,n){let o=n.find(et)??this.getChildren().find(et),r=o?()=>Jt(o):jo,s=n;for(let i=0;i<n.length;i++){let l=n[i];et(l)||(s===n&&(s=[...n]),s[i]=r().append(!F(l)||tt(l)||l.isInline()?l:wt(l.getTextContent())))}return super.splice(t,e,s)}extractWithChild(t){return et(t)}}function hC(t,e,n){let o=[],r=[],s=e.list;if(s!==void 0){let i=s[`${n.__tag}Depth`]||[],l=sa(n)-1,a=l%i.length,c=i[a],u=s[n.__tag],d,f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&o.push(u),h!==void 0&&n.__listType==="check"&&o.push(h),c!==void 0){o.push(...Us(c));for(let p=0;p<i.length;p++)p!==a&&r.push(n.__tag+p)}if(d!==void 0){let p=Us(d);l>1?o.push(...p):r.push(...p)}}r.length>0&&On(t,...r),o.length>0&&kt(t,...o)}function Sb(t){let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(et(o)){e.push(o);let r=o.getChildren();r.length>1&&r.forEach((s)=>{tt(s)&&e.push(dC(s))})}else e.push(dC(o))}return e}function pC(t){let e=t.nodeName.toLowerCase(),n=null;if(e==="ol")n=xo("number",t.start);else e==="ul"&&(n=function(o){if(o.getAttribute("__lexicallisttype")==="check"||o.classList.contains("contains-task-list")||o.getAttribute("data-is-checklist")==="1")return!0;for(let r of o.childNodes)if(ie(r)&&r.hasAttribute("aria-checked"))return!0;return!1}(t)?xo("check"):xo("bullet"));return{after:Sb,node:n}}var Nb={ol:"number",ul:"bullet"};function xo(t="number",e=1){return fe(new Gr(t,e))}function tt(t){return t instanceof Gr}var NC=Ne("INSERT_CHECK_LIST_COMMAND");function TC(t,e){let n=e&&e.disableTakeFocusOnClick||!1,o=typeof n=="boolean"?()=>n:n.peek.bind(n),r=(i)=>{(function(l,a){_C(l,()=>{if(ie(l.target)){let c=l.target,u=Ml(c);u!=null&&u.isEditable()&&u.update(()=>{let d=Lt(c);et(d)&&(a?(fu(Xp),fu(Vp)):c.focus(),d.toggleChecked())})}})})(i,o())},s=(i)=>{(function(l,a){_C(l,()=>{l.preventDefault(),a&&l.stopPropagation()})})(i,o())};return $t(t.registerCommand(NC,()=>(qs("check"),!0),st),t.registerCommand(Xn,(i)=>mC(i,t,!1),st),t.registerCommand(sn,(i)=>mC(i,t,!0),st),t.registerCommand($r,()=>{if(Td()!=null){let i=t.getRootElement();return i!=null&&i.focus(),!0}return!1},st),t.registerCommand(ml,(i)=>{let l=Td();return!(l==null||!t.isEditable())&&(t.update(()=>{let a=Lt(l);et(a)&&(i.preventDefault(),a.toggleChecked())}),!0)},st),t.registerCommand(Rr,(i)=>t.getEditorState().read(()=>{let l=v();if(A(l)&&l.isCollapsed()){let{anchor:a}=l,c=a.type==="element";if(c||a.offset===0){let u=a.getNode(),d=q(u,(f)=>F(f)&&!f.isInline());if(et(d)){let f=d.getParent();if(tt(f)&&f.getListType()==="check"&&(c||d.getFirstDescendant()===u)){let h=t.getElementByKey(d.__key);if(h!=null&&document.activeElement!==h)return h.focus(),i.preventDefault(),!0}}}}return!1}),st),t.registerRootListener((i)=>{if(i!==null)return i.addEventListener("click",r),i.addEventListener("pointerdown",s,{capture:!0}),i.addEventListener("mousedown",s,{capture:!0}),i.addEventListener("touchstart",s,{capture:!0,passive:!1}),()=>{i.removeEventListener("click",r),i.removeEventListener("pointerdown",s,{capture:!0}),i.removeEventListener("mousedown",s,{capture:!0}),i.removeEventListener("touchstart",s,{capture:!0})}}))}function _C(t,e){let n=t.target;if(!ie(n))return;let o=n.firstChild;if(ie(o)&&(o.tagName==="UL"||o.tagName==="OL"))return;let r=n.parentNode;if(!r||r.__lexicalListType!=="check")return;let s=null,i=null;if("clientX"in t)s=t.clientX;else if("touches"in t){let f=t.touches;f.length>0&&(s=f[0].clientX,i="touch")}if(s==null)return;let l=n.getBoundingClientRect(),a=s/U_(n),c=window.getComputedStyle?window.getComputedStyle(n,"::before"):{width:"0px"},u=parseFloat(c.width),d=i==="touch"||t.pointerType==="touch"?32:0;(n.dir==="rtl"?a<l.right+d&&a>l.right-u-d:a>l.left-d&&a<l.left+u+d)&&e()}function Td(){let t=document.activeElement;return ie(t)&&t.tagName==="LI"&&t.parentNode!=null&&t.parentNode.__lexicalListType==="check"?t:null}function mC(t,e,n){let o=Td();return o!=null&&e.update(()=>{let r=Lt(o);if(!et(r))return;let s=function(i,l){let a=l?i.getPreviousSibling():i.getNextSibling(),c=i;for(;a==null&&et(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;et(a);){let u=l?a.getLastChild():a.getFirstChild();if(!tt(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null}(r,n);if(s!=null){s.selectStart();let i=e.getElementByKey(s.__key);i!=null&&(t.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}var EC=Ne("UPDATE_LIST_START_COMMAND"),bC=Ne("INSERT_UNORDERED_LIST_COMMAND"),OC=Ne("INSERT_ORDERED_LIST_COMMAND"),MC=Ne("REMOVE_LIST_COMMAND");function AC(t,e){return $t(t.registerCommand(OC,()=>(qs("number"),!0),st),t.registerCommand(EC,(n)=>{let{listNodeKey:o,newStart:r}=n,s=Vt(o);return!!tt(s)&&(s.getListType()==="number"&&(s.setStart(r),yC(s)),!0)},st),t.registerCommand(bC,()=>(qs("bullet"),!0),st),t.registerCommand(MC,()=>(bd(),!0),st),t.registerCommand(go,()=>SC(!!(e&&e.restoreNumbering)),st),t.registerNodeTransform(Qo,(n)=>{let o=n.getFirstChild();if(o){if(K(o)){let r=o.getStyle(),s=o.getFormat();n.getTextStyle()!==r&&n.setTextStyle(r),n.getTextFormat()!==s&&n.setTextFormat(s)}}else{let r=v();A(r)&&(r.style!==n.getTextStyle()||r.format!==n.getTextFormat())&&r.isCollapsed()&&n.is(r.anchor.getNode())&&n.setTextStyle(r.style).setTextFormat(r.format)}}),t.registerNodeTransform(Ue,(n)=>{let o=n.getParent();if(et(o)&&n.is(o.getFirstChild())){let r=n.getStyle(),s=n.getFormat();r===o.getTextStyle()&&s===o.getTextFormat()||o.setTextStyle(r).setTextFormat(s)}}))}function vC(t){let e=(n)=>{let o=n.getParent();if(tt(n.getFirstChild())||!tt(o))return;let r=q(n,(s)=>et(s)&&tt(s.getParent())&&et(s.getPreviousSibling()));if(r===null&&n.getIndent()>0)n.setIndent(0);else if(et(r)){let s=r.getPreviousSibling();if(et(s)){let i=function(a){let c=a,u=c.getFirstChild();for(;tt(u);){let d=u.getLastChild();if(!et(d))break;c=d,u=c.getFirstChild()}return c}(s),l=i.getParent();if(tt(l)){let a=sa(l);a+1<sa(o)&&n.setIndent(a)}}}};return t.registerNodeTransform(Gr,(n)=>{let o=[n];for(;o.length>0;){let r=o.shift();if(tt(r)){for(let s of r.getChildren())if(et(s)){e(s);let i=s.getFirstChild();tt(i)&&o.push(i)}}}})}function Tb(t,e){t.update(()=>qs(e))}function Eb(t){t.update(()=>bd())}var DC=it({build:(t,e,n)=>me(e),config:Rt({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[Gr,Qo],register(t,e,n){let o=n.getOutput();return $t(_e(()=>AC(t,{restoreNumbering:o.shouldPreserveNumbering.value})),_e(()=>o.hasStrictIndent.value?vC(t):void 0))}}),bb=it({build:(t,e)=>me(e),config:Rt({disableTakeFocusOnClick:!1}),dependencies:[DC],name:"@lexical/list/CheckList",register:(t,e,n)=>TC(t,n.getOutput())});var At=Od,wC=At.$createListItemNode,RC=At.$createListNode,k1=At.$getListDepth,P1=At.$handleListInsertParagraph,K1=At.$insertList,Md=At.$isListItemNode,cn=At.$isListNode,B1=At.$removeList,W1=At.CheckListExtension,$C=At.INSERT_CHECK_LIST_COMMAND,IC=At.INSERT_ORDERED_LIST_COMMAND,FC=At.INSERT_UNORDERED_LIST_COMMAND,z1=At.ListExtension,yo=At.ListItemNode,wn=At.ListNode,ia=At.REMOVE_LIST_COMMAND,H1=At.UPDATE_LIST_START_COMMAND,U1=At.insertList,LC=At.registerCheckList,Ad=At.registerList,kC=At.registerListStrictIndentTransform,Y1=At.removeList;var vd={};at(vd,{ListPlugin:()=>Ob});var la=Dt(Bt(),1);function Ob({hasStrictIndent:t=!1,shouldPreserveNumbering:e=!1}){let[n]=mt();return la.useEffect(()=>{if(!n.hasNodes([wn,yo]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),la.useEffect(()=>se(Ad(n,{restoreNumbering:e}),t?kC(n):()=>{}),[n,t,e]),function(o){la.useEffect(()=>Ad(o),[o])}(n),null}var Mb=vd,PC=Mb.ListPlugin;var Dd={};at(Dd,{CheckListPlugin:()=>Ab});var KC=Dt(Bt(),1);function Ab({disableTakeFocusOnClick:t=!1}){let[e]=mt();return KC.useEffect(()=>LC(e,{disableTakeFocusOnClick:t}),[e,t]),null}var vb=Dd,BC=vb.CheckListPlugin;var wd={};at(wd,{registerTabIndentation:()=>Yl,TabIndentationPlugin:()=>Db});var WC=Dt(Bt(),1);function Db({maxIndent:t,$canIndent:e}){let[n]=mt();return WC.useEffect(()=>Yl(n,t,e),[n,t,e]),null}var zC=wd,HC=zC.TabIndentationPlugin,ow=zC.registerTabIndentation;var Ld={};at(Ld,{toggleLink:()=>zb,registerLink:()=>VC,registerClickableLink:()=>XC,registerAutoLink:()=>tx,formatUrl:()=>Rd,createLinkMatcherWithRegExp:()=>Lb,TOGGLE_LINK_COMMAND:()=>ca,LinkNode:()=>So,LinkExtension:()=>Fd,ClickableLinkExtension:()=>Fb,AutoLinkNode:()=>Jr,AutoLinkExtension:()=>Wb,$toggleLink:()=>Zs,$isLinkNode:()=>we,$isAutoLinkNode:()=>Te,$createLinkNode:()=>js,$createAutoLinkNode:()=>aa});var wb=new Set(["http:","https:","mailto:","sms:","tel:"]);class So extends re{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new So(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",e={},n){super(n);let{target:o=null,rel:r=null,title:s=null}=e;this.__url=t,this.__target=o,this.__rel=r,this.__title=s}afterCloneFrom(t){super.afterCloneFrom(t),this.__url=t.__url,this.__rel=t.__rel,this.__target=t.__target,this.__title=t.__title}createDOM(t){let e=document.createElement("a");return this.updateLinkDOM(null,e,t),kt(e,t.theme.link),e}updateLinkDOM(t,e,n){if(kl(e)){t&&t.__url===this.__url||(e.href=this.sanitizeUrl(this.__url));for(let o of["target","rel","title"]){let r=`__${o}`,s=this[r];t&&t[r]===s||(s?e[o]=s:e.removeAttribute(o))}}}updateDOM(t,e,n){return this.updateLinkDOM(t,e,n),!1}static importDOM(){return{a:(t)=>({conversion:$b,priority:1})}}static importJSON(t){return js().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=Rd(t);try{let e=new URL(Rd(t));if(!wb.has(e.protocol))return"about:blank"}catch(e){return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){let e=this.getWritable();return e.__url=t,e}getTarget(){return this.getLatest().__target}setTarget(t){let e=this.getWritable();return e.__target=t,e}getRel(){return this.getLatest().__rel}setRel(t){let e=this.getWritable();return e.__rel=t,e}getTitle(){return this.getLatest().__title}setTitle(t){let e=this.getWritable();return e.__title=t,e}insertNewAfter(t,e=!0){let n=Jt(this);return this.insertAfter(n,e),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,e,n){if(!A(e))return!1;let o=e.anchor.getNode(),r=e.focus.getNode();return this.isParentOf(o)&&this.isParentOf(r)&&e.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(t){return this.getType()===t.getType()&&this.__url===t.__url&&this.__target===t.__target&&this.__rel===t.__rel&&this.__title===t.__title}}function UC(t){let e=_n(t,"next");return[e,e.getFlipped()]}function YC(t,e){for(let n of e)if(n.origin.isAttached()){let o=We(n);return void yn(t,o)}}function Rb(t){let e=v(),n=null,o=null;function r(){A(e)&&(YC(e.anchor,n),YC(e.focus,o),xn(e))}A(e)&&(n=UC(e.anchor),o=UC(e.focus));let s=!1;for(let i of ge(t,"next")){let l=i.origin;if(F(l)&&!l.isInline()){let a=l.getChildren();if(a.length>0){let c=Jt(t);c.append(...a),l.append(c),s=!0}H_(l,rl(i),{$shouldSplit:()=>!1})}}if(t.isAttached()){let i=t.getPreviousSibling();if(we(i)&&i.shouldMergeAdjacentLink(t))return i.append(...t.getChildren()),t.remove(),void r();let l=t.getNextSibling();we(l)&&t.shouldMergeAdjacentLink(l)&&(t.append(...l.getChildren()),l.remove(),s=!0)}if(s){if(!t.canBeEmpty()&&t.isEmpty()){let i=t.getParent();t.remove(),i&&i.isEmpty()&&i.remove()}r()}}function $b(t){let e=null;if(kl(t)){let n=t.textContent;(n!==null&&n!==""||t.children.length>0)&&(e=js(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function js(t="",e){return fe(new So(t,e))}function we(t){return t instanceof So}class Jr extends So{__isUnlinked;constructor(t="",e={},n){super(t,e,n),this.__isUnlinked=e.isUnlinked!==void 0&&e.isUnlinked!==null&&e.isUnlinked}afterCloneFrom(t){super.afterCloneFrom(t),this.__isUnlinked=t.__isUnlinked}static getType(){return"autolink"}static clone(t){return new Jr(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(t){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){let e=this.getWritable();return e.__isUnlinked=t,e}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,e,n){return super.updateDOM(t,e,n)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return aa().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,e=!0){let n=aa(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,e),n}}function aa(t="",e){return fe(new Jr(t,e))}function Te(t){return t instanceof Jr}var ca=Ne("TOGGLE_LINK_COMMAND");function GC(t,e){if(t.type==="element"){let n=t.getNode();return F(n)||function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let l of r)i.append("v",l);throw s.search=i.toString(),Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[t.offset+e]||null}return null}function Zs(t,e={}){let n;if(t&&typeof t=="object"){let{url:u,...d}=t;n=u,e={...d,...e}}else n=t;let{target:o,title:r}=e,s=e.rel===void 0?"noreferrer":e.rel,i=v();if(i===null||!A(i)&&!Xt(i))return;if(Xt(i)){let u=i.getNodes();if(u.length===0)return;return void u.forEach((d)=>{if(n===null){let f=q(d,(h)=>!Te(h)&&we(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=q(d,(h)=>!Te(h)&&we(h));if(f)f.setURL(n),o!==void 0&&f.setTarget(o),s!==void 0&&f.setRel(s);else{let h=js(n,{rel:s,target:o});d.insertBefore(h),h.append(d)}}})}if(i.isCollapsed()&&n===null)for(let u of i.getNodes()){let d=q(u,(f)=>!Te(f)&&we(f));return void(d!==null&&(d.getChildren().forEach((f)=>{d.insertBefore(f)}),d.remove()))}let l=i.extract();if(n===null){let u=new Set;return void l.forEach((d)=>{let f=q(d,(h)=>!Te(h)&&we(h));if(f!==null){let h=f.getKey();if(u.has(h))return;(function(p,g){let _=new Set(g.filter((E)=>p.isParentOf(E)).map((E)=>E.getKey())),m=p.getChildren(),C=(E)=>_.has(E.getKey())||F(E)&&g.some((O)=>p.isParentOf(O)&&E.isParentOf(O)),x=m.filter(C);if(x.length===m.length)return m.forEach((E)=>p.insertBefore(E)),void p.remove();let N=m.findIndex(C),T=m.findLastIndex(C),y=N===0,S=T===m.length-1;if(y)x.forEach((E)=>p.insertBefore(E));else if(S)for(let E=x.length-1;E>=0;E--)p.insertAfter(x[E]);else{for(let O=x.length-1;O>=0;O--)p.insertAfter(x[O]);let E=m.slice(T+1);if(E.length>0){let O=Jt(p);x[x.length-1].insertAfter(O),E.forEach(($)=>O.append($))}}})(f,l),u.add(h)}})}let a=new Set,c=(u)=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(n),o!==void 0&&u.setTarget(o),s!==void 0&&u.setRel(s),r!==void 0&&u.setTitle(r))};if(l.length===1){let u=l[0],d=q(u,we);if(d!==null)return c(d)}(function(u){let d=v();if(!A(d))return u();let f=xn(d),h=f.isBackward(),p=GC(f.anchor,h?-1:0),g=GC(f.focus,h?0:-1),_=u();if(p||g){let m=v();if(A(m)){let C=m.clone();if(p){let x=p.getParent();x&&C.anchor.set(x.getKey(),p.getIndexWithinParent()+(h?1:0),"element")}if(g){let x=g.getParent();x&&C.focus.set(x.getKey(),g.getIndexWithinParent()+(h?0:1),"element")}St(xn(C))}}})(()=>{let u=null;for(let d of l){if(!d.isAttached())continue;let f=q(d,we);if(f){c(f);continue}if(F(d)){if(!d.isInline())continue;if(we(d)){if(!(Te(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let p of d.getChildren())d.insertBefore(p);d.remove();continue}}let h=d.getPreviousSibling();we(h)&&h.is(u)?h.append(d):(u=js(n,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var Ib=/^\+?[0-9\s()-]{5,}$/;function Rd(t){return t.match(/^[a-z][a-z0-9+.-]*:/i)||t.match(/^[/#.]/)?t:t.includes("@")?`mailto:${t}`:Ib.test(t)?`tel:${t}`:`https://${t}`}function VC(t,e){return $t(t.registerNodeTransform(So,Rb),t.registerCommand(ca,(n)=>{let o=e.validateUrl.peek(),r=e.attributes.peek();if(n===null)return Zs(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n))&&(Zs(n,r),!0);{let{url:s,target:i,rel:l,title:a}=n;return Zs(s,{...r,rel:l,target:i,title:a}),!0}},Q),_e(()=>{let n=e.validateUrl.value;if(!n)return;let o=e.attributes.value;return t.registerCommand(xl,(r)=>{let s=v();if(!A(s)||s.isCollapsed()||!De(r,ClipboardEvent))return!1;if(r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!n(i)&&(!s.getNodes().some((l)=>F(l))&&(t.dispatchCommand(ca,{...o,url:i}),r.preventDefault(),!0))},st)}))}var Fd=it({build:(t,e,n)=>me(e),config:{attributes:void 0,validateUrl:void 0},mergeConfig(t,e){let n=_o(t,e);return t.attributes&&(n.attributes=_o(t.attributes,n.attributes)),n},name:"@lexical/link/Link",nodes:()=>[So],register:(t,e,n)=>VC(t,n.getOutput())});function XC(t,e,n={}){let o=(s)=>{let i=s.target;if(!ln(i))return;let l=Ml(i);if(l===null)return;let a=null,c=null;if(l.update(()=>{let f=Lt(i);if(f!==null){let h=q(f,F);if(!e.disabled.peek())if(we(h))a=h.sanitizeUrl(h.getURL()),c=h.getTarget();else{let p=function(g,_){let m=g;for(;m!=null;){if(_(m))return m;m=m.parentNode}return null}(i,kl);p!==null&&(a=p.href,c=p.target)}}}),a===null||a==="")return;let u=t.getEditorState().read(v);if(A(u)&&!u.isCollapsed())return void s.preventDefault();let d=s.type==="auxclick"&&s.button===1;window.open(a,e.newTab.peek()||d||s.metaKey||s.ctrlKey||c==="_blank"?"_blank":"_self"),s.preventDefault()},r=(s)=>{s.button===1&&o(s)};return t.registerRootListener((s)=>{if(s)return s.addEventListener("click",o,n),s.addEventListener("mouseup",r,n),()=>{s.removeEventListener("click",o),s.removeEventListener("mouseup",r)}})}var Fb=it({build:(t,e,n)=>me(e),config:Rt({disabled:!1,newTab:!1}),dependencies:[Fd],name:"@lexical/link/ClickableLink",register:(t,e,n)=>XC(t,n.getOutput())});function Lb(t,e=(n)=>n){return(n)=>{let o=t.exec(n);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:e(o[0])}}}function $d(t,e){for(let n=0;n<e.length;n++){let o=e[n](t);if(o)return o}return null}var kb=/[.,;\s]/;function ua(t){return kb.test(t)}function qC(t){return ua(t[t.length-1])}function Id(t){return ua(t[0])}function ZC(t){let e=t.getPreviousSibling();return F(e)&&(e=e.getLastDescendant()),e===null||yt(e)||K(e)&&qC(e.getTextContent())}function QC(t){let e=t.getNextSibling();return F(e)&&(e=e.getFirstDescendant()),e===null||yt(e)||K(e)&&Id(e.getTextContent())}function Pb(t,e,n,o){if(!(t>0?ua(n[t-1]):ZC(o[0])))return!1;return e<n.length?ua(n[e]):QC(o[o.length-1])}function Kb(t,e,n){let o=[],r=[],s=[],i=0,l=0,a=[...t];for(;a.length>0;){let c=a[0],u=c.getTextContent().length,d=l;l+u<=e?(o.push(c),i+=u):d>=n?s.push(c):r.push(c),l+=u,a.shift()}return[i,o,r,s]}function Bb(t,e,n,o){let r=aa(o.url,o.attributes);if(t.length===1){let s,i=t[0];e===0?[s,i]=i.splitText(n):[,s,i]=i.splitText(e,n);let l=wt(o.text);return l.setFormat(s.getFormat()),l.setDetail(s.getDetail()),l.setStyle(s.getStyle()),r.append(l),s.replace(r),i}if(t.length>1){let s=t[0],i,l=s.getTextContent().length;e===0?i=s:[,i]=s.splitText(e);let a=[],c;for(let h=1;h<t.length;h++){let p=t[h],g=p.getTextContent().length,_=l;if(_<n)if(l+g<=n)a.push(p);else{let[m,C]=p.splitText(n-_);a.push(m),c=C}l+=g}let u=v(),d=u?u.getNodes().find(K):void 0,f=wt(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),r.append(f,...a),d&&d===i&&(A(u)?f.select(u.anchor.offset,u.focus.offset):Xt(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function JC(t,e,n){let o=t.getChildren(),r=o.length;for(let a=0;a<r;a++){let c=o[a];if(!K(c)||!c.isSimpleText())return Qs(t),void n(null,t.getURL())}let s=t.getTextContent(),i=$d(s,e);if(i===null||i.text!==s)return Qs(t),void n(null,t.getURL());if(!ZC(t)||!QC(t))return Qs(t),void n(null,t.getURL());let l=t.getURL();if(l!==i.url&&(t.setURL(i.url),n(i.url,l)),i.attributes){let a=t.getRel();a!==i.attributes.rel&&(t.setRel(i.attributes.rel||null),n(i.attributes.rel||null,a));let c=t.getTarget();c!==i.attributes.target&&(t.setTarget(i.attributes.target||null),n(i.attributes.target||null,c))}}function Qs(t){let e=t.getChildren();for(let n=e.length-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map((n)=>n.getLatest())}var jC={changeHandlers:[],excludeParents:[],matchers:[]};function tx(t,e=jC){let{matchers:n,changeHandlers:o,excludeParents:r}=e,s=(i,l)=>{for(let a of o)a(i,l)};return $t(t.registerNodeTransform(Ue,(i)=>{let l=i.getParentOrThrow(),a=i.getPreviousSibling();if(Te(l))JC(l,n,s);else if(!we(l)&&!r.some((c)=>c(l))){if(i.isSimpleText()&&(Id(i.getTextContent())||!Te(a))){let c=function(u){let d=[u],f=u.getNextSibling();for(;f!==null&&K(f)&&f.isSimpleText()&&(d.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return d}(i);(function(u,d,f){for(let C of u){let x=C.getParent();if(Te(x)&&!x.getIsUnlinked())return}let h=[...u],p=h.map((C)=>C.getTextContent()).join(""),g,_=p,m=0;for(;(g=$d(_,d))&&g!==null;){let C=g.index,x=C+g.length;if(Pb(m+C,m+x,p,h)){let[N,,T,y]=Kb(h,m+C,m+x),S=!1;for(let O of T){let $=O.getParent();if(Te($)&&!$.getIsUnlinked()){S=!0;break}}if(S){m+=x,_=_.substring(x);continue}let E=Bb(T,m+C-N,m+x-N,g);h=E?[E,...y]:y,f(g.url,null),m=0}else m+=x;_=_.substring(x)}})(c,n,s)}(function(c,u,d){let f=c.getParent(),h=c.getPreviousSibling(),p=c.getNextSibling(),g=c.getTextContent();if(!Te(f)||f.getIsUnlinked()){if(Te(h)&&!h.getIsUnlinked()&&h.is(c.getPreviousSibling())&&c.getParent()===h.getParent()){if(!Id(g))return Qs(h),void d(null,h.getURL());if(_=g,h.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(_):/^\.[a-zA-Z0-9]{1,}/.test(_)){let m=h.getTextContent()+g,C=$d(m,u);C!==null&&C.text===m&&(h.append(c),JC(h,u,d),d(null,h.getURL()))}}var _;!Te(p)||p.getIsUnlinked()||qC(g)||p.is(c.getNextSibling())&&c.getParent()===p.getParent()&&(Qs(p),d(null,p.getURL()))}})(i,n,s)}}),t.registerCommand(ca,(i)=>{let l=v();if(i!==null||!A(l))return!1;return l.extract().forEach((a)=>{let c=a.getParent();Te(c)&&(c.setIsUnlinked(!c.getIsUnlinked()),c.markDirty())}),!1},st))}var Wb=it({config:jC,dependencies:[Fd],mergeConfig(t,e){let n=_o(t,e);for(let o of["matchers","changeHandlers","excludeParents"]){let r=e[o];Array.isArray(r)&&(n[o]=[...t[o],...r])}return n},name:"@lexical/link/AutoLink",nodes:[Jr],register:tx}),zb=Zs;var te=Ld,aw=te.$createAutoLinkNode,ex=te.$createLinkNode,nx=te.$isAutoLinkNode,Vr=te.$isLinkNode,cw=te.$toggleLink,uw=te.AutoLinkExtension,ox=te.AutoLinkNode,dw=te.ClickableLinkExtension,fw=te.LinkExtension,Xr=te.LinkNode,kd=te.TOGGLE_LINK_COMMAND,gw=te.createLinkMatcherWithRegExp,hw=te.formatUrl,pw=te.registerAutoLink,_w=te.registerClickableLink,rx=te.registerLink,mw=te.toggleLink;var Kd={};at(Kd,{LinkPlugin:()=>Hb});var Pd=Dt(Bt(),1);function Hb({validateUrl:t,attributes:e}){let[n]=mt();return Pd.useEffect(()=>{if(!n.hasNodes([Xr]))throw Error("LinkPlugin: LinkNode not registered on editor")}),Pd.useEffect(()=>rx(n,me({attributes:e,validateUrl:t})),[n,t,e]),null}var Ub=Kd,sx=Ub.LinkPlugin;var Bd={};at(Bd,{AutoFocusPlugin:()=>Yb});var ix=Dt(Bt(),1);function Yb({defaultSelection:t}){let[e]=mt();return ix.useEffect(()=>{e.focus(()=>{let n=document.activeElement,o=e.getRootElement();o===null||n!==null&&o.contains(n)||o.focus({preventScroll:!0})},{defaultSelection:t})},[t,e]),null}var Gb=Bd,lx=Gb.AutoFocusPlugin;var Gd={};at(Gd,{getDefaultCodeLanguage:()=>qb,DEFAULT_CODE_LANGUAGE:()=>gx,CodeNode:()=>qr,CodeHighlightNode:()=>Qr,CodeExtension:()=>jb,$isCodeNode:()=>px,$isCodeHighlightNode:()=>un,$getStartOfCodeInLine:()=>Vb,$getLastCodeNodeOfLine:()=>Ud,$getFirstCodeNodeOfLine:()=>Hd,$getEndOfCodeInLine:()=>Xb,$getCodeLineDirection:()=>Jb,$createCodeNode:()=>Zr,$createCodeHighlightNode:()=>Yd});function dx(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function fx(t,e){let n=t;for(let o=oe(t,e);o&&(un(o.origin)||he(o.origin));o=o.getAdjacentCaret())n=o.origin;return n}function Hd(t){return fx(t,"previous")}function Ud(t){return fx(t,"next")}function Jb(t){let e=Hd(t),n=Ud(t),o=e;for(;o!==null;){if(un(o)){let s=t_(o.getTextContent());if(s!==null)return s}if(o===n)break;o=o.getNextSibling()}let r=e.getParent();if(F(r)){let s=r.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function Vb(t,e){let n=null,o=null,r=t,s=e,i=t.getTextContent();for(;;){if(s===0){if(r=r.getPreviousSibling(),r===null)break;if(un(r)||he(r)||yt(r)||dx(167),yt(r)){n={node:r,offset:1};break}s=Math.max(0,r.getTextContentSize()-1),i=r.getTextContent()}else s--;let a=i[s];un(r)&&a!==" "&&(o={node:r,offset:s})}if(o!==null)return o;let l=null;if(e<t.getTextContentSize())un(t)&&(l=t.getTextContent()[e]);else{let a=t.getNextSibling();un(a)&&(l=a.getTextContent()[0])}if(l!==null&&l!==" ")return n;{let a=function(c,u){let d=c,f=u,h=c.getTextContent(),p=c.getTextContentSize();for(;;){if(!un(d)||f===p){if(d=d.getNextSibling(),d===null||yt(d))return null;un(d)&&(f=0,h=d.getTextContent(),p=d.getTextContentSize())}if(un(d)){if(h[f]!==" ")return{node:d,offset:f};f++}}}(t,e);return a!==null?a:n}}function Xb(t){let e=Ud(t);return yt(e)&&dx(168),e}var gx="javascript",qb=()=>gx;function hx(t,e){for(let n of t.childNodes){if(qn(n)&&n.tagName===e)return!0;hx(n,e)}return!1}var ei="data-language",ti="data-highlight-language",da="data-theme";class qr extends re{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new qr(t.__language,t.__key)}constructor(t,e){super(e),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){let e=document.createElement("code");Tn(e,t.theme.code),e.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(e.setAttribute(ei,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(ti,n));let o=this.getTheme();o&&e.setAttribute(da,o);let r=this.getStyle();return r&&e.setAttribute("style",r),e}updateDOM(t,e,n){let o=this.__language,r=t.__language;o?o!==r&&e.setAttribute(ei,o):r&&e.removeAttribute(ei);let s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&r?s&&o?o!==r&&e.setAttribute(ti,o):e.removeAttribute(ti):s&&o&&e.setAttribute(ti,o);let i=this.__theme,l=t.__theme;i?i!==l&&e.setAttribute(da,i):l&&e.removeAttribute(da);let a=this.__style,c=t.__style;return a?a!==c&&e.setAttribute("style",a):c&&e.removeAttribute("style"),!1}exportDOM(t){let e=document.createElement("pre");Tn(e,t._config.theme.code),e.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(e.setAttribute(ei,n),this.getIsSyntaxHighlightSupported()&&e.setAttribute(ti,n));let o=this.getTheme();o&&e.setAttribute(da,o);let r=this.getStyle();return r&&e.setAttribute("style",r),{element:e}}static importDOM(){return{code:(t)=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||hx(t,"BR"))?{conversion:ax,priority:1}:null,div:()=>({conversion:Zb,priority:1}),pre:()=>({conversion:ax,priority:0}),table:(t)=>Wd(t)?{conversion:Qb,priority:3}:null,td:(t)=>{let e=t,n=e.closest("table");return e.classList.contains("js-file-line")||n&&Wd(n)?{conversion:cx,priority:3}:null},tr:(t)=>{let e=t.closest("table");return e&&Wd(e)?{conversion:cx,priority:3}:null}}}static importJSON(t){return Zr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,e=!0){let n=this.getChildren(),o=n.length;if(o>=2&&n[o-1].getTextContent()===`
18
- `&&n[o-2].getTextContent()===`
19
- `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){n[o-1].remove(),n[o-2].remove();let l=X();return this.insertAfter(l,e),l}let{anchor:r,focus:s}=t,i=(r.isBefore(s)?r:s).getNode();if(K(i)){let l=Hd(i),a=[];for(;;)if(he(l))a.push(Se()),l=l.getNextSibling();else{if(!un(l))break;{let g=0,_=l.getTextContent(),m=l.getTextContentSize();for(;g<m&&_[g]===" ";)g++;if(g!==0&&a.push(Yd(" ".repeat(g))),g!==m)break;l=l.getNextSibling()}}let c=i.splitText(r.offset)[0],u=r.offset===0?0:1,d=c.getIndexWithinParent()+u,f=i.getParentOrThrow(),h=[Pe(),...a];f.splice(d,0,h);let p=a[a.length-1];p?p.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(px(i)){let{offset:l}=t.anchor;i.splice(l,0,[Pe()]),i.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){let t=X();return this.getChildren().forEach((e)=>t.append(e)),this.replace(t),!0}setLanguage(t){let e=this.getWritable();return e.__language=t||void 0,e}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){let e=this.getWritable();return e.__isSyntaxHighlightSupported=t,e}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){let e=this.getWritable();return e.__theme=t||void 0,e}getTheme(){return this.getLatest().__theme}}function Zr(t,e){return ji(qr).setLanguage(t).setTheme(e)}function px(t){return t instanceof qr}function ax(t){return{node:Zr(t.getAttribute(ei))}}function Zb(t){let e=t,n=ux(e);return n||function(o){let r=o.parentElement;for(;r!==null;){if(ux(r))return!0;r=r.parentElement}return!1}(e)?{node:n?Zr():null}:{node:null}}function Qb(){return{node:Zr()}}function cx(){return{node:null}}function ux(t){return t.style.fontFamily.match("monospace")!==null}function Wd(t){return t.classList.contains("js-file-line-container")}class Qr extends Ue{__highlightType;constructor(t="",e,n){super(t,n),this.__highlightType=e}static getType(){return"code-highlight"}static clone(t){return new Qr(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__highlightType=t.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){let e=this.getWritable();return e.__highlightType=t||void 0,e}canHaveFormat(){return!1}createDOM(t){let e=super.createDOM(t),n=zd(t.theme,this.__highlightType);return Tn(e,n),e}updateDOM(t,e,n){let o=super.updateDOM(t,e,n),r=zd(n.theme,t.__highlightType),s=zd(n.theme,this.__highlightType);return r!==s&&(r&&Ir(e,r),s&&Tn(e,s)),o}static importJSON(t){return Yd().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return Zr()}}function zd(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function Yd(t="",e){return fe(new Qr(t,e))}function un(t){return t instanceof Qr}var jb=it({name:"@lexical/code",nodes:()=>[qr,Qr]});var Ee=Gd,fa=Ee.$createCodeHighlightNode,tr=Ee.$createCodeNode,ga=Ee.$getCodeLineDirection,ha=Ee.$getEndOfCodeInLine,No=Ee.$getFirstCodeNodeOfLine,er=Ee.$getLastCodeNodeOfLine,pa=Ee.$getStartOfCodeInLine,Re=Ee.$isCodeHighlightNode,be=Ee.$isCodeNode,_x=Ee.CodeExtension,ni=Ee.CodeHighlightNode,To=Ee.CodeNode,_a=Ee.DEFAULT_CODE_LANGUAGE,mx=Ee.getDefaultCodeLanguage;var nf={};at(nf,{registerMarkdownShortcuts:()=>fO,UNORDERED_LIST:()=>Kx,TRANSFORMERS:()=>xa,TEXT_MATCH_TRANSFORMERS:()=>ty,TEXT_FORMAT_TRANSFORMERS:()=>jx,STRIKETHROUGH:()=>Jx,QUOTE:()=>Px,ORDERED_LIST:()=>Bx,MULTILINE_ELEMENT_TRANSFORMERS:()=>Qx,LINK:()=>qx,ITALIC_UNDERSCORE:()=>Xx,ITALIC_STAR:()=>Vx,INLINE_CODE:()=>Wx,HIGHLIGHT:()=>zx,HEADING:()=>kx,ELEMENT_TRANSFORMERS:()=>Zx,CODE:()=>ri,CHECK_LIST:()=>dO,BOLD_UNDERSCORE:()=>Gx,BOLD_STAR:()=>Yx,BOLD_ITALIC_UNDERSCORE:()=>Ux,BOLD_ITALIC_STAR:()=>Hx,$convertToMarkdownString:()=>hO,$convertFromMarkdownString:()=>gO});function Jd(t,e){let n={};for(let o of t){let r=e(o);r&&(n[r]?n[r].push(o):n[r]=[o])}return n}function tf(t){let e=Jd(t,(n)=>n.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}var Cx=/[!-/:-@[-`{-~\s]/,xx=/[ \t\n\r\f]/,Vd=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,tO=/^\s{0,3}$/;function Xd(t){if(!rn(t))return!1;let e=t.getFirstChild();return e==null||t.getChildrenSize()===1&&K(e)&&tO.test(e.getTextContent())}function qd(t){return t.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n)))}function eO(t,e,n,o){for(let r of e){if(!r.export)continue;let s=r.export(t,(i)=>ma(i,n,o));if(s!=null)return s}return F(t)?ma(t,n,o):Be(t)?t.getTextContent():null}function ma(t,e,n,o,r){let s=[],i=t.getChildren();o||(o=[]),r||(r=[]);t:for(let l of i){for(let a of n){if(!a.export)continue;let c=a.export(l,(u)=>ma(u,e,n,o,[...r,...o]),(u,d)=>yx(u,d,e,o,r));if(c!=null){s.push(c);continue t}}yt(l)?s.push(`
20
- `):K(l)?s.push(yx(l,l.getTextContent(),e,o,r)):F(l)?s.push(ma(l,e,n,o,r)):Be(l)&&s.push(l.getTextContent())}return s.join("")}function yx(t,e,n,o,r){let s=e;t.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let i=s.match(/^(\s*)(.*?)(\s*)$/s)||["","",s,""],l=i[1],a=i[2],c=i[3],u=a==="",d="",f="",h="",p=Sx(t,!0),g=Sx(t,!1),_=new Set;for(let m of n){let C=m.format[0],x=m.tag;Nx(t,C)&&!_.has(C)&&(_.add(C),Nx(p,C)&&o.find((N)=>N.tag===x)||(o.push({format:C,tag:x}),d+=x))}for(let m=0;m<o.length;m++){let C=Zd(t,o[m].format),x=Zd(g,o[m].format);if(C&&x)continue;let N=[...o];for(;N.length>m;){let T=N.pop();r&&T&&r.find((y)=>y.tag===T.tag)||(T&&typeof T.tag=="string"&&(C?x||(h+=T.tag):f+=T.tag),o.pop())}break}return u&&!t.hasFormat("code")?f+s:f+l+d+a+h+c}function Sx(t,e){let n=e?t.getPreviousSibling():t.getNextSibling();return K(n)?n:null}function Zd(t,e){return K(t)&&t.hasFormat(e)}function Nx(t,e){return!!Zd(t,e)&&(e==="code"||(!t||!/^\s*$/.test(t.getTextContent())))}function nO(t,e){let n=t.getTextContent(),o=e.fullMatchRegExpByTag["`"],r=e.transformersByTag["`"],s=[],i=null;if(o&&r){let f=new RegExp(o.source,"g"),h=Array.from(n.matchAll(f));for(let p of h){let g=p.index,_=g+p[0].length;i||(i={content:p[2],endIndex:_,startIndex:g,tag:"`"}),s.push({end:_,start:g})}}let l=function(f,h,p=[]){let g=[],_=new Set(Object.keys(h.transformersByTag).filter((N)=>N[0]!=="`").map((N)=>N[0])),m=(N)=>{let T=0;for(let y=N-1;y>=0&&f[y]==="\\";y--)T++;return T%2==1},C=(N)=>p.some((T)=>N>=T.start&&N<T.end),x=0;for(;x<f.length;){let N=f[x];if(!_.has(N)||m(x)||C(x)){x++;continue}let T=1;for(;x+T<f.length&&f[x+T]===N;)T++;let y=Tx(N,f,x,T,!0),S=Tx(N,f,x,T,!1);(y||S)&&g.push({active:!0,canClose:S,canOpen:y,char:N,index:x,length:T,originalLength:T}),x+=T}return g}(n,e,s),a=l.length>0?function(f,h,p){let g={},_=0,m=null;for(;_<h.length;){let C=h[_];if(!C.active||!C.canClose||C.length===0){_++;continue}let x=`${C.char}${C.canOpen}`,N=g[x]??-1,T=!1;for(let y=_-1;y>N;y--){let S=h[y];if(!S.active||!S.canOpen||S.length===0||S.char!==C.char)continue;if(S.canClose||C.canOpen){if((S.originalLength+C.originalLength)%3==0&&S.originalLength%3!=0&&C.originalLength%3!=0)continue}let E=Math.min(S.length,C.length),O=Object.keys(p.transformersByTag).filter((k)=>k[0]===S.char&&k.length<=E).sort((k,L)=>L.length-k.length)[0];if(!O)continue;T=!0;let $=O.length,I={content:f.slice(S.index+S.length,C.index),endIndex:C.index+$,startIndex:S.index+(S.length-$),tag:O};(!m||I.startIndex<m.startIndex||I.startIndex===m.startIndex&&I.endIndex>m.endIndex)&&(m=I);for(let k=y+1;k<_;k++)h[k].active=!1;S.length-=$,C.length-=$,S.active=S.length>0,C.length>0?C.index+=$:(C.active=!1,_++);break}T||(g[x]=_-1,C.canOpen||(C.active=!1),_++)}return m}(n,l,e):null,c=null,u=null;if(i&&a?a.startIndex<=i.startIndex&&a.endIndex>=i.endIndex?(c=a,u=e.transformersByTag[a.tag]):(c=i,u=r):i?(c=i,u=r):a&&(c=a,u=e.transformersByTag[a.tag]),!c||!u)return null;let d=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return d.index=c.startIndex,d.input=n,{endIndex:c.endIndex,match:d,startIndex:c.startIndex,transformer:u}}function Tx(t,e,n,o,r){if(!Ex(e,n,o,r))return!1;if(t==="*")return!0;if(t==="_"){if(!Ex(e,n,o,!r))return!0;let s=r?e[n-1]:e[n+o];return s!==void 0&&Vd.test(s)}return!0}function Ex(t,e,n,o){let r=t[e-1],s=t[e+n],[i,l]=o?[s,r]:[r,s];return i!==void 0&&!xx.test(i)&&(!Vd.test(i)||(l===void 0||xx.test(l)||Vd.test(l)))}function Eo(t){return K(t)&&!t.hasFormat("code")}function nr(t,e,n){let o=nO(t,e),r=function(i,l){let a=i,c,u,d,f;for(let h of l){if(!h.replace||!h.importRegExp)continue;let p=a.getTextContent().match(h.importRegExp);if(!p)continue;let g=p.index||0,_=h.getEndIndex?h.getEndIndex(a,p):g+p[0].length;_!==!1&&(c===void 0||u===void 0||g<c&&(_>u||_<=c))&&(c=g,u=_,d=h,f=p)}return c===void 0||u===void 0||d===void 0||f===void 0?null:{endIndex:u,match:f,startIndex:c,transformer:d}}(t,n);if(o&&r&&(o.startIndex<=r.startIndex&&o.endIndex>=r.endIndex||r.startIndex>o.endIndex?r=null:o=null),o){let i=function(l,a,c,u,d){let f=l.getTextContent(),h,p,g;if(d[0]===f?h=l:a===0?[h,p]=l.splitText(c):[g,h,p]=l.splitText(a,c),h.setTextContent(d[2]),u)for(let _ of u.format)h.hasFormat(_)||h.toggleFormat(_);return{nodeAfter:p,nodeBefore:g,transformedNode:h}}(t,o.startIndex,o.endIndex,o.transformer,o.match);Eo(i.nodeAfter)&&nr(i.nodeAfter,e,n),Eo(i.nodeBefore)&&nr(i.nodeBefore,e,n),Eo(i.transformedNode)&&nr(i.transformedNode,e,n)}else if(r){let i=function(l,a,c,u,d){let f,h,p;return a===0?[f,h]=l.splitText(c):[p,f,h]=l.splitText(a,c),u.replace?{nodeAfter:h,nodeBefore:p,transformedNode:u.replace(f,d)||void 0}:null}(t,r.startIndex,r.endIndex,r.transformer,r.match);if(!i)return;Eo(i.nodeAfter)&&nr(i.nodeAfter,e,n),Eo(i.nodeBefore)&&nr(i.nodeBefore,e,n),Eo(i.transformedNode)&&nr(i.transformedNode,e,n)}let s=qd(t.getTextContent());t.setTextContent(s)}function oO(t,e=!1){let n=tf(t),o=function(r){let s={},i={},l=[];for(let c of r){let{tag:u}=c;s[u]=c;let d=u.replace(/(\*|\^|\+)/g,"\\$1");l.push(d),u.length===1?i[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${d}])(${d})((\\\\${d})?.*?[^${d}\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?![\\\\${d}])`):i[u]=new RegExp(`(?<!\\\\)(${d})((\\\\${d})?.*?[^\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?!\\\\)`)}return{fullMatchRegExpByTag:i,openTagsRegExp:new RegExp(`(?<![\\\\])(${l.join("|")})`,"g"),transformersByTag:s}}(n.textFormat);return(r,s)=>{let i=r.split(`
21
- `),l=i.length,a=s||xt();a.clear();for(let u=0;u<l;u++){let d=i[u],[f,h]=rO(i,u,n.multilineElement,a);f?u=h:sO(d,a,n.element,o,n.textMatch,e)}let c=a.getChildren();for(let u of c)if(!e&&Xd(u)&&a.getChildrenSize()>1)u.remove();else if(F(u))for(let d of u.getAllTextNodes())iO(d);v()!==null&&a.selectStart()}}function rO(t,e,n,o){for(let r of n){let{handleImportAfterStartMatch:s,regExpEnd:i,regExpStart:l,replace:a}=r,c=t[e].match(l);if(!c)continue;if(s){let p=s({lines:t,rootNode:o,startLineIndex:e,startMatch:c,transformer:r});if(p===null)continue;if(p)return p}let u=typeof i=="object"&&"regExp"in i?i.regExp:i,d=i&&typeof i=="object"&&"optional"in i?i.optional:!i,f=e,h=t.length;for(;f<h;){let p=u?t[f].match(u):null;if(!p&&(!d||d&&f<h-1)){f++;continue}if(p&&e===f&&p.index===c.index){f++;continue}let g=[];if(p&&e===f)g.push(t[e].slice(c[0].length,-p[0].length));else for(let _=e;_<=f;_++)if(_===e){let m=t[_].slice(c[0].length);g.push(m)}else if(_===f&&p){let m=t[_].slice(0,-p[0].length);g.push(m)}else g.push(t[_]);if(a(o,null,c,p,g,!0)!==!1)return[!0,f];break}}return[!1,e]}function sO(t,e,n,o,r,s){let i=wt(t),l=X();l.append(i),e.append(l);for(let{regExp:a,replace:c}of n){let u=t.match(a);if(u&&(i.setTextContent(t.slice(u[0].length)),c(l,[i],u,!0)!==!1))break}if(nr(i,o,r),l.isAttached()&&t.length>0){let a=l.getPreviousSibling();if(!s&&(rn(a)||Zl(a)||cn(a))){let c=a;if(cn(a)){let u=a.getLastDescendant();c=u==null?null:q(u,Md)}if(c!=null&&c.getTextContentSize()>0){let u=c.getLastChild();if(K(u)){let d=u.getTextContent();d.endsWith("\\")&&u.setTextContent(d.slice(0,-1))}c.splice(c.getChildrenSize(),0,[Pe(),...l.getChildren()]),l.remove()}}}}function iO(t){let e=new Set,n=t.getTextContent(),o=n.indexOf("\t");for(;o!==-1;)e.add(o),e.add(o+1),o=n.indexOf("\t",o+1);t.splitText(...e).forEach((r)=>{r.getTextContent()==="\t"&&r.replace(Se())})}function lO(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var wx=/^(\s*)(\d{1,})\.\s/,Rx=/^(\s*)[-*+]\s/,$x=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Qd=/^(#{1,6})\s/,Ix=/^>\s/,Fx=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,jd=/^[ \t]*`{3,}$/,aO=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,cO=/^(?:\|)(.+)(?:\|)\s?$/,uO=/^(\| ?:?-*:? ?)+\|\s?$/,bx=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Ox=/^<\/[a-z_][\w-]*\s*>/i,Mx=(t)=>new RegExp(`(?:${t.source})$`,t.flags),oi=zs("mdListMarker",{parse:(t)=>typeof t=="string"&&/^[-*+]$/.test(t)?t:"-",resetOnCopyNode:!0}),Ax=zs("mdCodeFence",{parse:(t)=>typeof t=="string"&&/^`{3,}$/.test(t)?t:"```",resetOnCopyNode:!0}),Lx=(t)=>(e,n,o,r)=>{let s=t(o);s.append(...n),e.replace(s),r||s.select(0,0)},ef=(t)=>(e,n,o,r)=>{let s=e.getPreviousSibling(),i=e.getNextSibling(),l=wC(t==="check"?o[3]==="x":void 0),a=o[0].trim()[0],c=t!=="bullet"&&t!=="check"||a!==oi.parse(a)?void 0:a;if(cn(i)&&i.getListType()===t){c&&Vn(i,oi,c);let d=i.getFirstChild();d!==null?d.insertBefore(l):i.append(l),e.remove()}else if(cn(s)&&s.getListType()===t)c&&Vn(s,oi,c),s.append(l),e.remove();else{let d=RC(t,t==="number"?Number(o[2]):void 0);c&&Vn(d,oi,c),d.append(l),e.replace(d)}l.append(...n),r||l.select(0,0);let u=function(d){let f=d.match(/\t/g),h=d.match(/ /g),p=0;return f&&(p+=f.length),h&&(p+=Math.floor(h.length/4)),p}(o[1]);u&&l.setIndent(u)},Ca=(t,e,n)=>{let o=[],r=t.getChildren(),s=0;for(let i of r)if(Md(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(cn(d)){o.push(Ca(d,e,n+1));continue}}let l=" ".repeat(4*n),a=t.getListType(),c=zo(t,oi),u=a==="number"?`${t.getStart()+s}. `:a==="check"?`${c} [${i.getChecked()?"x":" "}] `:c+" ";o.push(l+u+e(i)),s++}return o.join(`
22
- `)},kx={dependencies:[Ql],export:(t,e)=>{if(!ql(t))return null;let n=Number(t.getTag().slice(1));return"#".repeat(n)+" "+e(t)},regExp:Qd,replace:Lx((t)=>{let e="h"+t[1].length;return Vl(e)}),type:"element"},Px={dependencies:[jl],export:(t,e)=>{if(!Zl(t))return null;let n=e(t).split(`
23
- `),o=[];for(let r of n)o.push("> "+r);return o.join(`
24
- `)},regExp:Ix,replace:(t,e,n,o)=>{if(o){let s=t.getPreviousSibling();if(Zl(s))return s.splice(s.getChildrenSize(),0,[Pe(),...e]),void t.remove()}let r=Xl();r.append(...e),t.replace(r),o||r.select(0,0)},type:"element"},ri={dependencies:[To],export:(t)=>{if(!be(t))return null;let e=t.getTextContent(),n=zo(t,Ax);if(e.indexOf(n)>-1){let o=e.match(/`{3,}/g);if(o){let r=Math.max(...o.map((s)=>s.length));n="`".repeat(r+1)}}return n+(t.getLanguage()||"")+(e?`
25
- `+e:"")+`
26
- `+n},handleImportAfterStartMatch:({lines:t,rootNode:e,startLineIndex:n,startMatch:o})=>{let r=o[1],s=r.trim().length,i=t[n],l=o.index+r.length,a=i.slice(l),c=new RegExp(`\`{${s},}$`);if(c.test(a)){let h=a.match(c),p=a.slice(0,a.lastIndexOf(h[0])),g=[...o];return g[2]="",ri.replace(e,null,g,h,[p],!0),[!0,n]}let u=new RegExp(`^[ \\t]*\`{${s},}$`);for(let h=n+1;h<t.length;h++){let p=t[h];if(u.test(p)){let g=p.match(u),_=t.slice(n+1,h),m=i.slice(o[0].length);return m.length>0&&_.unshift(m),ri.replace(e,null,o,g,_,!0),[!0,h]}}let d=t.slice(n+1),f=i.slice(o[0].length);return f.length>0&&d.unshift(f),ri.replace(e,null,o,null,d,!0),[!0,t.length-1]},regExpEnd:{optional:!0,regExp:jd},regExpStart:Fx,replace:(t,e,n,o,r,s)=>{let i,l,a=n[1]?n[1].trim():"```",c=n[2]||void 0;if(!e&&r){if(r.length===1)o?(i=tr(c),l=r[0]):(i=tr(c),l=r[0].startsWith(" ")?r[0].slice(1):r[0]);else{for(i=tr(c),r.length>0&&(r[0].trim().length===0?r.shift():r[0].startsWith(" ")&&(r[0]=r[0].slice(1)));r.length>0&&!r[r.length-1].length;)r.pop();l=r.join(`
27
- `)}Vn(i,Ax,a);let u=wt(l);i.append(u),t.append(i)}else e&&Lx((u)=>tr(u?u[2]:void 0))(t,e,n,s)},type:"multiline-element"},Kx={dependencies:[wn,yo],export:(t,e)=>cn(t)?Ca(t,e,0):null,regExp:Rx,replace:ef("bullet"),type:"element"},dO={dependencies:[wn,yo],export:(t,e)=>cn(t)?Ca(t,e,0):null,regExp:$x,replace:ef("check"),type:"element"},Bx={dependencies:[wn,yo],export:(t,e)=>cn(t)?Ca(t,e,0):null,regExp:wx,replace:ef("number"),type:"element"},Wx={format:["code"],tag:"`",type:"text-format"},zx={format:["highlight"],tag:"==",type:"text-format"},Hx={format:["bold","italic"],tag:"***",type:"text-format"},Ux={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Yx={format:["bold"],tag:"**",type:"text-format"},Gx={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Jx={format:["strikethrough"],tag:"~~",type:"text-format"},Vx={format:["italic"],tag:"*",type:"text-format"},Xx={format:["italic"],intraword:!1,tag:"_",type:"text-format"},qx={dependencies:[Xr],export:(t,e,n)=>{if(!Vr(t)||nx(t))return null;let o=e(t),r=t.getTitle();return r!=null&&(r=r.replace(/([\\"])/g,"\\$1")),r?`[${o}](${t.getURL()} "${r}")`:`[${o}](${t.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(t,e)=>{if(on(t,Vr))return;let[,n,o,r]=e,s=o!=null?qd(o):void 0,i=r!=null?qd(r):void 0,l=ex(s,{title:i}),a=n.split("[").length-1,c=n.split("]").length-1,u=n,d="";if(a<c)return;if(a>c){let h=n.split("[");d="["+h[0],u=h.slice(1).join("[")}let f=wt(u);return f.setFormat(t.getFormat()),l.append(f),t.replace(l),d&&l.insertBefore(wt(d)),f},trigger:")",type:"text-match"},Zx=[kx,Px,Kx,Bx],Qx=[ri],jx=[Wx,Hx,Ux,Yx,Gx,zx,Vx,Xx,Jx],ty=[qx],xa=[...Zx,...Qx,...jx,...ty];function vx(t,e,n,o,r){let s=t.getParent();if(!jt(s)||t.getFirstChild()!==e)return!1;let i=e.getTextContent();if(!r&&i[n-1]!==" ")return!1;for(let{regExpStart:l,replace:a,regExpEnd:c}of o){if(c&&!("optional"in c)||c&&"optional"in c&&!c.optional)continue;let u=i.match(l);if(u){let d=r||u[0].endsWith(" ")?n:n-1;if(u[0].length!==d)continue;let f=e.getNextSiblings(),[h,p]=e.splitText(n);if(a(t,p?[p,...f]:f,u,null,null,!1)!==!1)return h.remove(),!0}}return!1}function Dx(t,e,n){let o=n.length;for(let r=e;r>=o;r--){let s=r-o;if(ey(t,s,n,0,o)&&t[s+o]!==" ")return s}return-1}function ey(t,e,n,o,r){for(let s=0;s<r;s++)if(t[e+s]!==n[o+s])return!1;return!0}function fO(t,e=xa){let n=tf(e),o=Jd(n.textFormat,({tag:i})=>i[i.length-1]),r=Jd(n.textMatch,({trigger:i})=>i);for(let i of e){let l=i.type;if(l==="element"||l==="text-match"||l==="multiline-element"){let a=i.dependencies;for(let c of a)t.hasNode(c)||lO(173,c.getType())}}let s=(i,l,a)=>{(function(c,u,d,f){let h=c.getParent();if(!jt(h)||c.getFirstChild()!==u)return!1;let p=u.getTextContent();if(p[d-1]!==" ")return!1;for(let{regExp:g,replace:_}of f){let m=p.match(g);if(m&&m[0].length===(m[0].endsWith(" ")?d:d-1)){let C=u.getNextSiblings(),[x,N]=u.splitText(d);if(_(c,N?[N,...C]:C,m,!1)!==!1)return x.remove(),!0}}return!1})(i,l,a,n.element)||vx(i,l,a,n.multilineElement)||function(c,u,d){let f=c.getTextContent(),h=d[f[u-1]];if(h==null)return!1;u<f.length&&(f=f.slice(0,u));for(let p of h){if(!p.replace||!p.regExp)continue;let g=f.match(p.regExp);if(g===null)continue;let _=g.index||0,m=_+g[0].length,C;return _===0?[C]=c.splitText(m):[,C]=c.splitText(_,m),C.selectNext(0,0),p.replace(C,g),!0}return!1}(l,a,r)||function(c,u,d){let f=c.getTextContent(),h=u-1,p=f[h],g=d[p];if(!g)return!1;for(let _ of g){let{tag:m}=_,C=m.length,x=h-C+1;if(C>1&&!ey(f,x,m,0,C))continue;if(f[x-1]===" ")continue;let N=f[h+1];if(_.intraword===!1&&N&&!Cx.test(N))continue;let T=c,y=T,S=Dx(f,x,m),E=y;for(;S<0&&(E=E.getPreviousSibling())&&!yt(E);)if(K(E)){if(E.hasFormat("code"))continue;let ot=E.getTextContent();y=E,S=Dx(ot,ot.length,m)}if(S<0)continue;if(y===T&&S+C===x)continue;let O=y.getTextContent();if(S>0&&O[S-1]===p)continue;let $=O[S-1];if(_.intraword===!1&&$&&!Cx.test($))continue;let I=T.getTextContent(),k=I.slice(0,x)+I.slice(h+1);T.setTextContent(k);let L=y===T?k:O;y.setTextContent(L.slice(0,S)+L.slice(S+C));let z=v(),M=Cn();St(M);let Z=h-C*(y===T?2:1)+1;M.anchor.set(y.__key,S,"text"),M.focus.set(T.__key,Z,"text");for(let ot of _.format)M.hasFormat(ot)||M.formatText(ot);M.anchor.set(M.focus.key,M.focus.offset,M.focus.type);for(let ot of _.format)M.hasFormat(ot)&&M.toggleFormat(ot);return A(z)&&(M.format=z.format),!0}}(l,a,o)};return se(t.registerUpdateListener(({tags:i,dirtyLeaves:l,editorState:a,prevEditorState:c})=>{if(i.has(Fp)||i.has(wr))return;if(t.isComposing())return;let u=a.read(v),d=c.read(v);if(!A(d)||!A(u)||!u.isCollapsed()||u.is(d))return;let f=u.anchor.key,h=u.anchor.offset,p=a._nodeMap.get(f);!K(p)||!l.has(f)||h!==1&&h>d.anchor.offset+1||t.update(()=>{if(!Eo(p))return;let g=p.getParent();g===null||be(g)||s(g,p,u.anchor.offset)})}),t.registerCommand(_l,(i)=>{if(i!==null&&i.shiftKey)return!1;let l=v();if(!A(l)||!l.isCollapsed())return!1;let a=l.anchor.offset,c=l.anchor.getNode();if(!K(c)||!Eo(c))return!1;let u=c.getParent();if(u===null||be(u))return!1;return a===c.getTextContent().length&&(!!vx(u,c,a,n.multilineElement,!0)&&(i!==null&&i.preventDefault(),!0))},st))}function gO(t,e=xa,n,o=!1,r=!1){let s=o?t:function(i,l=!1){let a=i.split(`
28
- `),c=!1,u=[];for(let d=0;d<a.length;d++){let f=a[d].trimEnd(),h=u[u.length-1];aO.test(f)?u.push(f):Fx.test(f)||jd.test(f)?(c=!c,u.push(f)):c||f===""||h===""||!h||Qd.test(h)||Qd.test(f)||Ix.test(f)||wx.test(f)||Rx.test(f)||$x.test(f)||cO.test(f)||uO.test(f)||!l||bx.test(f)||Ox.test(f)||Mx(Ox).test(h)||Mx(bx).test(h)||jd.test(h)?u.push(f):u[u.length-1]=h+" "+f.trimStart()}return u.join(`
29
- `)}(t,r);return oO(e,o)(s,n)}function hO(t=xa,e,n=!1){return function(r,s=!1){let i=tf(r),l=[...i.multilineElement,...i.element],a=!s,c=i.textFormat.filter((u)=>u.format.length===1).sort((u,d)=>Number(u.format.includes("code"))-Number(d.format.includes("code")));return(u)=>{let d=[],f=(u||xt()).getChildren();for(let h=0;h<f.length;h++){let p=f[h],g=eO(p,l,c,i.textMatch);g!=null&&d.push(a&&h>0&&!Xd(p)&&!Xd(f[h-1])?`
30
- `.concat(g):g)}return d.join(`
31
- `)}}(t,n)(e)}var bt=nf,of=bt.$convertFromMarkdownString,ny=bt.$convertToMarkdownString,$w=bt.BOLD_ITALIC_STAR,Iw=bt.BOLD_ITALIC_UNDERSCORE,Fw=bt.BOLD_STAR,Lw=bt.BOLD_UNDERSCORE,oy=bt.CHECK_LIST,kw=bt.CODE,ry=bt.ELEMENT_TRANSFORMERS,Pw=bt.HEADING,Kw=bt.HIGHLIGHT,Bw=bt.INLINE_CODE,Ww=bt.ITALIC_STAR,zw=bt.ITALIC_UNDERSCORE,Hw=bt.LINK,sy=bt.MULTILINE_ELEMENT_TRANSFORMERS,Uw=bt.ORDERED_LIST,Yw=bt.QUOTE,Gw=bt.STRIKETHROUGH,iy=bt.TEXT_FORMAT_TRANSFORMERS,ly=bt.TEXT_MATCH_TRANSFORMERS,ay=bt.TRANSFORMERS,Jw=bt.UNORDERED_LIST,cy=bt.registerMarkdownShortcuts;var rf={};at(rf,{MarkdownShortcutPlugin:()=>pO,DEFAULT_TRANSFORMERS:()=>dy});var uy=Dt(Bt(),1),dy=[{dependencies:[Cm],export:(t)=>mm(t)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(t,e,n,o)=>{let r=_m();o||t.getNextSibling()!=null?t.replace(r):t.insertBefore(r),r.selectNext()},type:"element"},...ay];function pO({transformers:t=dy}){let[e]=mt();return uy.useEffect(()=>cy(e,t),[e,t]),null}var fy=rf,Qw=fy.DEFAULT_TRANSFORMERS,gy=fy.MarkdownShortcutPlugin;var sf={};at(sf,{OnChangePlugin:()=>mO});var ya=Dt(Bt(),1),_O=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ya.useLayoutEffect:ya.useEffect;function mO({ignoreHistoryMergeTagChange:t=!0,ignoreSelectionChange:e=!1,onChange:n}){let[o]=mt();return _O(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:s,dirtyLeaves:i,prevEditorState:l,tags:a})=>{e&&s.size===0&&i.size===0||t&&a.has(fo)||l.isEmpty()||n(r,o,a)})},[o,t,e,n]),null}var CO=sf,hy=CO.OnChangePlugin;var dn=Dt(Bt(),1),xO=dn.createContext(null),lf={didCatch:!1,error:null};class af extends dn.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=lf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){let{error:e}=this.state;e!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(lf))}componentDidCatch(t,e){this.props.onError?.(t,e)}componentDidUpdate(t,e){let{didCatch:n}=this.state,{resetKeys:o}=this.props;n&&e.error!==null&&yO(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(lf))}render(){let{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:r,error:s}=this.state,i=t;if(r){let l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof e=="function")i=e(l);else if(n)i=dn.createElement(n,l);else if(o!==void 0)i=o;else throw s}return dn.createElement(xO.Provider,{value:{didCatch:r,error:s,resetErrorBoundary:this.resetErrorBoundary}},i)}}function yO(t=[],e=[]){return t.length!==e.length||t.some((n,o)=>!Object.is(n,e[o]))}var cf={};at(cf,{LexicalErrorBoundary:()=>SO});function SO({children:t,onError:e}){return w(af,{fallback:w("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:t})}var NO=cf,py=NO.LexicalErrorBoundary;var aR=Dt(uf(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(Prism.languages.markup)Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(t){if(t.type==="entity")t.attributes.title=t.content.replace(/&amp;/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var o=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,r=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return o}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+r+s+"(?:"+r+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+r+s+")(?:"+r+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(o),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+r+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+r+"$"),inside:{"table-header":{pattern:RegExp(o),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){if(u!==d)t.languages.markdown[u].inside.content.inside[d]=t.languages.markdown[d]})}),t.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function d(f){if(!f||typeof f==="string")return;for(var h=0,p=f.length;h<p;h++){var g=f[h];if(g.type!=="code"){d(g.content);continue}var _=g.content[1],m=g.content[3];if(_&&m&&_.type==="code-language"&&m.type==="code-block"&&typeof _.content==="string"){var C=_.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var x="language-"+C;if(!m.alias)m.alias=[x];else if(typeof m.alias==="string")m.alias=[m.alias,x];else m.alias.push(x)}}}d(u.tokens)}),t.hooks.add("wrap",function(u){if(u.type!=="code-block")return;var d="";for(var f=0,h=u.classes.length;f<h;f++){var p=u.classes[f],g=/language-(.+)/.exec(p);if(g){d=g[1];break}}var _=t.languages[d];if(!_){if(d&&d!=="none"&&t.plugins.autoloader){var m="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);u.attributes.id=m,t.plugins.autoloader.loadLanguages(d,function(){var C=document.getElementById(m);if(C)C.innerHTML=t.highlight(C.textContent,t.languages[d],d)})}}else u.content=t.highlight(c(u.content),_,d)});var i=RegExp(t.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},a=String.fromCodePoint||String.fromCharCode;function c(u){var d=u.replace(i,"");return d=d.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(f,h){if(h=h.toLowerCase(),h[0]==="#"){var p;if(h[1]==="x")p=parseInt(h.slice(2),16);else p=Number(h.slice(1));return a(p)}else{var g=l[h];if(g)return g;return f}}),d}t.languages.md=t.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(t){var e=t.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(t){var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(Prism);Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=Prism.languages.swift});(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript})(Prism);(function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,o={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[o,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:o.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:o.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":o,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:o.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:o.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(Prism);(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(n){var o=e[n],r=[];if(!/^\w+$/.test(n))r.push(/\w+/.exec(n)[0]);if(n==="diff")r.push("bold");t.languages.diff[n]={pattern:RegExp("^(?:["+o+`].*(?:\r
32
- ?|
33
- |(?![\\s\\S])))+`,"m"),alias:r,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:e})})(Prism);var ER=globalThis.Prism||window.Prism;var pf={};at(pf,{registerCodeHighlighting:()=>RO,normalizeCodeLanguage:()=>Ty,loadCodeLanguage:()=>by,isCodeLanguageLoaded:()=>Ey,getLanguageFriendlyName:()=>OO,getCodeThemeOptions:()=>vO,getCodeLanguages:()=>MO,getCodeLanguageOptions:()=>AO,PrismTokenizer:()=>Oy,CODE_LANGUAGE_MAP:()=>Ny,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>hf});var MR=Dt(uf(),1);function Sy(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(n){var o=e[n],r=[];/^\w+$/.test(n)||r.push(/\w+/.exec(n)[0]),n==="diff"&&r.push("bold"),t.languages.diff[n]={pattern:RegExp("^(?:["+o+`].*(?:\r
34
- ?|
35
- |(?![\\s\\S])))+`,"m"),alias:r,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:e})})(Prism);var Ge=globalThis.Prism||window.Prism,hf={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},Ny={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Ty(t){return Ny[t]||t}function OO(t){let e=Ty(t);return hf[e]||e}var MO=()=>Object.keys(Ge.languages).filter((t)=>typeof Ge.languages[t]!="function").sort();function AO(){let t=[];for(let[e,n]of Object.entries(hf))t.push([e,n]);return t}function vO(){return[]}function Ey(t){let e=function(o){let r=/^diff-([\w-]+)/i.exec(o);return r?r[1]:null}(t),n=e||t;try{return!!n&&Ge.languages.hasOwnProperty(n)}catch(o){return!1}}async function by(t,e,n){}function ff(t){return typeof t=="string"?t:Array.isArray(t)?t.map(ff).join(""):ff(t.content)}function DO(t,e){let n=/^diff-([\w-]+)/i.exec(e),o=t.getTextContent(),r=Ge.tokenize(o,Ge.languages[n?"diff":e]);return n&&(r=function(s,i){let l=i,a=Ge.languages[l],c={tokens:s},u=Ge.languages.diff.PREFIXES;for(let d of c.tokens){if(typeof d=="string"||!(d.type in u)||!Array.isArray(d.content))continue;let f=d.type,h=0,p=()=>(h++,new Ge.Token("prefix",u[f],f.replace(/^(\w+).*/,"$1"))),g=d.content.filter((T)=>typeof T=="string"||T.type!=="prefix"),_=d.content.length-g.length,m=Ge.tokenize(ff(g),a);m.unshift(p());let C=/\r\n|\n/g,x=(T)=>{let y=[];C.lastIndex=0;let S,E=0;for(;h<_&&(S=C.exec(T));){let O=S.index+S[0].length;y.push(T.slice(E,O)),E=O,y.push(p())}if(y.length!==0)return E<T.length&&y.push(T.slice(E)),y},N=(T)=>{for(let y=0;y<T.length&&h<_;y++){let S=T[y];if(typeof S=="string"){let E=x(S);E&&(T.splice(y,1,...E),y+=E.length-1)}else if(typeof S.content=="string"){let E=x(S.content);E&&(S.content=E)}else Array.isArray(S.content)?N(S.content):N([S.content])}};N(m),h<_&&m.push(p()),d.content=m}return c.tokens}(r,n[1])),gf(r)}function gf(t,e){let n=[];for(let o of t)if(typeof o=="string"){let r=o.split(/(\n|\t)/),s=r.length;for(let i=0;i<s;i++){let l=r[i];l===`
36
- `||l===`\r
37
- `?n.push(Pe()):l==="\t"?n.push(Se()):l.length>0&&n.push(fa(l,e))}}else{let{content:r,alias:s}=o;typeof r=="string"?n.push(...gf([r],o.type==="prefix"&&typeof s=="string"?s:o.type)):Array.isArray(r)&&n.push(...gf(r,o.type==="unchanged"?void 0:o.type))}return n}var Oy={$tokenize(t,e){return DO(t,e||this.defaultLanguage)},defaultLanguage:_a,tokenize(t,e){return Ge.tokenize(t,Ge.languages[e||""]||Ge.languages[this.defaultLanguage])}};function _y(t,e,n){let o=t.getParent();be(o)?My(o,e,n):Re(t)&&t.replace(wt(t.__text))}function wO(t,e){let n=e.getElementByKey(t.getKey());if(n===null)return;let o=t.getChildren(),r=o.length;if(r===n.__cachedChildrenLength)return;n.__cachedChildrenLength=r;let s="1",i=1;for(let l=0;l<r;l++)yt(o[l])&&(s+=`
38
- `+ ++i);n.setAttribute("data-gutter",s)}var df=new Set;function My(t,e,n){let o=t.getKey(),r=e.getKey()+"/"+o;t.getLanguage()===void 0&&t.setLanguage(n.defaultLanguage);let s=t.getLanguage()||n.defaultLanguage;if(!Ey(s))return t.getIsSyntaxHighlightSupported()&&t.setIsSyntaxHighlightSupported(!1),void by();t.getIsSyntaxHighlightSupported()||t.setIsSyntaxHighlightSupported(!0),df.has(r)||(df.add(r),e.update(()=>{(function(i,l){let a=Vt(i);if(!be(a)||!a.isAttached())return;let c=v();if(!A(c))return void l();let u=c.anchor,d=u.offset,f=u.type==="element"&&yt(a.getChildAtIndex(u.offset-1)),h=0;if(!f){let p=u.getNode();h=d+p.getPreviousSiblings().reduce((g,_)=>g+_.getTextContentSize(),0)}if(!l())return;if(f)return void u.getNode().select(d,d);a.getChildren().some((p)=>{let g=K(p);if(g||yt(p)){let _=p.getTextContentSize();if(g&&_>=h)return p.select(h,h),!0;h-=_}return!1})})(o,()=>{let i=Vt(o);if(!be(i)||!i.isAttached())return!1;let l=i.getLanguage()||n.defaultLanguage,a=n.$tokenize(i,l),c=function(h,p){let g=0;for(;g<h.length&&my(h[g],p[g]);)g++;let _=h.length,m=p.length,C=Math.min(_,m)-g,x=0;for(;x<C;)if(x++,!my(h[_-x],p[m-x])){x--;break}let N=g,T=_-x,y=p.slice(g,m-x);return{from:N,nodesForReplacement:y,to:T}}(i.getChildren(),a),{from:u,to:d,nodesForReplacement:f}=c;return!(u===d&&!f.length)&&(t.splice(u,d-u,f),!0)})},{onUpdate:()=>{df.delete(r)},skipTransforms:!0}))}function my(t,e){return Re(t)&&Re(e)&&t.__text===e.__text&&t.__highlightType===e.__highlightType||he(t)&&he(e)||yt(t)&&yt(e)}function or(t){if(!A(t))return!1;let e=t.anchor.getNode(),n=be(e)?e:e.getParent(),o=t.focus.getNode(),r=be(o)?o:o.getParent();return be(n)&&n.is(r)}function Ay(t){let e=t.getNodes(),n=[];if(e.length===1&&be(e[0]))return n;let o=[];for(let r=0;r<e.length;r++){let s=e[r];Re(s)||he(s)||yt(s)||Sy(169),yt(s)?o.length>0&&(n.push(o),o=[]):o.push(s)}if(o.length>0){let r=t.isBackward()?t.anchor:t.focus,s=mn(o[0].getKey(),0,"text");r.is(s)||n.push(o)}return n}function Cy(t){let e=v();if(!A(e)||!or(e))return!1;let n=Ay(e),o=n.length;if(o===0&&e.isCollapsed())return t===He&&e.insertNodes([Se()]),!0;if(o===0&&t===He&&e.getTextContent()===`
39
- `){let r=Se(),s=Pe(),i=e.isBackward()?"previous":"next";return e.insertNodes([r,s]),Ks(tl(Or(Mp(r,"next",0),We(oe(s,"next"))),i)),!0}for(let r=0;r<o;r++){let s=n[r];if(s.length>0){let i=s[0];if(r===0&&(i=No(i)),t===He){let l=Se();if(i.insertBefore(l),r===0){let a=e.isBackward()?"focus":"anchor",c=mn(i.getKey(),0,"text");e[a].is(c)&&e[a].set(l.getKey(),0,"text")}}else he(i)&&i.remove()}}return!0}function xy(t,e){let n=v();if(!A(n))return!1;let{anchor:o,focus:r}=n,s=o.offset,i=r.offset,l=o.getNode(),a=r.getNode(),c=t===sn;if(!or(n)||!Re(l)&&!he(l)||!Re(a)&&!he(a))return!1;if(!e.altKey){if(n.isCollapsed()){let m=l.getParentOrThrow();if(c&&s===0&&l.getPreviousSibling()===null){if(m.getPreviousSibling()===null)return m.selectPrevious(),e.preventDefault(),!0}else if(!c&&s===l.getTextContentSize()&&l.getNextSibling()===null){if(m.getNextSibling()===null)return m.selectNext(),e.preventDefault(),!0}}return!1}let u,d;if(l.isBefore(a)?(u=No(l),d=er(a)):(u=No(a),d=er(l)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let m=0;m<f.length;m++){let C=f[m];if(!Re(C)&&!he(C)&&!yt(C))return!1}e.preventDefault(),e.stopPropagation();let h=c?u.getPreviousSibling():d.getNextSibling();if(!yt(h))return!0;let p=c?h.getPreviousSibling():h.getNextSibling();if(p==null)return!0;let g=Re(p)||he(p)||yt(p)?c?No(p):er(p):null,_=g!=null?g:p;return h.remove(),f.forEach((m)=>m.remove()),t===sn?(f.forEach((m)=>_.insertBefore(m)),_.insertBefore(h)):(_.insertAfter(h),_=h,f.forEach((m)=>{_.insertAfter(m),_=m})),n.setTextNodeRange(l,s,a,i),!0}function yy(t,e){let n=v();if(!A(n))return!1;let{anchor:o,focus:r}=n,s=o.getNode(),i=r.getNode(),l=t===Cl;if(!or(n)||!Re(s)&&!he(s)||!Re(i)&&!he(i))return!1;let a=i;if(ga(a)==="rtl"?!l:l){let c=pa(a,r.offset);if(c!==null){let{node:u,offset:d}=c;yt(u)?u.selectNext(0,0):n.setTextNodeRange(u,d,u,d)}else a.getParentOrThrow().selectStart()}else ha(a).select();return e.preventDefault(),e.stopPropagation(),!0}function RO(t,e){if(!t.hasNodes([To,ni]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");e==null&&(e=Oy);let n=[];return t._headless!==!0&&n.push(t.registerMutationListener(To,(o)=>{t.getEditorState().read(()=>{for(let[r,s]of o)if(s!=="destroyed"){let i=Vt(r);i!==null&&wO(i,t)}})},{skipInitialization:!1})),n.push(t.registerNodeTransform(To,(o)=>My(o,t,e)),t.registerNodeTransform(Ue,(o)=>_y(o,t,e)),t.registerNodeTransform(ni,(o)=>_y(o,t,e)),t.registerCommand(ho,(o)=>{let r=function(s){let i=v();if(!A(i)||!or(i))return null;let l=s?Sn:He,a=s?Sn:Yo,c=i.anchor,u=i.focus;if(c.is(u))return a;let d=Ay(i);if(d.length!==1)return l;let f=d[0],h,p;f.length===0&&Sy(285),i.isBackward()?(h=u,p=c):(h=c,p=u);let g=No(f[0]),_=er(f[0]),m=mn(g.getKey(),0,"text"),C=mn(_.getKey(),_.getTextContentSize(),"text");return h.isBefore(m)||C.isBefore(p)?l:m.isBefore(h)||p.isBefore(C)?a:l}(o.shiftKey);return r!==null&&(o.preventDefault(),t.dispatchCommand(r,void 0),!0)},st),t.registerCommand(Yo,()=>!!or(v())&&(el([Se()]),!0),st),t.registerCommand(He,(o)=>Cy(He),st),t.registerCommand(Sn,(o)=>Cy(Sn),st),t.registerCommand(sn,(o)=>{let r=v();if(!A(r)||!or(r))return!1;let s=xt().getFirstDescendant(),{anchor:i}=r,l=i.getNode();return(!s||!l||s.getKey()!==l.getKey())&&xy(sn,o)},st),t.registerCommand(Xn,(o)=>{let r=v();if(!A(r)||!or(r))return!1;let s=xt().getLastDescendant(),{anchor:i}=r,l=i.getNode();return(!s||!l||s.getKey()!==l.getKey())&&xy(Xn,o)},st),t.registerCommand(Cl,(o)=>yy(Cl,o),st),t.registerCommand(yu,(o)=>yy(yu,o),st)),se(...n)}var fn=pf,_f=fn.CODE_LANGUAGE_FRIENDLY_NAME_MAP,mf=fn.CODE_LANGUAGE_MAP,Cf=fn.PrismTokenizer,xf=fn.getCodeLanguageOptions,yf=fn.getCodeLanguages,Sf=fn.getCodeThemeOptions,Nf=fn.getLanguageFriendlyName,HR=fn.isCodeLanguageLoaded,UR=fn.loadCodeLanguage,Na=fn.normalizeCodeLanguage,Tf=fn.registerCodeHighlighting;var Ef={};at(Ef,{registerCodeHighlighting:()=>HO,normalizeCodeLanguage:()=>WO,normalizeCodeLang:()=>BO,getLanguageFriendlyName:()=>KO,getDefaultCodeLanguage:()=>mx,getCodeThemeOptions:()=>PO,getCodeLanguages:()=>kO,getCodeLanguageOptions:()=>LO,PrismTokenizer:()=>zO,DEFAULT_CODE_LANGUAGE:()=>_a,CodeNode:()=>To,CodeHighlightNode:()=>ni,CodeExtension:()=>_x,CODE_LANGUAGE_MAP:()=>FO,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>IO,$isCodeNode:()=>be,$isCodeHighlightNode:()=>Re,$getStartOfCodeInLine:()=>pa,$getLastCodeNodeOfLine:()=>er,$getFirstCodeNodeOfLine:()=>No,$getEndOfCodeInLine:()=>ha,$getCodeLineDirection:()=>ga,$createCodeNode:()=>tr,$createCodeHighlightNode:()=>fa});var IO=_f,FO=mf,LO=xf,kO=yf,PO=Sf,KO=Nf,BO=Na,WO=Na,zO=Cf,HO=Tf;var Ot=Ef,GR=Ot.$createCodeHighlightNode,Dy=Ot.$createCodeNode,JR=Ot.$getCodeLineDirection,VR=Ot.$getEndOfCodeInLine,XR=Ot.$getFirstCodeNodeOfLine,qR=Ot.$getLastCodeNodeOfLine,ZR=Ot.$getStartOfCodeInLine,QR=Ot.$isCodeHighlightNode,jR=Ot.$isCodeNode,t$=Ot.CODE_LANGUAGE_FRIENDLY_NAME_MAP,e$=Ot.CODE_LANGUAGE_MAP,n$=Ot.CodeExtension,o$=Ot.CodeHighlightNode,wy=Ot.CodeNode,r$=Ot.DEFAULT_CODE_LANGUAGE,s$=Ot.PrismTokenizer,i$=Ot.getCodeLanguageOptions,l$=Ot.getCodeLanguages,a$=Ot.getCodeThemeOptions,c$=Ot.getDefaultCodeLanguage,u$=Ot.getLanguageFriendlyName,d$=Ot.normalizeCodeLang,f$=Ot.normalizeCodeLanguage,g$=Ot.registerCodeHighlighting;var Wf={};at(Wf,{setScrollableTablesActive:()=>nS,registerTableSelectionObserver:()=>sS,registerTablePlugin:()=>iS,registerTableCellUnmergeTransform:()=>rS,getTableObserverFromTableElement:()=>wf,getTableElement:()=>bo,getDOMCellFromTarget:()=>li,applyTableHandlers:()=>Qy,TableRowNode:()=>lr,TableObserver:()=>Bf,TableNode:()=>In,TableExtension:()=>NM,TableCellNode:()=>$n,TableCellHeaderStates:()=>pt,INSERT_TABLE_COMMAND:()=>By,$unmergeCell:()=>rM,$removeTableRowAtIndex:()=>XO,$moveTableColumn:()=>sM,$mergeCells:()=>Jy,$isTableSelection:()=>lt,$isTableRowNode:()=>ut,$isTableNode:()=>Et,$isTableCellNode:()=>U,$isSimpleTable:()=>Xy,$isScrollableTablesActive:()=>ai,$insertTableRow__EXPERIMENTAL:()=>ZO,$insertTableRowAtSelection:()=>Hy,$insertTableRow:()=>qO,$insertTableColumn__EXPERIMENTAL:()=>jO,$insertTableColumnAtSelection:()=>Uy,$insertTableColumn:()=>QO,$getTableRowNodeFromTableCellNodeOrThrow:()=>kf,$getTableRowIndexFromTableCellNode:()=>JO,$getTableNodeFromLexicalNodeOrThrow:()=>Aa,$getTableColumnIndexFromTableCellNode:()=>VO,$getTableCellNodeRect:()=>Df,$getTableCellNodeFromLexicalNode:()=>GO,$getTableAndElementByKey:()=>Kf,$getNodeTriplet:()=>Pt,$getElementForTableNode:()=>oS,$findTableNode:()=>ir,$findCellNode:()=>es,$deleteTableRow__EXPERIMENTAL:()=>eM,$deleteTableRowAtSelection:()=>Yy,$deleteTableColumn__EXPERIMENTAL:()=>nM,$deleteTableColumnAtSelection:()=>Gy,$deleteTableColumn:()=>tM,$createTableSelectionFrom:()=>Ma,$createTableSelection:()=>qy,$createTableRowNode:()=>sr,$createTableNodeWithDimensions:()=>Wy,$createTableNode:()=>wa,$createTableCellNode:()=>Oe,$computeTableMapSkipCellCheck:()=>Rn,$computeTableMap:()=>ee});var Ff=/^(\d+(?:\.\d+)?)px$/,pt={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class $n extends re{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new $n(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign,this.__colSpan=t.__colSpan,this.__headerState=t.__headerState,this.__width=t.__width}static importDOM(){return{td:(t)=>({conversion:Ry,priority:0}),th:(t)=>({conversion:Ry,priority:0})}}static importJSON(t){return Oe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=pt.NO_STATUS,e=1,n,o){super(o),this.__colSpan=e,this.__rowSpan=1,this.__headerState=t,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){let e=document.createElement(this.getTag());return this.__width&&(e.style.width=`${this.__width}px`),this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(e.style.backgroundColor=this.__backgroundColor),Of(this.__verticalAlign)&&(e.style.verticalAlign=this.__verticalAlign),kt(e,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),e}exportDOM(t){let e=super.exportDOM(t);if(qn(e.element)){let n=e.element;n.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),n.style.border="1px solid black",this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),n.style.width=`${this.getWidth()||75}px`,n.style.verticalAlign=this.getVerticalAlign()||"top",n.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(n.style.backgroundColor="#f2f3f5")}return e}exportJSON(){return{...super.exportJSON(),...Of(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){let e=this.getWritable();return e.__colSpan=t,e}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){let e=this.getWritable();return e.__rowSpan=t,e}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,e=pt.BOTH){let n=this.getWritable();return n.__headerState=t&e|n.__headerState&~e,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){let e=this.getWritable();return e.__width=t,e}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){let e=this.getWritable();return e.__backgroundColor=t,e}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){let e=this.getWritable();return e.__verticalAlign=t||void 0,e}toggleHeaderStyle(t){let e=this.getWritable();return(e.__headerState&t)===t?e.__headerState-=t:e.__headerState+=t,e}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==pt.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Of(t){return t==="middle"||t==="bottom"}function Ry(t){let e=t,n=t.nodeName.toLowerCase(),o;Ff.test(e.style.width)&&(o=parseFloat(e.style.width));let r=pt.NO_STATUS;if(n==="th")r=e.getAttribute("scope")==="col"?pt.COLUMN:pt.ROW;let s=Oe(r,e.colSpan,o);s.__rowSpan=e.rowSpan;let i=e.style.backgroundColor;i!==""&&(s.__backgroundColor=i);let l=e.style.verticalAlign;Of(l)&&(s.__verticalAlign=l);let a=e.style,c=(a&&a.textDecoration||"").split(" "),u=a.fontWeight==="700"||a.fontWeight==="bold",d=c.includes("line-through"),f=a.fontStyle==="italic",h=c.includes("underline");return{after:(p)=>{let g=[],_=null,m=()=>{if(_){let C=_.getFirstChild();yt(C)&&_.getChildrenSize()===1&&C.remove()}};for(let C of p)Dp(C)||K(C)||yt(C)?(K(C)&&(u&&C.toggleFormat("bold"),d&&C.toggleFormat("strikethrough"),f&&C.toggleFormat("italic"),h&&C.toggleFormat("underline")),_?_.append(C):(_=X().append(C),g.push(_))):(g.push(C),m(),_=null);return m(),g.length===0&&g.push(X()),g},node:s}}function Oe(t=pt.NO_STATUS,e=1,n){return fe(new $n(t,e,n))}function U(t){return t instanceof $n}var By=Ne("INSERT_TABLE_COMMAND");function W(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class lr extends re{__height;static getType(){return"tablerow"}static clone(t){return new lr(t.__height,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__height=t.__height}static importDOM(){return{tr:(t)=>({conversion:UO,priority:0})}}static importJSON(t){return sr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,e){super(e),this.__height=t}exportJSON(){let t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){let e=document.createElement("tr");return this.__height&&(e.style.height=`${this.__height}px`),kt(e,t.theme.tableRow),e}extractWithChild(t,e,n){return n==="html"}isShadowRoot(){return!0}setHeight(t){let e=this.getWritable();return e.__height=t,e}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function UO(t){let e=t,n;return Ff.test(e.style.height)&&(n=parseFloat(e.style.height)),{after:(o)=>Hu(o,U),node:sr(n)}}function sr(t){return fe(new lr(t))}function ut(t){return t instanceof lr}var Lf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,YO=Lf&&"documentMode"in document?document.documentMode:null,$y=Lf&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function Wy(t,e,n=!0){let o=wa();for(let r=0;r<t;r++){let s=sr();for(let i=0;i<e;i++){let l=pt.NO_STATUS;typeof n=="object"?(r===0&&n.rows&&(l|=pt.ROW),i===0&&n.columns&&(l|=pt.COLUMN)):n&&(r===0&&(l|=pt.ROW),i===0&&(l|=pt.COLUMN));let a=Oe(l),c=X();c.append(wt()),a.append(c),s.append(a)}o.append(s)}return o}function GO(t){let e=q(t,(n)=>U(n));return U(e)?e:null}function kf(t){let e=q(t,(n)=>ut(n));if(ut(e))return e;throw Error("Expected table cell to be inside of table row.")}function Aa(t){let e=q(t,(n)=>Et(n));if(Et(e))return e;throw Error("Expected table cell to be inside of table.")}function JO(t){let e=kf(t);return Aa(e).getChildren().findIndex((n)=>n.is(e))}function VO(t){return kf(t).getChildren().findIndex((e)=>e.is(t))}function zy(t,e){let n=Aa(t),{x:o,y:r}=n.getCordsFromCellNode(t,e);return{above:n.getCellNodeFromCords(o,r-1,e),below:n.getCellNodeFromCords(o,r+1,e),left:n.getCellNodeFromCords(o-1,r,e),right:n.getCellNodeFromCords(o+1,r,e)}}function XO(t,e){let n=t.getChildren();if(e>=n.length||e<0)throw Error("Expected table cell to be inside of table row.");return n[e].remove(),t}function qO(t,e,n=!0,o,r){let s=t.getChildren();if(e>=s.length||e<0)throw Error("Table row target index out of range");let i=s[e];if(!ut(i))throw Error("Row before insertion index does not exist.");for(let l=0;l<o;l++){let a=i.getChildren(),c=a.length,u=sr();for(let d=0;d<c;d++){let f=a[d];U(f)||W(12);let{above:h,below:p}=zy(f,r),g=pt.NO_STATUS,_=h&&h.getWidth()||p&&p.getWidth()||void 0;(h&&h.hasHeaderState(pt.COLUMN)||p&&p.hasHeaderState(pt.COLUMN))&&(g|=pt.COLUMN);let m=Oe(g,1,_);m.append(X()),u.append(m)}n?i.insertAfter(u):i.insertBefore(u)}return t}Lf&&"InputEvent"in window&&!YO&&new window.InputEvent("input");var Mf=(t,e)=>t===pt.BOTH||t===e?e:pt.NO_STATUS;function Hy(t=!0){let e=v();A(e)||lt(e)||W(188);let n=e.anchor.getNode(),o=e.focus.getNode(),[r]=Pt(n),[s,,i]=Pt(o),[,l,a]=ee(i,s,r),{startRow:c}=a,{startRow:u}=l;return t?Af(c+r.__rowSpan>u+s.__rowSpan?r:s,!0):Af(u<c?s:r,!1)}var ZO=Hy;function Af(t,e=!0){let[,,n]=Pt(t),[o,r]=ee(n,t,t),s=o[0].length,{startRow:i}=r,l=null;if(e){let a=i+t.__rowSpan-1,c=o[a],u=sr();for(let f=0;f<s;f++){let{cell:h,startRow:p}=c[f];if(p+h.__rowSpan-1<=a){let g=c[f].cell.__headerState,_=Mf(g,pt.COLUMN);u.append(Oe(_).append(X()))}else h.setRowSpan(h.__rowSpan+1)}let d=n.getChildAtIndex(a);ut(d)||W(256),d.insertAfter(u),l=u}else{let a=i,c=o[a],u=sr();for(let f=0;f<s;f++){let{cell:h,startRow:p}=c[f];if(p===a){let g=c[f].cell.__headerState,_=Mf(g,pt.COLUMN);u.append(Oe(_).append(X()))}else h.setRowSpan(h.__rowSpan+1)}let d=n.getChildAtIndex(a);ut(d)||W(257),d.insertBefore(u),l=u}return l}function QO(t,e,n=!0,o,r){let s=t.getChildren(),i=[];for(let l=0;l<s.length;l++){let a=s[l];if(ut(a))for(let c=0;c<o;c++){let u=a.getChildren();if(e>=u.length||e<0)throw Error("Table column target index out of range");let d=u[e];U(d)||W(12);let{left:f,right:h}=zy(d,r),p=pt.NO_STATUS;(f&&f.hasHeaderState(pt.ROW)||h&&h.hasHeaderState(pt.ROW))&&(p|=pt.ROW);let g=Oe(p);g.append(X()),i.push({newTableCell:g,targetCell:d})}}return i.forEach(({newTableCell:l,targetCell:a})=>{n?a.insertAfter(l):a.insertBefore(l)}),t}function Uy(t=!0){let e=v();A(e)||lt(e)||W(188);let n=e.anchor.getNode(),o=e.focus.getNode(),[r]=Pt(n),[s,,i]=Pt(o),[,l,a]=ee(i,s,r),{startColumn:c}=a,{startColumn:u}=l;return t?vf(c+r.__colSpan>u+s.__colSpan?r:s,!0):vf(u<c?s:r,!1)}var jO=Uy;function vf(t,e=!0,n=!0){let[,,o]=Pt(t),[r,s]=ee(o,t,t),i=r.length,{startColumn:l}=s,a=e?l+t.__colSpan-1:l-1,c=o.getFirstChild();ut(c)||W(120);let u=null;function d(p=pt.NO_STATUS){let g=Oe(p).append(X());return u===null&&(u=g),g}let f=c;t:for(let p=0;p<i;p++){if(p!==0){let T=f.getNextSibling();ut(T)||W(121),f=T}let g=r[p],_=g[a<0?0:a].cell.__headerState,m=Mf(_,pt.ROW);if(a<0){Pf(f,d(m));continue}let{cell:C,startColumn:x,startRow:N}=g[a];if(x+C.__colSpan-1<=a){let T=C,y=N,S=a;for(;y!==p&&T.__rowSpan>1;){if(S-=C.__colSpan,!(S>=0)){f.append(d(m));continue t}{let{cell:E,startRow:O}=g[S];T=E,y=O}}T.insertAfter(d(m))}else C.setColSpan(C.__colSpan+1)}u!==null&&n&&si(u);let h=o.getColWidths();if(h){let p=[...h],g=a<0?0:a,_=p[g];p.splice(g,0,_),o.setColWidths(p)}return u}function tM(t,e){let n=t.getChildren();for(let o=0;o<n.length;o++){let r=n[o];if(ut(r)){let s=r.getChildren();if(e>=s.length||e<0)throw Error("Table column target index out of range");s[e].remove()}}return t}function Yy(){let t=v();A(t)||lt(t)||W(188);let[e,n]=t.isBackward()?[t.focus.getNode(),t.anchor.getNode()]:[t.anchor.getNode(),t.focus.getNode()],[o,,r]=Pt(e),[s]=Pt(n),[i,l,a]=ee(r,o,s),{startRow:c}=l,{startRow:u}=a,d=u+s.__rowSpan-1;if(i.length===d-c+1)return void r.remove();let f=i[0].length,h=i[d+1],p=r.getChildAtIndex(d+1);for(let g=d;g>=c;g--){for(let m=f-1;m>=0;m--){let{cell:C,startRow:x,startColumn:N}=i[g][m];if(N===m){if(x<c||x+C.__rowSpan-1>d){let T=Math.max(x,c),y=Math.min(C.__rowSpan+x-1,d),S=T<=y?y-T+1:0;C.setRowSpan(C.__rowSpan-S)}if(x>=c&&x+C.__rowSpan-1>d&&g===d){p===null&&W(122);let T=null;for(let y=0;y<m;y++){let S=h[y],E=S.cell;S.startRow===g+1&&(T=E),E.__colSpan>1&&(y+=E.__colSpan-1)}T===null?Pf(p,C):T.insertAfter(C)}}}let _=r.getChildAtIndex(g);ut(_)||W(206,String(g)),_.remove()}if(h!==void 0){let{cell:g}=h[0];si(g)}else{let g=i[c-1],{cell:_}=g[0];si(_)}}var eM=Yy;function Gy(){let t=v();A(t)||lt(t)||W(188);let e=t.anchor.getNode(),n=t.focus.getNode(),[o,,r]=Pt(e),[s]=Pt(n),[i,l,a]=ee(r,o,s),{startColumn:c}=l,{startRow:u,startColumn:d}=a,f=Math.min(c,d),h=Math.max(c+o.__colSpan-1,d+s.__colSpan-1),p=h-f+1;if(i[0].length===h-f+1)return r.selectPrevious(),void r.remove();let g=i.length;for(let x=0;x<g;x++)for(let N=f;N<=h;N++){let{cell:T,startColumn:y}=i[x][N];if(y<f){if(N===f){let S=f-y;T.setColSpan(T.__colSpan-Math.min(p,T.__colSpan-S))}}else if(y+T.__colSpan-1>h){if(N===h){let S=h-y+1;T.setColSpan(T.__colSpan-S)}}else T.remove()}let _=i[u],m=c>d?_[c+o.__colSpan]:_[d+s.__colSpan];if(m!==void 0){let{cell:x}=m;si(x)}else{let x=d<c?_[d-1]:_[c-1],{cell:N}=x;si(N)}let C=r.getColWidths();if(C){let x=[...C];x.splice(f,p),r.setColWidths(x)}}var nM=Gy;function si(t){let e=t.getFirstDescendant();e==null?t.selectStart():e.getParentOrThrow().selectStart()}function Pf(t,e){let n=t.getFirstChild();n!==null?n.insertBefore(e):t.append(e)}function Jy(t){if(t.length===0)return null;let e=Aa(t[0]),[n]=Rn(e,null,null),o=1/0,r=-1/0,s=1/0,i=-1/0,l=new Set;for(let h of n)for(let p of h){if(!p||!p.cell)continue;let g=p.cell.getKey();if(!l.has(g)&&t.some((_)=>_.is(p.cell))){l.add(g);let{startRow:_,startColumn:m}=p,C=p.cell.__rowSpan||1,x=p.cell.__colSpan||1;o=Math.min(o,_),r=Math.max(r,_+C-1),s=Math.min(s,m),i=Math.max(i,m+x-1)}}if(o===1/0||s===1/0)return null;let a=r-o+1,c=i-s+1,u=n[o][s];if(!u.cell)return null;let d=u.cell;d.setColSpan(c),d.setRowSpan(a);let f=new Set([d.getKey()]);for(let h=o;h<=r;h++)for(let p=s;p<=i;p++){let g=n[h][p];if(!g.cell)continue;let _=g.cell,m=_.getKey();if(!f.has(m))f.add(m),oM(_)||d.append(..._.getChildren()),_.remove()}return d.getChildrenSize()===0&&d.append(X()),d}function oM(t){if(t.getChildrenSize()!==1)return!1;let e=t.getFirstChildOrThrow();return!(!rn(e)||!e.isEmpty())}function rM(){let t=v();A(t)||lt(t)||W(188);let e=t.anchor.getNode(),n=q(e,U);return U(n)||W(148),Vy(n)}function Vy(t){let[e,n,o]=Pt(t),r=e.__colSpan,s=e.__rowSpan;if(r===1&&s===1)return;let[i,l]=ee(o,e,e),{startColumn:a,startRow:c}=l,u=e.__headerState&pt.COLUMN,d=Array.from({length:r},(p,g)=>{let _=u;for(let m=0;_!==0&&m<i.length;m++)_&=i[m][g+a].cell.__headerState;return _}),f=e.__headerState&pt.ROW,h=Array.from({length:s},(p,g)=>{let _=f;for(let m=0;_!==0&&m<i[0].length;m++)_&=i[g+c][m].cell.__headerState;return _});if(r>1){for(let p=1;p<r;p++)e.insertAfter(Oe(d[p]|h[0]).append(X()));e.setColSpan(1)}if(s>1){let p;for(let g=1;g<s;g++){let _=c+g,m=i[_];p=(p||n).getNextSibling(),ut(p)||W(125);let C=null;for(let x=0;x<a;x++){let N=m[x],T=N.cell;N.startRow===_&&(C=T),T.__colSpan>1&&(x+=T.__colSpan-1)}if(C===null)for(let x=r-1;x>=0;x--)Pf(p,Oe(d[x]|h[g]).append(X()));else for(let x=r-1;x>=0;x--)C.insertAfter(Oe(d[x]|h[g]).append(X()))}e.setRowSpan(1)}}function ee(t,e,n){let[o,r,s]=Rn(t,e,n);return r===null&&W(207),s===null&&W(208),[o,r,s]}function Rn(t,e,n){let o=[],r=null,s=null;function i(a){let c=o[a];return c===void 0&&(o[a]=c=[]),c}let l=t.getChildren();for(let a=0;a<l.length;a++){let c=l[a];ut(c)||W(209);let u=i(a);for(let d=c.getFirstChild(),f=0;d!=null;d=d.getNextSibling()){for(U(d)||W(147);u[f]!==void 0;)f++;let h={cell:d,startColumn:f,startRow:a},{__rowSpan:p,__colSpan:g}=d;for(let _=0;_<p&&!(a+_>=l.length);_++){let m=i(a+_);for(let C=0;C<g;C++)m[f+C]=h}e!==null&&r===null&&e.is(d)&&(r=h),n!==null&&s===null&&n.is(d)&&(s=h)}}return[o,r,s]}function Pt(t){let e;if(t instanceof $n)e=t;else if("__type"in t){let r=q(t,U);U(r)||W(148),e=r}else{let r=q(t.getNode(),U);U(r)||W(148),e=r}let n=e.getParent();ut(n)||W(149);let o=n.getParent();return Et(o)||W(210),[e,n,o]}function Oa(t,e,n){let o,r=Math.min(e.startColumn,n.startColumn),s=Math.min(e.startRow,n.startRow),i=Math.max(e.startColumn+e.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),l=Math.max(e.startRow+e.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{o=!1;for(let a=0;a<t.length;a++)for(let c=0;c<t[0].length;c++){let u=t[a][c];if(!u)continue;let d=u.startColumn+u.cell.__colSpan-1,f=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=i&&d>=r,p=u.startRow<=l&&f>=s;if(h&&p){let g=Math.min(r,u.startColumn),_=Math.max(i,d),m=Math.min(s,u.startRow),C=Math.max(l,f);g===r&&_===i&&m===s&&C===l||(r=g,i=_,s=m,l=C,o=!0)}}}while(o);return{maxColumn:i,maxRow:l,minColumn:r,minRow:s}}function Xy(t){let e=t.getChildren(),n=null;for(let o of e){if(!ut(o))return!1;if(n===null&&(n=o.getChildrenSize()),o.getChildrenSize()!==n)return!1;let r=o.getChildren();for(let s of r)if(!U(s)||s.getRowSpan()!==1||s.getColSpan()!==1)return!1}return(n||0)>0}function sM(t,e,n){if(e===n)return;let o=t.getColumnCount();if(e<0||e>=o||n<0||n>=o)return;if(!Xy(t))return;t.getChildren().filter(ut).forEach((s)=>{let i=s.getChildren(),[l]=i.splice(e,1);i.splice(n,0,l),s.splice(0,i.length,i)});let r=t.getColWidths();if(r&&r.length===o){let s=[...r],[i]=s.splice(e,1);s.splice(n,0,i),t.setColWidths(s)}}function Df(t){let[e,,n]=Pt(t),o=n.getChildren(),r=o.length,s=o[0].getChildren().length,i=Array(r);for(let l=0;l<r;l++)i[l]=Array(s);for(let l=0;l<r;l++){let a=o[l].getChildren(),c=0;for(let u=0;u<a.length;u++){for(;i[l][c];)c++;let d=a[u],f=d.__rowSpan||1,h=d.__colSpan||1;for(let p=0;p<f;p++)for(let g=0;g<h;g++)i[l+p][c+g]=d;if(e===d)return{colSpan:h,columnIndex:c,rowIndex:l,rowSpan:f};c+=h}}return null}function Iy(t){let[[e,n,o,r],[s,i,l,a]]=["anchor","focus"].map((c)=>{let u=t[c].getNode(),d=q(u,U);U(d)||W(238,c,u.getKey(),u.getType());let f=d.getParent();ut(f)||W(239,c);let h=f.getParent();return Et(h)||W(240,c),[u,d,f,h]});return r.is(a)||W(241),{anchorCell:n,anchorNode:e,anchorRow:o,anchorTable:r,focusCell:i,focusNode:s,focusRow:l,focusTable:a}}class va{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,e,n){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;let t=Vt(this.tableKey),e=Vt(this.anchor.key),n=Vt(this.focus.key);return t!==null&&e!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return lt(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,e,n){this.dirty=this.dirty||t!==this.tableKey||e!==this.anchor.key||n!==this.focus.key,this.tableKey=t,this.anchor.key=e,this.focus.key=n,this._cachedNodes=null}clone(){return new va(this.tableKey,mn(this.anchor.key,this.anchor.offset,this.anchor.type),mn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let e=0;this.getNodes().filter(U).forEach((o)=>{let r=o.getFirstChild();rn(r)&&(e|=r.getTextFormat())});let n=Tl[t];return(e&n)!==0}insertNodes(t){let e=this.focus.getNode();F(e)||W(151),xn(e.select(0,e.getChildrenSize())).insertNodes(t)}getShape(){let{anchorCell:t,focusCell:e}=Iy(this),n=Df(t);n===null&&W(153);let o=Df(e);o===null&&W(155);let r=Math.min(n.columnIndex,o.columnIndex),s=Math.max(n.columnIndex+n.colSpan-1,o.columnIndex+o.colSpan-1),i=Math.min(n.rowIndex,o.rowIndex),l=Math.max(n.rowIndex+n.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(r,s),fromY:Math.min(i,l),toX:Math.max(r,s),toY:Math.max(i,l)}}getNodes(){if(!this.isValid())return[];let t=this._cachedNodes;if(t!==null)return t;let{anchorTable:e,anchorCell:n,focusCell:o}=Iy(this),r=o.getParents()[1];if(r!==e){if(e.isParentOf(o)){let g=r.getParent();g==null&&W(159),this.set(this.tableKey,o.getKey(),g.getKey())}else{let g=e.getParent();g==null&&W(158),this.set(this.tableKey,g.getKey(),o.getKey())}return this.getNodes()}let[s,i,l]=ee(e,n,o),{minColumn:a,maxColumn:c,minRow:u,maxRow:d}=Oa(s,i,l),f=new Map([[e.getKey(),e]]),h=null;for(let g=u;g<=d;g++)for(let _=a;_<=c;_++){let{cell:m}=s[g][_],C=m.getParent();ut(C)||W(160),C!==h&&(f.set(C.getKey(),C),h=C),f.has(m.getKey())||iM(m,(x)=>{f.set(x.getKey(),x)})}let p=Array.from(f.values());return n_()||(this._cachedNodes=p),p}getTextContent(){let t=this.getNodes().filter((n)=>U(n)),e="";for(let n=0;n<t.length;n++){let o=t[n],r=o.__parent,s=(t[n+1]||{}).__parent;e+=o.getTextContent()+(s!==r?`
40
- `:"\t")}return e}}function lt(t){return t instanceof va}function qy(){let t=mn("root",0,"element"),e=mn("root",0,"element");return new va("root",t,e)}function Ma(t,e,n){t.getKey(),e.getKey(),n.getKey();let o=v(),r=lt(o)?o.clone():qy();return r.set(t.getKey(),e.getKey(),n.getKey()),r}function iM(t,e){let n=[[t]];for(let o=n.at(-1);o!==void 0&&n.length>0;o=n.at(-1)){let r=o.pop();r===void 0?n.pop():e(r)!==!1&&F(r)&&n.push(r.getChildren())}}function Kf(t,e=Gn()){let n=Vt(t);Et(n)||W(231,t);let o=bo(n,e.getElementByKey(t));return o===null&&W(232,t),{tableElement:o,tableNode:n}}class Zy{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){let{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}setShouldCheckSelectionForTable(t){this.shouldCheckSelectionForTable=t}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:t}=this;return t?(this.shouldCheckSelectionForTable=null,t):null}}class Bf{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(t,e){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=e,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach((t)=>t()),this.listenersToRemove.clear()}$lookup(){return Kf(this.tableNodeKey,this.editor)}trackTable(){let t=new MutationObserver((e)=>{this.editor.getEditorState().read(()=>{let n=!1;for(let s=0;s<e.length;s++){let i=e[s].target.nodeName;if(i==="TABLE"||i==="TBODY"||i==="THEAD"||i==="TR"){n=!0;break}}if(!n)return;let{tableNode:o,tableElement:r}=this.$lookup();this.table=os(o,r)},{editor:this.editor})});this.editor.getEditorState().read(()=>{let{tableNode:e,tableElement:n}=this.$lookup();this.table=os(e,n),t.observe(n,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(t=!0){let e=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:o}=this.$lookup();Ta(e,os(n,o),null),t&&v()!==null&&(St(null),e.dispatchCommand(Nn,void 0))}$enableHighlightStyle(){let t=this.editor,{tableElement:e}=this.$lookup();On(e,t._config.theme.tableSelection),e.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:t}=this.$lookup();kt(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&W(233,t.tableKey,this.tableNodeKey);let e=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Ta(e,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let t=po(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,e=!1){let n=this.editor,{tableNode:o}=this.$lookup(),r=t.x,s=t.y;if(this.focusCell=t,!this.isHighlightingCells)(e||this.anchorX!==r||this.anchorY!==s||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&r===this.focusX&&s===this.focusY)return!1;if(this.focusX=r,this.focusY=s,this.isHighlightingCells){let i=$f(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let l=i;if(l===null&&e&&(l=o.getCellNodeFromCords(r,s,this.table)),l!==null){let a=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=l.getKey(),this.tableSelection=Ma(o,a,l),St(this.tableSelection),n.dispatchCommand(Nn,void 0),Ta(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Vt(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){let t=this.$getAnchorTableCell();return t===null&&W(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Vt(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){let t=this.$getFocusTableCell();return t===null&&W(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:e}=this.$lookup(),n=$f(e,t.elem);if(n!==null){let o=n.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(e.getKey(),o,o)):this.tableSelection=Ma(e,n,n),this.anchorCellNodeKey=o}}$formatCells(t){let e=v();lt(e)||W(236);let n=Cn(),o=n.anchor,r=n.focus,s=e.getNodes().filter(U);s.length>0||W(237);let i=s[0].getFirstChild(),l=rn(i)?i.getFormatFlags(t,null):null;s.forEach((a)=>{o.set(a.getKey(),0,"element"),r.set(a.getKey(),a.getChildrenSize(),"element"),n.formatText(t,l)}),St(e),this.editor.dispatchCommand(Nn,void 0)}$clearText(){let{editor:t}=this,e=Vt(this.tableNodeKey);if(!Et(e))throw Error("Expected TableNode.");let n=v();lt(n)||W(253);let o=n.getNodes().filter(U),r=e.getFirstChild(),s=e.getLastChild();if(o.length>0&&r!==null&&s!==null&&ut(r)&&ut(s)&&o[0]===r.getFirstChild()&&o[o.length-1]===s.getLastChild()){e.selectPrevious();let i=e.getParent();return e.remove(),void(Jn(i)&&i.isEmpty()&&t.dispatchCommand(go,void 0))}o.forEach((i)=>{if(F(i)){let l=X(),a=wt();l.append(a),i.append(l),i.getChildren().forEach((c)=>{c!==l&&c.remove()})}}),Ta(t,this.table,null),St(null),t.dispatchCommand(Nn,void 0)}}var ns="__lexicalTableSelection";function ts(t){return qn(t)&&t.nodeName==="TABLE"}function bo(t,e){if(!e)return e;let n=ts(e)?e:t.getDOMSlot(e).element;return n.nodeName!=="TABLE"&&W(245,e.nodeName),n}function Da(t){return t._window}function ii(t,e){for(let n=e,o=null;n!==null;n=n.getParent()){if(t.is(n))return o;U(n)&&(o=n)}return null}var lM=[[Xn,"down"],[sn,"up"],[Rr,"backward"],[gl,"forward"]],aM=[ul,Bs,Dr],cM=[hl,pl];function uM(t,e){let n=t.getRootElement(),o=t._window;if(!n||!o)return()=>{};let r=(s)=>{let i=s.target;if(s.button!==0||!ln(i)||!n.contains(i))return;let l=function(a){let c=li(a);if(c===null)return null;let u=c.elem;for(;u!=null;){if(u.nodeName==="TABLE"&&ns in u&&u[ns])return{cellElement:c,tableElement:u,tableObserver:u[ns]};u=u.parentNode}return null}(i);t.update(()=>{if(lt(v())){for(let[d]of e.observers.values())d.$clearHighlight(!1);St(null),t.dispatchCommand(Nn,void 0)}if(!l)return;let{tableObserver:a,tableElement:c,cellElement:u}=l;(function(d,f,h,p,g,_){let m=d._window;if(!m)return;let C=(T)=>{if(g.isSelecting)return;g.isSelecting=!0,T!==null&&g.anchorCell===null&&d.update(()=>{g.$setAnchorCellForSelection(T)});let y=()=>{g.isSelecting=!1,m.removeEventListener("pointerup",y),m.removeEventListener("pointermove",S)},S=(E)=>{if(!((I)=>!(1&~I.buttons))(E)&&g.isSelecting)return g.isSelecting=!1,m.removeEventListener("pointerup",y),void m.removeEventListener("pointermove",S);if(!ln(E.target))return;let O=null,$=!($y||p.contains(E.target));if($)O=Fy(p,E.target);else for(let I of document.elementsFromPoint(E.clientX,E.clientY))if(O=Fy(p,I),O)break;if(O){let I=O;g.anchorCell===null&&d.update(()=>{g.$setAnchorCellForSelection(I)}),g.focusCell!==null&&O.elem===g.focusCell.elem||(_.setNextFocus({focusCell:O,override:$,tableKey:g.tableNodeKey}),d.dispatchCommand(Nn,void 0))}};m.addEventListener("pointerup",y,g.listenerOptions),m.addEventListener("pointermove",S,g.listenerOptions)};g.pointerType=f.pointerType;let x=Ls(g.tableNodeKey),N=Ke();if($y&&f.shiftKey&&Qn(N,x)&&(A(N)||lt(N))){let T=N.anchor.getNode(),y=ii(x,N.anchor.getNode());if(y)g.$setAnchorCellForSelection(rr(g,y)),g.$setFocusCellForSelection(h),jn(f);else(x.isBefore(T)?x.selectStart():x.selectEnd()).anchor.set(N.anchor.key,N.anchor.offset,N.anchor.type)}else f.pointerType!=="touch"&&g.$setAnchorCellForSelection(h);C(h)})(t,s,u,c,a,e)})};return o.addEventListener("pointerdown",r),()=>{o.removeEventListener("pointerdown",r)}}function Qy(t,e,n,o,r){let s=n.getRootElement(),i=Da(n);s!==null&&i!==null||W(246);let l=new Bf(n,t.getKey()),a=bo(t,e);(function(f,h){wf(f)!==null&&W(205),f[ns]=h})(a,l),l.listenersToRemove.add(()=>function(f,h){wf(f)===h&&delete f[ns]}(a,l));let c=(f)=>{if(f.detail>=3&&ln(f.target))li(f.target)!==null&&f.preventDefault()};a.addEventListener("mousedown",c,l.listenerOptions),l.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});for(let[f,h]of lM)l.listenersToRemove.add(n.registerCommand(f,(p)=>eS(n,p,h,t,l,r),ve));l.listenersToRemove.add(n.registerCommand($r,(f)=>{let h=v();if(lt(h)){let p=ii(t,h.focus.getNode());if(p!==null)return jn(f),p.selectEnd(),!0}return!1},ve));let u=(f)=>()=>{let h=v();if(!Qn(h,t))return!1;if(lt(h))return l.$clearText(),!0;if(A(h)){if(!U(ii(t,h.anchor.getNode())))return!1;let p=h.anchor.getNode(),g=h.focus.getNode(),_=t.isParentOf(p),m=t.isParentOf(g);if(_&&!m||m&&!_)return l.$clearText(),!0;let C=q(h.anchor.getNode(),(N)=>F(N)),x=C&&q(C,(N)=>F(N)&&U(N.getParent()));if(!F(x)||!F(C))return!1;if(f===Bs&&x.getPreviousSibling()===null)return!0}return!1};for(let f of aM)l.listenersToRemove.add(n.registerCommand(f,u(f),ve));let d=(f)=>{let h=v();if(!lt(h)&&!A(h))return!1;let p=t.isParentOf(h.anchor.getNode());if(p!==t.isParentOf(h.focus.getNode())){let g=p?"anchor":"focus",_=p?"focus":"anchor",{key:m,offset:C,type:x}=h[_];return t[h[g].isBefore(h[_])?"selectPrevious":"selectNext"]()[_].set(m,C,x),!1}return!!Qn(h,t)&&(!!lt(h)&&(f&&(f.preventDefault(),f.stopPropagation()),l.$clearText(),!0))};for(let f of cM)l.listenersToRemove.add(n.registerCommand(f,d,ve));return l.listenersToRemove.add(n.registerCommand(cl,(f)=>{let h=v();if(h){if(!lt(h)&&!A(h))return!1;Vs(n,De(f,ClipboardEvent)?f:null,Ym(h));let p=d(f);return A(h)?(h.removeText(),!0):p}return!1},ve)),l.listenersToRemove.add(n.registerCommand(ze,(f)=>{let h=v();if(!Qn(h,t))return!1;if(lt(h))return l.$formatCells(f),!0;if(A(h)){let p=q(h.anchor.getNode(),(g)=>U(g));if(!U(p))return!1}return!1},ve)),l.listenersToRemove.add(n.registerCommand(fl,(f)=>{let h=v();if(!lt(h)||!Qn(h,t))return!1;let p=h.anchor.getNode(),g=h.focus.getNode();if(!U(p)||!U(g))return!1;if(function(E,O){if(lt(E)){let $=E.anchor.getNode(),I=E.focus.getNode();if(O&&$&&I){let[k]=ee(O,$,I);return $.getKey()===k[0][0].cell.getKey()&&I.getKey()===k[k.length-1].at(-1).cell.getKey()}}return!1}(h,t))return t.setFormat(f),!0;let[_,m,C]=ee(t,p,g),x=Math.max(m.startRow+m.cell.__rowSpan-1,C.startRow+C.cell.__rowSpan-1),N=Math.max(m.startColumn+m.cell.__colSpan-1,C.startColumn+C.cell.__colSpan-1),T=Math.min(m.startRow,C.startRow),y=Math.min(m.startColumn,C.startColumn),S=new Set;for(let E=T;E<=x;E++)for(let O=y;O<=N;O++){let $=_[E][O].cell;if(S.has($))continue;S.add($),$.setFormat(f);let I=$.getChildren();for(let k=0;k<I.length;k++){let L=I[k];F(L)&&!L.isInline()&&L.setFormat(f)}}return!0},ve)),l.listenersToRemove.add(n.registerCommand(ll,(f)=>{let h=v();if(!Qn(h,t))return!1;if(lt(h))return l.$clearHighlight(),!1;if(A(h)){let p=q(h.anchor.getNode(),(g)=>U(g));if(!U(p))return!1;if(typeof f=="string"){let g=ky(n,h,t);if(g)return Ly(g,t,[wt(f)]),!0}}return!1},ve)),o&&l.listenersToRemove.add(n.registerCommand(ho,(f)=>{let h=v();if(!A(h)||!h.isCollapsed()||!Qn(h,t))return!1;let p=es(h.anchor.getNode());return!(p===null||!t.is(ir(p)))&&(jn(f),function(g,_){let m=_==="next"?"getNextSibling":"getPreviousSibling",C=_==="next"?"getFirstChild":"getLastChild",x=g[m]();if(F(x))return x.selectEnd();let N=q(g,ut);N===null&&W(247);for(let y=N[m]();ut(y);y=y[m]()){let S=y[C]();if(F(S))return S.selectEnd()}let T=q(N,Et);T===null&&W(248),_==="next"?T.selectNext():T.selectPrevious()}(p,f.shiftKey?"previous":"next"),!0)},ve)),l.listenersToRemove.add(n.registerCommand(Wp,(f)=>t.isSelected(),ve)),l.listenersToRemove.add(n.registerCommand(go,()=>{let f=v();if(!A(f)||!f.isCollapsed()||!Qn(f,t))return!1;let h=ky(n,f,t);return!!h&&(Ly(h,t),!0)},ve)),l}function dM(t,e){let n=v(),o=Ke(),r=t.getAndClearNextFocus();if(r!==null){let{tableKey:l,focusCell:a}=r,c=t.observers.get(l);c||W(335,l);let[u]=c;if(lt(n)&&n.tableKey===u.tableNodeKey)return(a.x!==u.focusX||a.y!==u.focusY)&&(u.$setFocusCellForSelection(a),!0);if(u.anchorCell!==null&&u.anchorCellNodeKey!==null&&a.elem!==u.anchorCell.elem&&u.tableSelection!==null)return u.$setFocusCellForSelection(a,!0),!0}let s=t.getAndClearShouldCheckSelectionForTable();if(s&&A(o)&&A(n)&&n.isCollapsed()){let l=Ls(s),a=n.anchor.getNode(),c=l.getFirstChild(),u=es(a);if(u!==null&&ut(c)){let d=c.getFirstChild();if(U(d)&&l.is(q(u,(f)=>f.is(l)||f.is(d))))return d.selectStart(),!0}}lt(n)&&function(l,a){let c=Da(l),u=Ke();if(!a.is(u))return;let d=Ls(a.tableKey),f=po(c);if(f&&f.anchorNode&&f.focusNode){let h=Lt(f.focusNode),p=h&&!d.isParentOf(h),g=Lt(f.anchorNode),_=g&&d.isParentOf(g);if(p&&_&&f.rangeCount>0){let m=Tp(f,l);m&&(m.anchor.set(d.getKey(),a.isBackward()?d.getChildrenSize():0,"element"),f.removeAllRanges(),St(m))}}}(e,n),A(n)&&function(l,a){let c=Ke(),{anchor:u,focus:d}=l,f=u.getNode(),h=d.getNode(),p=es(f),g=es(h),_=p?ir(p):null,m=g?ir(g):null,C=l.isBackward(),x=p&&g&&_&&m&&_.is(m),N=m&&(!_||_.isParentOf(m)),T=_&&(!m||m.isParentOf(_));if(N){let y=l.clone(),[S]=ee(m,g,g),E=S[0][0].cell,O=S[S.length-1].at(-1).cell;y.focus.set(C?E.getKey():O.getKey(),C?0:O.getChildrenSize(),"element"),St(y)}else if(T){let y=l.clone(),[S]=ee(_,p,p),E=S[0][0].cell,O=S[S.length-1].at(-1).cell;y.anchor.set(C?O.getKey():E.getKey(),C?O.getChildrenSize():0,"element"),St(y)}else if(x){let y=a.observers.get(_.getKey());y||W(335,_.getKey());let[S]=y;if(p.is(g)||(S.$setAnchorCellForSelection(rr(S,p)),S.$setFocusCellForSelection(rr(S,g),!0)),S.pointerType==="touch"&&S.isSelecting&&l.isCollapsed()&&A(c)&&c.isCollapsed()){let E=es(c.anchor.getNode());E&&!E.is(g)&&(S.$setAnchorCellForSelection(rr(S,E)),S.$setFocusCellForSelection(rr(S,g),!0),S.pointerType=null)}}}(n,t);let i=t.observers.entries().map(([l,[a]])=>({tableNode:Ls(l),tableObserver:a})).toArray();for(let{tableNode:l,tableObserver:a}of i)fM(e,l,a);return!1}function fM(t,e,n){let o=v(),r=Ke();o&&!o.is(r)&&(lt(o)||lt(r))&&n.tableSelection&&!n.tableSelection.is(r)&&(lt(o)&&o.tableKey===n.tableNodeKey?n.$updateTableTableSelection(o):!lt(o)&&lt(r)&&r.tableKey===n.tableNodeKey&&n.$updateTableTableSelection(null)),n.hasHijackedSelectionStyles&&!e.isSelected()?function(s,i){i.$enableHighlightStyle(),Rf(i.table,(l)=>{let a=l.elem;l.highlighted=!1,tS(s,l),a.getAttribute("style")||a.removeAttribute("style")})}(t,n):!n.hasHijackedSelectionStyles&&e.isSelected()&&function(s,i){i.$disableHighlightStyle(),Rf(i.table,(l)=>{l.highlighted=!0,jy(s,l)})}(t,n)}function wf(t){return t[ns]||null}function li(t){let e=t;for(;e!=null;){let n=e.nodeName;if(n==="TD"||n==="TH"){let o=e._cell;return o===void 0?null:o}e=e.parentNode}return null}function Fy(t,e){if(!t.contains(e))return null;let n=null;for(let o=e;o!=null;o=o.parentNode){if(o===t)return n;let r=o.nodeName;r!=="TD"&&r!=="TH"||(n=o._cell||null)}return null}function os(t,e){let n=[],o={columns:0,domRows:n,rows:0},r=bo(t,e).querySelector("tr"),s=0,i=0;for(n.length=0;r!=null;){let l=r.nodeName;if(l==="TD"||l==="TH"){let u={elem:r,hasBackgroundColor:r.style.backgroundColor!=="",highlighted:!1,x:s,y:i};r._cell=u;let d=n[i];d===void 0&&(d=n[i]=[]),d[s]=u}else{let u=r.firstChild;if(u!=null){r=u;continue}}let a=r.nextSibling;if(a!=null){s++,r=a;continue}let c=r.parentNode;if(c!=null){let u=c.nextSibling;if(u==null)break;i++,s=0,r=u}}return o.columns=s+1,o.rows=i+1,o}function Ta(t,e,n){let o=new Set(n?n.getNodes():[]);Rf(e,(r,s)=>{let i=r.elem;o.has(s)?(r.highlighted=!0,jy(t,r)):(r.highlighted=!1,tS(t,r),i.getAttribute("style")||i.removeAttribute("style"))})}function Rf(t,e){let{domRows:n}=t;for(let o=0;o<n.length;o++){let r=n[o];if(r)for(let s=0;s<r.length;s++){let i=r[s];if(!i)continue;let l=Lt(i.elem);l!==null&&e(i,l,{x:s,y:o})}}}var gM=(t,e,n,o,r)=>{let s=r==="forward";switch(r){case"backward":case"forward":return n!==(s?t.table.columns-1:0)?ba(e.getCellNodeFromCordsOrThrow(n+(s?1:-1),o,t.table),s):o!==(s?t.table.rows-1:0)?ba(e.getCellNodeFromCordsOrThrow(s?0:t.table.columns-1,o+(s?1:-1),t.table),s):s?e.selectNext():e.selectPrevious(),!0;case"up":return o!==0?ba(e.getCellNodeFromCordsOrThrow(n,o-1,t.table),!1):e.selectPrevious(),!0;case"down":return o!==t.table.rows-1?ba(e.getCellNodeFromCordsOrThrow(n,o+1,t.table),!0):e.selectNext(),!0;default:return!1}};function bf(t,e){let n,o;if(e.startColumn===t.minColumn)n="minColumn";else{if(e.startColumn+e.cell.__colSpan-1!==t.maxColumn)return null;n="maxColumn"}if(e.startRow===t.minRow)o="minRow";else{if(e.startRow+e.cell.__rowSpan-1!==t.maxRow)return null;o="maxRow"}return[n,o]}function Ea([t,e]){return[t==="minColumn"?"maxColumn":"minColumn",e==="minRow"?"maxRow":"minRow"]}function jr(t,e,[n,o]){let r=e[o],s=t[r];s===void 0&&W(250,o,String(r));let i=e[n],l=s[i];return l===void 0&&W(250,n,String(i)),l}function hM(t,e,n,o,r){let s=Oa(e,n,o),i=function(y,S){let{minColumn:E,maxColumn:O,minRow:$,maxRow:I}=S,k=1,L=1,z=1,M=1,Z=y[$],ot=y[I];for(let gt=E;gt<=O;gt++)k=Math.max(k,Z[gt].cell.__rowSpan),M=Math.max(M,ot[gt].cell.__rowSpan);for(let gt=$;gt<=I;gt++)L=Math.max(L,y[gt][E].cell.__colSpan),z=Math.max(z,y[gt][O].cell.__colSpan);return{bottomSpan:M,leftSpan:L,rightSpan:z,topSpan:k}}(e,s),{topSpan:l,leftSpan:a,bottomSpan:c,rightSpan:u}=i,d=function(y,S){let E=bf(y,S);return E===null&&W(249,S.cell.getKey()),E}(s,n),[f,h]=Ea(d),p=s[f],g=s[h];r==="forward"?p+=f==="maxColumn"?1:a:r==="backward"?p-=f==="minColumn"?1:u:r==="down"?g+=h==="maxRow"?1:l:r==="up"&&(g-=h==="minRow"?1:c);let _=e[g];if(_===void 0)return!1;let m=_[p];if(m===void 0)return!1;let[C,x]=function(y,S,E){let O=Oa(y,S,E),$=bf(O,S);if($)return[jr(y,O,$),jr(y,O,Ea($))];let I=bf(O,E);if(I)return[jr(y,O,Ea(I)),jr(y,O,I)];let k=["minColumn","minRow"];return[jr(y,O,k),jr(y,O,Ea(k))]}(e,n,m),N=rr(t,C.cell),T=rr(t,x.cell);return t.$setAnchorCellForSelection(N),t.$setFocusCellForSelection(T,!0),!0}function Qn(t,e){if(A(t)||lt(t)){let n=e.isParentOf(t.anchor.getNode()),o=e.isParentOf(t.focus.getNode());return n&&o}return!1}function ba(t,e){e?t.selectStart():t.selectEnd()}function jy(t,e){let n=e.elem,o=t._config.theme;U(Lt(n))||W(131),kt(n,o.tableCellSelected)}function tS(t,e){let n=e.elem;U(Lt(n))||W(131);let o=t._config.theme;On(n,o.tableCellSelected)}function es(t){let e=q(t,U);return U(e)?e:null}function ir(t){let e=q(t,Et);return Et(e)?e:null}function pM(t,e,n,o,r,s,i){let l=_n(n.focus,r?"previous":"next");if(nl(l))return!1;let a=l;for(let _ of Is(l).iterNodeCarets("shadowRoot")){if(!ol(_)||!F(_.origin))return!1;a=_}let c=a.getParentAtCaret();if(!U(c))return!1;let u=c,d=function(_){for(let m of Is(_).iterNodeCarets("root")){let{origin:C}=m;if(U(C)){if(uo(m))return ge(C,_.direction)}else if(!ut(C))break}return null}(oe(u,a.direction)),f=q(u,Et);if(!f||!f.is(s))return!1;let h=t.getElementByKey(u.getKey()),p=li(h);if(!h||!p)return!1;let g=oS(t,f);if(i.table=g,d)if(o==="extend"){let _=li(t.getElementByKey(d.origin.getKey()));if(!_)return!1;i.$setAnchorCellForSelection(p),i.$setFocusCellForSelection(_,!0)}else{let _=We(d);yn(n.anchor,_),yn(n.focus,_)}else if(o==="extend")i.$setAnchorCellForSelection(p),i.$setFocusCellForSelection(p,!0);else{let _=function(m){let C=Fs(m);return uo(C)?We(C):m}(oe(f,l.direction));yn(n.anchor,_),yn(n.focus,_)}return jn(e),!0}function eS(t,e,n,o,r,s){if((n==="up"||n==="down")&&function(l){let a=l.getRootElement();if(!a)return!1;return a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu"}(t))return!1;let i=v();if(!Qn(i,o)){if(A(i)){if(n==="backward"){if(i.focus.offset>0)return!1;let l=function(c){for(let u=c,d=c;d!==null;u=d,d=d.getParent())if(F(d)){if(d!==u&&d.getFirstChild()!==u)return null;if(!d.isInline())return d}return null}(i.focus.getNode());if(!l)return!1;let a=l.getPreviousSibling();return!!Et(a)&&(jn(e),e.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(e.shiftKey&&(n==="up"||n==="down")){let l=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=q(l,(h)=>Et(h));if(U(a)&&(a=q(a,Et)),a!==o)return!1;if(!a)return!1;let c=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!c)return!1;let u=0;n==="up"&&F(c)&&(u=c.getChildrenSize());let d=c;if(n==="up"&&F(c))d=c.getLastChild()||c,u=K(d)?d.getTextContentSize():0;let f=i.clone();return f.focus.set(d.getKey(),u,K(d)?"text":"element"),St(f),jn(e),!0}if(jt(l)){let a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a){if(ii(o,a)!==null){let c=o.getFirstDescendant(),u=o.getLastDescendant();if(!c||!u)return!1;let[d]=Pt(c),[f]=Pt(u),h=o.getCordsFromCellNode(d,r.table),p=o.getCordsFromCellNode(f,r.table),g=o.getDOMCellFromCordsOrThrow(h.x,h.y,r.table),_=o.getDOMCellFromCordsOrThrow(p.x,p.y,r.table);return r.$setAnchorCellForSelection(g),r.$setFocusCellForSelection(_,!0),!0}}return!1}{let a=q(l,(u)=>F(u)&&!u.isInline());if(U(a)&&(a=q(a,Et)),!a)return!1;let c=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Et(c)&&r.tableNodeKey===c.getKey()){let u=c.getFirstDescendant(),d=c.getLastDescendant();if(!u||!d)return!1;let[f]=Pt(u),[h]=Pt(d),p=i.clone();return p.focus.set((n==="up"?f:h).getKey(),n==="up"?0:h.getChildrenSize(),"element"),jn(e),St(p),!0}}}}return n==="down"&&ai(t)&&s.setShouldCheckSelectionForTable(o.getKey()),!1}if(A(i)){if(n==="backward"||n==="forward")return pM(t,e,i,e.shiftKey?"extend":"move",n==="backward",o,r);if(i.isCollapsed()){let{anchor:l,focus:a}=i,c=q(l.getNode(),U),u=q(a.getNode(),U);if(!U(c)||!c.is(u))return!1;let d=ir(c);if(d!==o&&d!=null){let C=bo(d,t.getElementByKey(d.getKey()));if(C!=null)return r.table=os(d,C),eS(t,e,n,d,r,s)}let f=t.getElementByKey(c.__key),h=t.getElementByKey(l.key);if(h==null||f==null)return!1;let p;if(l.type==="element")p=h.getBoundingClientRect();else{let C=po(Da(t));if(C===null||C.rangeCount===0)return!1;p=C.getRangeAt(0).getBoundingClientRect()}let g=n==="up"?c.getFirstChild():c.getLastChild();if(g==null)return!1;let _=t.getElementByKey(g.__key);if(_==null)return!1;let m=_.getBoundingClientRect();if(n==="up"?m.top>p.top-p.height:p.bottom+p.height>m.bottom){jn(e);let C=o.getCordsFromCellNode(c,r.table);if(!e.shiftKey)return gM(r,o,C.x,C.y,n);{let x=o.getDOMCellFromCordsOrThrow(C.x,C.y,r.table);r.$setAnchorCellForSelection(x),r.$setFocusCellForSelection(x,!0)}return!0}}}else if(lt(i)){let{anchor:l,focus:a}=i,c=q(l.getNode(),U),u=q(a.getNode(),U),[d]=i.getNodes();Et(d)||W(251);let f=bo(d,t.getElementByKey(d.getKey()));if(!U(c)||!U(u)||!Et(d)||f==null)return!1;r.$updateTableTableSelection(i);let h=os(d,f),p=o.getCordsFromCellNode(c,h),g=o.getDOMCellFromCordsOrThrow(p.x,p.y,h);if(r.$setAnchorCellForSelection(g),jn(e),e.shiftKey){let[_,m,C]=ee(o,c,u);return hM(r,_,m,C,n)}return u.selectEnd(),!0}return!1}function jn(t){t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()}function Ly(t,e,n){let o=X();t==="first"?e.insertBefore(o):e.insertAfter(o),o.append(...n||[]),o.selectEnd()}function ky(t,e,n){let o=n.getParent();if(!o)return;let r=po(Da(t));if(!r)return;let s=r.anchorNode,i=t.getElementByKey(o.getKey()),l=bo(n,t.getElementByKey(n.getKey()));if(!s||!i||!l||!i.contains(s)||l.contains(s))return;let a=q(e.anchor.getNode(),(C)=>U(C));if(!a)return;let c=q(a,(C)=>Et(C));if(!Et(c)||!c.is(n))return;let[u,d]=ee(n,a,a),f=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:p,startColumn:g}=d,_=p===f.startRow&&g===f.startColumn,m=p===h.startRow&&g===h.startColumn;return _?"first":m?"last":void 0}function rr(t,e){let{tableNode:n}=t.$lookup(),o=n.getCordsFromCellNode(e,t.table);return n.getDOMCellFromCordsOrThrow(o.x,o.y,t.table)}function $f(t,e,n){return ii(t,Lt(e,n))}function Py(t,e,n){let o=t.querySelector("colgroup");if(!o)return;let r=[];for(let s=0;s<e;s++){let i=document.createElement("col"),l=n&&n[s];l&&(i.style.width=`${l}px`),r.push(i)}o.replaceChildren(...r)}function Ky(t,e,n){if(!e.theme.tableAlignment)return;let o=[],r=[];for(let s of["center","right"]){let i=e.theme.tableAlignment[s];i&&(s===n?r:o).push(i)}On(t,...o),kt(t,...r)}var If=new WeakSet;function ai(t=Gn()){return If.has(t)}function nS(t,e){e?If.add(t):If.delete(t)}class In extends re{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){let e=this.getWritable();return e.__colWidths=t,e}static clone(t){return new In(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:(t)=>({conversion:_M,priority:1})}}static importJSON(t){return wa().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,e,n){return n==="html"}getDOMSlot(t){let e=ts(t)?t:t.querySelector("table");return ts(e)||W(229),super.getDOMSlot(t).withElement(e).withAfter(e.querySelector("colgroup"))}createDOM(t,e){let n=document.createElement("table");this.__style&&(n.style.cssText=this.__style);let o=document.createElement("colgroup");if(n.appendChild(o),l_(o),kt(n,t.theme.table),this.updateTableElement(null,n,t),ai(e)){let r=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?kt(r,s):r.style.cssText="overflow-x: auto;",r.appendChild(n),this.updateTableWrapper(null,r,n,t),r}return n}updateTableWrapper(t,e,n,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&function(r,s,i,l){l>0?(kt(r,i.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(On(r,i.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))}(e,n,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&function(r,s,i,l){l>0?(kt(r,i.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(On(r,i.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))}(e,n,o,this.__frozenRowCount)}updateTableElement(t,e,n){this.__style!==(t?t.__style:"")&&(e.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&function(s,i,l){l?(kt(s,i.theme.tableRowStriping),s.setAttribute("data-lexical-row-striping","true")):(On(s,i.theme.tableRowStriping),s.removeAttribute("data-lexical-row-striping"))}(e,n,this.__rowStriping);let o=t?t.getColumnCount():0,r=t?t.__colWidths:void 0;this.getColumnCount()===o&&this.getColWidths()===r||Py(e,this.getColumnCount(),this.getColWidths()),Ky(e,n,this.getFormatType())}updateDOM(t,e,n){let o=this.getDOMSlot(e).element;return e===o===ai()||(ie(r=e)&&r.nodeName==="DIV"&&this.updateTableWrapper(t,e,o,n),this.updateTableElement(t,o,n),!1);var r}scaleDOMColWidths(t,e){let n=this.getColWidths();if(!n)return;Py(this.getDOMSlot(t).element,this.getColumnCount(),n.map((o)=>o*e))}exportDOM(t){let e=super.exportDOM(t),{element:n}=e;return{after:(o)=>{if(e.after&&(o=e.after(o)),!ts(o)&&ie(o)&&(o=o.querySelector("table")),!ts(o))return null;Ky(o,t._config,this.getFormatType());let[r]=Rn(this,null,null),s=new Map;for(let c of r)for(let u of c){let d=u.cell.getKey();s.has(d)||s.set(d,{colSpan:u.cell.getColSpan(),startColumn:u.startColumn})}let i=new Set;for(let c of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let u=c.getAttribute("data-temporary-table-cell-lexical-key");if(u){let d=s.get(u);if(c.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(u);for(let f=0;f<d.colSpan;f++)i.add(f+d.startColumn)}}}let l=o.querySelector(":scope > colgroup");if(l){let c=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((u,d)=>i.has(d));l.replaceChildren(...c)}let a=o.querySelectorAll(":scope > tr");if(a.length>0){let c=document.createElement("tbody");for(let u of a)c.appendChild(u);o.append(c)}return o},element:!ts(n)&&ie(n)?n.querySelector("table"):n}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,e){let{rows:n,domRows:o}=e;for(let r=0;r<n;r++){let s=o[r];if(s!=null)for(let i=0;i<s.length;i++){let l=s[i];if(l==null)continue;let{elem:a}=l,c=$f(this,a);if(c!==null&&t.is(c))return{x:i,y:r}}}throw Error("Cell not found in table.")}getDOMCellFromCords(t,e,n){let{domRows:o}=n,r=o[e];if(r==null)return null;let s=r[t<r.length?t:r.length-1];return s==null?null:s}getDOMCellFromCordsOrThrow(t,e,n){let o=this.getDOMCellFromCords(t,e,n);if(!o)throw Error("Cell not found at cords.");return o}getCellNodeFromCords(t,e,n){let o=this.getDOMCellFromCords(t,e,n);if(o==null)return null;let r=Lt(o.elem);return U(r)?r:null}getCellNodeFromCordsOrThrow(t,e,n){let o=this.getCellNodeFromCords(t,e,n);if(!o)throw Error("Node at cords not TableCellNode.");return o}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(t){let e=this.getWritable();return e.__rowStriping=t,e}setFrozenColumns(t){let e=this.getWritable();return e.__frozenColumnCount=t,e}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){let e=this.getWritable();return e.__frozenRowCount=t,e}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let t=this.getFirstChild();if(!t)return 0;let e=0;return t.getChildren().forEach((n)=>{U(n)&&(e+=n.getColSpan())}),e}}function oS(t,e){let n=t.getElementByKey(e.getKey());return n===null&&W(230),os(e,n)}function _M(t){let e=wa();t.hasAttribute("data-lexical-row-striping")&&e.setRowStriping(!0),t.hasAttribute("data-lexical-frozen-column")&&e.setFrozenColumns(1),t.hasAttribute("data-lexical-frozen-row")&&e.setFrozenRows(1);let n=t.querySelector(":scope > colgroup");if(n){let o=[];for(let r of n.querySelectorAll(":scope > col")){let s=r.style.width||"";if(!Ff.test(s)&&(s=r.getAttribute("width")||"",!/^\d+$/.test(s))){o=void 0;break}o.push(parseFloat(s))}o&&e.setColWidths(o)}return{after:(o)=>Hu(o,ut),node:e}}function wa(){return fe(new In)}function Et(t){return t instanceof In}function mM(t){ut(t.getParent())?t.isEmpty()&&t.append(X()):t.remove()}function CM(t){Et(t.getParent())?Uu(t,U):t.remove()}function xM(t){Uu(t,ut);let[e]=Rn(t,null,null),n=e.reduce((i,l)=>Math.max(i,l.length),0),o=t.getChildren();for(let i=0;i<e.length;++i){let l=o[i];if(!l)continue;ut(l)||W(254,l.constructor.name,l.getType());let a=e[i].reduce((c,u)=>u?1+c:c,0);if(a!==n)for(let c=a;c<n;++c){let u=Oe();u.append(X()),l.append(u)}}let r=t.getColWidths(),s=t.getColumnCount();if(r&&r.length!==s){let i;if(s<r.length)i=r.slice(0,s);else if(r.length>0){let l=r[r.length-1];i=[...r,...Array(s-r.length).fill(l)]}t.setColWidths(i)}}function yM(t){if(t.detail<3||!ln(t.target))return!1;let e=Lt(t.target);if(e===null)return!1;let n=q(e,(o)=>F(o)&&!o.isInline());if(n===null)return!1;return!!U(n.getParent())&&(n.select(0),!0)}function SM(){let t=v();if(!A(t))return!1;let e=ir(t.anchor.getNode());if(e===null)return!1;let n=xt();if(!n.is(e.getParent())||n.getChildrenSize()!==1)return!1;let[o]=Rn(e,null,null);if(o.length===0||o[0].length===0)return!1;let r=o[0][0];if(!r||!r.cell)return!1;let s=o[o.length-1],i=s[s.length-1];if(!i||!i.cell)return!1;let l=Ma(e,r.cell,i.cell);return St(l),!0}function rS(t){return t.registerNodeTransform($n,(e)=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,n]=Pt(e),[o]=ee(n,e,e),r=o.length,s=o[0].length,i=n.getFirstChild();ut(i)||W(175);let l=[];for(let a=0;a<r;a++){a!==0&&(i=i.getNextSibling(),ut(i)||W(175));let c=null;for(let u=0;u<s;u++){let d=o[a][u],f=d.cell;if(d.startRow===a&&d.startColumn===u)c=f,l.push(f);else if(f.getColSpan()>1||f.getRowSpan()>1){U(f)||W(176);let h=Oe(f.__headerState);c!==null?c.insertAfter(h):z_(i,h)}}}for(let a of l)a.setColSpan(1),a.setRowSpan(1)}})}function sS(t,e=!0){let n=new Zy,o=(r,s,i)=>{let l=bo(r,i),a=Qy(r,l,t,e,n);n.observers.set(s,[a,l])};return $t(uM(t,n),t.registerCommand(Nn,()=>dM(n,t),ve),t.registerMutationListener(In,(r)=>{t.getEditorState().read(()=>{for(let[s,i]of r){let l=n.observers.get(s);if(i==="created"||i==="updated"){let{tableNode:a,tableElement:c}=Kf(s);l===void 0?o(a,s,c):c!==l[1]&&(l[0].removeListeners(),n.observers.delete(s),o(a,s,c))}else i==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.observers.delete(s))}},{editor:t})},{skipInitialization:!1}),()=>{for(let[,[r]]of n.observers)r.removeListeners()})}function iS(t,e){t.hasNodes([In])||W(255);let{hasNestedTables:n=Nm(!1)}=e??{};return $t(t.registerCommand(By,(o)=>function({rows:r,columns:s,includeHeaders:i},l){let a=v()||Ke();if(!a||!A(a))return!1;if(!l&&ir(a.anchor.getNode()))return!1;let c=Wy(Number(r),Number(s),i);Ll(c);let u=c.getFirstDescendant();return K(u)&&u.select(),!0}(o,n.peek()),Q),t.registerCommand(Sl,(o,r)=>t===r&&function(s,i){let{nodes:l,selection:a}=s;if(!l.some((d)=>Et(d)||W_(d).some((f)=>Et(f.node))))return!1;let c=lt(a),u=A(a);if(!(u&&q(a.anchor.getNode(),(d)=>U(d))!==null&&q(a.focus.getNode(),(d)=>U(d))!==null||c))return!1;if(l.length===1&&Et(l[0]))return function(d,f){let h=f.getStartEndPoints(),p=lt(f);if(h===null)return!1;let[g,_]=h,[m,C,x]=Pt(g),N=q(_.getNode(),(j)=>U(j));if(!(U(m)&&U(N)&&ut(C)&&Et(x)))return!1;let[T,y,S]=ee(x,m,N),[E]=Rn(d,null,null),O=T.length,$=O>0?T[0].length:0,I=y.startRow,k=y.startColumn,L=E.length,z=L>0?E[0].length:0;if(p){let j=Oa(T,y,S),Mt=j.maxRow-j.minRow+1,vt=j.maxColumn-j.minColumn+1;I=j.minRow,k=j.minColumn,L=Math.min(L,Mt),z=Math.min(z,vt)}let M=!1,Z=Math.min(O,I+L)-1,ot=Math.min($,k+z)-1,gt=new Set;for(let j=I;j<=Z;j++)for(let Mt=k;Mt<=ot;Mt++){let vt=T[j][Mt];gt.has(vt.cell.getKey())||(vt.cell.__rowSpan===1&&vt.cell.__colSpan===1||(Vy(vt.cell),gt.add(vt.cell.getKey()),M=!0))}let[rt]=Rn(x.getWritable(),null,null),$e=L-O+I;for(let j=0;j<$e;j++)Af(rt[O-1][0].cell);let ae=z-$+k;for(let j=0;j<ae;j++)vf(rt[0][$-1].cell,!0,!1);[rt]=Rn(x.getWritable(),null,null);for(let j=I;j<I+L;j++)for(let Mt=k;Mt<k+z;Mt++){let vt=j-I,Ie=Mt-k,ce=E[vt][Ie];if(ce.startRow!==vt||ce.startColumn!==Ie)continue;let Ce=ce.cell;if(Ce.__rowSpan!==1||Ce.__colSpan!==1){let Le=[],YS=Math.min(j+Ce.__rowSpan,I+L)-1,GS=Math.min(Mt+Ce.__colSpan,k+z)-1;for(let Ia=j;Ia<=YS;Ia++)for(let Fa=Mt;Fa<=GS;Fa++){let JS=rt[Ia][Fa];Le.push(JS.cell)}Jy(Le),M=!0}let{cell:ue}=rt[j][Mt],Fe=Ce.getBackgroundColor();Fe!=null&&ue.setBackgroundColor(Fe);let Je=ue.getChildren();Ce.getChildren().forEach((Le)=>{if(K(Le))X().append(Le),ue.append(Le);else ue.append(Le)}),Je.forEach((Le)=>Le.remove())}if(p&&M){let[j]=Rn(x.getWritable(),null,null);j[y.startRow][y.startColumn].cell.selectEnd()}return!0}(l[0],a);if(u&&i.peek()&&!function(d){if(lt(d)&&!d.focus.getNode().is(d.anchor.getNode()))return!0;if(A(d)&&U(d.anchor.getNode())&&!d.anchor.getNode().is(d.focus.getNode()))return!0;return!1}(a))return!1;return!0}(o,n),Q),t.registerCommand(Nl,SM,st),t.registerCommand(Ar,yM,Q),t.registerNodeTransform(In,xM),t.registerNodeTransform(lr,CM),t.registerNodeTransform($n,mM))}var NM=it({build:(t,e,n)=>me(e),config:Rt({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasTabHandler:!0}),name:"@lexical/table/Table",nodes:()=>[In,lr,$n],register(t,e,n){let o=n.getOutput();return $t(_e(()=>{let r=o.hasHorizontalScroll.value;ai(t)!==r&&(nS(t,r),t.registerNodeTransform(In,()=>{})())}),iS(t,o),_e(()=>sS(t,o.hasTabHandler.value)),_e(()=>o.hasCellMerge.value?void 0:rS(t)),_e(()=>o.hasCellBackgroundColor.value?void 0:t.registerNodeTransform($n,(r)=>{r.getBackgroundColor()!==null&&r.setBackgroundColor(null)})))}});var Y=Wf,x$=Y.$computeTableMap,y$=Y.$computeTableMapSkipCellCheck,S$=Y.$createTableCellNode,N$=Y.$createTableNode,T$=Y.$createTableNodeWithDimensions,E$=Y.$createTableRowNode,b$=Y.$createTableSelection,O$=Y.$createTableSelectionFrom,M$=Y.$deleteTableColumn,A$=Y.$deleteTableColumnAtSelection,v$=Y.$deleteTableColumn__EXPERIMENTAL,D$=Y.$deleteTableRowAtSelection,w$=Y.$deleteTableRow__EXPERIMENTAL,R$=Y.$findCellNode,$$=Y.$findTableNode,I$=Y.$getElementForTableNode,F$=Y.$getNodeTriplet,L$=Y.$getTableAndElementByKey,k$=Y.$getTableCellNodeFromLexicalNode,P$=Y.$getTableCellNodeRect,K$=Y.$getTableColumnIndexFromTableCellNode,B$=Y.$getTableNodeFromLexicalNodeOrThrow,W$=Y.$getTableRowIndexFromTableCellNode,z$=Y.$getTableRowNodeFromTableCellNodeOrThrow,H$=Y.$insertTableColumn,U$=Y.$insertTableColumnAtSelection,Y$=Y.$insertTableColumn__EXPERIMENTAL,G$=Y.$insertTableRow,J$=Y.$insertTableRowAtSelection,V$=Y.$insertTableRow__EXPERIMENTAL,X$=Y.$isScrollableTablesActive,q$=Y.$isSimpleTable,Z$=Y.$isTableCellNode,Q$=Y.$isTableNode,j$=Y.$isTableRowNode,tI=Y.$isTableSelection,eI=Y.$mergeCells,nI=Y.$moveTableColumn,oI=Y.$removeTableRowAtIndex,rI=Y.$unmergeCell,sI=Y.INSERT_TABLE_COMMAND,iI=Y.TableCellHeaderStates,lS=Y.TableCellNode,lI=Y.TableExtension,aS=Y.TableNode,aI=Y.TableObserver,cS=Y.TableRowNode,cI=Y.applyTableHandlers,uI=Y.getDOMCellFromTarget,dI=Y.getTableElement,fI=Y.getTableObserverFromTableElement,gI=Y.registerTableCellUnmergeTransform,hI=Y.registerTablePlugin,pI=Y.registerTableSelectionObserver,_I=Y.setScrollableTablesActive;var qt=Dt(Bt(),1);var TM={paragraph:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bullet:"Bullet List",number:"Numbered List",check:"Check List",quote:"Quote",code:"Code Block"};function EM(t){let{anchor:e,focus:n}=t,o=t.anchor.getNode(),r=t.focus.getNode();if(o===r)return o;if(t.isBackward())return Iu(n)?o:r;else return Iu(e)?r:o}function OS({rightContent:t}={}){let[e]=mt(),[n,o]=qt.useState(!1),[r,s]=qt.useState(!1),[i,l]=qt.useState("paragraph"),[a,c]=qt.useState(!1),[u,d]=qt.useState(!1),[f,h]=qt.useState(!1),[p,g]=qt.useState(!1),[_,m]=qt.useState(!1),[C,x]=qt.useState(!1),N=qt.useCallback(()=>{let M=v();if(A(M)){c(M.hasFormat("bold")),d(M.hasFormat("italic")),h(M.hasFormat("underline")),g(M.hasFormat("strikethrough")),m(M.hasFormat("code"));let Z=EM(M),ot=Z.getParent();x(Vr(ot)||Vr(Z));let gt=M.anchor.getNode(),rt=gt.getKey()==="root"?gt:gt.getTopLevelElementOrThrow(),$e=rt.getKey();if(e.getElementByKey($e)!==null)if(cn(rt)){let j=Fl(gt,wn),Mt=j?j.getListType():rt.getListType();l(Mt)}else if(ql(rt))l(rt.getTag());else{let j=rt.getType();if(j in TM)l(j);else l("paragraph")}}},[e]);qt.useEffect(()=>{return e.registerCommand(Nn,()=>{return N(),!1},vr)},[e,N]),qt.useEffect(()=>{return e.registerUpdateListener(({editorState:M})=>{M.read(()=>{N()})})},[e,N]),qt.useEffect(()=>{let M=e.registerCommand(Uo,(ot)=>{return o(ot),!1},st),Z=e.registerCommand(Ho,(ot)=>{return s(ot),!1},st);return()=>{M(),Z()}},[e]);let T=()=>{e.update(()=>{let M=v();if(A(M))Lr(M,()=>X())})},y=(M)=>{e.update(()=>{let Z=v();if(A(Z))Lr(Z,()=>Vl(M))})},S=()=>{if(i!=="bullet")e.dispatchCommand(FC,void 0);else e.dispatchCommand(ia,void 0)},E=()=>{if(i!=="number")e.dispatchCommand(IC,void 0);else e.dispatchCommand(ia,void 0)},O=()=>{if(i!=="check")e.dispatchCommand($C,void 0);else e.dispatchCommand(ia,void 0)},$=()=>{if(i!=="quote")e.update(()=>{let M=v();if(A(M))Lr(M,()=>Xl())});else T()},I=()=>{if(i!=="code")e.update(()=>{let M=v();if(A(M))Lr(M,()=>Dy())});else T()},k=qt.useCallback(()=>{if(!C){let M=prompt("Enter link URL (e.g., https://example.com):");if(M)e.dispatchCommand(kd,M)}else e.dispatchCommand(kd,null)},[e,C]),L=qt.useCallback(()=>{e.update(()=>{let M=v();if(A(M))M.setFormat(0),Lr(M,()=>X())})},[e]);return Tt("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[Tt("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[w("button",{type:"button",disabled:!n,onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(El,void 0),title:"Undo","aria-label":"Undo",children:w(ES,{className:"h-4 w-4"})}),w("button",{type:"button",disabled:!r,onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(yl,void 0),title:"Redo","aria-label":"Redo",children:w(SS,{className:"h-4 w-4"})}),w("div",{className:"toolbar-divider"}),Tt("select",{value:i,onChange:(M)=>{let Z=M.target.value;switch(Z){case"paragraph":T();break;case"h1":case"h2":case"h3":y(Z);break;case"bullet":S();break;case"number":E();break;case"check":O();break;case"quote":$();break;case"code":I();break}},"aria-label":"Block formatting",children:[w("option",{value:"paragraph",children:"Normal"}),w("option",{value:"h1",children:"Heading 1"}),w("option",{value:"h2",children:"Heading 2"}),w("option",{value:"h3",children:"Heading 3"}),w("option",{value:"bullet",children:"Bullet List"}),w("option",{value:"number",children:"Numbered List"}),w("option",{value:"check",children:"Check List"}),w("option",{value:"quote",children:"Quote"}),w("option",{value:"code",children:"Code Block"})]}),w("div",{className:"toolbar-divider"}),w("button",{type:"button",className:a?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(ze,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:w(uS,{className:"h-4 w-4"})}),w("button",{type:"button",className:u?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(ze,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:w(pS,{className:"h-4 w-4"})}),w("button",{type:"button",className:f?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(ze,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:w(bS,{className:"h-4 w-4"})}),w("button",{type:"button",className:p?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(ze,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:w(TS,{className:"h-4 w-4"})}),w("button",{type:"button",className:_?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>e.dispatchCommand(ze,"code"),title:"Inline Code","aria-label":"Inline Code",children:w(dS,{className:"h-4 w-4"})}),w("button",{type:"button",className:C?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:k,title:"Insert Link","aria-label":"Link",children:w(_S,{className:"h-4 w-4"})}),w("div",{className:"toolbar-divider"}),w("button",{type:"button",className:i==="h1"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>y("h1"),title:"H1","aria-label":"Heading 1",children:w(fS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="h2"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>y("h2"),title:"H2","aria-label":"Heading 2",children:w(gS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="h3"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:()=>y("h3"),title:"H3","aria-label":"Heading 3",children:w(hS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="bullet"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:S,title:"Bullet List","aria-label":"Bullet List",children:w(xS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="number"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:E,title:"Numbered List","aria-label":"Numbered List",children:w(mS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="check"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:O,title:"Check List","aria-label":"Check List",children:w(CS,{className:"h-4 w-4"})}),w("button",{type:"button",className:i==="quote"?"active":"",onMouseDown:(M)=>M.preventDefault(),onClick:$,title:"Quote","aria-label":"Quote",children:w(yS,{className:"h-4 w-4"})}),w("div",{className:"toolbar-divider"}),w("button",{type:"button",onMouseDown:(M)=>M.preventDefault(),onClick:L,title:"Clear Formatting","aria-label":"Clear Formatting",children:w(NS,{className:"h-4 w-4"})})]}),t&&w("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:t})]})}var MS={paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3"},list:{checklist:"editor-checklist",listitem:"editor-listitem",listitemChecked:"editor-listitem-checked",listitemUnchecked:"editor-listitem-unchecked",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},link:"editor-link",text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",underlineStrikethrough:"editor-text-underlineStrikethrough",code:"editor-text-code"},code:"editor-code-block"};var ci=[oy,...ry,...sy,...iy,...ly];function bM({value:t,initialContent:e="",onChange:n}){let[o]=mt(),r=rs.useRef(!1),s=rs.useRef("");return rs.useEffect(()=>{if(!r.current){r.current=!0;let i=t!==void 0?t:e;if(i)o.update(()=>{of(i,ci)}),s.current=i}},[o,e,t]),rs.useEffect(()=>{if(r.current&&t!==void 0&&t!==s.current)o.update(()=>{of(t,ci)}),s.current=t},[o,t]),w(hy,{ignoreSelectionChange:!0,onChange:(i)=>{i.read(()=>{let l=ny(ci);if(l!==s.current)s.current=l,n?.(l)})}})}function vS({initialContent:t="",value:e,onChange:n,placeholder:o="Write your markdown content here...",readOnly:r=!1,autoFocus:s=!1,className:i="",hideToolbar:l=!1,rightToolbarContent:a}){let c={namespace:"ShumaiWysiwygMarkdownEditor",theme:MS,editable:!r,onError:(u)=>{console.error("[MarkdownEditor] Error:",u)},nodes:[Ql,jl,wn,yo,wy,aS,lS,cS,ox,Xr]};return w("div",{className:`shumai-editor-wrapper ${r?"read-only":""} ${i}`,children:Tt(c_,{initialConfig:c,children:[!r&&!l?w(OS,{rightContent:a}):a?w("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:a}):null,Tt(AS,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[w("div",{className:"relative min-h-full",children:w(jm,{contentEditable:w(rC,{className:"editor-input"}),placeholder:w("div",{className:"editor-placeholder",children:o}),ErrorBoundary:py})}),w(uC,{}),w(PC,{}),w(BC,{}),w(HC,{}),w(sx,{}),w(gy,{transformers:ci}),w(bM,{value:e,initialContent:t,onChange:n}),s&&w(lx,{})]})]})})}function KS({projectId:t,assetId:e,rootFolderId:n,isRoot:o}){let r=$a(),s=DS(),{canAdmin:i}=kS(t),{data:l,isLoading:a}=Ra({queryKey:["folders",e,"agentsmd"],queryFn:async()=>{let L=await ui.api.folders[":folderId"].agentsmd.$get({param:{folderId:e}});if(!L.ok)throw Error("Failed to fetch agents.md");return await L.json()}}),[c,u]=Kt.useState(""),[d,f]=Kt.useState(!1),[h,p]=Kt.useState("idle"),g=Kt.useRef(null),_=Kt.useRef(null),m=Kt.useRef(""),C=Kt.useRef(null),x=Kt.useRef(Promise.resolve());Kt.useEffect(()=>{if(!d&&l!==void 0){let L=l.content??"";u(L),m.current=L,C.current=L,f(!0)}},[l,d]);let[N,T]=Kt.useState(!1),y=wS({mutationFn:async(L)=>{let z=await ui.api.folders[":folderId"].agentsmd.$patch({param:{folderId:e},json:{content:L}});if(!z.ok)throw Error("Failed to save agents.md");return await z.json()},onSuccess:(L,z)=>{if(p("saved"),C.current=z,s.setQueryData(["folders",e,"agentsmd"],{content:z}),s.invalidateQueries({queryKey:["folders",e]}),_.current)clearTimeout(_.current);_.current=setTimeout(()=>{p("idle")},2500)},onError:()=>{p("error")}}),S=Kt.useRef(y.mutateAsync);S.current=y.mutateAsync;let E=Kt.useCallback((L)=>{if(!i)return Promise.resolve();if(C.current===L)return p("saved"),Promise.resolve();p("saving");let z=x.current.then(async()=>{await S.current(L)}).catch(()=>{});return x.current=z,z},[i]),O=Kt.useCallback((L)=>{if(!i)return;if(u(L),m.current=L,g.current)clearTimeout(g.current);p("saving"),g.current=setTimeout(()=>{g.current=null,E(L)},1000)},[i,E]),$=Kt.useCallback(()=>{if(g.current)return clearTimeout(g.current),g.current=null,E(m.current);return x.current},[E]);Kt.useEffect(()=>{return()=>{if($(),_.current)clearTimeout(_.current)}},[$]);let I=async()=>{T(!0);try{$(),await x.current}catch{}finally{if(o||e===n)r({to:"/projects/$projectId",params:{projectId:t}});else r({to:"/projects/$projectId/folders/$folderId",params:{projectId:t,folderId:e}})}},k=Tt("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[i?Tt("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(h==="saving"||N)&&Tt("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[w(zf,{className:"h-3.5 w-3.5 shrink-0"}),w("span",{children:Fn.saving_ellipsis()})]}),h==="saved"&&!N&&Tt("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[w($S,{className:"h-3.5 w-3.5 shrink-0"}),w("span",{children:Fn.saved()})]}),h==="error"&&!N&&Tt("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[w(RS,{className:"h-3.5 w-3.5 shrink-0"}),w("span",{children:Fn.agents_md_save_failed()})]})]}):Tt("div",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/60 px-2.5 py-1 rounded-md shrink-0",title:Fn.agents_md_readonly_hint(),children:[w(IS,{className:"h-3.5 w-3.5 shrink-0"}),w("span",{children:Fn.agents_md_readonly_hint()})]}),Tt("div",{className:"flex items-center gap-2 shrink-0",children:[i&&w(PS,{orientation:"vertical",className:"h-4 shrink-0"}),Tt(LS,{variant:"ghost",size:"sm",onClick:I,disabled:N,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Fn.close(),children:[w(FS,{className:"h-4 w-4 mr-1 shrink-0"}),w("span",{children:Fn.close()})]})]})]});if(a||!d)return Tt("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[w(zf,{className:"h-4 w-4 animate-pulse mr-2"}),w("span",{children:Fn.agents_md_loading()})]});return w("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:w(vS,{value:c,onChange:O,placeholder:Fn.agents_md_placeholder(),readOnly:!i,rightToolbarContent:k,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function OM({teamId:t,projectId:e,projectName:n,assetId:o,rootFolderId:r,isRoot:s}){let i=$a(),[l,a]=di.useState(240),[c,u]=di.useState(360),{fileListLeftSidebarCollapsed:d,setFileListLeftSidebarCollapsed:f}=zS(),{isChatbotOpen:h,setIsChatbotOpen:p}=HS(),{data:g}=Ra({queryKey:["folders",o],queryFn:async()=>{let C=await ui.api.folders[":folderId"].$get({param:{folderId:o}});if(!C.ok)throw Error("failed to fetch folder");return await C.json()},enabled:!!o}),{setProjectState:_,clearProjectState:m}=WS();return di.useEffect(()=>{let x=s||o===r?[]:g?.name?[{id:o,name:g.name},...g?.ancestorFolders??[]]:g?.ancestorFolders??[];return _({teamId:t,projectId:e,projectName:n,ancestorFolders:x,currentAsset:{name:g?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(N)=>{i({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:N}})}}),()=>m()},[t,e,n,g?.ancestorFolders,g?.name,s,o,r,_,m,i]),w("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:Tt("div",{className:"flex-1 flex overflow-hidden relative",children:[!d&&w("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>f(!0)}),h&&w("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>p(!1)}),!d&&Tt(qo,{children:[w("div",{className:"bg-background flex-shrink-0",style:{width:l},children:w(BS,{teamId:t,projectId:e,projectName:n,rootFolderId:r,selectedFolderId:o,ancestorFolders:g?.ancestorFolders??[]})}),w(Hf,{onResize:(C)=>{a((x)=>Math.max(180,Math.min(400,x+C)))},className:"hidden md:block"})]}),w("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:w(KS,{projectId:e,assetId:o,rootFolderId:r,isRoot:s})}),h&&Tt(qo,{children:[w(Hf,{onResize:(C)=>{u((x)=>Math.max(240,Math.min(600,x-C)))},className:"hidden md:block"}),w("div",{style:{width:c},className:"bg-background flex flex-col flex-shrink-0",children:w(US,{projectId:e,contextAssetId:o})})]})]})})}
41
- export{OM as g};