@shumai-one/shumai 0.4.6 → 0.4.7

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 (143) hide show
  1. package/bin/{chunk-1bgsphyz.js → chunk-05tnmf8h.js} +2 -2
  2. package/bin/chunk-0xsgx9ep.js +1 -0
  3. package/bin/{chunk-3d5rm1d1.js → chunk-0ygtayqf.js} +1 -1
  4. package/bin/{chunk-crja7whq.js → chunk-11c93g1m.js} +2 -2
  5. package/bin/chunk-1ajgdv26.js +1 -0
  6. package/bin/{chunk-ba33nf0q.js → chunk-1ntn42d2.js} +3 -3
  7. package/bin/chunk-2kxhdnma.js +3 -0
  8. package/bin/chunk-30dsxm8s.js +1 -0
  9. package/bin/chunk-3b6h719s.js +3 -0
  10. package/bin/{chunk-pdh9bnyj.js → chunk-3g5pyw2e.js} +2 -2
  11. package/bin/{chunk-p75f5pgq.js → chunk-3h9c5ak3.js} +2 -2
  12. package/bin/{chunk-2qjfpmcf.js → chunk-3m5kwcj7.js} +1 -1
  13. package/bin/{chunk-w1wxzqqb.js → chunk-3p1bb08a.js} +2 -2
  14. package/bin/{chunk-6vxzkrsj.js → chunk-3r5yc5wm.js} +4 -4
  15. package/bin/{chunk-sab7tjxw.js → chunk-3tyk9xgf.js} +3 -3
  16. package/bin/{chunk-h9mka9br.js → chunk-4a88wwg2.js} +1 -1
  17. package/bin/{chunk-z08bqvkc.js → chunk-4f5pnnah.js} +14 -14
  18. package/bin/{chunk-dpc11hpd.js → chunk-4jgq9m51.js} +7 -7
  19. package/bin/{chunk-d7fwggt6.js → chunk-4m8gk79m.js} +1 -1
  20. package/bin/{chunk-b9hyc0a1.js → chunk-53vtc74g.js} +2 -2
  21. package/bin/{chunk-1kt5dzjv.js → chunk-58e1a3re.js} +2 -2
  22. package/bin/{chunk-dmvvt8va.js → chunk-5qkwpy8c.js} +2 -2
  23. package/bin/{chunk-07jszkhj.js → chunk-5rk7dyx9.js} +58 -58
  24. package/bin/{chunk-ga3pahzf.js → chunk-5v4s2kp4.js} +1 -1
  25. package/bin/{chunk-v8v8vdf7.js → chunk-5wp37g6w.js} +4 -4
  26. package/bin/{chunk-hs2r9qaw.js → chunk-628k58ek.js} +2 -2
  27. package/bin/{chunk-rp4pc6kz.js → chunk-6kdf411z.js} +1 -1
  28. package/bin/chunk-6ksrrayx.css +1 -0
  29. package/bin/chunk-6rjkbwz6.js +14 -0
  30. package/bin/{chunk-md5pcq46.js → chunk-781990k7.js} +4 -4
  31. package/bin/{chunk-ey3h4sct.js → chunk-887pj9xd.js} +2 -2
  32. package/bin/{chunk-1jybg56e.js → chunk-8b1w6bj9.js} +1 -1
  33. package/bin/{chunk-0wvhahzh.js → chunk-8gna37dd.js} +1 -1
  34. package/bin/{chunk-rmzcarv9.js → chunk-8sf106rq.js} +1 -1
  35. package/bin/{chunk-2jrjwaqr.js → chunk-8ystwvdt.js} +1 -1
  36. package/bin/{chunk-3j5njrpr.js → chunk-9v6eqa3n.js} +2 -2
  37. package/bin/{chunk-rsd164d9.js → chunk-9va1mzeq.js} +1 -1
  38. package/bin/{chunk-kmbjp5kp.js → chunk-an6nsq1t.js} +1 -1
  39. package/bin/{chunk-vzj2j11x.js → chunk-ayq8dskd.js} +1 -1
  40. package/bin/{chunk-y20sbaz5.js → chunk-b0rjvx5g.js} +1 -1
  41. package/bin/chunk-bgm76rzj.js +1 -0
  42. package/bin/chunk-btmxr226.js +1 -0
  43. package/bin/chunk-camzbwqh.js +2 -0
  44. package/bin/{chunk-t350k3s1.js → chunk-ccvjwhqq.js} +1 -1
  45. package/bin/{chunk-pgj2kjnn.js → chunk-dkzyv61a.js} +2 -2
  46. package/bin/{chunk-y56yvezn.js → chunk-dyq6h9ha.js} +1 -1
  47. package/bin/{chunk-teqprbd8.js → chunk-e17daz1x.js} +1 -1
  48. package/bin/{chunk-dbw8c1jj.js → chunk-ebf1r872.js} +4 -4
  49. package/bin/{chunk-2vzzd0q6.js → chunk-ebx3bd4c.js} +1 -1
  50. package/bin/{chunk-161rxeq2.js → chunk-ee3mrvqp.js} +1 -1
  51. package/bin/chunk-fg6zf2gb.js +2 -0
  52. package/bin/{chunk-6y4xkcte.js → chunk-fhazy8f9.js} +1 -1
  53. package/bin/{chunk-gqr5hxhj.js → chunk-fk712d68.js} +1 -1
  54. package/bin/{chunk-afnzb9ne.js → chunk-fvgb6rps.js} +2 -2
  55. package/bin/chunk-g9gmht89.js +2 -0
  56. package/bin/{chunk-1t51fp6n.js → chunk-gf4n4ahk.js} +1 -1
  57. package/bin/{chunk-gcjsw9yp.js → chunk-h3wr8nnk.js} +1 -1
  58. package/bin/chunk-htpjtarr.js +2 -0
  59. package/bin/{chunk-kg8eg9z3.js → chunk-hye75kp0.js} +2 -2
  60. package/bin/{chunk-3tg39jx7.js → chunk-j41mya13.js} +2 -2
  61. package/bin/chunk-j547gtag.js +2 -0
  62. package/bin/{chunk-a4056d0r.js → chunk-jde9r5mj.js} +1 -1
  63. package/bin/chunk-jf4kcad0.js +1 -0
  64. package/bin/{chunk-tgr86ac4.js → chunk-jt04mf5s.js} +1 -1
  65. package/bin/{chunk-hnhdq2wd.js → chunk-k3qypq3x.js} +1 -1
  66. package/bin/chunk-k5hnrtrt.js +1 -0
  67. package/bin/{chunk-mtb9fpj2.js → chunk-k810fstm.js} +1 -1
  68. package/bin/{chunk-3n4224c0.js → chunk-kg2c445x.js} +1 -1
  69. package/bin/{chunk-edqd8evk.js → chunk-kq2qbwx1.js} +1 -1
  70. package/bin/{chunk-7nvk7waw.js → chunk-m2h7a172.js} +1 -1
  71. package/bin/{chunk-brwbhbmc.js → chunk-m638fg4n.js} +5 -5
  72. package/bin/{chunk-3dgahs95.js → chunk-mm1a0zja.js} +1 -1
  73. package/bin/{chunk-hxyg5q2a.js → chunk-njabdtvb.js} +2 -2
  74. package/bin/{chunk-b6q287d1.js → chunk-njqf50vw.js} +1 -1
  75. package/bin/{chunk-47tn3vtg.js → chunk-nn5hyf6f.js} +1 -1
  76. package/bin/{chunk-t7bvde99.js → chunk-nnq8g9yy.js} +3 -3
  77. package/bin/{chunk-8cn7fx40.js → chunk-ny7qjn6s.js} +1 -1
  78. package/bin/{chunk-3d9tfxp4.js → chunk-p5fwjk5c.js} +1 -1
  79. package/bin/{chunk-s05cdax2.js → chunk-pa1fmskf.js} +1 -1
  80. package/bin/{chunk-a796sgcw.js → chunk-pcspeqwq.js} +2 -2
  81. package/bin/{chunk-yfr0hzb7.js → chunk-q1d7x1cc.js} +1 -1
  82. package/bin/{chunk-y1b3ck7m.js → chunk-q45n02fs.js} +1 -1
  83. package/bin/chunk-q6jsw0rr.js +211 -0
  84. package/bin/chunk-qjzyze00.js +1 -0
  85. package/bin/{chunk-2yr5k567.js → chunk-r55htzxr.js} +1 -1
  86. package/bin/{chunk-46wfxyd7.js → chunk-r7e2fmmx.js} +2 -2
  87. package/bin/{chunk-5kvc1gp2.js → chunk-rbagbd0e.js} +1 -1
  88. package/bin/{chunk-dz076sh7.js → chunk-rdscv38p.js} +1 -1
  89. package/bin/chunk-rfhmk32e.js +1 -0
  90. package/bin/{chunk-qs7855cz.js → chunk-rkafv27g.js} +2 -2
  91. package/bin/{chunk-hd6dnnyg.js → chunk-rkqpnyzx.js} +1 -1
  92. package/bin/{chunk-z6jpt0h6.js → chunk-s30fjvzs.js} +3 -3
  93. package/bin/{chunk-dj5a6kkh.js → chunk-s41mgkse.js} +1 -1
  94. package/bin/{chunk-988casfy.js → chunk-s63vj79f.js} +1 -1
  95. package/bin/{chunk-9d0thqcy.js → chunk-t3t7dcfq.js} +1 -1
  96. package/bin/{chunk-gsfcpcye.js → chunk-twyxs4z2.js} +1 -1
  97. package/bin/{chunk-1dqsf5qj.js → chunk-typ46eqd.js} +5 -5
  98. package/bin/chunk-v1sgrg0r.js +1 -0
  99. package/bin/{chunk-j9ks8bd7.js → chunk-vdnmq163.js} +1 -1
  100. package/bin/{chunk-jg2v25d2.js → chunk-vx66rms0.js} +2 -2
  101. package/bin/{chunk-9nvymwqj.js → chunk-wvq717b5.js} +2 -2
  102. package/bin/chunk-xbge27m4.js +1 -0
  103. package/bin/{chunk-ysv80zyb.js → chunk-xca338dw.js} +3 -3
  104. package/bin/chunk-xcsz1wp7.js +1 -0
  105. package/bin/{chunk-ehpfg3km.js → chunk-xznabrt2.js} +1 -1
  106. package/bin/{chunk-pvg3msgw.js → chunk-xzyfnfck.js} +3 -3
  107. package/bin/{chunk-9trnkbtr.js → chunk-ycw3rwhx.js} +3 -3
  108. package/bin/{chunk-qbqym9m6.js → chunk-yqvhgtez.js} +2 -2
  109. package/bin/{chunk-4syt6rn0.js → chunk-yr03tf5r.js} +2 -2
  110. package/bin/{chunk-n3xjwszr.js → chunk-z9jpgxf1.js} +1 -1
  111. package/bin/chunk-zb0az2tq.js +2 -0
  112. package/bin/{chunk-pwkby9h7.js → chunk-zbt4h7n0.js} +1 -1
  113. package/bin/{chunk-kk42xhgz.js → chunk-zcdqsp1e.js} +1 -1
  114. package/bin/chunk-zej27b5c.js +2 -0
  115. package/bin/{chunk-axmd242s.js → chunk-zmjtv19e.js} +1 -1
  116. package/bin/{chunk-7e5z637e.js → chunk-zr11zfwc.js} +1 -1
  117. package/bin/{chunk-k6avge95.js → chunk-zz0522zr.js} +4 -4
  118. package/bin/shumai-app.html +1 -1
  119. package/bin/shumai-app.js +294 -293
  120. package/package.json +7 -7
  121. package/bin/chunk-0c67210c.js +0 -1
  122. package/bin/chunk-2z1pnt7h.js +0 -2
  123. package/bin/chunk-3vmapyk9.js +0 -1
  124. package/bin/chunk-886pnknh.js +0 -3
  125. package/bin/chunk-908pypkr.js +0 -1
  126. package/bin/chunk-952qwf17.js +0 -2
  127. package/bin/chunk-9a2tf0mh.js +0 -2
  128. package/bin/chunk-apfrw0wd.js +0 -3
  129. package/bin/chunk-batadmvr.js +0 -2
  130. package/bin/chunk-bvdvp192.js +0 -1
  131. package/bin/chunk-db1msmdh.js +0 -2
  132. package/bin/chunk-dkx3pmdz.js +0 -1
  133. package/bin/chunk-hacyjx1s.js +0 -1
  134. package/bin/chunk-he5nvmqw.js +0 -1
  135. package/bin/chunk-hyr1vtfp.js +0 -1
  136. package/bin/chunk-jh8q3885.js +0 -211
  137. package/bin/chunk-jzbrt2vk.js +0 -1
  138. package/bin/chunk-nqym3zbs.js +0 -1
  139. package/bin/chunk-sebbjvgv.css +0 -1
  140. package/bin/chunk-t8gv2ekj.js +0 -14
  141. package/bin/chunk-vm5tn0zm.js +0 -2
  142. package/bin/chunk-wmjp8dcm.js +0 -1
  143. package/bin/chunk-wy8dkyxj.js +0 -1
@@ -1,21 +1,21 @@
1
- import{ks,aa,at,O,P,dt,h,He,D,b,u,S,Z,t,o,K,L,B,Me,Qa,tn,A,I,ke,Po,nn,Re,E,h0,g0,Bm,A0,Dc,kg,vp,ce,Pt,yr,on,so,$t,ir,hr}from"./chunk-jh8q3885.js";import{va}from"./chunk-qs7855cz.js";import{Er}from"./chunk-ehpfg3km.js";import{si}from"./chunk-kmbjp5kp.js";import{Bi}from"./chunk-y20sbaz5.js";import{qi}from"./chunk-d7fwggt6.js";import{Ql}from"./chunk-gqr5hxhj.js";import{vn}from"./chunk-rmzcarv9.js";import{z,w,Oe}from"./chunk-qbqym9m6.js";var rm=w(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},me=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,s={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function C(y){if(y instanceof a)return new a(y.type,C(y.content),y.alias);else if(Array.isArray(y))return y.map(C);else return y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){if(!C.__id)Object.defineProperty(C,"__id",{value:++r});return C.__id},clone:function C(y,N){N=N||{};var T,v;switch(i.util.type(y)){case"Object":if(v=i.util.objId(y),N[v])return N[v];T={},N[v]=T;for(var R in y)if(y.hasOwnProperty(R))T[R]=C(y[R],N);return T;case"Array":if(v=i.util.objId(y),N[v])return N[v];return T=[],N[v]=T,y.forEach(function(F,k){T[k]=C(F,N)}),T;default:return y}},getLanguage:function(C){while(C){var y=n.exec(C.className);if(y)return y[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,y){C.className=C.className.replace(RegExp(n,"gi"),""),C.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(T){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(C){var y=document.getElementsByTagName("script");for(var N in y)if(y[N].src==C)return y[N]}return null}},isActive:function(C,y,N){var T="no-"+y;while(C){var v=C.classList;if(v.contains(y))return!0;if(v.contains(T))return!1;C=C.parentElement}return!!N}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(C,y){var N=i.util.clone(i.languages[C]);for(var T in y)N[T]=y[T];return N},insertBefore:function(C,y,N,T){T=T||i.languages;var v=T[C],R={};for(var F in v)if(v.hasOwnProperty(F)){if(F==y){for(var k in N)if(N.hasOwnProperty(k))R[k]=N[k]}if(!N.hasOwnProperty(F))R[F]=v[F]}var H=T[C];return T[C]=R,i.languages.DFS(i.languages,function(U,W){if(W===H&&U!=C)this[U]=R}),R},DFS:function C(y,N,T,v){v=v||{};var R=i.util.objId;for(var F in y)if(y.hasOwnProperty(F)){N.call(y,F,y[F],T||F);var k=y[F],H=i.util.type(k);if(H==="Object"&&!v[R(k)])v[R(k)]=!0,C(k,N,null,v);else if(H==="Array"&&!v[R(k)])v[R(k)]=!0,C(k,N,F,v)}}},plugins:{},highlightAll:function(C,y){i.highlightAllUnder(document,C,y)},highlightAllUnder:function(C,y,N){var T={callback:N,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),i.hooks.run("before-all-elements-highlight",T);for(var v=0,R;R=T.elements[v++];)i.highlightElement(R,y===!0,T.callback)},highlightElement:function(C,y,N){var T=i.util.getLanguage(C),v=i.languages[T];i.util.setLanguage(C,T);var R=C.parentElement;if(R&&R.nodeName.toLowerCase()==="pre")i.util.setLanguage(R,T);var F=C.textContent,k={element:C,language:T,grammar:v,code:F};function H(W){k.highlightedCode=W,i.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,i.hooks.run("after-highlight",k),i.hooks.run("complete",k),N&&N.call(k.element)}if(i.hooks.run("before-sanity-check",k),R=k.element.parentElement,R&&R.nodeName.toLowerCase()==="pre"&&!R.hasAttribute("tabindex"))R.setAttribute("tabindex","0");if(!k.code){i.hooks.run("complete",k),N&&N.call(k.element);return}if(i.hooks.run("before-highlight",k),!k.grammar){H(i.util.encode(k.code));return}if(y&&e.Worker){var U=new Worker(i.filename);U.onmessage=function(W){H(W.data)},U.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else H(i.highlight(k.code,k.grammar,k.language))},highlight:function(C,y,N){var T={code:C,grammar:y,language:N};if(i.hooks.run("before-tokenize",T),!T.grammar)throw Error('The language "'+T.language+'" has no grammar.');return T.tokens=i.tokenize(T.code,T.grammar),i.hooks.run("after-tokenize",T),a.stringify(i.util.encode(T.tokens),T.language)},tokenize:function(C,y){var N=y.rest;if(N){for(var T in N)y[T]=N[T];delete y.rest}var v=new d;return f(v,v.head,C),c(C,v,y,v.head,0),p(v)},hooks:{all:{},add:function(C,y){var N=i.hooks.all;N[C]=N[C]||[],N[C].push(y)},run:function(C,y){var N=i.hooks.all[C];if(!N||!N.length)return;for(var T=0,v;v=N[T++];)v(y)}},Token:a};e.Prism=i;function a(C,y,N,T){this.type=C,this.content=y,this.alias=N,this.length=(T||"").length|0}a.stringify=function C(y,N){if(typeof y=="string")return y;if(Array.isArray(y)){var T="";return y.forEach(function(H){T+=C(H,N)}),T}var v={type:y.type,content:C(y.content,N),tag:"span",classes:["token",y.type],attributes:{},language:N},R=y.alias;if(R)if(Array.isArray(R))Array.prototype.push.apply(v.classes,R);else v.classes.push(R);i.hooks.run("wrap",v);var F="";for(var k in v.attributes)F+=" "+k+'="'+(v.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+F+">"+v.content+"</"+v.tag+">"};function l(C,y,N,T){C.lastIndex=y;var v=C.exec(N);if(v&&T&&v[1]){var R=v[1].length;v.index+=R,v[0]=v[0].slice(R)}return v}function c(C,y,N,T,v,R){for(var F in N){if(!N.hasOwnProperty(F)||!N[F])continue;var k=N[F];k=Array.isArray(k)?k:[k];for(var H=0;H<k.length;++H){if(R&&R.cause==F+","+H)return;var U=k[H],W=U.inside,J=!!U.lookbehind,G=!!U.greedy,ne=U.alias;if(G&&!U.pattern.global){var ee=U.pattern.toString().match(/[imsuy]*$/)[0];U.pattern=RegExp(U.pattern.source,ee+"g")}var se=U.pattern||U;for(var V=T.next,fe=v;V!==y.tail;fe+=V.value.length,V=V.next){if(R&&fe>=R.reach)break;var Ce=V.value;if(y.length>C.length)return;if(Ce instanceof a)continue;var Ae=1,oe;if(G){if(oe=l(se,fe,C,J),!oe||oe.index>=C.length)break;var Ie=oe.index,ae=oe.index+oe[0].length,ue=fe;ue+=V.value.length;while(Ie>=ue)V=V.next,ue+=V.value.length;if(ue-=V.value.length,fe=ue,V.value instanceof a)continue;for(var we=V;we!==y.tail&&(ue<ae||typeof we.value==="string");we=we.next)Ae++,ue+=we.value.length;Ae--,Ce=C.slice(fe,ue),oe.index-=fe}else if(oe=l(se,0,Ce,J),!oe)continue;var Ie=oe.index,ht=oe[0],Qt=Ce.slice(0,Ie),Be=Ce.slice(Ie+ht.length),_t=fe+Ce.length;if(R&&_t>R.reach)R.reach=_t;var Vt=V.prev;if(Qt)Vt=f(y,Vt,Qt),fe+=Qt.length;g(y,Vt,Ae);var Tr=new a(F,W?i.tokenize(ht,W):ht,ne,ht);if(V=f(y,Vt,Tr),Be)f(y,V,Be);if(Ae>1){var er={cause:F+","+H,reach:_t};if(c(C,y,N,V.prev,fe,er),R&&er.reach>R.reach)R.reach=er.reach}}}}}function d(){var C={value:null,prev:null,next:null},y={value:null,prev:C,next:null};C.next=y,this.head=C,this.tail=y,this.length=0}function f(C,y,N){var T=y.next,v={value:N,prev:y,next:T};return y.next=v,T.prev=v,C.length++,v}function g(C,y,N){var T=y.next;for(var v=0;v<N&&T!==C.tail;v++)T=T.next;y.next=T,T.prev=y,C.length-=v}function p(C){var y=[],N=C.head.next;while(N!==C.tail)y.push(N.value),N=N.next;return y}if(!e.document){if(!e.addEventListener)return i;if(!i.disableWorkerMessageHandler)e.addEventListener("message",function(C){var y=JSON.parse(C.data),{language:N,code:T,immediateClose:v}=y;if(e.postMessage(i.highlight(T,i.languages[N],N)),v)e.close()},!1);return i}var m=i.util.currentScript();if(m){if(i.filename=m.src,m.hasAttribute("data-manual"))i.manual=!0}function _(){if(!i.manual)i.highlightAll()}if(!i.manual){var x=document.readyState;if(x==="loading"||x==="interactive"&&m&&m.defer)document.addEventListener("DOMContentLoaded",_);else if(window.requestAnimationFrame)window.requestAnimationFrame(_);else window.setTimeout(_,16)}return i}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=me;if(typeof global<"u")global.Prism=me;me.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]};me.languages.markup.tag.inside["attr-value"].inside.entity=me.languages.markup.entity;me.languages.markup.doctype.inside["internal-subset"].inside=me.languages.markup;me.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&amp;/,"&")});Object.defineProperty(me.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:me.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:me.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},me.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(me.languages.markup.tag,"addAttribute",{value:function(e,n){me.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\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:[n,"language-"+n],inside:me.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});me.languages.html=me.languages.markup;me.languages.mathml=me.languages.markup;me.languages.svg=me.languages.markup;me.languages.xml=me.languages.extend("markup",{});me.languages.ssml=me.languages.xml;me.languages.atom=me.languages.xml;me.languages.rss=me.languages.xml;(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.tag.addAttribute("style","css")})(me);me.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:/[{}[\];(),.:]/};me.languages.javascript=me.languages.extend("clike",{"class-name":[me.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}|\?\?=?|\?\.?|[~:]/});me.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;me.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:me.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:me.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:me.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:me.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:me.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});me.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:me.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"}});me.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(me.languages.markup)me.languages.markup.tag.addInlined("script","javascript"),me.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");me.languages.js=me.languages.javascript;(function(){if(typeof me>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",n=function(m,_){return"✖ Error "+m+" while fetching file: "+_},r="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},i="data-src-status",a="loading",l="loaded",c="failed",d="pre[data-src]:not(["+i+'="'+l+'"]):not(['+i+'="'+a+'"])';function f(m,_,x){var C=new XMLHttpRequest;C.open("GET",m,!0),C.onreadystatechange=function(){if(C.readyState==4)if(C.status<400&&C.responseText)_(C.responseText);else if(C.status>=400)x(n(C.status,C.statusText));else x(r)},C.send(null)}function g(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var x=Number(_[1]),C=_[2],y=_[3];if(!C)return[x,x];if(!y)return[x,void 0];return[x,Number(y)]}return}me.hooks.add("before-highlightall",function(m){m.selector+=", "+d}),me.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(d)){m.code="",_.setAttribute(i,a);var x=_.appendChild(document.createElement("CODE"));x.textContent=e;var C=_.getAttribute("data-src"),y=m.language;if(y==="none"){var N=(/\.(\w+)$/.exec(C)||[,"none"])[1];y=s[N]||N}me.util.setLanguage(x,y),me.util.setLanguage(_,y);var T=me.plugins.autoloader;if(T)T.loadLanguages(y);f(C,function(v){_.setAttribute(i,l);var R=g(_.getAttribute("data-range"));if(R){var F=v.split(/\r\n?|\n/g),k=R[0],H=R[1]==null?F.length:R[1];if(k<0)k+=F.length;if(k=Math.max(0,Math.min(k-1,F.length)),H<0)H+=F.length;if(H=Math.max(0,Math.min(H,F.length)),v=F.slice(k,H).join(`
2
- `),!_.hasAttribute("data-start"))_.setAttribute("data-start",String(k+1))}x.textContent=v,me.highlightElement(x)},function(v){_.setAttribute(i,c),x.textContent=v})}}),me.plugins.fileHighlight={highlight:function(_){var x=(_||document).querySelectorAll(d);for(var C=0,y;y=x[C++];)me.highlightElement(y)}};var p=!1;me.fileHighlight=function(){if(!p)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0;me.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var RO=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Pm=I("bold",RO);var MO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Km=I("heading-1",MO);var DO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],zm=I("heading-2",DO);var $O=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],Um=I("heading-3",$O);var wO=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],Hm=I("italic",wO);var kO=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Wm=I("list-ordered",kO);var IO=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Gm=I("quote",IO);var LO=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],jm=I("redo-2",LO);var FO=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],Ym=I("remove-formatting",FO);var PO=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],Vm=I("strikethrough",PO);var BO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Xm=I("underline",BO);var KO=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],qm=I("undo-2",KO);S();S();S();S();var qd={};Oe(qd,{LexicalComposerContext:()=>Jm,createLexicalComposerContext:()=>zO,useLexicalComposerContext:()=>UO});var Jm=at(null);function zO(e,n){let r=null;return e!=null&&(r=e[1]),{getTheme:function(){return n!=null?n:r!=null?r.getTheme():null}}}function UO(){let e=dt(Jm);return e==null&&function(n,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",n);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${n}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}var Jd=qd,{LexicalComposerContext:Zm,createLexicalComposerContext:Qm,useLexicalComposerContext:st}=Jd;var Pg={};Oe(Pg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>Za,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>Fr,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Ka,$createLineBreakNode:()=>Bc,$createNodeSelection:()=>bc,$createParagraphNode:()=>Mn,$createPoint:()=>xo,$createRangeSelection:()=>SC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>lC,$createTextNode:()=>Cn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>br,$formatText:()=>fC,$fullReconcile:()=>bC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>fi,$getAdjacentNode:()=>GC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>Fo,$getCaretRange:()=>Lr,$getCaretRangeInDirection:()=>Lg,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>cr,$getChildCaretAtIndex:()=>by,$getChildCaretOrSelf:()=>yy,$getCollapsedCaretRange:()=>Sy,$getCommonAncestor:()=>Ic,$getCommonAncestorResultBranchOrder:()=>Ig,$getDOMSlot:()=>$n,$getDOMTextNode:()=>ar,$getDocument:()=>Sn,$getEditor:()=>yo,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>XC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>Dn,$getSelection:()=>ze,$getSiblingCaret:()=>St,$getSlot:()=>wr,$getSlotFrame:()=>hy,$getSlotHost:()=>Hn,$getSlotNameWithinHost:()=>py,$getSlotNames:()=>jn,$getState:()=>mc,$getStateChange:()=>yA,$getTextContent:()=>aR,$getTextNodeOffset:()=>_o,$getTextPointCaret:()=>Ir,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Pa,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>Oy,$insertNodes:()=>iR,$isBlockElementNode:()=>CC,$isChildCaret:()=>Yn,$isDecoratorNode:()=>qe,$isEditorState:()=>fR,$isElementDOMSlot:()=>iy,$isElementNode:()=>Y,$isExtendableTextPointCaret:()=>Ty,$isInlineElementOrDecoratorNode:()=>VC,$isInlineFormattable:()=>Tc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>Lo,$isNodeCaret:()=>tM,$isNodeSelection:()=>gi,$isParagraphNode:()=>wC,$isRangeSelection:()=>ge,$isRootNode:()=>Kt,$isRootOrShadowRoot:()=>At,$isSelectionCapturedInDecoratorInput:()=>zc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>kr,$isSlotChild:()=>$r,$isSlotHost:()=>$o,$isTabNode:()=>sg,$isTextNode:()=>te,$isTextPointCaret:()=>mo,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Gn,$isTokenOrTab:()=>Fa,$markSlotEditable:()=>dy,$needsBlockCursorBeside:()=>gc,$nodesOfType:()=>kR,$normalizeCaret:()=>wo,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>YC,$parseSerializedNode:()=>uR,$removeFromParent:()=>Un,$removeSlot:()=>xy,$removeTextFromCaretRange:()=>Ey,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Bt,$setDirectionFromDOM:()=>ly,$setFormatFromDOM:()=>cy,$setPointFromCaret:()=>Ua,$setSelection:()=>rn,$setSelectionFromCaretRange:()=>Ny,$setSlot:()=>Og,$setState:()=>SA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>vy,$splitNode:()=>PR,$updateDOMSelection:()=>NC,$updateRangeSelectionFromCaretRange:()=>ya,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>jx,CAN_REDO_COMMAND:()=>IA,CAN_UNDO_COMMAND:()=>LA,CAN_USE_BEFORE_INPUT:()=>Sa,CAN_USE_DOM:()=>Xn,CLEAR_EDITOR_COMMAND:()=>wA,CLEAR_HISTORY_COMMAND:()=>kA,CLICK_COMMAND:()=>Ax,COLLABORATION_TAG:()=>tC,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>TR,COMMAND_PRIORITY_BEFORE_EDITOR:()=>yR,COMMAND_PRIORITY_BEFORE_HIGH:()=>ER,COMMAND_PRIORITY_BEFORE_LOW:()=>SR,COMMAND_PRIORITY_BEFORE_NORMAL:()=>NR,COMMAND_PRIORITY_CRITICAL:()=>CR,COMMAND_PRIORITY_EDITOR:()=>ti,COMMAND_PRIORITY_HIGH:()=>xR,COMMAND_PRIORITY_LOW:()=>mR,COMMAND_PRIORITY_NORMAL:()=>_R,COMPOSITION_END_COMMAND:()=>Xf,COMPOSITION_END_TAG:()=>Ec,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>rC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ai,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>VA,DEFAULT_EDITOR_DOM_CONFIG:()=>La,DELETE_CHARACTER_COMMAND:()=>Ma,DELETE_LINE_COMMAND:()=>$a,DELETE_WORD_COMMAND:()=>Da,DRAGEND_COMMAND:()=>Hx,DRAGOVER_COMMAND:()=>Ux,DRAGSTART_COMMAND:()=>zx,DROP_COMMAND:()=>Kx,DecoratorNode:()=>Pc,ElementNode:()=>Io,FOCUS_COMMAND:()=>Gx,FORMAT_ELEMENT_COMMAND:()=>$A,FORMAT_TEXT_COMMAND:()=>vr,HISTORIC_TAG:()=>GA,HISTORY_MERGE_TAG:()=>uc,HISTORY_PUSH_TAG:()=>jA,INDENT_CONTENT_COMMAND:()=>MA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>xa,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>RA,INTERNAL_$isBlock:()=>xn,IS_ALL_FORMATTING:()=>eA,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Na,IS_APPLE:()=>Kn,IS_APPLE_WEBKIT:()=>Wa,IS_BOLD:()=>YO,IS_CHROME:()=>Bf,IS_CODE:()=>JO,IS_FIREFOX:()=>ko,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>gs,IS_ITALIC:()=>VO,IS_SAFARI:()=>Ha,IS_STRIKETHROUGH:()=>XO,IS_SUBSCRIPT:()=>ZO,IS_SUPERSCRIPT:()=>QO,IS_UNDERLINE:()=>qO,KEY_ARROW_DOWN_COMMAND:()=>kx,KEY_ARROW_LEFT_COMMAND:()=>Dx,KEY_ARROW_RIGHT_COMMAND:()=>Rx,KEY_ARROW_UP_COMMAND:()=>wx,KEY_BACKSPACE_COMMAND:()=>Lx,KEY_DELETE_COMMAND:()=>Px,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>xc,KEY_ESCAPE_COMMAND:()=>Fx,KEY_MODIFIER_COMMAND:()=>Yx,KEY_SPACE_COMMAND:()=>Ix,KEY_TAB_COMMAND:()=>Bx,LineBreakNode:()=>Va,MOVE_TO_END:()=>Mx,MOVE_TO_START:()=>$x,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>gA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>DA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>YA,ParagraphNode:()=>Xa,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>ac,RootNode:()=>ja,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>OA,SELECT_ALL_COMMAND:()=>Wx,SET_TEXT_FORMAT_COMMAND:()=>AA,SKIP_COLLAB_TAG:()=>XA,SKIP_DOM_SELECTION_TAG:()=>oC,SKIP_SCROLL_INTO_VIEW_TAG:()=>nC,SKIP_SELECTION_FOCUS_TAG:()=>Nc,TEXT_TYPE_TO_FORMAT:()=>Xt,TabNode:()=>Ga,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>WA,configExtension:()=>uM,createCommand:()=>Ee,createEditor:()=>bR,createRefCountedRegistry:()=>Vx,createSharedNodeState:()=>xx,createState:()=>CA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>ZC,flipDirection:()=>Pr,getActiveElement:()=>kc,getActiveElementDeep:()=>di,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>mi,getDOMOwnerDocument:()=>Hc,getDOMSelection:()=>qn,getDOMSelectionFromTarget:()=>qC,getDOMSelectionPoints:()=>Vn,getDOMSelectionRange:()=>ey,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>JC,getDOMTextNode:()=>FC,getDeclaredSlots:()=>my,getEditorPropertyFromDOMNode:()=>Ja,getNearestEditorFromDOMNode:()=>fs,getParentElement:()=>Es,getRegisteredNode:()=>Kc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>QC,getStaticNodeConfig:()=>el,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>IC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>Mr,isDOMCapturingSelection:()=>Ba,isDOMDocumentNode:()=>pi,isDOMNode:()=>_i,isDOMShadowRoot:()=>lr,isDOMTextNode:()=>Co,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>ry,isExactShortcutMatch:()=>Qe,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>Ct,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>sy,isLastChildInBlockNode:()=>$C,isLexicalEditor:()=>Uc,isModifierMatch:()=>WC,isOnlyChildInBlockNode:()=>DC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>qa,iterStaticNodeConfigChain:()=>tl,makeStepwiseIterator:()=>$g,mergeRegister:()=>Fg,mountSlotContainer:()=>WR,normalizeClassNames:()=>ol,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>JA,setDOMUnmanaged:()=>uy,setNodeIndentFromDOM:()=>ay,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>Dr,tokenizeRawText:()=>EC,unmountSlotContainer:()=>GR});function q(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lx(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);r.search=s.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Xn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,HO=Xn&&"documentMode"in document?document.documentMode:null,Kn=Xn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ko=Xn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Sa=!(!Xn||!("InputEvent"in window)||HO)&&"getTargetRanges"in new window.InputEvent("input"),gs=Xn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=Xn&&/Android/.test(navigator.userAgent),Ha=Xn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=Xn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Na=Xn&&Pf&&Bf,Wa=Xn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Kn&&!Bf,WO=0,GO=1,jO=2,YO=1,VO=2,XO=4,qO=8,JO=16,ZO=32,QO=64,Kf=128,eA=2047,tA=1,nA=2,oA=3,rA=4,sA=5,iA=6,Ea=Ha||gs||Wa?" ":"​",ds=`
1
+ import{Rs,ia,at,O,P,dt,h,He,D,b,u,S,L,t,o,K,Z,B,Me,Qa,tn,A,I,ke,Po,nn,Re,E,b0,v0,Um,w0,Dc,Pg,xp,ce,Pt,yr,on,so,$t,lr,gr}from"./chunk-q6jsw0rr.js";import{wa}from"./chunk-rkafv27g.js";import{Er}from"./chunk-xznabrt2.js";import{si}from"./chunk-an6nsq1t.js";import{Bi}from"./chunk-b0rjvx5g.js";import{qi}from"./chunk-4m8gk79m.js";import{Ql}from"./chunk-fk712d68.js";import{vn}from"./chunk-8sf106rq.js";import{z,w,Oe}from"./chunk-yqvhgtez.js";var rm=w(function(pH,Pd){var iI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},me=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,s={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function C(y){if(y instanceof a)return new a(y.type,C(y.content),y.alias);else if(Array.isArray(y))return y.map(C);else return y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){if(!C.__id)Object.defineProperty(C,"__id",{value:++r});return C.__id},clone:function C(y,N){N=N||{};var T,v;switch(i.util.type(y)){case"Object":if(v=i.util.objId(y),N[v])return N[v];T={},N[v]=T;for(var R in y)if(y.hasOwnProperty(R))T[R]=C(y[R],N);return T;case"Array":if(v=i.util.objId(y),N[v])return N[v];return T=[],N[v]=T,y.forEach(function(F,k){T[k]=C(F,N)}),T;default:return y}},getLanguage:function(C){while(C){var y=n.exec(C.className);if(y)return y[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,y){C.className=C.className.replace(RegExp(n,"gi"),""),C.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(T){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(C){var y=document.getElementsByTagName("script");for(var N in y)if(y[N].src==C)return y[N]}return null}},isActive:function(C,y,N){var T="no-"+y;while(C){var v=C.classList;if(v.contains(y))return!0;if(v.contains(T))return!1;C=C.parentElement}return!!N}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(C,y){var N=i.util.clone(i.languages[C]);for(var T in y)N[T]=y[T];return N},insertBefore:function(C,y,N,T){T=T||i.languages;var v=T[C],R={};for(var F in v)if(v.hasOwnProperty(F)){if(F==y){for(var k in N)if(N.hasOwnProperty(k))R[k]=N[k]}if(!N.hasOwnProperty(F))R[F]=v[F]}var H=T[C];return T[C]=R,i.languages.DFS(i.languages,function(U,W){if(W===H&&U!=C)this[U]=R}),R},DFS:function C(y,N,T,v){v=v||{};var R=i.util.objId;for(var F in y)if(y.hasOwnProperty(F)){N.call(y,F,y[F],T||F);var k=y[F],H=i.util.type(k);if(H==="Object"&&!v[R(k)])v[R(k)]=!0,C(k,N,null,v);else if(H==="Array"&&!v[R(k)])v[R(k)]=!0,C(k,N,F,v)}}},plugins:{},highlightAll:function(C,y){i.highlightAllUnder(document,C,y)},highlightAllUnder:function(C,y,N){var T={callback:N,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),i.hooks.run("before-all-elements-highlight",T);for(var v=0,R;R=T.elements[v++];)i.highlightElement(R,y===!0,T.callback)},highlightElement:function(C,y,N){var T=i.util.getLanguage(C),v=i.languages[T];i.util.setLanguage(C,T);var R=C.parentElement;if(R&&R.nodeName.toLowerCase()==="pre")i.util.setLanguage(R,T);var F=C.textContent,k={element:C,language:T,grammar:v,code:F};function H(W){k.highlightedCode=W,i.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,i.hooks.run("after-highlight",k),i.hooks.run("complete",k),N&&N.call(k.element)}if(i.hooks.run("before-sanity-check",k),R=k.element.parentElement,R&&R.nodeName.toLowerCase()==="pre"&&!R.hasAttribute("tabindex"))R.setAttribute("tabindex","0");if(!k.code){i.hooks.run("complete",k),N&&N.call(k.element);return}if(i.hooks.run("before-highlight",k),!k.grammar){H(i.util.encode(k.code));return}if(y&&e.Worker){var U=new Worker(i.filename);U.onmessage=function(W){H(W.data)},U.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else H(i.highlight(k.code,k.grammar,k.language))},highlight:function(C,y,N){var T={code:C,grammar:y,language:N};if(i.hooks.run("before-tokenize",T),!T.grammar)throw Error('The language "'+T.language+'" has no grammar.');return T.tokens=i.tokenize(T.code,T.grammar),i.hooks.run("after-tokenize",T),a.stringify(i.util.encode(T.tokens),T.language)},tokenize:function(C,y){var N=y.rest;if(N){for(var T in N)y[T]=N[T];delete y.rest}var v=new d;return f(v,v.head,C),c(C,v,y,v.head,0),p(v)},hooks:{all:{},add:function(C,y){var N=i.hooks.all;N[C]=N[C]||[],N[C].push(y)},run:function(C,y){var N=i.hooks.all[C];if(!N||!N.length)return;for(var T=0,v;v=N[T++];)v(y)}},Token:a};e.Prism=i;function a(C,y,N,T){this.type=C,this.content=y,this.alias=N,this.length=(T||"").length|0}a.stringify=function C(y,N){if(typeof y=="string")return y;if(Array.isArray(y)){var T="";return y.forEach(function(H){T+=C(H,N)}),T}var v={type:y.type,content:C(y.content,N),tag:"span",classes:["token",y.type],attributes:{},language:N},R=y.alias;if(R)if(Array.isArray(R))Array.prototype.push.apply(v.classes,R);else v.classes.push(R);i.hooks.run("wrap",v);var F="";for(var k in v.attributes)F+=" "+k+'="'+(v.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+F+">"+v.content+"</"+v.tag+">"};function l(C,y,N,T){C.lastIndex=y;var v=C.exec(N);if(v&&T&&v[1]){var R=v[1].length;v.index+=R,v[0]=v[0].slice(R)}return v}function c(C,y,N,T,v,R){for(var F in N){if(!N.hasOwnProperty(F)||!N[F])continue;var k=N[F];k=Array.isArray(k)?k:[k];for(var H=0;H<k.length;++H){if(R&&R.cause==F+","+H)return;var U=k[H],W=U.inside,J=!!U.lookbehind,G=!!U.greedy,ne=U.alias;if(G&&!U.pattern.global){var ee=U.pattern.toString().match(/[imsuy]*$/)[0];U.pattern=RegExp(U.pattern.source,ee+"g")}var se=U.pattern||U;for(var V=T.next,fe=v;V!==y.tail;fe+=V.value.length,V=V.next){if(R&&fe>=R.reach)break;var Ce=V.value;if(y.length>C.length)return;if(Ce instanceof a)continue;var Ae=1,oe;if(G){if(oe=l(se,fe,C,J),!oe||oe.index>=C.length)break;var Ie=oe.index,ae=oe.index+oe[0].length,ue=fe;ue+=V.value.length;while(Ie>=ue)V=V.next,ue+=V.value.length;if(ue-=V.value.length,fe=ue,V.value instanceof a)continue;for(var we=V;we!==y.tail&&(ue<ae||typeof we.value==="string");we=we.next)Ae++,ue+=we.value.length;Ae--,Ce=C.slice(fe,ue),oe.index-=fe}else if(oe=l(se,0,Ce,J),!oe)continue;var Ie=oe.index,ht=oe[0],Qt=Ce.slice(0,Ie),Be=Ce.slice(Ie+ht.length),_t=fe+Ce.length;if(R&&_t>R.reach)R.reach=_t;var Vt=V.prev;if(Qt)Vt=f(y,Vt,Qt),fe+=Qt.length;g(y,Vt,Ae);var Tr=new a(F,W?i.tokenize(ht,W):ht,ne,ht);if(V=f(y,Vt,Tr),Be)f(y,V,Be);if(Ae>1){var er={cause:F+","+H,reach:_t};if(c(C,y,N,V.prev,fe,er),R&&er.reach>R.reach)R.reach=er.reach}}}}}function d(){var C={value:null,prev:null,next:null},y={value:null,prev:C,next:null};C.next=y,this.head=C,this.tail=y,this.length=0}function f(C,y,N){var T=y.next,v={value:N,prev:y,next:T};return y.next=v,T.prev=v,C.length++,v}function g(C,y,N){var T=y.next;for(var v=0;v<N&&T!==C.tail;v++)T=T.next;y.next=T,T.prev=y,C.length-=v}function p(C){var y=[],N=C.head.next;while(N!==C.tail)y.push(N.value),N=N.next;return y}if(!e.document){if(!e.addEventListener)return i;if(!i.disableWorkerMessageHandler)e.addEventListener("message",function(C){var y=JSON.parse(C.data),{language:N,code:T,immediateClose:v}=y;if(e.postMessage(i.highlight(T,i.languages[N],N)),v)e.close()},!1);return i}var m=i.util.currentScript();if(m){if(i.filename=m.src,m.hasAttribute("data-manual"))i.manual=!0}function _(){if(!i.manual)i.highlightAll()}if(!i.manual){var x=document.readyState;if(x==="loading"||x==="interactive"&&m&&m.defer)document.addEventListener("DOMContentLoaded",_);else if(window.requestAnimationFrame)window.requestAnimationFrame(_);else window.setTimeout(_,16)}return i}(iI);if(typeof Pd<"u"&&Pd.exports)Pd.exports=me;if(typeof global<"u")global.Prism=me;me.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]};me.languages.markup.tag.inside["attr-value"].inside.entity=me.languages.markup.entity;me.languages.markup.doctype.inside["internal-subset"].inside=me.languages.markup;me.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&amp;/,"&")});Object.defineProperty(me.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:me.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:me.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},me.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(me.languages.markup.tag,"addAttribute",{value:function(e,n){me.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\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:[n,"language-"+n],inside:me.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});me.languages.html=me.languages.markup;me.languages.mathml=me.languages.markup;me.languages.svg=me.languages.markup;me.languages.xml=me.languages.extend("markup",{});me.languages.ssml=me.languages.xml;me.languages.atom=me.languages.xml;me.languages.rss=me.languages.xml;(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.tag.addAttribute("style","css")})(me);me.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:/[{}[\];(),.:]/};me.languages.javascript=me.languages.extend("clike",{"class-name":[me.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}|\?\?=?|\?\.?|[~:]/});me.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;me.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:me.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:me.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:me.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:me.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:me.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});me.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:me.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"}});me.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(me.languages.markup)me.languages.markup.tag.addInlined("script","javascript"),me.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");me.languages.js=me.languages.javascript;(function(){if(typeof me>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var e="Loading…",n=function(m,_){return"✖ Error "+m+" while fetching file: "+_},r="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},i="data-src-status",a="loading",l="loaded",c="failed",d="pre[data-src]:not(["+i+'="'+l+'"]):not(['+i+'="'+a+'"])';function f(m,_,x){var C=new XMLHttpRequest;C.open("GET",m,!0),C.onreadystatechange=function(){if(C.readyState==4)if(C.status<400&&C.responseText)_(C.responseText);else if(C.status>=400)x(n(C.status,C.statusText));else x(r)},C.send(null)}function g(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var x=Number(_[1]),C=_[2],y=_[3];if(!C)return[x,x];if(!y)return[x,void 0];return[x,Number(y)]}return}me.hooks.add("before-highlightall",function(m){m.selector+=", "+d}),me.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(d)){m.code="",_.setAttribute(i,a);var x=_.appendChild(document.createElement("CODE"));x.textContent=e;var C=_.getAttribute("data-src"),y=m.language;if(y==="none"){var N=(/\.(\w+)$/.exec(C)||[,"none"])[1];y=s[N]||N}me.util.setLanguage(x,y),me.util.setLanguage(_,y);var T=me.plugins.autoloader;if(T)T.loadLanguages(y);f(C,function(v){_.setAttribute(i,l);var R=g(_.getAttribute("data-range"));if(R){var F=v.split(/\r\n?|\n/g),k=R[0],H=R[1]==null?F.length:R[1];if(k<0)k+=F.length;if(k=Math.max(0,Math.min(k-1,F.length)),H<0)H+=F.length;if(H=Math.max(0,Math.min(H,F.length)),v=F.slice(k,H).join(`
2
+ `),!_.hasAttribute("data-start"))_.setAttribute("data-start",String(k+1))}x.textContent=v,me.highlightElement(x)},function(v){_.setAttribute(i,c),x.textContent=v})}}),me.plugins.fileHighlight={highlight:function(_){var x=(_||document).querySelectorAll(d);for(var C=0,y;y=x[C++];)me.highlightElement(y)}};var p=!1;me.fileHighlight=function(){if(!p)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0;me.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var RO=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Pm=I("bold",RO);var MO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Bm=I("heading-1",MO);var DO=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],Km=I("heading-2",DO);var $O=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],zm=I("heading-3",$O);var wO=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],Hm=I("italic",wO);var kO=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Wm=I("list-ordered",kO);var IO=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Gm=I("quote",IO);var LO=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],jm=I("redo-2",LO);var FO=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],Ym=I("remove-formatting",FO);var PO=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],Vm=I("strikethrough",PO);var BO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Xm=I("underline",BO);var KO=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],qm=I("undo-2",KO);S();S();S();S();var qd={};Oe(qd,{LexicalComposerContext:()=>Jm,createLexicalComposerContext:()=>zO,useLexicalComposerContext:()=>UO});var Jm=at(null);function zO(e,n){let r=null;return e!=null&&(r=e[1]),{getTheme:function(){return n!=null?n:r!=null?r.getTheme():null}}}function UO(){let e=dt(Jm);return e==null&&function(n,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",n);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${n}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}var Jd=qd,{LexicalComposerContext:Zm,createLexicalComposerContext:Qm,useLexicalComposerContext:st}=Jd;var Fg={};Oe(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>Za,$assumeActiveEditor:()=>cR,$caretFromPoint:()=>Fr,$caretRangeFromSelection:()=>Ff,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>YR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>XR,$createChildrenArray:()=>Ka,$createLineBreakNode:()=>Bc,$createNodeSelection:()=>bc,$createParagraphNode:()=>Mn,$createPoint:()=>xo,$createRangeSelection:()=>SC,$createRangeSelectionFromDom:()=>sR,$createTabNode:()=>lC,$createTextNode:()=>Cn,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>br,$formatText:()=>fC,$fullReconcile:()=>bC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>fi,$getAdjacentNode:()=>GC,$getAdjacentSiblingOrParentSiblingCaret:()=>iM,$getCaretInDirection:()=>Fo,$getCaretRange:()=>Lr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Rf,$getChildCaret:()=>cr,$getChildCaretAtIndex:()=>by,$getChildCaretOrSelf:()=>yy,$getCollapsedCaretRange:()=>Sy,$getCommonAncestor:()=>Ic,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>$n,$getDOMTextNode:()=>ir,$getDocument:()=>Sn,$getEditor:()=>yo,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>XC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>Dn,$getSelection:()=>ze,$getSiblingCaret:()=>St,$getSlot:()=>wr,$getSlotFrame:()=>hy,$getSlotHost:()=>Hn,$getSlotNameWithinHost:()=>py,$getSlotNames:()=>jn,$getState:()=>mc,$getStateChange:()=>yA,$getTextContent:()=>aR,$getTextNodeOffset:()=>_o,$getTextPointCaret:()=>Ir,$getTextPointCaretSlice:()=>Lf,$getWritableNodeState:()=>Wf,$hasAncestor:()=>Pa,$hasUpdateTag:()=>IR,$insertNodeToNearestRootAtCaret:()=>Oy,$insertNodes:()=>iR,$isBlockElementNode:()=>CC,$isChildCaret:()=>Yn,$isDecoratorNode:()=>qe,$isEditorState:()=>fR,$isElementDOMSlot:()=>iy,$isElementNode:()=>Y,$isExtendableTextPointCaret:()=>Ty,$isInlineElementOrDecoratorNode:()=>VC,$isInlineFormattable:()=>Tc,$isLeafNode:()=>DR,$isLexicalNode:()=>og,$isLineBreakNode:()=>Lo,$isNodeCaret:()=>tM,$isNodeSelection:()=>gi,$isParagraphNode:()=>wC,$isRangeSelection:()=>ge,$isRootNode:()=>Kt,$isRootOrShadowRoot:()=>At,$isSelectionCapturedInDecoratorInput:()=>zc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>kr,$isSlotChild:()=>$r,$isSlotHost:()=>$o,$isTabNode:()=>sg,$isTextNode:()=>te,$isTextPointCaret:()=>mo,$isTextPointCaretSlice:()=>sM,$isTokenOrSegmented:()=>Gn,$isTokenOrTab:()=>Fa,$markSlotEditable:()=>dy,$needsBlockCursorBeside:()=>gc,$nodesOfType:()=>kR,$normalizeCaret:()=>wo,$normalizeSelection__EXPERIMENTAL:()=>ni,$onUpdate:()=>YC,$parseSerializedNode:()=>uR,$removeFromParent:()=>Un,$removeSlot:()=>xy,$removeTextFromCaretRange:()=>Ey,$rewindSiblingCaret:()=>Ts,$selectAll:()=>wR,$setCompositionKey:()=>Bt,$setDirectionFromDOM:()=>ly,$setFormatFromDOM:()=>cy,$setPointFromCaret:()=>Ua,$setSelection:()=>rn,$setSelectionFromCaretRange:()=>Ny,$setSlot:()=>Og,$setState:()=>SA,$setTextFormat:()=>oR,$splitAtPointCaretNext:()=>vy,$splitNode:()=>PR,$updateDOMSelection:()=>NC,$updateRangeSelectionFromCaretRange:()=>ya,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>jf,BLUR_COMMAND:()=>jx,CAN_REDO_COMMAND:()=>IA,CAN_UNDO_COMMAND:()=>LA,CAN_USE_BEFORE_INPUT:()=>Sa,CAN_USE_DOM:()=>Xn,CLEAR_EDITOR_COMMAND:()=>wA,CLEAR_HISTORY_COMMAND:()=>kA,CLICK_COMMAND:()=>Ax,COLLABORATION_TAG:()=>tC,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>TR,COMMAND_PRIORITY_BEFORE_EDITOR:()=>yR,COMMAND_PRIORITY_BEFORE_HIGH:()=>ER,COMMAND_PRIORITY_BEFORE_LOW:()=>SR,COMMAND_PRIORITY_BEFORE_NORMAL:()=>NR,COMMAND_PRIORITY_CRITICAL:()=>CR,COMMAND_PRIORITY_EDITOR:()=>ti,COMMAND_PRIORITY_HIGH:()=>xR,COMMAND_PRIORITY_LOW:()=>mR,COMMAND_PRIORITY_NORMAL:()=>_R,COMPOSITION_END_COMMAND:()=>Xf,COMPOSITION_END_TAG:()=>Ec,COMPOSITION_START_COMMAND:()=>Vf,COMPOSITION_START_TAG:()=>rC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ai,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>VA,DEFAULT_EDITOR_DOM_CONFIG:()=>La,DELETE_CHARACTER_COMMAND:()=>Ra,DELETE_LINE_COMMAND:()=>Da,DELETE_WORD_COMMAND:()=>Ma,DRAGEND_COMMAND:()=>Hx,DRAGOVER_COMMAND:()=>Ux,DRAGSTART_COMMAND:()=>zx,DROP_COMMAND:()=>Kx,DecoratorNode:()=>Pc,ElementNode:()=>Io,FOCUS_COMMAND:()=>Gx,FORMAT_ELEMENT_COMMAND:()=>$A,FORMAT_TEXT_COMMAND:()=>vr,HISTORIC_TAG:()=>GA,HISTORY_MERGE_TAG:()=>uc,HISTORY_PUSH_TAG:()=>jA,INDENT_CONTENT_COMMAND:()=>MA,INPUT_COMMAND:()=>Yf,INSERT_LINE_BREAK_COMMAND:()=>xa,INSERT_PARAGRAPH_COMMAND:()=>Nf,INSERT_TAB_COMMAND:()=>RA,INTERNAL_$isBlock:()=>xn,IS_ALL_FORMATTING:()=>eA,IS_ANDROID:()=>Pf,IS_ANDROID_CHROME:()=>Na,IS_APPLE:()=>Kn,IS_APPLE_WEBKIT:()=>Wa,IS_BOLD:()=>YO,IS_CHROME:()=>Bf,IS_CODE:()=>JO,IS_FIREFOX:()=>ko,IS_HIGHLIGHT:()=>Kf,IS_IOS:()=>gs,IS_ITALIC:()=>VO,IS_SAFARI:()=>Ha,IS_STRIKETHROUGH:()=>XO,IS_SUBSCRIPT:()=>ZO,IS_SUPERSCRIPT:()=>QO,IS_UNDERLINE:()=>qO,KEY_ARROW_DOWN_COMMAND:()=>kx,KEY_ARROW_LEFT_COMMAND:()=>Dx,KEY_ARROW_RIGHT_COMMAND:()=>Rx,KEY_ARROW_UP_COMMAND:()=>wx,KEY_BACKSPACE_COMMAND:()=>Lx,KEY_DELETE_COMMAND:()=>Px,KEY_DOWN_COMMAND:()=>Qf,KEY_ENTER_COMMAND:()=>xc,KEY_ESCAPE_COMMAND:()=>Fx,KEY_MODIFIER_COMMAND:()=>Yx,KEY_SPACE_COMMAND:()=>Ix,KEY_TAB_COMMAND:()=>Bx,LineBreakNode:()=>Va,MOVE_TO_END:()=>Mx,MOVE_TO_START:()=>$x,NODE_STATE_DIRECT:()=>ff,NODE_STATE_KEY:()=>gA,NODE_STATE_LATEST:()=>gf,OUTDENT_CONTENT_COMMAND:()=>DA,PASTE_COMMAND:()=>qf,PASTE_TAG:()=>YA,ParagraphNode:()=>Xa,REDO_COMMAND:()=>Zf,REMOVE_TEXT_COMMAND:()=>ac,RootNode:()=>ja,SELECTION_CHANGE_COMMAND:()=>Gf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>OA,SELECT_ALL_COMMAND:()=>Wx,SET_TEXT_FORMAT_COMMAND:()=>AA,SKIP_COLLAB_TAG:()=>XA,SKIP_DOM_SELECTION_TAG:()=>oC,SKIP_SCROLL_INTO_VIEW_TAG:()=>nC,SKIP_SELECTION_FOCUS_TAG:()=>Nc,TEXT_TYPE_TO_FORMAT:()=>Xt,TabNode:()=>Ga,TextNode:()=>ms,UNDO_COMMAND:()=>Jf,addClassNamesToElement:()=>pM,buildImportMap:()=>WA,configExtension:()=>uM,createCommand:()=>Ee,createEditor:()=>bR,createRefCountedRegistry:()=>Vx,createSharedNodeState:()=>xx,createState:()=>CA,declarePeerDependency:()=>dM,defineExtension:()=>cM,findAllLexicalElementsDeep:()=>ZC,flipDirection:()=>Pr,getActiveElement:()=>kc,getActiveElementDeep:()=>di,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>mi,getDOMOwnerDocument:()=>Hc,getDOMSelection:()=>qn,getDOMSelectionFromTarget:()=>qC,getDOMSelectionPoints:()=>Vn,getDOMSelectionRange:()=>ey,getDOMSelectionRangeAndPoints:()=>FR,getDOMShadowRoots:()=>JC,getDOMTextNode:()=>FC,getDeclaredSlots:()=>my,getEditorPropertyFromDOMNode:()=>Ja,getNearestEditorFromDOMNode:()=>fs,getParentElement:()=>Es,getRegisteredNode:()=>Kc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>VR,getRootOwnerDocument:()=>QC,getStaticNodeConfig:()=>el,getStyleObjectFromCSS:()=>Of,getTextDirection:()=>MR,getTransformSetFromKlass:()=>IC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>Mr,isDOMCapturingSelection:()=>Ba,isDOMDocumentNode:()=>pi,isDOMNode:()=>_i,isDOMShadowRoot:()=>ar,isDOMTextNode:()=>Co,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>ry,isExactShortcutMatch:()=>Qe,isHTMLAnchorElement:()=>BR,isHTMLElement:()=>Ct,isHTMLTableCellElement:()=>zR,isHTMLTableRowElement:()=>KR,isInlineDomNode:()=>sy,isLastChildInBlockNode:()=>$C,isLexicalEditor:()=>Uc,isModifierMatch:()=>WC,isOnlyChildInBlockNode:()=>DC,isSelectionCapturedInDecoratorInput:()=>RR,isSelectionWithinEditor:()=>qa,iterStaticNodeConfigChain:()=>tl,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>WR,normalizeClassNames:()=>ol,registerEventListener:()=>ng,registerEventListeners:()=>mM,removeClassNamesFromElement:()=>hM,removeFromParent:()=>$R,resetRandomKey:()=>OR,safeCast:()=>fM,setDOMStyleFromCSS:()=>Af,setDOMStyleObject:()=>JA,setDOMUnmanaged:()=>uy,setNodeIndentFromDOM:()=>ay,shallowMergeConfig:()=>gM,stopLexicalPropagation:()=>bf,toggleTextFormatType:()=>Dr,tokenizeRawText:()=>EC,unmountSlotContainer:()=>GR});function q(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lx(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);r.search=s.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Xn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,HO=Xn&&"documentMode"in document?document.documentMode:null,Kn=Xn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ko=Xn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Sa=!(!Xn||!("InputEvent"in window)||HO)&&"getTargetRanges"in new window.InputEvent("input"),gs=Xn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pf=Xn&&/Android/.test(navigator.userAgent),Ha=Xn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Pf,Bf=Xn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Na=Xn&&Pf&&Bf,Wa=Xn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Kn&&!Bf,WO=0,GO=1,jO=2,YO=1,VO=2,XO=4,qO=8,JO=16,ZO=32,QO=64,Kf=128,eA=2047,tA=1,nA=2,oA=3,rA=4,sA=5,iA=6,Ea=Ha||gs||Wa?" ":"​",ds=`
3
3
 
4
- `,zf=ko?" ":Ea,cx="֑-߿יִ-﷽ﹰ-ﻼ",ux="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",aA=new RegExp("^[^"+ux+"]*["+cx+"]"),lA=new RegExp("^[^"+cx+"]*["+ux+"]"),Xt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},cA={directionless:1,unmergeable:2},pc={center:2,end:6,justify:4,left:1,right:3,start:5},uA={[nA]:"center",[iA]:"end",[rA]:"justify",[tA]:"left",[oA]:"right",[sA]:"start"},dA={normal:0,segmented:2,token:1},fA={[WO]:"normal",[jO]:"segmented",[GO]:"token"},gA="$",e_="$config";function t_(){return yo()._blockCursorElement}function pA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new ri(this.element,e,this.after)}withAfter(e){return new ri(this.element,this.before,e)}withElement(e){return this.element===e?this:new ri(e,this.before,this.after)}insertChild(e){let n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&q(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&q(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&q(359),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";let s=n_(e,this.element);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);if(i<0)return"after";if(n===e)return r<=i?"before":"after";let a=n_(e,n);if(a===null)return"after";let l=Array.prototype.indexOf.call(e.childNodes,a);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}}function n_(e,n){let r=n;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}class ii extends ri{withBefore(e){return new ii(this.element,e,this.after)}withAfter(e){return new ii(this.element,this.before,e)}withElement(e){return this.element===e?this:new ii(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;for(;pA(n);)e=n,n=n.nextSibling;let r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===t_()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Wa||gs||Ha);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,s=this.before,i=Sn().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,s),e){let a=Sn().createElement("img");a.setAttribute("data-lexical-managed-linebreak","true"),a.style.setProperty("display","inline","important"),a.style.setProperty("border","0px","important"),a.style.setProperty("margin","0px","important"),a.alt="",r.insertBefore(a,i),r.__lexicalLineBreak=a}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),n=this.getInsertionAnchor(),r=0;for(let s=this.element.firstChild;s!==null&&s!==e&&s!==n;s=s.nextSibling)r++;return r}resolveChildIndex(e,n,r,s){if(r===this.element){let c=this.getFirstChildOffset(),d=t_(),f=this.element.childNodes,g=Math.min(s,f.length),p=0;for(let m=c;m<g;m++)f[m]!==d&&p++;return[e,Math.min(p,e.getChildrenSize())]}let i=o_(n,r);i.push(s);let a=o_(n,this.element),l=e.getIndexWithinParent();for(let c=0;c<a.length;c++){let d=i[c],f=a[c];if(d===void 0||d<f)break;if(d>f){l+=1;break}}return[e.getParentOrThrow(),l]}}function o_(e,n){let r=[],s=n;for(;s!==e&&s!==null;s=s.parentNode){let i=0;for(let a=s.previousSibling;a!==null;a=a.previousSibling)i++;r.push(i)}return s!==e&&q(225),r.reverse()}var dx;try{dx="0.49.0+prod.esm"}catch(e){}var fx=dx??'"<unknown>+source"';class ei{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var ls=null;function gx(e,n=1000){return e instanceof Ta?e.clone():e.size<n?new Map(e):new Ta().init(new Map(e),void 0,e.size)}class Ta{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Ta().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){let n=this.getWithTombstone(e);return n===ls?void 0:n}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let n=new Map(this._old);for(let[r,s]of this._nursery)s!==ls?n.set(r,s):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){let r=this.getWithTombstone(e);if(r===n)return this;let s=this.getNursery();return r!==ls&&r!==void 0||(this._size++,r===ls&&s.delete(e)),s.set(e,n),this}delete(e){let n=this.has(e);return n&&(this.getNursery().set(e,ls),this._size--),n}getOrInsert(e,n){let r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){let r=this.get(e);if(r!==void 0)return r;let s=n(e);return this.set(e,s),s}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,n=this._old;if(n)for(let r of n){let s=r[0],i=e?e.get(s):void 0;i!==ls&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(let r of e)r[1]===ls||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(let[r,s]of this.entries())e(s,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function hc(e,n,r,s,i,a){if(Y(e)){let l=e.getFirstChild();for(;l!==null;){let c=l.__key;l.__parent===n&&((Y(l)||$o(l)&&l.__slots!==null)&&hc(l,c,r,s,i,a),r.has(c)||a.delete(c),i.push(c)),l=l.getNextSibling()}}for(let l of $o(e)&&e.__slots!==null?e.__slots.values():[]){let c=s.get(l);c!==void 0&&$r(c)&&c.__slotHost===n&&((Y(c)||$o(c)&&c.__slots!==null)&&hc(c,l,r,s,i,a),r.has(l)||a.delete(l),i.push(l))}}var df=!1,Uf=0;function hA(e){Uf=e.timeStamp}function Zd(e,n,r){let s=e.nodeName==="BR",i=n.__lexicalLineBreak;return i&&(e===i||s&&e.previousSibling===i)||s&&hi(e,r)!==void 0}function mA(e,n,r){let s=qn(Nn(r)),i=s&&Vn(s,r._rootElement),a=null,l=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,l=i.focusOffset);let c=e.nodeValue;c!==null&&mg(n,c,a,l,!1)}function _A(e,n,r){if(ge(e)){let s=e.anchor.getNode();if(s.is(r)&&e.format!==s.getFormat())return!1}return Co(n)&&r.isAttached()}function xA(e,n,r){for(let s=e;s&&!vg(s);s=Es(s)){let i=hi(s,n);if(i!==void 0){let a=ot(i,r);if(a)return qe(a)||!Ct(s)?void 0:[s,a]}}}function px(e,n,r){df=!0;let s=performance.now()-Uf>100;try{Wn(e,()=>{let i=ze()||function(p){return p.read("latest",()=>{let m=ze();return m!==null?m.clone():null})}(e),a=new Map,{_editorState:l,_blockCursorElement:c}=e,d=!1,f="";for(let p=0;p<n.length;p++){let m=n[p],{type:_,target:x}=m,C=xA(x,e,l);if(!C)continue;let[y,N]=C;if(_==="characterData")s&&te(N)&&Co(x)&&_A(i,x,N)&&mA(x,N,e);else if(_==="childList"){d=!0;let T=m.addedNodes;for(let F=0;F<T.length;F++){let k=T[F],H=fg(k),U=k.parentNode;if(!(U==null||k===c||H!==null||Zd(k,U,e)||e._slotsUsed&&Ct(k)&&k.hasAttribute("data-lexical-slot")||vg(k))){if(ko){let W=(Ct(k)?k.innerText:null)||k.nodeValue;W&&(f+=W)}U.removeChild(k)}}let v=m.removedNodes,R=v.length;if(R>0){let F=0;for(let k=0;k<R;k++){let H=v[k];(Zd(H,x,e)||c===H)&&(x.appendChild(H),F++)}R!==F&&a.set(y,N)}}}if(a.size>0)for(let[p,m]of a)m.reconcileObservedMutation(p,e);let g=r.takeRecords();if(g.length>0){for(let p=0;p<g.length;p++){let m=g[p],{addedNodes:_,target:x}=m;for(let C=0;C<_.length;C++){let y=_[C],N=y.parentNode;N==null||y.nodeName!=="BR"||Zd(y,x,e)||N.removeChild(y)}}r.takeRecords()}i!==null&&(d&&rn(i),ko&&jC(e)&&i.insertRawText(f))})}finally{df=!1}}function hx(e){let n=e._observer;if(n!==null)px(e,n.takeRecords(),n)}function mx(e){(function(n){Uf===0&&Nn(n).addEventListener("textInput",hA,!0)})(e),e._observer=new MutationObserver((n,r)=>{px(e,n,r)})}var ff="direct",gf="latest";class _x{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||NA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}}function CA(e,n){return new _x(e,n)}function mc(e,n,r=gf){let s=(r===gf?e.getLatest():e).__state;return s?s.getValue(n):n.defaultValue}function yA(e,n,r){let s=mc(e,r,ff),i=mc(n,r,ff);return r.isEqual(s,i)?null:[s,i]}function SA(e,n,r){let s;if(Wt(),typeof r=="function"){let a=e.getLatest(),l=mc(a,n);if(s=r(l),n.isEqual(l,s))return a}else s=r;let i=e.getWritable();return Wf(i).updateFromKnown(n,s),i}function xx(e){let n=new Map,r=new Set;for(let{ownNodeConfig:s}of tl(typeof e=="function"?e:e.replace))if(s&&s.stateConfigs)for(let i of s.stateConfigs){let a;"stateConfig"in i?(a=i.stateConfig,i.flat&&r.add(a.key)):a=i,n.set(a.key,a)}return{flatKeys:r,sharedConfigMap:n}}var r_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=s;let{sharedConfigMap:a}=this.sharedNodeState,l=i!==void 0?i:function(c,d,f){let g=f.size;if(d)for(let p in d){let m=c.get(p);m&&f.has(m)||g++}return g}(a,r,s);this.size=l}getValue(e){let n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},n={};for(let[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(let r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return s_(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;let{sharedNodeState:n,unknownState:r}=this,s=new Map(this.knownState);return new Hf(e,n,function(i,a,l){let c;if(l)for(let[d,f]of Object.entries(l)){if(r_.has(d))continue;let g=i.get(d);g?a.has(g)||a.set(g,g.parse(f)):(c=c||{},c[d]=f)}return c}(n.sharedConfigMap,s,r),s,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=s_(i)),this.size++),s.set(e,n)}updateFromUnknown(e,n){if(r_.has(e))return;let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=n)}updateFromJSON(e){let{knownState:n}=this;for(let r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(let[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}}function Wf(e){let n=e.getWritable(),r=n.__state?n.__state.getWritable(n):new Hf(n,Cx(n));return n.__state=r,r}function Cx(e){return e.__state?e.__state.sharedNodeState:dg(yo(),e.getType()).sharedNodeState}function s_(e){if(e)for(let n in e)return e}function NA(e){return e}function i_(e,n,r){for(let[s,i]of n.knownState){if(e.has(s.key))continue;e.add(s.key);let a=r?r.getValue(s):s.defaultValue;if(a!==i&&!s.isEqual(a,i))return!0}return!1}function a_(e,n,r){let{unknownState:s}=n,i=r?r.unknownState:void 0;if(s)for(let[a,l]of Object.entries(s)){if(e.has(a))continue;if(e.add(a),l!==(i?i[a]:void 0))return!0}return!1}function l_(e,n){let r=e.__state;return r&&r.node===e?r.getWritable(n):r}function c_(e,n){let{__mode:r,__format:s,__style:i}=e,{__mode:a,__format:l,__style:c}=n,d=e.__state,f=n.__state;return(r===null||r===a)&&(s===null||s===l)&&(i===null||i===c)&&(e.__state===null||d===f||function(g,p){if(g===p)return!0;let m=new Set;return!(g&&i_(m,g,p)||p&&i_(m,p,g)||g&&a_(m,g,p)||p&&a_(m,p,g))}(d,f))}function u_(e,n){let r=e.mergeWithSibling(n),s=Ve()._normalizedNodes;return s.add(e.__key),s.add(n.__key),r}function d_(e){let n,r,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(n=s.getPreviousSibling())!==null&&te(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(c_(n,s)){s=u_(n,s);break}break}n.remove()}for(;(r=s.getNextSibling())!==null&&te(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(c_(s,r)){s=u_(s,r);break}break}r.remove()}}else s.remove()}function ni(e){return f_(e.anchor),f_(e.focus),e}function f_(e){for(;e.type==="element";){let n=e.getNode(),r=e.offset,s,i;if(r===n.getChildrenSize()?(s=n.getChildAtIndex(r-1),i=!0):(s=n.getChildAtIndex(r),i=!1),te(s)){e.set(s.__key,i?s.getTextContentSize():0,"text",!0);break}if(!Y(s))break;e.set(s.__key,i?s.getChildrenSize():0,"element",!0)}}var ba=Symbol.for("@lexical/CachedTextSize");function g_(e,n){return hf.read(()=>{let r=0,s=e;for(let i=0;i<n&&s!==null;i++){let a=ho.get(s);if(a===void 0&&q(345,s),Y(a)){let l=xt.get(s);if(l!==void 0&&Y(l)&&l.__parent!==a.__parent)r+=a.getTextContentSize();else{let c=ps.get(s),d=c&&c.__lexicalTextContent;typeof d!="string"&&q(346,a.getType()),r+=d.length}i<n-1&&!a.isInline()&&(r+=2)}else{let l=a[ba];l===void 0&&q(347,a.getType(),s),r+=l}s=a.__next}return r},{editor:Ye})}function yx(e){Y(e)||e[ba]===void 0&&(e[ba]=te(e)?e.__text.length:e.getTextContentSize())}var EA=4,Oa,Ye,Aa,Fe="",Tt=null,en=null,qt=null;function Mo(){return{firstTextKey:qt,format:Tt,style:en}}function zn(e){e.firstTextKey!==null&&(Tt=e.format,en=e.style,qt=e.firstTextKey)}function pf(e){if(qt!==null)return;let n=e.__lexicalFirstTextKey;if(n===void 0&&q(348),n===null)return;let r=xt.get(n);te(r)&&(Tt=r.getFormat(),en=r.getStyle(),qt=n)}var Lc,ma,_a,ho,hf,xt,ps,mf,Ra,hs,sr=!1,_c=!1;function Ar(e,n){let r=ho.get(e),s=xt.has(e);if(n!==null){let i=Sf(e);i.parentNode===n&&n.removeChild(i)}if(!s){if(Ye._keyToDOMMap.delete(e),Y(r)){let i=Ka(r,ho);_f(i,0,i.length-1,null)}if(r!==void 0){for(let i of Rn(r).values()){let a=Cf(i);Ar(i,null),a!==null&&a.remove()}_g(Ra,Aa,Lc,r,"destroyed")}}}function _f(e,n,r,s){for(let i=n;i<=r;++i){let a=e[i];a!==void 0&&Ar(a,s)}}function cs(e,n){e.setProperty("text-align",n)}var TA="40px";function Sx(e,n){let r=Oa.theme.indent;if(typeof r=="string"){let s=e.classList.contains(r);n>0&&!s?e.classList.add(r):n<1&&s&&e.classList.remove(r)}e.style.setProperty("padding-inline-start",n===0?"":`calc(${n} * var(--lexical-indent-base-value, ${TA}))`)}function Nx(e,n){let r=e.style;n===0?cs(r,""):n===1?cs(r,"left"):n===2?cs(r,"center"):n===3?cs(r,"right"):n===4?cs(r,"justify"):n===5?cs(r,"start"):n===6&&cs(r,"end")}function xf(e,n){let r=function(s){let i=s.__dir;if(i!==null)return i;if(Kt(s))return null;let a=s.getParent();return a===null||At(a)&&a.__dir===null?"auto":null}(n);r!==null?e.dir=r:e.removeAttribute("dir")}function Ex(e){let n=Sn().createElement("div");return n.setAttribute("data-lexical-slot",e),n.style.display="none",n}function Tx(e,n,r){n||e.contentEditable==="false"?dy(r,Ye):r.removeAttribute("contenteditable")}function p_(e,n,r){let s=Fe,i=Mo();Fe="";let a="",l=qe(e);for(let[c,d]of r){let f=Ex(c);Tx(n,l,f),n.appendChild(f),Fe="";let g=Mo();Rr(d,$n(e,f,Ye)),zn(g),bx(e,c,n,f),a+=Fe}return zn(i),Fe=s,a}function Rn(e){return $o(e)&&e.__slots!==null?e.__slots:gy}function bx(e,n,r,s){let i=hs.$getSlotTargetElement(e,n,r,Ye);i!==null&&(s.parentElement!==i&&i.appendChild(s),s.style.display="")}function Cf(e){let n=ps.get(e);return n!==void 0?n.parentElement:null}function h_(e,n,r){let s=Rn(e),i=Rn(n);for(let[g,p]of s)if(!i.has(g)){let m=Cf(p);Ar(p,null),m!==null&&m.remove()}let a=Fe,l=Mo(),c="",d=null,f=qe(n);for(let[g,p]of i){let m=s.get(g),_=m!==void 0?Cf(m):null;Fe="";let x=Mo();if(_===null){_=Ex(g);let C=null;for(let y of r.children)if(!y.hasAttribute("data-lexical-slot")){C=y;break}r.insertBefore(_,C),Rr(p,$n(n,_,Ye))}else m===p?rr(p,_):(m!==void 0&&Ar(m,_),Rr(p,$n(n,_,Ye)));if(zn(x),Tx(r,f,_),bx(n,g,r,_),c+=Fe,_.parentElement===r){let C=d===null?r.firstChild:d.nextSibling;C!==_&&r.insertBefore(_,C),d=_}}return zn(l),Fe=a,c}function Rr(e,n){let r=xt.get(e);if(r===void 0&&q(60),n!==null){let i=ho.get(e);if(i!==void 0){let a=ps.get(e);if(a!==void 0){let l=$r(i)?i.__slotHost:null,c=$r(r)?r.__slotHost:null,d=i.__parent!==r.__parent||l!==c,f=c!==null&&a.parentElement!==n.element;if(d||f)return n.insertChild(a),rr(e,n.element)}}}let s=hs.$createDOM(r,Ye);if(function(i,a,l){let c=l._keyToDOMMap;BC(a,l,i),c.set(i,a)}(e,s,Ye),te(r)?s.setAttribute("data-lexical-text","true"):qe(r)&&(s.setAttribute("data-lexical-decorator","true"),uy(s,{captureSelection:!0})),Y(r)){let{__indent:i,__size:a}=r;xf(s,r),i!==0&&Sx(s,i);let l=Rn(r),c=l.size>0?p_(r,s,l):"";if(a===0)s.__lexicalTextContent=c,s.__lexicalFirstTextKey=null,Fe+=c,l.size>0&&(s.__lexicalSlotTextLength=c.length);else{let f=Fe,g=a-1;if(yf(Ka(r,xt),r,0,g,$n(r,s,Ye)),c!==""){let p=s.__lexicalTextContent||"";s.__lexicalTextContent=c+p,Fe=f+c+p}l.size>0&&(s.__lexicalSlotTextLength=c.length)}let d=r.__format;d!==0&&Nx(s,d),r.isInline()||vx(null,r,s)}else{let i=r.getTextContent();if(qe(r)){let a=r.decorate(Ye,Oa);a!==null&&Ox(e,a),s.contentEditable="false";let l=Rn(r);l.size>0&&p_(r,s,l)}Fe+=i}return n!==null&&n.insertChild(s),hs.$decorateDOM(r,null,s,Ye),yx(r),_g(Ra,Aa,Lc,r,"created"),s}function yf(e,n,r,s,i){let a=Fe,l=Mo();Fe="",Tt=null,en=null,qt=null;let c=r;for(;c<=s;++c){let f=Mo();Rr(e[c],i);let g=xt.get(e[c]);g!==null&&te(g)?Tt===null&&(Tt=g.getFormat(),en=g.getStyle(),qt=g.__key):Y(g)&&c<s&&!g.isInline()&&(Fe+=ds),zn(f)}let d=Ye._keyToDOMMap.get(n.__key);d===void 0&&q(349,n.__key),d.__lexicalTextContent=Fe,d.__lexicalFirstTextKey=qt,Fe=a+Fe,zn(l)}function vx(e,n,r){let s=$n(n,r,Ye),i=s.element.__lexicalLastChildKind??null,a=function(l,c){if(l){let d=l.__last;if(d){let f=c.get(d);if(f)return Lo(f)?"line-break":qe(f)&&f.isInline()?"decorator":null}return Rn(l).size>0?null:"empty"}return null}(n,xt);i!==a&&s.setManagedLineBreak(a)}function bA(e,n,r){var s;Tt=null,en=null,qt=null,function(i,a,l){let c=Fe,d=i.__size,f=a.__size;Fe="";let g=l.element,p=Ye._keyToDOMMap.get(a.__key);p===void 0&&q(351,a.__key);let m=f-d;if(!sr&&Math.abs(m)<=1&&d>=EA&&i.__first===a.__first&&(m!==0||!Ye._cloneNotNeeded.has(i.__key))){let _=p.__lexicalTextContent,x=mf.get(i.__key);if(!sr&&typeof _=="string"&&x!==void 0){let C=function(y,N){let T=N.size;if(T===0||T>=y.__size)return null;let v=y.__last,R=null,F=0;for(;v!==null&&F<T;){if(!N.has(v))return null;R=v;let k=xt.get(v);if(k===void 0)return null;v=k.__prev,F++}if(F!==T)return null;if(v!==null&&N.has(v))return null;return R}(a,x);if(C!==null){let y=x.size;if(m===0){let N=g_(C,y),T=C,v=0;for(;T!==null&&v<y;){let U=xt.get(T);if(U===void 0)break;let W=Mo();rr(T,g),te(U)&&Tt===null&&(Tt=U.getFormat(),en=U.getStyle(),qt=U.__key),zn(W),T=U.__next,v++}let R="";for(T=C,v=0;T!==null&&v<y;){let U=xt.get(T);if(U===void 0)break;let W;if(Y(U)){let J=Ye._keyToDOMMap.get(T),G=J&&J.__lexicalTextContent;typeof G!="string"&&q(352,U.getType()),W=G}else W=U.getTextContent();R+=W,v<y-1&&Y(U)&&!U.isInline()&&(R+=ds),T=U.__next,v++}let F=p.__lexicalSlotTextLength||0,k=F>0?_.slice(F):_,H=k.slice(0,k.length-N)+R;return p.__lexicalTextContent=H,Fe=c+H,void m_(a,p,x)}if(function(N,T,v,R,F,k,H,U){if(U!==1&&U!==-1)return!1;if(H!==(U===1?2:1))return!1;let J=H-U,G=N.__last;for(let Be=0;Be<J-1;Be++){if(G===null)return!1;let _t=ho.get(G);if(_t===void 0)return!1;G=_t.__prev}if(G===null)return!1;let ne=xt.get(k),ee=ho.get(G);if(ne===void 0||ee===void 0)return!1;if(ne.__prev!==ee.__prev)return!1;let se=[],V=k;for(let Be=0;Be<H;Be++){if(V===null)return!1;se.push(V);let _t=xt.get(V);V=_t?_t.__next:null}let fe=[];V=G;for(let Be=0;Be<J;Be++){if(V===null)return!1;fe.push(V);let _t=ho.get(V);V=_t?_t.__next:null}let Ce=new Set(fe),Ae=new Set(se),oe=[],ae=0,ue=0;for(;ae<J&&ue<H;)if(se[ue]===fe[ae])oe.push({key:se[ue],kind:"reconcile"}),ae++,ue++;else if(Ae.has(fe[ae])){if(Ce.has(se[ue]))return!1;oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++}else oe.push({key:fe[ae],kind:"destroy"}),ae++;for(;ae<J;)oe.push({key:fe[ae++],kind:"destroy"});for(;ue<H;)oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++;let we=g_(G,J);for(let Be of oe){let _t=Mo();if(Be.kind==="reconcile")rr(Be.key,v.element);else if(Be.kind==="destroy")Ar(Be.key,v.element);else{let Vt=null;for(let Tr=Be.nextIndex+1;Tr<H;Tr++){let er=Ye._keyToDOMMap.get(se[Tr]);if(er!==void 0){Vt=er;break}}Rr(Be.key,v.withBefore(Vt??v.before))}if(Be.kind!=="destroy"){let Vt=xt.get(Be.key);Vt&&te(Vt)&&Tt===null&&(Tt=Vt.getFormat(),en=Vt.getStyle(),qt=Vt.__key)}zn(_t)}let Ie="";for(let Be=0;Be<H;Be++){let _t=xt.get(se[Be]);if(_t===void 0)return!1;let Vt;if(Y(_t)){let Tr=Ye._keyToDOMMap.get(se[Be]),er=Tr&&Tr.__lexicalTextContent;typeof er!="string"&&q(350,_t.getType()),Vt=er}else Vt=_t.getTextContent();Ie+=Vt,Be<H-1&&Y(_t)&&!_t.isInline()&&(Ie+=ds)}let ht=R.__lexicalSlotTextLength||0,Qt=ht>0?F.slice(ht):F;return R.__lexicalTextContent=Qt.slice(0,Qt.length-we)+Ie,!0}(i,0,l,p,_,C,y,m)){let N=p.__lexicalTextContent;return typeof N!="string"&&q(353),Fe=c+N,void m_(a,p,x)}}}if(m===0){let C=i.__first,y=0;for(;C!==null;){let N=xt.get(C);if(N===void 0)break;let T=sr||_a.has(C)||ma.has(C),v=Mo();if(T)rr(C,g);else{let R,F;if(Y(N)){F=ps.get(C);let k=F&&F.__lexicalTextContent;typeof k!="string"&&q(354,N.getType()),R=k}else R=N.getTextContent();Fe+=R,F!==void 0&&pf(F)}te(N)?Tt===null&&(Tt=N.getFormat(),en=N.getStyle(),qt=N.__key):Y(N)&&y<f-1&&!N.isInline()&&(Fe+=ds),zn(v),C=N.__next,y++}return p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,void(Fe=c+Fe)}}if(d===1&&f===1){let _=i.__first,x=a.__first;if(_===x)rr(_,g);else{let y=Sf(_),N=Rr(x,null);try{y.parentNode===g?g.replaceChild(N,y):l.insertChild(N)}catch(T){if(typeof T=="object"&&T!=null){let v=`${T.toString()} Parent: ${g.tagName}, new child: {tag: ${N.tagName} key: ${x}}, old child: {tag: ${y.tagName}, key: ${_}}.`;throw Error(v)}throw T}Ar(_,null)}let C=xt.get(x);te(C)&&Tt===null&&(Tt=C.getFormat(),en=C.getStyle(),qt=C.__key)}else{let _=Ka(i,ho),x=Ka(a,xt);if(_.length!==d&&q(227),x.length!==f&&q(228),d===0)f!==0&&yf(x,a,0,f-1,l);else if(f===0){if(d!==0){let C=l.after==null&&l.before==null&&Rn(a).size===0&&l.element.__lexicalLineBreak==null;_f(_,0,d-1,C?null:g),C&&(g.textContent="")}}else(function(C,y,N,T,v,R){let F=T-1,k=v-1,H,U,W=R.getFirstChild(),J=0,G=0;for(;J<=F&&G<=k;){let se=y[J],V=N[G],fe=Mo();if(se===V)W=Qd(rr(V,R.element)),J++,G++;else{if(U===void 0&&(U=__(N,G)),H===void 0)H=__(y,J);else if(!H.has(se)){J++,zn(fe);continue}if(!U.has(se)){W=Qd(Sf(se)),Ar(se,R.element),J++,H.delete(se),zn(fe);continue}if(H.has(V)){let Ae=ui(Ye,V);Ae!==W&&R.withBefore(W??R.before).insertChild(Ae),W=Qd(rr(V,R.element)),J++,G++}else Rr(V,R.withBefore(W??R.before)),G++}let Ce=xt.get(V);Ce!==null&&te(Ce)?Tt===null&&(Tt=Ce.getFormat(),en=Ce.getStyle(),qt=Ce.__key):Y(Ce)&&G<=k&&!Ce.isInline()&&(Fe+=ds),zn(fe)}let ne=J>F,ee=G>k;if(ne&&!ee){let se=N[k+1],V=se===void 0?null:Ye.getElementByKey(se);yf(N,C,G,k,R.withBefore(V??R.before))}else ee&&!ne&&_f(y,J,F,R.element)})(a,_,x,d,f,l)}p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,Fe=c+Fe}(e,n,$n(n,r,Ye)),At(n)||(s=n,Tt==null||Tt===s.__textFormat||_c||s.setTextFormat(Tt),function(i){en==null||en===i.__textStyle||_c||i.setTextStyle(en)}(n))}function m_(e,n,r){let s=n.__lexicalFirstTextKey;if(s!=null){let i=e.__key,a=s;for(;a!==null;){let l=xt.get(a);if(l===void 0){a=null;break}if(l.__parent===i)break;a=l.__parent}if(a!==null&&!r.has(a)){let l=xt.get(s);if(te(l))return Tt=l.getFormat(),void(en=l.getStyle())}}n.__lexicalFirstTextKey=qt}function rr(e,n){let r=ho.get(e),s=xt.get(e);r!==void 0&&s!==void 0||q(61);let i=sr||_a.has(e)||ma.has(e),a=ui(Ye,e);if(r===s&&!i){let l;if(Y(r)){let c=a.__lexicalTextContent;typeof c!="string"&&q(355,r.getType()),l=c,pf(a)}else l=r.getTextContent();return Fe+=l,a}if(r!==s&&i&&_g(Ra,Aa,Lc,s,"updated"),hs.$updateDOM(s,r,a,Ye)){let l=Rr(e,null);return n===null&&q(62),n.replaceChild(l,a),Ar(e,null),l}if(Y(r)){Y(s)||q(334,e);let l=s.__indent;(sr||l!==r.__indent)&&Sx(a,l);let c=s.__format;(sr||c!==r.__format)&&Nx(a,c);let d=i&&(Rn(s).size>0||Rn(r).size>0)?h_(r,s,a):"";if(i){let f=Fe;if(bA(r,s,a),Kt(s)||s.isInline()||vx(0,s,a),d!==""){let g=a.__lexicalTextContent||"";a.__lexicalTextContent=d+g,Fe=f+d+g,a.__lexicalSlotTextLength=d.length}else(Rn(s).size>0||Rn(r).size>0)&&(a.__lexicalSlotTextLength=0)}else{let f=a.__lexicalTextContent;typeof f!="string"&&q(356,r.getType()),Fe+=f,pf(a)}if((sr||s.__dir!==r.__dir||s.__parent!==r.__parent)&&(xf(a,s),Kt(s)&&!sr)){for(let f of s.getChildren())if(Y(f))xf(ui(Ye,f.getKey()),f)}}else{let l=s.getTextContent();if(qe(s)){let c=s.decorate(Ye,Oa);c!==null&&Ox(e,c),i&&(Rn(s).size>0||Rn(r).size>0)&&h_(r,s,a)}Fe+=l}if(!_c&&Kt(s)){let l=s.getLatest();if(l.__cachedText!==Fe){let c=l.getWritable();c.__cachedText=Fe,s=c}}return hs.$decorateDOM(s,r,a,Ye),yx(s),a}function Ox(e,n){let r=Ye._pendingDecorators,s=Ye._decorators;if(r===null){if(s[e]===n)return;r=KC(Ye)}r[e]=n}function Qd(e){let n=e.nextSibling;return n!==null&&n===Ye._blockCursorElement&&(n=n.nextSibling),n}function __(e,n){let r=new Set;for(let s=n;s<e.length;s++)r.add(e[s]);return r}function vA(e,n,r,s,i,a){Fe="",Tt=null,en=null,qt=null,sr=s===2,Ye=r,Oa=r._config,hs=r._config.dom||La,Aa=r._nodes,Lc=Ye._listeners.mutation,ma=i,_a=a,ho=e._nodeMap,hf=e,xt=n._nodeMap,_c=n._readOnly,ps=gx(r._keyToDOMMap),mf=function(){let c=new Map,d=(f)=>{for(let g of f){let p=xt.get(g);if(p===void 0)continue;let m=p.__parent;if(m===null)continue;let _=c.get(m);_===void 0&&(_=new Set,c.set(m,_)),_.add(g)}};return d(ma.keys()),d(_a),c}();let l=new Map;return Ra=l,rr("root",null),Ye=void 0,Aa=void 0,ma=void 0,_a=void 0,ho=void 0,hf=void 0,xt=void 0,Oa=void 0,ps=void 0,mf=void 0,Ra=void 0,hs=La,l}function Sf(e){let n=ps.get(e);return n===void 0&&q(75,e),n}function Ee(e){return{type:e}}var Gf=Ee("SELECTION_CHANGE_COMMAND"),OA=Ee("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ax=Ee("CLICK_COMMAND"),jf=Ee("BEFORE_INPUT_COMMAND"),Yf=Ee("INPUT_COMMAND"),Vf=Ee("COMPOSITION_START_COMMAND"),Xf=Ee("COMPOSITION_END_COMMAND"),Ma=Ee("DELETE_CHARACTER_COMMAND"),xa=Ee("INSERT_LINE_BREAK_COMMAND"),Nf=Ee("INSERT_PARAGRAPH_COMMAND"),ai=Ee("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Ee("PASTE_COMMAND"),ac=Ee("REMOVE_TEXT_COMMAND"),Da=Ee("DELETE_WORD_COMMAND"),$a=Ee("DELETE_LINE_COMMAND"),vr=Ee("FORMAT_TEXT_COMMAND"),AA=Ee("SET_TEXT_FORMAT_COMMAND"),Jf=Ee("UNDO_COMMAND"),Zf=Ee("REDO_COMMAND"),Qf=Ee("KEYDOWN_COMMAND"),Rx=Ee("KEY_ARROW_RIGHT_COMMAND"),Mx=Ee("MOVE_TO_END"),Dx=Ee("KEY_ARROW_LEFT_COMMAND"),$x=Ee("MOVE_TO_START"),wx=Ee("KEY_ARROW_UP_COMMAND"),kx=Ee("KEY_ARROW_DOWN_COMMAND"),xc=Ee("KEY_ENTER_COMMAND"),Ix=Ee("KEY_SPACE_COMMAND"),Lx=Ee("KEY_BACKSPACE_COMMAND"),Fx=Ee("KEY_ESCAPE_COMMAND"),Px=Ee("KEY_DELETE_COMMAND"),Bx=Ee("KEY_TAB_COMMAND"),RA=Ee("INSERT_TAB_COMMAND"),MA=Ee("INDENT_CONTENT_COMMAND"),DA=Ee("OUTDENT_CONTENT_COMMAND"),Kx=Ee("DROP_COMMAND"),$A=Ee("FORMAT_ELEMENT_COMMAND"),zx=Ee("DRAGSTART_COMMAND"),Ux=Ee("DRAGOVER_COMMAND"),Hx=Ee("DRAGEND_COMMAND"),eg=Ee("COPY_COMMAND"),tg=Ee("CUT_COMMAND"),Wx=Ee("SELECT_ALL_COMMAND"),wA=Ee("CLEAR_EDITOR_COMMAND"),kA=Ee("CLEAR_HISTORY_COMMAND"),IA=Ee("CAN_REDO_COMMAND"),LA=Ee("CAN_UNDO_COMMAND"),Gx=Ee("FOCUS_COMMAND"),jx=Ee("BLUR_COMMAND"),Yx=Ee("KEY_MODIFIER_COMMAND");function Vx(e){let n=new Map;return{dispose(){for(let r of n.values())r.dispose();n.clear()},register(r,s){let i=n.get(r);i===void 0&&(i={dispose:e(r,s),holders:new Set},n.set(r,i));let a=()=>{let l=n.get(r);l&&l.holders.delete(a)&&l.holders.size===0&&(n.delete(r),l.dispose())};return i.holders.add(a),a}}}function ng(e,n,r,s){return e.addEventListener(n,r,s),e.removeEventListener.bind(e,n,r,s)}var tr=Object.freeze({}),Ef=[["keydown",function(e,n){let r=n._inputState;if(r.lastKeyDownTimeStamp=e.timeStamp,r.lastKeyCode=e.key,e.key!=="Backspace"&&wa(r),n.isComposing())return;ie(n,Qf,e)}],["pointerdown",function(e,n){let r=Ng(e),s=e.pointerType;_i(r)&&s!=="touch"&&s!=="pen"&&e.button===0&&Wn(n,()=>{Ba(r,n)||(n._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,n){ie(n,Vf,e)}],["compositionend",function(e,n){let r=n._inputState;ko?r.compositionPhase="ending-firefox":gs||!Ha&&!Wa?ie(n,Xf,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,n){e.stopPropagation();let r=n._inputState;wa(r),Wn(n,()=>{Zx(e,n)||n.dispatchCommand(Yf,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,n){Wn(n,()=>{let r=ze(),s=qn(Nn(n)),i=Ns();if(s){if(ge(r)){let a=r.anchor,l=a.getNode();a.type==="element"&&a.offset===0&&r.isCollapsed()&&!Kt(l)&&Dn().getChildrenSize()===1&&l.getTopLevelElementOrThrow().isEmpty()&&i!==null&&r.is(i)&&(s.removeAllRanges(),r.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let a=Vn(s,n._rootElement).anchorNode;if(Ct(a)||Co(a))rn(ka(i,s,n,e))}}if(ko&&s!==null&&s.rangeCount===0){let a=n._rootElement;if(a!==null&&e.target===a){let l=e.clientY,c=a.childNodes.length;for(let f=0;f<a.childNodes.length;f++){let g=a.childNodes[f];if(Ct(g)){let p=g.getBoundingClientRect();if(l<=(p.top+p.bottom)/2){c=f;break}}}s.setBaseAndExtent(a,c,a,c);let d=ka(i,s,n,e);d!==null?rn(d):s.removeAllRanges()}}ie(n,Ax,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];Sa&&Ef.push(["beforeinput",(e,n)=>function(r,s){let i=r.inputType;if(i==="deleteCompositionText"||ko&&jC(s))return;if(i==="insertCompositionText")return;Wn(s,()=>{Zx(r,s)||ie(s,jf,r)},{event:r})}(e,n)]);var Tf=new WeakMap,Cc=new WeakMap,FA=Vx((e)=>(e.addEventListener("selectionchange",N_),()=>e.removeEventListener("selectionchange",N_)));function Xx(e,n,r,s,i,a){let{anchor:l,focus:c}=e,d=l.getNode(),f=Ve(),g;if(a!==void 0)g=a;else{let C=qn(Nn(f));g=C!==null?Vn(C,f._rootElement):null}let p=g!==null?g.anchorNode:null,m=l.key,_=f.getElementByKey(m),x=r.length;return m!==c.key||!te(d)||(!i&&(!Sa||f._inputState.lastBeforeInputInsertTextTimeStamp<s+50)||d.isDirty()&&x<2||zC(r))&&l.offset!==c.offset&&!d.isComposing()||Gn(d)||d.isDirty()&&x>1||(i||!Sa)&&_!==null&&!d.isComposing()&&p!==ar(d,_,f)||g!==null&&n!==null&&(!n.collapsed||n.startContainer!==g.anchorNode||n.startOffset!==g.anchorOffset)||!d.isComposing()&&(d.getFormat()!==e.format||d.getStyle()!==e.style)||function(C,y){if(y.isSegmented())return!0;if(!C.isCollapsed())return!1;let N=C.anchor.offset,T=y.getParentOrThrow(),v=Fa(y);return N===0?!y.canInsertTextBefore()||!T.canInsertTextBefore()&&!y.isComposing()||v||function(R){let F=R.getPreviousSibling();return(te(F)||Y(F)&&F.isInline())&&!F.canInsertTextAfter()}(y):N===y.getTextContentSize()&&(!y.canInsertTextAfter()||!T.canInsertTextAfter()&&!y.isComposing()||v)}(e,d)}function x_(e,n){return Co(e)&&e.nodeValue!==null&&n!==0&&n!==e.nodeValue.length}function C_(e,n,r){let{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:l}=Vn(e,n._rootElement),c=n._inputState;c.isSelectionChangeFromDOMUpdate&&(c.isSelectionChangeFromDOMUpdate=!1,x_(s,i)&&x_(a,l)&&!c.postDeleteSelectionToRestore)||Wn(n,()=>{if(!r)return void rn(null);if(!qa(n,s,a))return;let d=ze();if(c.postDeleteSelectionToRestore&&ge(d)&&d.isCollapsed()){let f=d.anchor,g=c.postDeleteSelectionToRestore.anchor;(f.key===g.key&&f.offset===g.offset+1||f.offset===1&&g.getNode().is(f.getNode().getPreviousSibling()))&&(d=c.postDeleteSelectionToRestore.clone(),rn(d))}if(c.postDeleteSelectionToRestore=null,ge(d)){let f=d.anchor,g=f.getNode();if(d.isCollapsed()){e.type==="Range"&&s===a&&(d.dirty=!0);let p=Nn(n).event,m=p?p.timeStamp:performance.now(),{format:_,style:x,offset:C,key:y,timeStamp:N}=c.collapsedSelectionFormat,T=Dn(),v=n.isComposing()===!1&&T.getTextContent()==="";if(m<N+200&&f.offset===C&&f.key===y)lc(d,_,x);else if(f.type==="text")te(g)||q(141),qx(d,g);else if(f.type==="element"&&!v){Y(g)||q(259);let R=f.getNode();R.isEmpty()?function(F,k){let H=k.getTextFormat(),U=k.getTextStyle();lc(F,H,U)}(d,R):lc(d,d.format,"")}}else{let p=f.key,m=d.focus.key,_=d.getNodes(),x=_.length,C=d.isBackward(),y=C?l:i,N=C?i:l,T=C?m:p,v=C?p:m,R=2047,F=!1;for(let k=0;k<x;k++){let H=_[k],U=H.getTextContentSize();if(te(H)&&U!==0&&!(k===0&&H.__key===T&&y===U||k===x-1&&H.__key===v&&N===0)&&(F=!0,R&=H.getFormat(),R===0))break}d.format=F?R:0}}ie(n,Gf)})}function lc(e,n,r){e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}function qx(e,n){lc(e,n.getFormat(),n.getStyle())}function Jx(e){if(!e.getTargetRanges)return null;let n=e.getTargetRanges();return n.length===0?null:n[0]}function y_(e){let{lastKeyCode:n}=Ve()._inputState;if(e==null||e.length<=1||n==null)return;let r=n.length===1?n:n==="Enter"?`
4
+ `,zf=ko?" ":Ea,cx="֑-߿יִ-﷽ﹰ-ﻼ",ux="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",aA=new RegExp("^[^"+ux+"]*["+cx+"]"),lA=new RegExp("^[^"+cx+"]*["+ux+"]"),Xt={bold:1,capitalize:1024,code:16,highlight:Kf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},cA={directionless:1,unmergeable:2},pc={center:2,end:6,justify:4,left:1,right:3,start:5},uA={[nA]:"center",[iA]:"end",[rA]:"justify",[tA]:"left",[oA]:"right",[sA]:"start"},dA={normal:0,segmented:2,token:1},fA={[WO]:"normal",[jO]:"segmented",[GO]:"token"},gA="$",e_="$config";function t_(){return yo()._blockCursorElement}function pA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class ri{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new ri(this.element,e,this.after)}withAfter(e){return new ri(this.element,this.before,e)}withElement(e){return this.element===e?this:new ri(e,this.before,this.after)}insertChild(e){let n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&q(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&q(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&q(359),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,n,r){if(this.element===e)return n===e&&r===0?"before":"after";let s=n_(e,this.element);if(s===null)return"after";let i=Array.prototype.indexOf.call(e.childNodes,s);if(i<0)return"after";if(n===e)return r<=i?"before":"after";let a=n_(e,n);if(a===null)return"after";let l=Array.prototype.indexOf.call(e.childNodes,a);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}}function n_(e,n){let r=n;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}class ii extends ri{withBefore(e){return new ii(this.element,e,this.after)}withAfter(e){return new ii(this.element,this.before,e)}withElement(e){return this.element===e?this:new ii(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),n=e?e.nextSibling:this.element.firstChild;for(;pA(n);)e=n,n=n.nextSibling;let r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===t_()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Wa||gs||Ha);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,s=this.before,i=Sn().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,s),e){let a=Sn().createElement("img");a.setAttribute("data-lexical-managed-linebreak","true"),a.style.setProperty("display","inline","important"),a.style.setProperty("border","0px","important"),a.style.setProperty("margin","0px","important"),a.alt="",r.insertBefore(a,i),r.__lexicalLineBreak=a}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),n=this.getInsertionAnchor(),r=0;for(let s=this.element.firstChild;s!==null&&s!==e&&s!==n;s=s.nextSibling)r++;return r}resolveChildIndex(e,n,r,s){if(r===this.element){let c=this.getFirstChildOffset(),d=t_(),f=this.element.childNodes,g=Math.min(s,f.length),p=0;for(let m=c;m<g;m++)f[m]!==d&&p++;return[e,Math.min(p,e.getChildrenSize())]}let i=o_(n,r);i.push(s);let a=o_(n,this.element),l=e.getIndexWithinParent();for(let c=0;c<a.length;c++){let d=i[c],f=a[c];if(d===void 0||d<f)break;if(d>f){l+=1;break}}return[e.getParentOrThrow(),l]}}function o_(e,n){let r=[],s=n;for(;s!==e&&s!==null;s=s.parentNode){let i=0;for(let a=s.previousSibling;a!==null;a=a.previousSibling)i++;r.push(i)}return s!==e&&q(225),r.reverse()}var dx;try{dx="0.49.0+prod.esm"}catch(e){}var fx=dx??'"<unknown>+source"';class ei{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let n of this._back)e.push(n);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}var ls=null;function gx(e,n=1000){return e instanceof Ta?e.clone():e.size<n?new Map(e):new Ta().init(new Map(e),void 0,e.size)}class Ta{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new Ta().init(this._old,this._nursery,this._size)}init(e,n,r){return this._old=e,this._nursery=n,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let n=this._nursery&&this._nursery.get(e);return n!==void 0?n:this._old&&this._old.get(e)}get(e){let n=this.getWithTombstone(e);return n===ls?void 0:n}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let n=new Map(this._old);for(let[r,s]of this._nursery)s!==ls?n.set(r,s):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(e,n){let r=this.getWithTombstone(e);if(r===n)return this;let s=this.getNursery();return r!==ls&&r!==void 0||(this._size++,r===ls&&s.delete(e)),s.set(e,n),this}delete(e){let n=this.has(e);return n&&(this.getNursery().set(e,ls),this._size--),n}getOrInsert(e,n){let r=this.get(e);return r!==void 0?r:(this.set(e,n),n)}getOrInsertComputed(e,n){let r=this.get(e);if(r!==void 0)return r;let s=n(e);return this.set(e,s),s}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,n=this._old;if(n)for(let r of n){let s=r[0],i=e?e.get(s):void 0;i!==ls&&(i!==void 0&&(r[1]=i),yield r)}if(e)for(let r of e)r[1]===ls||n&&n.has(r[0])||(yield r)}forEach(e,n){n!==void 0&&(e=e.bind(n));for(let[r,s]of this.entries())e(s,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function hc(e,n,r,s,i,a){if(Y(e)){let l=e.getFirstChild();for(;l!==null;){let c=l.__key;l.__parent===n&&((Y(l)||$o(l)&&l.__slots!==null)&&hc(l,c,r,s,i,a),r.has(c)||a.delete(c),i.push(c)),l=l.getNextSibling()}}for(let l of $o(e)&&e.__slots!==null?e.__slots.values():[]){let c=s.get(l);c!==void 0&&$r(c)&&c.__slotHost===n&&((Y(c)||$o(c)&&c.__slots!==null)&&hc(c,l,r,s,i,a),r.has(l)||a.delete(l),i.push(l))}}var df=!1,Uf=0;function hA(e){Uf=e.timeStamp}function Zd(e,n,r){let s=e.nodeName==="BR",i=n.__lexicalLineBreak;return i&&(e===i||s&&e.previousSibling===i)||s&&hi(e,r)!==void 0}function mA(e,n,r){let s=qn(Nn(r)),i=s&&Vn(s,r._rootElement),a=null,l=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,l=i.focusOffset);let c=e.nodeValue;c!==null&&mg(n,c,a,l,!1)}function _A(e,n,r){if(ge(e)){let s=e.anchor.getNode();if(s.is(r)&&e.format!==s.getFormat())return!1}return Co(n)&&r.isAttached()}function xA(e,n,r){for(let s=e;s&&!vg(s);s=Es(s)){let i=hi(s,n);if(i!==void 0){let a=ot(i,r);if(a)return qe(a)||!Ct(s)?void 0:[s,a]}}}function px(e,n,r){df=!0;let s=performance.now()-Uf>100;try{Wn(e,()=>{let i=ze()||function(p){return p.read("latest",()=>{let m=ze();return m!==null?m.clone():null})}(e),a=new Map,{_editorState:l,_blockCursorElement:c}=e,d=!1,f="";for(let p=0;p<n.length;p++){let m=n[p],{type:_,target:x}=m,C=xA(x,e,l);if(!C)continue;let[y,N]=C;if(_==="characterData")s&&te(N)&&Co(x)&&_A(i,x,N)&&mA(x,N,e);else if(_==="childList"){d=!0;let T=m.addedNodes;for(let F=0;F<T.length;F++){let k=T[F],H=fg(k),U=k.parentNode;if(!(U==null||k===c||H!==null||Zd(k,U,e)||e._slotsUsed&&Ct(k)&&k.hasAttribute("data-lexical-slot")||vg(k))){if(ko){let W=(Ct(k)?k.innerText:null)||k.nodeValue;W&&(f+=W)}U.removeChild(k)}}let v=m.removedNodes,R=v.length;if(R>0){let F=0;for(let k=0;k<R;k++){let H=v[k];(Zd(H,x,e)||c===H)&&(x.appendChild(H),F++)}R!==F&&a.set(y,N)}}}if(a.size>0)for(let[p,m]of a)m.reconcileObservedMutation(p,e);let g=r.takeRecords();if(g.length>0){for(let p=0;p<g.length;p++){let m=g[p],{addedNodes:_,target:x}=m;for(let C=0;C<_.length;C++){let y=_[C],N=y.parentNode;N==null||y.nodeName!=="BR"||Zd(y,x,e)||N.removeChild(y)}}r.takeRecords()}i!==null&&(d&&rn(i),ko&&jC(e)&&i.insertRawText(f))})}finally{df=!1}}function hx(e){let n=e._observer;if(n!==null)px(e,n.takeRecords(),n)}function mx(e){(function(n){Uf===0&&Nn(n).addEventListener("textInput",hA,!0)})(e),e._observer=new MutationObserver((n,r)=>{px(e,n,r)})}var ff="direct",gf="latest";class _x{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||NA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}}function CA(e,n){return new _x(e,n)}function mc(e,n,r=gf){let s=(r===gf?e.getLatest():e).__state;return s?s.getValue(n):n.defaultValue}function yA(e,n,r){let s=mc(e,r,ff),i=mc(n,r,ff);return r.isEqual(s,i)?null:[s,i]}function SA(e,n,r){let s;if(Wt(),typeof r=="function"){let a=e.getLatest(),l=mc(a,n);if(s=r(l),n.isEqual(l,s))return a}else s=r;let i=e.getWritable();return Wf(i).updateFromKnown(n,s),i}function xx(e){let n=new Map,r=new Set;for(let{ownNodeConfig:s}of tl(typeof e=="function"?e:e.replace))if(s&&s.stateConfigs)for(let i of s.stateConfigs){let a;"stateConfig"in i?(a=i.stateConfig,i.flat&&r.add(a.key)):a=i,n.set(a.key,a)}return{flatKeys:r,sharedConfigMap:n}}var r_=new Set(["__proto__","constructor","prototype"]);class Hf{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=s;let{sharedConfigMap:a}=this.sharedNodeState,l=i!==void 0?i:function(c,d,f){let g=f.size;if(d)for(let p in d){let m=c.get(p);m&&f.has(m)||g++}return g}(a,r,s);this.size=l}getValue(e){let n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},n={};for(let[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(let r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return s_(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;let{sharedNodeState:n,unknownState:r}=this,s=new Map(this.knownState);return new Hf(e,n,function(i,a,l){let c;if(l)for(let[d,f]of Object.entries(l)){if(r_.has(d))continue;let g=i.get(d);g?a.has(g)||a.set(g,g.parse(f)):(c=c||{},c[d]=f)}return c}(n.sharedConfigMap,s,r),s,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=s_(i)),this.size++),s.set(e,n)}updateFromUnknown(e,n){if(r_.has(e))return;let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},(e in this.unknownState)||this.size++,this.unknownState[e]=n)}updateFromJSON(e){let{knownState:n}=this;for(let r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(let[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}}function Wf(e){let n=e.getWritable(),r=n.__state?n.__state.getWritable(n):new Hf(n,Cx(n));return n.__state=r,r}function Cx(e){return e.__state?e.__state.sharedNodeState:dg(yo(),e.getType()).sharedNodeState}function s_(e){if(e)for(let n in e)return e}function NA(e){return e}function i_(e,n,r){for(let[s,i]of n.knownState){if(e.has(s.key))continue;e.add(s.key);let a=r?r.getValue(s):s.defaultValue;if(a!==i&&!s.isEqual(a,i))return!0}return!1}function a_(e,n,r){let{unknownState:s}=n,i=r?r.unknownState:void 0;if(s)for(let[a,l]of Object.entries(s)){if(e.has(a))continue;if(e.add(a),l!==(i?i[a]:void 0))return!0}return!1}function l_(e,n){let r=e.__state;return r&&r.node===e?r.getWritable(n):r}function c_(e,n){let{__mode:r,__format:s,__style:i}=e,{__mode:a,__format:l,__style:c}=n,d=e.__state,f=n.__state;return(r===null||r===a)&&(s===null||s===l)&&(i===null||i===c)&&(e.__state===null||d===f||function(g,p){if(g===p)return!0;let m=new Set;return!(g&&i_(m,g,p)||p&&i_(m,p,g)||g&&a_(m,g,p)||p&&a_(m,p,g))}(d,f))}function u_(e,n){let r=e.mergeWithSibling(n),s=Ve()._normalizedNodes;return s.add(e.__key),s.add(n.__key),r}function d_(e){let n,r,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(n=s.getPreviousSibling())!==null&&te(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(c_(n,s)){s=u_(n,s);break}break}n.remove()}for(;(r=s.getNextSibling())!==null&&te(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(c_(s,r)){s=u_(s,r);break}break}r.remove()}}else s.remove()}function ni(e){return f_(e.anchor),f_(e.focus),e}function f_(e){for(;e.type==="element";){let n=e.getNode(),r=e.offset,s,i;if(r===n.getChildrenSize()?(s=n.getChildAtIndex(r-1),i=!0):(s=n.getChildAtIndex(r),i=!1),te(s)){e.set(s.__key,i?s.getTextContentSize():0,"text",!0);break}if(!Y(s))break;e.set(s.__key,i?s.getChildrenSize():0,"element",!0)}}var ba=Symbol.for("@lexical/CachedTextSize");function g_(e,n){return hf.read(()=>{let r=0,s=e;for(let i=0;i<n&&s!==null;i++){let a=ho.get(s);if(a===void 0&&q(345,s),Y(a)){let l=xt.get(s);if(l!==void 0&&Y(l)&&l.__parent!==a.__parent)r+=a.getTextContentSize();else{let c=ps.get(s),d=c&&c.__lexicalTextContent;typeof d!="string"&&q(346,a.getType()),r+=d.length}i<n-1&&!a.isInline()&&(r+=2)}else{let l=a[ba];l===void 0&&q(347,a.getType(),s),r+=l}s=a.__next}return r},{editor:Ye})}function yx(e){Y(e)||e[ba]===void 0&&(e[ba]=te(e)?e.__text.length:e.getTextContentSize())}var EA=4,va,Ye,Oa,Fe="",Tt=null,en=null,qt=null;function Mo(){return{firstTextKey:qt,format:Tt,style:en}}function zn(e){e.firstTextKey!==null&&(Tt=e.format,en=e.style,qt=e.firstTextKey)}function pf(e){if(qt!==null)return;let n=e.__lexicalFirstTextKey;if(n===void 0&&q(348),n===null)return;let r=xt.get(n);te(r)&&(Tt=r.getFormat(),en=r.getStyle(),qt=n)}var Lc,ma,_a,ho,hf,xt,ps,mf,Aa,hs,sr=!1,_c=!1;function Ar(e,n){let r=ho.get(e),s=xt.has(e);if(n!==null){let i=Sf(e);i.parentNode===n&&n.removeChild(i)}if(!s){if(Ye._keyToDOMMap.delete(e),Y(r)){let i=Ka(r,ho);_f(i,0,i.length-1,null)}if(r!==void 0){for(let i of Rn(r).values()){let a=Cf(i);Ar(i,null),a!==null&&a.remove()}_g(Aa,Oa,Lc,r,"destroyed")}}}function _f(e,n,r,s){for(let i=n;i<=r;++i){let a=e[i];a!==void 0&&Ar(a,s)}}function cs(e,n){e.setProperty("text-align",n)}var TA="40px";function Sx(e,n){let r=va.theme.indent;if(typeof r=="string"){let s=e.classList.contains(r);n>0&&!s?e.classList.add(r):n<1&&s&&e.classList.remove(r)}e.style.setProperty("padding-inline-start",n===0?"":`calc(${n} * var(--lexical-indent-base-value, ${TA}))`)}function Nx(e,n){let r=e.style;n===0?cs(r,""):n===1?cs(r,"left"):n===2?cs(r,"center"):n===3?cs(r,"right"):n===4?cs(r,"justify"):n===5?cs(r,"start"):n===6&&cs(r,"end")}function xf(e,n){let r=function(s){let i=s.__dir;if(i!==null)return i;if(Kt(s))return null;let a=s.getParent();return a===null||At(a)&&a.__dir===null?"auto":null}(n);r!==null?e.dir=r:e.removeAttribute("dir")}function Ex(e){let n=Sn().createElement("div");return n.setAttribute("data-lexical-slot",e),n.style.display="none",n}function Tx(e,n,r){n||e.contentEditable==="false"?dy(r,Ye):r.removeAttribute("contenteditable")}function p_(e,n,r){let s=Fe,i=Mo();Fe="";let a="",l=qe(e);for(let[c,d]of r){let f=Ex(c);Tx(n,l,f),n.appendChild(f),Fe="";let g=Mo();Rr(d,$n(e,f,Ye)),zn(g),bx(e,c,n,f),a+=Fe}return zn(i),Fe=s,a}function Rn(e){return $o(e)&&e.__slots!==null?e.__slots:gy}function bx(e,n,r,s){let i=hs.$getSlotTargetElement(e,n,r,Ye);i!==null&&(s.parentElement!==i&&i.appendChild(s),s.style.display="")}function Cf(e){let n=ps.get(e);return n!==void 0?n.parentElement:null}function h_(e,n,r){let s=Rn(e),i=Rn(n);for(let[g,p]of s)if(!i.has(g)){let m=Cf(p);Ar(p,null),m!==null&&m.remove()}let a=Fe,l=Mo(),c="",d=null,f=qe(n);for(let[g,p]of i){let m=s.get(g),_=m!==void 0?Cf(m):null;Fe="";let x=Mo();if(_===null){_=Ex(g);let C=null;for(let y of r.children)if(!y.hasAttribute("data-lexical-slot")){C=y;break}r.insertBefore(_,C),Rr(p,$n(n,_,Ye))}else m===p?rr(p,_):(m!==void 0&&Ar(m,_),Rr(p,$n(n,_,Ye)));if(zn(x),Tx(r,f,_),bx(n,g,r,_),c+=Fe,_.parentElement===r){let C=d===null?r.firstChild:d.nextSibling;C!==_&&r.insertBefore(_,C),d=_}}return zn(l),Fe=a,c}function Rr(e,n){let r=xt.get(e);if(r===void 0&&q(60),n!==null){let i=ho.get(e);if(i!==void 0){let a=ps.get(e);if(a!==void 0){let l=$r(i)?i.__slotHost:null,c=$r(r)?r.__slotHost:null,d=i.__parent!==r.__parent||l!==c,f=c!==null&&a.parentElement!==n.element;if(d||f)return n.insertChild(a),rr(e,n.element)}}}let s=hs.$createDOM(r,Ye);if(function(i,a,l){let c=l._keyToDOMMap;BC(a,l,i),c.set(i,a)}(e,s,Ye),te(r)?s.setAttribute("data-lexical-text","true"):qe(r)&&(s.setAttribute("data-lexical-decorator","true"),uy(s,{captureSelection:!0})),Y(r)){let{__indent:i,__size:a}=r;xf(s,r),i!==0&&Sx(s,i);let l=Rn(r),c=l.size>0?p_(r,s,l):"";if(a===0)s.__lexicalTextContent=c,s.__lexicalFirstTextKey=null,Fe+=c,l.size>0&&(s.__lexicalSlotTextLength=c.length);else{let f=Fe,g=a-1;if(yf(Ka(r,xt),r,0,g,$n(r,s,Ye)),c!==""){let p=s.__lexicalTextContent||"";s.__lexicalTextContent=c+p,Fe=f+c+p}l.size>0&&(s.__lexicalSlotTextLength=c.length)}let d=r.__format;d!==0&&Nx(s,d),r.isInline()||vx(null,r,s)}else{let i=r.getTextContent();if(qe(r)){let a=r.decorate(Ye,va);a!==null&&Ox(e,a),s.contentEditable="false";let l=Rn(r);l.size>0&&p_(r,s,l)}Fe+=i}return n!==null&&n.insertChild(s),hs.$decorateDOM(r,null,s,Ye),yx(r),_g(Aa,Oa,Lc,r,"created"),s}function yf(e,n,r,s,i){let a=Fe,l=Mo();Fe="",Tt=null,en=null,qt=null;let c=r;for(;c<=s;++c){let f=Mo();Rr(e[c],i);let g=xt.get(e[c]);g!==null&&te(g)?Tt===null&&(Tt=g.getFormat(),en=g.getStyle(),qt=g.__key):Y(g)&&c<s&&!g.isInline()&&(Fe+=ds),zn(f)}let d=Ye._keyToDOMMap.get(n.__key);d===void 0&&q(349,n.__key),d.__lexicalTextContent=Fe,d.__lexicalFirstTextKey=qt,Fe=a+Fe,zn(l)}function vx(e,n,r){let s=$n(n,r,Ye),i=s.element.__lexicalLastChildKind??null,a=function(l,c){if(l){let d=l.__last;if(d){let f=c.get(d);if(f)return Lo(f)?"line-break":qe(f)&&f.isInline()?"decorator":null}return Rn(l).size>0?null:"empty"}return null}(n,xt);i!==a&&s.setManagedLineBreak(a)}function bA(e,n,r){var s;Tt=null,en=null,qt=null,function(i,a,l){let c=Fe,d=i.__size,f=a.__size;Fe="";let g=l.element,p=Ye._keyToDOMMap.get(a.__key);p===void 0&&q(351,a.__key);let m=f-d;if(!sr&&Math.abs(m)<=1&&d>=EA&&i.__first===a.__first&&(m!==0||!Ye._cloneNotNeeded.has(i.__key))){let _=p.__lexicalTextContent,x=mf.get(i.__key);if(!sr&&typeof _=="string"&&x!==void 0){let C=function(y,N){let T=N.size;if(T===0||T>=y.__size)return null;let v=y.__last,R=null,F=0;for(;v!==null&&F<T;){if(!N.has(v))return null;R=v;let k=xt.get(v);if(k===void 0)return null;v=k.__prev,F++}if(F!==T)return null;if(v!==null&&N.has(v))return null;return R}(a,x);if(C!==null){let y=x.size;if(m===0){let N=g_(C,y),T=C,v=0;for(;T!==null&&v<y;){let U=xt.get(T);if(U===void 0)break;let W=Mo();rr(T,g),te(U)&&Tt===null&&(Tt=U.getFormat(),en=U.getStyle(),qt=U.__key),zn(W),T=U.__next,v++}let R="";for(T=C,v=0;T!==null&&v<y;){let U=xt.get(T);if(U===void 0)break;let W;if(Y(U)){let J=Ye._keyToDOMMap.get(T),G=J&&J.__lexicalTextContent;typeof G!="string"&&q(352,U.getType()),W=G}else W=U.getTextContent();R+=W,v<y-1&&Y(U)&&!U.isInline()&&(R+=ds),T=U.__next,v++}let F=p.__lexicalSlotTextLength||0,k=F>0?_.slice(F):_,H=k.slice(0,k.length-N)+R;return p.__lexicalTextContent=H,Fe=c+H,void m_(a,p,x)}if(function(N,T,v,R,F,k,H,U){if(U!==1&&U!==-1)return!1;if(H!==(U===1?2:1))return!1;let J=H-U,G=N.__last;for(let Be=0;Be<J-1;Be++){if(G===null)return!1;let _t=ho.get(G);if(_t===void 0)return!1;G=_t.__prev}if(G===null)return!1;let ne=xt.get(k),ee=ho.get(G);if(ne===void 0||ee===void 0)return!1;if(ne.__prev!==ee.__prev)return!1;let se=[],V=k;for(let Be=0;Be<H;Be++){if(V===null)return!1;se.push(V);let _t=xt.get(V);V=_t?_t.__next:null}let fe=[];V=G;for(let Be=0;Be<J;Be++){if(V===null)return!1;fe.push(V);let _t=ho.get(V);V=_t?_t.__next:null}let Ce=new Set(fe),Ae=new Set(se),oe=[],ae=0,ue=0;for(;ae<J&&ue<H;)if(se[ue]===fe[ae])oe.push({key:se[ue],kind:"reconcile"}),ae++,ue++;else if(Ae.has(fe[ae])){if(Ce.has(se[ue]))return!1;oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++}else oe.push({key:fe[ae],kind:"destroy"}),ae++;for(;ae<J;)oe.push({key:fe[ae++],kind:"destroy"});for(;ue<H;)oe.push({key:se[ue],kind:"create",nextIndex:ue}),ue++;let we=g_(G,J);for(let Be of oe){let _t=Mo();if(Be.kind==="reconcile")rr(Be.key,v.element);else if(Be.kind==="destroy")Ar(Be.key,v.element);else{let Vt=null;for(let Tr=Be.nextIndex+1;Tr<H;Tr++){let er=Ye._keyToDOMMap.get(se[Tr]);if(er!==void 0){Vt=er;break}}Rr(Be.key,v.withBefore(Vt??v.before))}if(Be.kind!=="destroy"){let Vt=xt.get(Be.key);Vt&&te(Vt)&&Tt===null&&(Tt=Vt.getFormat(),en=Vt.getStyle(),qt=Vt.__key)}zn(_t)}let Ie="";for(let Be=0;Be<H;Be++){let _t=xt.get(se[Be]);if(_t===void 0)return!1;let Vt;if(Y(_t)){let Tr=Ye._keyToDOMMap.get(se[Be]),er=Tr&&Tr.__lexicalTextContent;typeof er!="string"&&q(350,_t.getType()),Vt=er}else Vt=_t.getTextContent();Ie+=Vt,Be<H-1&&Y(_t)&&!_t.isInline()&&(Ie+=ds)}let ht=R.__lexicalSlotTextLength||0,Qt=ht>0?F.slice(ht):F;return R.__lexicalTextContent=Qt.slice(0,Qt.length-we)+Ie,!0}(i,0,l,p,_,C,y,m)){let N=p.__lexicalTextContent;return typeof N!="string"&&q(353),Fe=c+N,void m_(a,p,x)}}}if(m===0){let C=i.__first,y=0;for(;C!==null;){let N=xt.get(C);if(N===void 0)break;let T=sr||_a.has(C)||ma.has(C),v=Mo();if(T)rr(C,g);else{let R,F;if(Y(N)){F=ps.get(C);let k=F&&F.__lexicalTextContent;typeof k!="string"&&q(354,N.getType()),R=k}else R=N.getTextContent();Fe+=R,F!==void 0&&pf(F)}te(N)?Tt===null&&(Tt=N.getFormat(),en=N.getStyle(),qt=N.__key):Y(N)&&y<f-1&&!N.isInline()&&(Fe+=ds),zn(v),C=N.__next,y++}return p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,void(Fe=c+Fe)}}if(d===1&&f===1){let _=i.__first,x=a.__first;if(_===x)rr(_,g);else{let y=Sf(_),N=Rr(x,null);try{y.parentNode===g?g.replaceChild(N,y):l.insertChild(N)}catch(T){if(typeof T=="object"&&T!=null){let v=`${T.toString()} Parent: ${g.tagName}, new child: {tag: ${N.tagName} key: ${x}}, old child: {tag: ${y.tagName}, key: ${_}}.`;throw Error(v)}throw T}Ar(_,null)}let C=xt.get(x);te(C)&&Tt===null&&(Tt=C.getFormat(),en=C.getStyle(),qt=C.__key)}else{let _=Ka(i,ho),x=Ka(a,xt);if(_.length!==d&&q(227),x.length!==f&&q(228),d===0)f!==0&&yf(x,a,0,f-1,l);else if(f===0){if(d!==0){let C=l.after==null&&l.before==null&&Rn(a).size===0&&l.element.__lexicalLineBreak==null;_f(_,0,d-1,C?null:g),C&&(g.textContent="")}}else(function(C,y,N,T,v,R){let F=T-1,k=v-1,H,U,W=R.getFirstChild(),J=0,G=0;for(;J<=F&&G<=k;){let se=y[J],V=N[G],fe=Mo();if(se===V)W=Qd(rr(V,R.element)),J++,G++;else{if(U===void 0&&(U=__(N,G)),H===void 0)H=__(y,J);else if(!H.has(se)){J++,zn(fe);continue}if(!U.has(se)){W=Qd(Sf(se)),Ar(se,R.element),J++,H.delete(se),zn(fe);continue}if(H.has(V)){let Ae=ui(Ye,V);Ae!==W&&R.withBefore(W??R.before).insertChild(Ae),W=Qd(rr(V,R.element)),J++,G++}else Rr(V,R.withBefore(W??R.before)),G++}let Ce=xt.get(V);Ce!==null&&te(Ce)?Tt===null&&(Tt=Ce.getFormat(),en=Ce.getStyle(),qt=Ce.__key):Y(Ce)&&G<=k&&!Ce.isInline()&&(Fe+=ds),zn(fe)}let ne=J>F,ee=G>k;if(ne&&!ee){let se=N[k+1],V=se===void 0?null:Ye.getElementByKey(se);yf(N,C,G,k,R.withBefore(V??R.before))}else ee&&!ne&&_f(y,J,F,R.element)})(a,_,x,d,f,l)}p.__lexicalTextContent=Fe,p.__lexicalFirstTextKey=qt,Fe=c+Fe}(e,n,$n(n,r,Ye)),At(n)||(s=n,Tt==null||Tt===s.__textFormat||_c||s.setTextFormat(Tt),function(i){en==null||en===i.__textStyle||_c||i.setTextStyle(en)}(n))}function m_(e,n,r){let s=n.__lexicalFirstTextKey;if(s!=null){let i=e.__key,a=s;for(;a!==null;){let l=xt.get(a);if(l===void 0){a=null;break}if(l.__parent===i)break;a=l.__parent}if(a!==null&&!r.has(a)){let l=xt.get(s);if(te(l))return Tt=l.getFormat(),void(en=l.getStyle())}}n.__lexicalFirstTextKey=qt}function rr(e,n){let r=ho.get(e),s=xt.get(e);r!==void 0&&s!==void 0||q(61);let i=sr||_a.has(e)||ma.has(e),a=ui(Ye,e);if(r===s&&!i){let l;if(Y(r)){let c=a.__lexicalTextContent;typeof c!="string"&&q(355,r.getType()),l=c,pf(a)}else l=r.getTextContent();return Fe+=l,a}if(r!==s&&i&&_g(Aa,Oa,Lc,s,"updated"),hs.$updateDOM(s,r,a,Ye)){let l=Rr(e,null);return n===null&&q(62),n.replaceChild(l,a),Ar(e,null),l}if(Y(r)){Y(s)||q(334,e);let l=s.__indent;(sr||l!==r.__indent)&&Sx(a,l);let c=s.__format;(sr||c!==r.__format)&&Nx(a,c);let d=i&&(Rn(s).size>0||Rn(r).size>0)?h_(r,s,a):"";if(i){let f=Fe;if(bA(r,s,a),Kt(s)||s.isInline()||vx(0,s,a),d!==""){let g=a.__lexicalTextContent||"";a.__lexicalTextContent=d+g,Fe=f+d+g,a.__lexicalSlotTextLength=d.length}else(Rn(s).size>0||Rn(r).size>0)&&(a.__lexicalSlotTextLength=0)}else{let f=a.__lexicalTextContent;typeof f!="string"&&q(356,r.getType()),Fe+=f,pf(a)}if((sr||s.__dir!==r.__dir||s.__parent!==r.__parent)&&(xf(a,s),Kt(s)&&!sr)){for(let f of s.getChildren())if(Y(f))xf(ui(Ye,f.getKey()),f)}}else{let l=s.getTextContent();if(qe(s)){let c=s.decorate(Ye,va);c!==null&&Ox(e,c),i&&(Rn(s).size>0||Rn(r).size>0)&&h_(r,s,a)}Fe+=l}if(!_c&&Kt(s)){let l=s.getLatest();if(l.__cachedText!==Fe){let c=l.getWritable();c.__cachedText=Fe,s=c}}return hs.$decorateDOM(s,r,a,Ye),yx(s),a}function Ox(e,n){let r=Ye._pendingDecorators,s=Ye._decorators;if(r===null){if(s[e]===n)return;r=KC(Ye)}r[e]=n}function Qd(e){let n=e.nextSibling;return n!==null&&n===Ye._blockCursorElement&&(n=n.nextSibling),n}function __(e,n){let r=new Set;for(let s=n;s<e.length;s++)r.add(e[s]);return r}function vA(e,n,r,s,i,a){Fe="",Tt=null,en=null,qt=null,sr=s===2,Ye=r,va=r._config,hs=r._config.dom||La,Oa=r._nodes,Lc=Ye._listeners.mutation,ma=i,_a=a,ho=e._nodeMap,hf=e,xt=n._nodeMap,_c=n._readOnly,ps=gx(r._keyToDOMMap),mf=function(){let c=new Map,d=(f)=>{for(let g of f){let p=xt.get(g);if(p===void 0)continue;let m=p.__parent;if(m===null)continue;let _=c.get(m);_===void 0&&(_=new Set,c.set(m,_)),_.add(g)}};return d(ma.keys()),d(_a),c}();let l=new Map;return Aa=l,rr("root",null),Ye=void 0,Oa=void 0,ma=void 0,_a=void 0,ho=void 0,hf=void 0,xt=void 0,va=void 0,ps=void 0,mf=void 0,Aa=void 0,hs=La,l}function Sf(e){let n=ps.get(e);return n===void 0&&q(75,e),n}function Ee(e){return{type:e}}var Gf=Ee("SELECTION_CHANGE_COMMAND"),OA=Ee("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ax=Ee("CLICK_COMMAND"),jf=Ee("BEFORE_INPUT_COMMAND"),Yf=Ee("INPUT_COMMAND"),Vf=Ee("COMPOSITION_START_COMMAND"),Xf=Ee("COMPOSITION_END_COMMAND"),Ra=Ee("DELETE_CHARACTER_COMMAND"),xa=Ee("INSERT_LINE_BREAK_COMMAND"),Nf=Ee("INSERT_PARAGRAPH_COMMAND"),ai=Ee("CONTROLLED_TEXT_INSERTION_COMMAND"),qf=Ee("PASTE_COMMAND"),ac=Ee("REMOVE_TEXT_COMMAND"),Ma=Ee("DELETE_WORD_COMMAND"),Da=Ee("DELETE_LINE_COMMAND"),vr=Ee("FORMAT_TEXT_COMMAND"),AA=Ee("SET_TEXT_FORMAT_COMMAND"),Jf=Ee("UNDO_COMMAND"),Zf=Ee("REDO_COMMAND"),Qf=Ee("KEYDOWN_COMMAND"),Rx=Ee("KEY_ARROW_RIGHT_COMMAND"),Mx=Ee("MOVE_TO_END"),Dx=Ee("KEY_ARROW_LEFT_COMMAND"),$x=Ee("MOVE_TO_START"),wx=Ee("KEY_ARROW_UP_COMMAND"),kx=Ee("KEY_ARROW_DOWN_COMMAND"),xc=Ee("KEY_ENTER_COMMAND"),Ix=Ee("KEY_SPACE_COMMAND"),Lx=Ee("KEY_BACKSPACE_COMMAND"),Fx=Ee("KEY_ESCAPE_COMMAND"),Px=Ee("KEY_DELETE_COMMAND"),Bx=Ee("KEY_TAB_COMMAND"),RA=Ee("INSERT_TAB_COMMAND"),MA=Ee("INDENT_CONTENT_COMMAND"),DA=Ee("OUTDENT_CONTENT_COMMAND"),Kx=Ee("DROP_COMMAND"),$A=Ee("FORMAT_ELEMENT_COMMAND"),zx=Ee("DRAGSTART_COMMAND"),Ux=Ee("DRAGOVER_COMMAND"),Hx=Ee("DRAGEND_COMMAND"),eg=Ee("COPY_COMMAND"),tg=Ee("CUT_COMMAND"),Wx=Ee("SELECT_ALL_COMMAND"),wA=Ee("CLEAR_EDITOR_COMMAND"),kA=Ee("CLEAR_HISTORY_COMMAND"),IA=Ee("CAN_REDO_COMMAND"),LA=Ee("CAN_UNDO_COMMAND"),Gx=Ee("FOCUS_COMMAND"),jx=Ee("BLUR_COMMAND"),Yx=Ee("KEY_MODIFIER_COMMAND");function Vx(e){let n=new Map;return{dispose(){for(let r of n.values())r.dispose();n.clear()},register(r,s){let i=n.get(r);i===void 0&&(i={dispose:e(r,s),holders:new Set},n.set(r,i));let a=()=>{let l=n.get(r);l&&l.holders.delete(a)&&l.holders.size===0&&(n.delete(r),l.dispose())};return i.holders.add(a),a}}}function ng(e,n,r,s){return e.addEventListener(n,r,s),e.removeEventListener.bind(e,n,r,s)}var tr=Object.freeze({}),Ef=[["keydown",function(e,n){let r=n._inputState;if(r.lastKeyDownTimeStamp=e.timeStamp,r.lastKeyCode=e.key,e.key!=="Backspace"&&$a(r),n.isComposing())return;ie(n,Qf,e)}],["pointerdown",function(e,n){let r=Ng(e),s=e.pointerType;_i(r)&&s!=="touch"&&s!=="pen"&&e.button===0&&Wn(n,()=>{Ba(r,n)||(n._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,n){ie(n,Vf,e)}],["compositionend",function(e,n){let r=n._inputState;ko?r.compositionPhase="ending-firefox":gs||!Ha&&!Wa?ie(n,Xf,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,n){e.stopPropagation();let r=n._inputState;$a(r),Wn(n,()=>{Zx(e,n)||n.dispatchCommand(Yf,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,n){Wn(n,()=>{let r=ze(),s=qn(Nn(n)),i=Ns();if(s){if(ge(r)){let a=r.anchor,l=a.getNode();a.type==="element"&&a.offset===0&&r.isCollapsed()&&!Kt(l)&&Dn().getChildrenSize()===1&&l.getTopLevelElementOrThrow().isEmpty()&&i!==null&&r.is(i)&&(s.removeAllRanges(),r.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let a=Vn(s,n._rootElement).anchorNode;if(Ct(a)||Co(a))rn(ka(i,s,n,e))}}if(ko&&s!==null&&s.rangeCount===0){let a=n._rootElement;if(a!==null&&e.target===a){let l=e.clientY,c=a.childNodes.length;for(let f=0;f<a.childNodes.length;f++){let g=a.childNodes[f];if(Ct(g)){let p=g.getBoundingClientRect();if(l<=(p.top+p.bottom)/2){c=f;break}}}s.setBaseAndExtent(a,c,a,c);let d=ka(i,s,n,e);d!==null?rn(d):s.removeAllRanges()}}ie(n,Ax,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];Sa&&Ef.push(["beforeinput",(e,n)=>function(r,s){let i=r.inputType;if(i==="deleteCompositionText"||ko&&jC(s))return;if(i==="insertCompositionText")return;Wn(s,()=>{Zx(r,s)||ie(s,jf,r)},{event:r})}(e,n)]);var Tf=new WeakMap,Cc=new WeakMap,FA=Vx((e)=>(e.addEventListener("selectionchange",N_),()=>e.removeEventListener("selectionchange",N_)));function Xx(e,n,r,s,i,a){let{anchor:l,focus:c}=e,d=l.getNode(),f=Ve(),g;if(a!==void 0)g=a;else{let C=qn(Nn(f));g=C!==null?Vn(C,f._rootElement):null}let p=g!==null?g.anchorNode:null,m=l.key,_=f.getElementByKey(m),x=r.length;return m!==c.key||!te(d)||(!i&&(!Sa||f._inputState.lastBeforeInputInsertTextTimeStamp<s+50)||d.isDirty()&&x<2||zC(r))&&l.offset!==c.offset&&!d.isComposing()||Gn(d)||d.isDirty()&&x>1||(i||!Sa)&&_!==null&&!d.isComposing()&&p!==ir(d,_,f)||g!==null&&n!==null&&(!n.collapsed||n.startContainer!==g.anchorNode||n.startOffset!==g.anchorOffset)||!d.isComposing()&&(d.getFormat()!==e.format||d.getStyle()!==e.style)||function(C,y){if(y.isSegmented())return!0;if(!C.isCollapsed())return!1;let N=C.anchor.offset,T=y.getParentOrThrow(),v=Fa(y);return N===0?!y.canInsertTextBefore()||!T.canInsertTextBefore()&&!y.isComposing()||v||function(R){let F=R.getPreviousSibling();return(te(F)||Y(F)&&F.isInline())&&!F.canInsertTextAfter()}(y):N===y.getTextContentSize()&&(!y.canInsertTextAfter()||!T.canInsertTextAfter()&&!y.isComposing()||v)}(e,d)}function x_(e,n){return Co(e)&&e.nodeValue!==null&&n!==0&&n!==e.nodeValue.length}function C_(e,n,r){let{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:l}=Vn(e,n._rootElement),c=n._inputState;c.isSelectionChangeFromDOMUpdate&&(c.isSelectionChangeFromDOMUpdate=!1,x_(s,i)&&x_(a,l)&&!c.postDeleteSelectionToRestore)||Wn(n,()=>{if(!r)return void rn(null);if(!qa(n,s,a))return;let d=ze();if(c.postDeleteSelectionToRestore&&ge(d)&&d.isCollapsed()){let f=d.anchor,g=c.postDeleteSelectionToRestore.anchor;(f.key===g.key&&f.offset===g.offset+1||f.offset===1&&g.getNode().is(f.getNode().getPreviousSibling()))&&(d=c.postDeleteSelectionToRestore.clone(),rn(d))}if(c.postDeleteSelectionToRestore=null,ge(d)){let f=d.anchor,g=f.getNode();if(d.isCollapsed()){e.type==="Range"&&s===a&&(d.dirty=!0);let p=Nn(n).event,m=p?p.timeStamp:performance.now(),{format:_,style:x,offset:C,key:y,timeStamp:N}=c.collapsedSelectionFormat,T=Dn(),v=n.isComposing()===!1&&T.getTextContent()==="";if(m<N+200&&f.offset===C&&f.key===y)lc(d,_,x);else if(f.type==="text")te(g)||q(141),qx(d,g);else if(f.type==="element"&&!v){Y(g)||q(259);let R=f.getNode();R.isEmpty()?function(F,k){let H=k.getTextFormat(),U=k.getTextStyle();lc(F,H,U)}(d,R):lc(d,d.format,"")}}else{let p=f.key,m=d.focus.key,_=d.getNodes(),x=_.length,C=d.isBackward(),y=C?l:i,N=C?i:l,T=C?m:p,v=C?p:m,R=2047,F=!1;for(let k=0;k<x;k++){let H=_[k],U=H.getTextContentSize();if(te(H)&&U!==0&&!(k===0&&H.__key===T&&y===U||k===x-1&&H.__key===v&&N===0)&&(F=!0,R&=H.getFormat(),R===0))break}d.format=F?R:0}}ie(n,Gf)})}function lc(e,n,r){e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}function qx(e,n){lc(e,n.getFormat(),n.getStyle())}function Jx(e){if(!e.getTargetRanges)return null;let n=e.getTargetRanges();return n.length===0?null:n[0]}function y_(e){let{lastKeyCode:n}=Ve()._inputState;if(e==null||e.length<=1||n==null)return;let r=n.length===1?n:n==="Enter"?`
5
5
  `:n==="Tab"?"\t":null;if(!r)return;let s=ze();if(!ge(s)||!s.isCollapsed())return;let i=s.anchor.getNode();if(!te(i))return;let{offset:a}=s.anchor;if(i.getTextContentSize()===a){let l=i.getNextSibling();if(r===`
6
- `){if(Lo(l))l.selectEnd();else if(!l){let c=br(i,CC),d=c&&c.getNextSibling();Y(d)&&d.selectStart()}}else r==="\t"?sg(l)&&l.selectEnd():te(l)&&l.getTextContent()[0]===r&&l.select(1,1)}else i.getTextContent()[a]===r&&i.select(a+1,a+1)}function wa(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function S_(e){wa(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>wa(e),0)}function Zx(e,n){let r=Ng(e);if(Ct(r)&&Ba(r,n))return!0;let s=n.getRootElement();if(s===null)return!1;let i=di(s.ownerDocument);return i!==null&&s.contains(i)&&Ba(i,n)}function PA(e){let n=e.inputType,r=Jx(e),s=Ve(),i=s._inputState,a=ze();if(n==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(wa(i),e.preventDefault(),ge(a)&&!a.isCollapsed()){let p=a.isBackward()?a.anchor:a.focus;a.anchor.set(p.key,p.offset,p.type),a.focus.set(p.key,p.offset,p.type)}return!0}if(n==="deleteContentBackward"){if(a===null){let p=Ns();if(!ge(p))return!0;rn(p.clone())}if(ge(a)){let p=a.anchor.key===a.focus.key;if(function(m,_){return m.lastKeyCode==="MediaLast"&&_<m.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&s.isComposing()&&p){if(Bt(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Wn(s,()=>{Bt(null)})},30),ge(a)){let m=a.anchor.getNode();m.markDirty(),te(m)||q(142),qx(a,m)}}else{if(Bt(null),gs&&r!==null&&!r.collapsed&&(a.applyDOMRange(r),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let m=a.anchor.getNode(),_=m.getTextContent(),x=m.canInsertTextAfter(),C=a.anchor.offset===0&&a.focus.offset===_.length,y=Na&&p&&!C&&x;if(y&&a.isCollapsed()&&(y=!qe(GC(a.anchor,!0))),!y){ie(s,Ma,!0);let N=ze();Na&&ge(N)&&N.isCollapsed()&&(i.postDeleteSelectionToRestore=N,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!ge(a))return!0;let l=e.data;i.unprocessedBeforeInputData!==null&&hg(!1,s,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||Kt(a.anchor.getNode())||r===null||a.applyDOMRange(r),i.unprocessedBeforeInputData=null;let{anchor:c,focus:d}=a,f=c.getNode(),g=d.getNode();if(n==="insertText"||n==="insertTranspose"){if(l===`
7
- `)e.preventDefault(),ie(s,xa,!1);else if(l===ds)e.preventDefault(),ie(s,Nf);else if(l==null&&e.dataTransfer){let p=e.dataTransfer.getData("text/plain");e.preventDefault(),a.insertRawText(p)}else l!=null&&Xx(a,r,l,e.timeStamp,!0)?(e.preventDefault(),ie(s,ai,l),y_(l)):i.unprocessedBeforeInputData=l;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ie(s,ai,e),y_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let p=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let m=s._compositionKey;Bt(null),p||ie(s,ai,e),cc(m);break}case"insertLineBreak":Bt(null),ie(s,xa,!1);break;case"insertParagraph":Bt(null),i.isInsertLineBreak&&!gs?(i.isInsertLineBreak=!1,ie(s,xa,!1)):ie(s,Nf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ie(s,qf,e);break;case"deleteByComposition":(function(p,m){return p!==m||Y(p)||Y(m)||!Fa(p)||!Fa(m)})(f,g)&&ie(s,ac,e);break;case"deleteByDrag":xs(Nc),ie(s,ac,e);break;case"deleteByCut":ie(s,ac,e);break;case"deleteContent":ie(s,Ma,!1);break;case"deleteWordBackward":ie(s,Da,!0);break;case"deleteWordForward":ie(s,Da,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ie(s,$a,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ie(s,$a,!1);break;case"formatStrikeThrough":ie(s,vr,"strikethrough");break;case"formatBold":ie(s,vr,"bold");break;case"formatItalic":ie(s,vr,"italic");break;case"formatUnderline":ie(s,vr,"underline");break;case"historyUndo":ie(s,Jf);break;case"historyRedo":ie(s,Zf)}return!0}function BA(e){let n=Ve(),r=n._inputState,s=ze(),i=e.data,a=Jx(e),l=!1;if(i!=null&&ge(s)){let c=qn(Nn(n)),d=c!==null?Vn(c,n._rootElement):null,f=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&!n.isComposing();f&&(r.hadOrphanedCompositionEvents=!0);let g=s.anchor.getNode(),p=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&n.isComposing()&&te(g)&&Gn(g);if(!f&&!p&&Xx(s,a,i,e.timeStamp,!1,d)){if(l=!0,r.compositionPhase==="ending-firefox"){let N=yc(n,i);if(r.compositionPhase="idle",N)return xs(Ec),X_(),!0}let m=s.anchor.getNode();if(c===null||d===null)return!0;let _=s.isBackward(),x=_?s.anchor.offset:s.focus.offset,C=_?s.focus.offset:s.anchor.offset;Sa&&!s.isCollapsed()&&te(m)&&d.anchorNode!==null&&m.getTextContent().slice(0,x)+i+m.getTextContent().slice(x+C)===HC(d.anchorNode)||ie(n,ai,i);let y=i.length;ko&&y>1&&e.inputType==="insertCompositionText"&&!n.isComposing()&&(s.anchor.offset-=y,s._cachedNodes=null,s._cachedIsBackward=null),Na&&n.isComposing()&&(r.lastKeyDownTimeStamp=0,Bt(null))}}if(!l)hg(!1,n,i!==null?i:void 0),r.compositionPhase==="ending-firefox"&&(yc(n,i||void 0),xs(Ec),r.compositionPhase="idle");return X_(),!0}function KA(e){let n=Ve(),r=n._inputState,s=ze();if(ge(s)&&!n.isComposing()){r.compositionPhase="composing",r.hadOrphanedCompositionEvents=!1;let i=s.anchor,a=s.anchor.getNode();if(Bt(i.key),xs(rC),e.timeStamp<r.lastKeyDownTimeStamp+30||i.type==="element"||!s.isCollapsed()||!Na&&(a.getFormat()!==s.format||te(a)&&a.getStyle()!==s.style)||te(a)&&(Gn(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){ie(n,ai,zf);let l=ze();ge(l)&&Bt(l.anchor.key)}}return!0}function zA(e){let n=Ve();return n._inputState.compositionPhase="idle",yc(n,e.data),xs(Ec),!0}function cc(e){if(e===null)return;let n=ot(e);if(!te(n)||n.getType()==="text"||Gn(n)||!n.isAttached())return;let r=ze(),s=ge(r)&&r.anchor.key===e?r.anchor.offset:null,i=Cn(n.getTextContent());if(i.setFormat(n.getFormat()),i.setStyle(n.getStyle()),n.replace(i),s!==null){let a=Math.min(s,i.getTextContentSize());i.select(a,a)}}function yc(e,n){let r=e._compositionKey;if(Bt(null),r!==null&&n!=null){if(n===""){let i=ot(r),a=e.getElementByKey(r),l=a!==null&&te(i)?ar(i,a,e):null;if(l!==null&&l.nodeValue!==null&&te(i)){let c=qn(Nn(e)),d=c&&Vn(c,e._rootElement),f=null,g=null;d!==null&&d.anchorNode===l&&(f=d.anchorOffset,g=d.focusOffset),mg(i,l.nodeValue,f,g,!0)}return cc(r),!1}if(n[n.length-1]===`
8
- `){let i=ze();if(ge(i)||gi(i)){if(ge(i)){let a=i.focus;i.anchor.set(a.key,a.offset,a.type)}return ie(e,xc,null),cc(r),!1}}let s=ot(r);if(s!==null&&te(s)&&Gn(s)){s.markDirty();let i=ze(),a=s.getTextContentSize(),l=ge(i)&&i.anchor.key===r?i.anchor.offset:a;return s.select(l,l).insertText(n),!0}}return hg(!0,e,n),cc(r),!1}function UA(e){let n=Ve(),r=n._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){let s=J_(e);if(s&&Wn(n,()=>{yc(n,r.compositionEndData)}),r.compositionPhase="idle",r.compositionEndData="",s)return!0}if(function(s){return Qe(s,"ArrowRight",{shiftKey:"any"})}(e))ie(n,Rx,e);else if(function(s){return Qe(s,"ArrowRight",{...or,shiftKey:"any"})}(e))ie(n,Mx,e);else if(function(s){return Qe(s,"ArrowLeft",{shiftKey:"any"})}(e))ie(n,Dx,e);else if(function(s){return Qe(s,"ArrowLeft",{...or,shiftKey:"any"})}(e))ie(n,$x,e);else if(function(s){return Qe(s,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))ie(n,wx,e);else if(function(s){return Qe(s,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))ie(n,kx,e);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))r.isInsertLineBreak=!0,ie(n,xc,e);else if(function(s){return s.key===" "}(e))ie(n,Ix,e);else if(function(s){return Kn&&Qe(s,"o",{ctrlKey:!0})}(e))e.preventDefault(),r.isInsertLineBreak=!0,ie(n,xa,!0);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))r.isInsertLineBreak=!1,ie(n,xc,e);else if(function(s){return Qe(s,"Backspace",{shiftKey:"any"})||Kn&&Qe(s,"h",{ctrlKey:!0})}(e))J_(e)?ie(n,Lx,e)&&S_(r):(e.preventDefault(),ie(n,Ma,!0));else if(function(s){return s.key==="Escape"}(e))ie(n,Fx,e);else if(function(s){return Qe(s,"Delete",{})||Kn&&Qe(s,"d",{ctrlKey:!0})}(e))!function(s){return s.key==="Delete"}(e)?(e.preventDefault(),ie(n,Ma,!1)):ie(n,Px,e);else if(function(s){return Qe(s,"Backspace",q_)}(e))e.preventDefault(),ie(n,Da,!0);else if(function(s){return Qe(s,"Delete",q_)}(e))e.preventDefault(),ie(n,Da,!1);else if(function(s){return Kn&&Qe(s,"Backspace",{metaKey:!0})}(e))e.preventDefault(),ie(n,$a,!0);else if(function(s){return Kn&&(Qe(s,"Delete",{metaKey:!0})||Qe(s,"k",{ctrlKey:!0}))}(e))e.preventDefault(),ie(n,$a,!1);else if(function(s){return Qe(s,"b",or)}(e))e.preventDefault(),ie(n,vr,"bold");else if(function(s){return Qe(s,"u",or)}(e))e.preventDefault(),ie(n,vr,"underline");else if(function(s){return Qe(s,"i",or)}(e))e.preventDefault(),ie(n,vr,"italic");else if(function(s){return Qe(s,"Tab",{shiftKey:"any"})}(e))ie(n,Bx,e);else if(function(s){return Qe(s,"z",or)}(e))e.preventDefault(),ie(n,Jf);else if(function(s){if(Kn)return Qe(s,"z",{metaKey:!0,shiftKey:!0});return Qe(s,"y",{ctrlKey:!0})||Qe(s,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),ie(n,Zf);else{let s=n._editorState._selection;!function(i){return Qe(i,"a",or)}(e)?s===null||ge(s)||(!function(i){return Qe(i,"c",or)}(e)?function(i){return Qe(i,"x",or)}(e)&&(e.preventDefault(),ie(n,tg,e)):(e.preventDefault(),ie(n,eg,e))):(e.preventDefault(),ie(n,Wx,e)&&S_(r))}return function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey}(e)&&n.dispatchCommand(Yx,e),!0}function Qx(e){let n=e.__lexicalEventHandles;return n===void 0&&(n=[],e.__lexicalEventHandles=n),n}var li=new Map;function N_(e){let n=qC(e.target);if(n===null)return;let r=Hc(e.target),s=null,i=null,a=r!==null?Cc.get(r):void 0;if(r!==null){if(a!==void 0){let{editors:p,hasShadowEditor:m}=a;if(m===void 0){m=!1;for(let _ of p)if(_._rootElement!==null&&lr(_._rootElement.getRootNode())){m=!0;break}a.hasShadowEditor=m}if(m){let _=null,x=null;for(let C of p){let y=C._rootElement;if(y===null)continue;let N=Vn(n,y).anchorNode;if(N!==null&&fs(N)===C){if(lr(y.getRootNode())){s=C,i=N;break}_===null&&(_=C,x=N)}}s===null&&_!==null&&(s=_,i=x)}else{let _=n.anchorNode;_===null||Ct(_)&&_.shadowRoot!==null||(s=fs(_),s!==null&&(i=_))}}if(s===null){let p=di(r);s=p!==null?fs(p):null}}if(s===null)return;if(s._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let p of a.editors)p._inputState.isSelectionChangeFromMouseDown=!1;Wn(s,()=>{let p=Ns(),m=i??Vn(n,s._rootElement).anchorNode;if(Ct(m)||Co(m))rn(ka(p,n,s,e))})}let l=pg(s),c=l[l.length-1],d=c._key,f=li.get(d),g=f||c;g!==s&&C_(n,g,!1),C_(n,s,!0),s!==c?li.set(d,s):f&&li.delete(d)}function bf(e){e._lexicalHandled=!0}function E_(e){return e._lexicalHandled===!0}var T_=()=>{};function HA(e){let n=Tf.get(e);if(n===void 0)return void T_();let r=Cc.get(n);if(r===void 0)return void T_();Tf.delete(e);let s=Ja(e);Uc(s)?(function(a){if(a._parentEditor!==null){let l=pg(a),c=l[l.length-1]._key;li.get(c)===a&&li.delete(c)}else li.delete(a._key)}(s),r.editors.delete(s),r.hasShadowEditor=void 0,e.__lexicalEditor=null):s&&q(198);let i=Qx(e);for(let a=0;a<i.length;a++)i[a]();e.__lexicalEventHandles=[]}function vf(e,n,r){Wt();let s=e.__key,i=e.getParent();if(i===null)return void(Jt(e)!==null&&q(367,s,String(Jt(e))));let a=function(c){let d=ze();if(!ge(d)||!Y(c))return d;let{anchor:f,focus:g}=d,p=f.getNode(),m=g.getNode();return Pa(p,c)&&f.set(c.__key,0,"element"),Pa(m,c)&&g.set(c.__key,0,"element"),d}(e),l=!1;if(ge(a)&&n){let{anchor:c,focus:d}=a;c.key===s&&(vc(c,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0),d.key===s&&(vc(d,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0)}else gi(a)&&n&&e.isSelected()&&e.selectPrevious();if(ge(a)&&n&&!l){let c=e.getIndexWithinParent();Un(e),us(a,i,c,-1)}else Un(e);r||At(i)||i.canBeEmpty()||!i.isEmpty()||vf(i,n),n&&a&&Kt(i)&&i.isEmpty()&&i.selectEnd()}function WA(e){return e}var eC=Symbol.for("ephemeral");function Sc(e){return e[eC]||!1}var b_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class cn{__type;__key;__parent;__prev;__next;__state;[ba];static getType(){let{ownNodeType:e}=el(this);return e===void 0&&q(64,this.name),e}static clone(e){q(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||fy(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",b_),Object.defineProperty(this,ba,b_),PC(this,e)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let n=ot(e);if(n===null)break;e=n.__parent!==null?n.__parent:Jt(n)}return!1}isSelected(e){let n=e||ze();if(n==null)return!1;let r=n.getNodes().some((s)=>s.__key===this.__key);if(te(this))return r;if(ge(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let s=this.getParent();if(qe(this)&&this.isInline()&&s){let i=n.isBackward()?n.focus:n.anchor;if(s.is(i.getNode())&&i.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&q(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(At(n)||Jt(e)!==null)return Y(e)||e===this&&qe(e)||q(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&q(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:ot(e)}getPreviousSiblings(){let e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=Y(this)?this:this.getParent(),r=Y(e)?e:e.getParent(),s=n&&r?Ic(n,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=Ic(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?Ig(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(e){return Pa(e,this)}getNodesBetween(e){let n=this.isBefore(e),r=[],s=new Set,i=this;for(;i!==null;){let a=i.__key;if(s.has(a)||(s.add(a),r.push(i)),i===e)break;let l=Y(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}let c=n?i.getNextSibling():i.getPreviousSibling();if(c!==null){i=c;continue}let d=i.getParentOrThrow();if(s.has(d.__key)||r.push(d),d===e)break;let f=null,g=d;do{if(g===null&&q(68),f=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;f!==null||s.has(g.__key)||r.push(g)}while(f===null);i=f}return n||r.reverse(),r}isDirty(){let e=Ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Sc(this))return this;let e=ot(this.__key);return e===null&&q(113),e}getWritable(){if(Sc(this))return this;Wt();let e=Bo(),n=Ve(),r=e._nodeMap,s=this.__key,i=this.getLatest(),a=n._cloneNotNeeded,l=ze();if(l!==null&&l.setCachedNodes(null),a.has(s))return $c(i),i;let c=bg(i);return a.add(s),$c(c),r.set(s,c),c}getTextContent(){return _y(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){q(70)}updateDOM(e,n,r){q(71)}getDOMSlot(e){return new ri(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){q(18,this.name)}updateFromJSON(e){return function(n,r){let s=n.getWritable(),i=r.$,a=i;for(let l of Cx(s).flatKeys)l in r&&(a!==void 0&&a!==i||(a={...i}),a[l]=r[l]);return(s.__state||a)&&Wf(n).updateFromJSON(a),s}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,n){Wt();let r=ze();r!==null&&(r=r.clone()),cf(this,e);let s=this.getLatest(),i=this.__key,a=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),d=c.__size,f=l.getParent(),g=f!==null?l.getIndexWithinParent():-1;Un(l),f!==null&&ge(r)&&us(r,f,g,-1);let p=s.getPreviousSibling(),m=s.getNextSibling(),{__prev:_,__next:x,__parent:C}=s;if(vf(s,!1,!0),p===null)c.__first=a;else p.getWritable().__next=a;if(l.__prev=_,m===null)c.__last=a;else m.getWritable().__prev=a;l.__next=x,l.__parent=C,c.__size=d;let y=0;n&&(Y(this)&&Y(l)||q(139),y=l.getChildrenSize(),l.splice(y,0,this.getChildren()));let N=jn(this);if(N.length>0){$o(this)&&$o(l)||q(368,this.__key,l.__key);for(let T of N){let v=wr(this,T);v!==null&&(xy(this,T),Og(l,T,v))}}if(ge(r)){rn(r);let T=r.anchor,v=r.focus;T.key===i&&(n&&T.type==="element"?T.set(l.__key,y+T.offset,"element"):R_(T,l)),v.key===i&&(n&&v.type==="element"?v.set(l.__key,y+v.offset,"element"):R_(v,l))}return Do()===i&&Bt(a),l}insertAfter(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.getParent(),a=ze(),l=!1,c=!1;if(i!==null){let m=e.getIndexWithinParent();if(ge(a)){let _=i.__key,{anchor:x,focus:C}=a;l=x.type==="element"&&x.key===_&&x.offset===m+1,c=C.type==="element"&&C.key===_&&C.offset===m+1}Un(s),n&&ge(a)&&us(a,i,m,-1)}else Un(s);let d=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),g=s.__key,p=r.__next;if(d===null)f.__last=g;else d.getWritable().__prev=g;if(f.__size++,r.__next=g,s.__next=p,s.__prev=r.__key,s.__parent=r.__parent,n&&ge(a)){let m=this.getIndexWithinParent();us(a,f,m+1);let _=f.__key;l&&a.anchor.set(_,m+2,"element"),c&&a.focus.set(_,m+2,"element")}return e}insertBefore(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.__key,a=ze(),l=s.getParent(),c=l!==null?s.getIndexWithinParent():-1;Un(s),l!==null&&n&&ge(a)&&us(a,l,c,-1);let d=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),g=r.__prev,p=this.getIndexWithinParent();if(d===null)f.__first=i;else d.getWritable().__next=i;if(f.__size++,r.__prev=i,s.__prev=g,s.__next=r.__key,s.__parent=r.__parent,n&&ge(a))us(a,this.getParentOrThrow(),p);return e}isParentRequired(){return!1}createParentElementNode(){return Mn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){Wt();let r=Hn(this);if(r!==null)return r.selectPrevious(e,n);let s=this.getPreviousSibling(),i=this.getParentOrThrow();if(s===null)return i.select(0,0);if(Y(s))return s.select();if(!te(s)){let a=s.getIndexWithinParent()+1;return i.select(a,a)}return s.select(e,n)}selectNext(e,n){Wt();let r=Hn(this);if(r!==null)return r.selectNext(e,n);let s=this.getNextSibling(),i=this.getParentOrThrow();if(s===null)return i.select();if(Y(s))return s.select(0,0);if(!te(s)){let a=s.getIndexWithinParent();return i.select(a,a)}return s.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function og(e){return e instanceof cn}var GA="historic",jA="history-push",uc="history-merge",YA="paste",VA="cut",tC="collaboration",XA="skip-collab",nC="skip-scroll-into-view",oC="skip-dom-selection",Nc="skip-selection-focus",rC="composition-start",Ec="composition-end",qA="!important";function Of(e){let n={};if(!e)return n;let r="",s="",i=null,a=!1,l=!1,c=!1,d=0,f=e.length,g=-1;for(let _=0;_<f;_++){let x=e[_];if(a)x==="*"&&e[_+1]==="/"&&(a=!1,_++);else if(l)g===-1&&(g=_),l=!1;else if(i===null)if(x!=="/"||e[_+1]!=="*")if(x!=='"'&&x!=="'")if(x!=="(")if(x!==")")if(c||x!==":"||d!==0){if(x===";"&&d===0){g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1);let C=r.trim(),y=s.trim();C!==""&&y!==""&&(n[C]=y),r="",s="",c=!1;continue}g===-1&&(g=_)}else g!==-1&&(r+=e.slice(g,_),g=-1),c=!0;else g===-1&&(g=_),d=Math.max(0,d-1);else g===-1&&(g=_),d++;else g===-1&&(g=_),i=x;else g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1),a=!0,_++;else g===-1&&(g=_),x==="\\"?l=!0:x===i&&(i=null)}g!==-1&&(c?s+=e.slice(g,f):r+=e.slice(g,f));let p=r.trim(),m=s.trim();return p!==""&&m!==""&&(n[p]=m),n}function sC(e,n,r){let s=r.trimEnd(),i=s.length-10;i>=0&&s.slice(i).toLowerCase()===qA?e.setProperty(n,s.slice(0,i).trim(),"important"):e.setProperty(n,r,"")}function JA(e,n){for(let r in n){let s=n[r];s==null?e.removeProperty(r):sC(e,r,s)}}function Af(e,n,r=""){if(n===r)return;let s=Of(r),i=Of(n);for(let a in i)delete s[a],sC(e,a,i[a]);for(let a in s)e.removeProperty(a)}function ef(e,n){return 16&n?"code":n&Kf?"mark":32&n?"sub":64&n?"sup":null}function tf(e,n){return 1&n?"strong":2&n?"em":"span"}function iC(e,n,r,s,i){let a=s.classList,l=ci(i,"base");l!==void 0&&a.add(...l),l=ci(i,"underlineStrikethrough");let c=!1,d=8&n&&4&n;l!==void 0&&(8&r&&4&r?(c=!0,d||a.add(...l)):d&&a.remove(...l));for(let f in Xt){let g=Xt[f];if(l=ci(i,f),l!==void 0)if(r&g){if(c&&(f==="underline"||f==="strikethrough")){n&g&&a.remove(...l);continue}((n&g)===0||d&&f==="underline"||f==="strikethrough")&&a.add(...l)}else n&g&&a.remove(...l)}}function aC(e,n,r){let s=r.isComposing(),i=e+(s?Ea:""),a=yo(),l=Tg(a).$getDOMSlot(r,n,a),c=l.getFirstChild();if(c===null||c.nodeType!==Node.TEXT_NODE)return void l.insertChild(Sn().createTextNode(i));let d=c,f=d.nodeValue;if(f!==i)if(s||ko){let[g,p,m]=function(_,x){let C=_.length,y=x.length,N=0,T=0;for(;N<C&&N<y&&_[N]===x[N];)N++;for(;T+N<C&&T+N<y&&_[C-T-1]===x[y-T-1];)T++;return[N,C-N-T,x.slice(N,y-T)]}(f,i);p!==0&&d.deleteData(g,p),d.insertData(g,m)}else d.nodeValue=i}function v_(e,n,r,s,i,a){aC(i,e,n);let l=a.theme.text;l!==void 0&&iC(0,0,s,e,l)}function rc(e,n){let r=Sn().createElement(n);return r.appendChild(e),r}function Tc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends cn{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:tR,priority:0}),b:()=>({conversion:QA,priority:0}),code:()=>({conversion:nr,priority:0}),em:()=>({conversion:nr,priority:0}),i:()=>({conversion:nr,priority:0}),mark:()=>({conversion:nr,priority:0}),s:()=>({conversion:nr,priority:0}),span:()=>({conversion:ZA,priority:0}),strong:()=>({conversion:nr,priority:0}),sub:()=>({conversion:nr,priority:0}),sup:()=>({conversion:nr,priority:0}),u:()=>({conversion:nr,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",n){super(n),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return fA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Do()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let n=Xt[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Dr(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,s=ef(0,r),i=tf(0,r),a=s===null?i:s,l=Sn().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Sn().createElement(i),l.appendChild(c)),v_(c,this,0,r,this.__text,e);let d=this.__style;return d!==""&&Af(l.style,d),l}updateDOM(e,n,r){let s=this.__text,i=e.__format,a=this.__format,l=ef(0,i),c=ef(0,a),d=tf(0,i),f=tf(0,a);if((l===null?d:l)!==(c===null?f:c))return!0;if(l===c&&d!==f){let x=n.firstChild;x==null&&q(48);let C=Sn().createElement(f);return v_(C,this,0,a,s,r),n.replaceChild(C,x),!1}let g=n;c!==null&&l!==null&&(g=n.firstChild,g==null&&q(49)),aC(s,g,this);let p=r.theme.text;p!==void 0&&i!==a&&iC(0,i,a,g,p);let m=e.__style,_=this.__style;return m!==_&&Af(n.style,_,m),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return Ct(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=rc(n,"b")),this.hasFormat("italic")&&(n=rc(n,"i")),this.hasFormat("strikethrough")&&(n=rc(n,"s")),this.hasFormat("underline")&&(n=rc(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Xt[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?cA[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Dr(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let n=dA[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){Wt();let r=e,s=n,i=ze(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!ge(i))return yC(l,r,l,s,"text","text");{let c=Do();c!==i.anchor.key&&c!==i.focus.key||Bt(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=e;c<0&&(c=l+c,c<0&&(c=0));let d=ze();if(s&&ge(d)){let g=e+l;d.setTextNodeRange(i,g,i,g)}let f=a.slice(0,c)+r+a.slice(c+n);return i.__text=f,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Wt();let n=this.getLatest(),r=n.getTextContent();if(r==="")return[];let s=n.__key,i=Do(),a=r.length;e.sort((H,U)=>H-U),e.push(a);let l=[],c=e.length;for(let H=0,U=0;H<a&&U<=c;U++){let W=e[U];W>H&&(l.push(r.slice(H,W)),H=W)}let d=l.length;if(d===1)return[n];let f=l[0],g=n.getParent(),p,m=n.getFormat(),_=n.getStyle(),x=n.__detail,C=!1,y=null,N=null,T=ze();if(ge(T)){let[H,U]=T.isBackward()?[T.focus,T.anchor]:[T.anchor,T.focus];H.type==="text"&&H.key===s&&(y=H),U.type==="text"&&U.key===s&&(N=U)}n.isSegmented()?(p=Cn(f),p.__format=m,p.__style=_,p.__detail=x,p.__state=l_(n,p),C=!0):p=n.setTextContent(f);let v=[p];for(let H=1;H<d;H++){let U=Cn(l[H]);U.__format=m,U.__style=_,U.__detail=x,U.__state=l_(n,U);let W=U.__key;i===s&&Bt(W),v.push(U)}let R=y?y.offset:null,F=N?N.offset:null,k=0;for(let H of v){if(!y&&!N)break;let U=k+H.getTextContentSize();if(y!==null&&R!==null&&R<=U&&R>=k&&(y.set(H.getKey(),R-k,"text"),R<U&&(y=null)),N!==null&&F!==null&&F<=U&&F>=k){N.set(H.getKey(),F-k,"text");break}k=U}if(g!==null){(function(W){let J=W.getPreviousSibling(),G=W.getNextSibling();J!==null&&$c(J),G!==null&&$c(G)})(this);let H=g.getWritable(),U=this.getIndexWithinParent();C?(H.splice(U,0,v),this.remove()):H.splice(U,1,v),ge(T)&&us(T,g,U,d-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||q(50);let r=this.__key,s=e.__key,i=this.__text,a=i.length;Do()===s&&Bt(r);let l=ze();if(ge(l)){let{anchor:g,focus:p}=l;g!==null&&g.key===s&&P_(g,n,r,e,a),p!==null&&p.key===s&&P_(p,n,r,e,a)}let c=e.__text,d=n?c+i:i+c;this.setTextContent(d);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function ZA(e){return{forChild:rg(e.style),node:null}}function QA(e){let n=e,r=n.style.fontWeight==="normal";return{forChild:rg(n.style,r?void 0:"bold"),node:null}}var O_=new WeakMap;function eR(e){if(!Ct(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function tR(e){let n=e;e.parentElement===null&&q(129);let r=n.textContent||"";if(function(s){let i,a=s.parentNode,l=[s];for(;a!==null&&(i=O_.get(a))===void 0&&!eR(a);)l.push(a),a=a.parentNode;let c=i===void 0?a:i;for(let d=0;d<l.length;d++)O_.set(l[d],c);return c}(n)!==null)return{node:ig(r)};if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!1))!==null;){let a=s.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(r=r.slice(1)),i=!1;break}}i&&(r=r.slice(1))}if(r[r.length-1]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Cn(r)}}function A_(e,n){let r=e;for(;;){let s;for(;(s=n?r.nextSibling:r.previousSibling)===null;){let a=r.parentElement;if(a===null)return null;r=a}if(r=s,Ct(r)){let a=r.style.display;if(a===""&&!sy(r)||a!==""&&!a.startsWith("inline"))return null}let i=r;for(;(i=n?r.firstChild:r.lastChild)!==null;)r=i;if(Co(r))return r;if(r.nodeName==="BR")return null}}var nR={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nr(e){let n=nR[e.nodeName.toLowerCase()];return n===void 0?{node:null}:{forChild:rg(e.style,n),node:null}}function Cn(e=""){return Za(new ms(e))}function te(e){return e instanceof ms}function rg(e,n){let r=e.fontWeight,s=e.textDecoration.split(" "),i=r==="700"||r==="bold",a=s.includes("line-through"),l=e.fontStyle==="italic",c=s.includes("underline"),d=e.verticalAlign;return(f)=>te(f)||Tc(f)?(i&&!f.hasFormat("bold")&&f.toggleFormat("bold"),a&&!f.hasFormat("strikethrough")&&f.toggleFormat("strikethrough"),l&&!f.hasFormat("italic")&&f.toggleFormat("italic"),c&&!f.hasFormat("underline")&&f.toggleFormat("underline"),d!=="sub"||f.hasFormat("subscript")||f.toggleFormat("subscript"),d!=="super"||f.hasFormat("superscript")||f.toggleFormat("superscript"),n&&!f.hasFormat(n)&&f.toggleFormat(n),f):f}class Ga extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let n=super.createDOM(e),r=ci(e.theme,"tab");if(r!==void 0)n.classList.add(...r);return n}setTextContent(e){return super.setTextContent("\t")}spliceText(e,n,r,s){return r===""&&n===0||r==="\t"&&n===1||q(286),this}setDetail(e){return e!==2&&q(127),this}setMode(e){return e!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function lC(){return Za(new Ga)}function sg(e){return e instanceof Ga}class cC{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){if(this.key===e.key)return this.offset<e.offset;return wg(wo(Fr(this,"next")),wo(Fr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&q(20),e}set(e,n,r,s){let i=this._selection,a=this.key;s&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,Mr()||(Do()===a&&Bt(e),i!==null&&(i.setCachedNodes(null),ge(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function xo(e,n,r){return new cC(e,n,r)}function nf(e,n){let r=n.__key,s=e.offset,i="element";if(te(n)){i="text";let a=n.getTextContentSize();s>a&&(s=a)}else if(!Y(n)){let a=n.getNextSibling();if(te(a))r=a.__key,s=0,i="text";else{let l=n.getParent();l&&(r=l.__key,s=n.getIndexWithinParent()+1)}}e.set(r,s,i)}function R_(e,n){if(Y(n)){let r=n.getLastDescendant();Y(r)||te(r)?nf(e,r):nf(e,n)}else nf(e,n)}function M_(e,n,r,s){let i=e.getNode(),a=i.getChildAtIndex(e.offset),l=Cn();if(l.setFormat(r),l.setStyle(s),wC(a))a.splice(0,0,[l]);else if(a!==null){let c=At(i)?Mn().append(l):l;a.insertBefore(c)}else if(At(i)){let c=i.getLastChild();Y(c)&&!c.isInline()&&c.isEmpty()?c.append(l):i.append(Mn().append(l))}else i.append(l);e.is(n)&&n.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function D_(e,n,r,s){let i=e.anchor.getNode();te(i)||q(398);let a=e.anchor.offset,l=Cn(n);l.setFormat(r),l.setStyle(s);let c=i.getParentOrThrow();if(a===0)c.isInline()&&!i.__prev?c.insertBefore(l):i.insertBefore(l,!1);else if(a===i.getTextContentSize())c.isInline()&&!i.__next?c.insertAfter(l):i.insertAfter(l,!1);else{let[d]=i.splitText(a);d.insertAfter(l,!1)}i.getTextContent()===""&&i.isAttached()&&i.remove(),l.selectEnd(),l.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-n.length,e.anchor.type)}class Fc{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!gi(e))return!1;let n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every((s)=>r.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Fc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let n=this.getNodes().filter((a)=>Jt(a)===null),r=n.length;if(r===0)return;let s=n[r-1],i;if(te(s))i=s.select();else{let a=s.getIndexWithinParent()+1;i=s.getParentOrThrow().select(a,a)}i.insertNodes(e);for(let a=0;a<r;a++)n[a].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=this._nodes,r=[];for(let s of n){let i=ot(s);i!==null&&r.push(i)}return Mr()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){let e=this.getNodes().filter((n)=>Jt(n)===null);if((ze()||Ns())===this&&e[0]){let n=St(e[0],"next");Ny(Lr(n,n))}for(let n of e)n.remove();uC()}}function uC(){let e=Dn();if(e.isEmpty()){let n=Mn();e.append(n),n.select()}}function ge(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,s){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ge(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=function(r){let s=[],[i,a]=r.getTextSlices();i&&s.push(i.caret.origin);let l=new Set,c=new Set;for(let d of r)if(Yn(d)){let{origin:f}=d;s.length===0?l.add(f):(c.add(f),s.push(f))}else{let{origin:f}=d;Y(f)&&c.has(f)||s.push(f)}if(a&&s.push(a.caret.origin),kr(r.focus)&&Y(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let d=cr(r.focus.origin,"previous");Yn(d)&&l.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(s[s.length-1]);d=fi(d))l.delete(d.origin),s.pop();for(;s.length>1;){let d=s[s.length-1];if(!Y(d)||c.has(d)||d.isEmpty()||l.has(d))break;s.pop()}if(s.length===0&&r.isCollapsed()){let d=wo(r.anchor),f=wo(r.anchor.getFlipped()),g=(m)=>mo(m)?m.origin:m.getNodeAtCaret(),p=g(d)||g(f)||(r.anchor.getNodeAtCaret()?d.origin:f.origin);s.push(p)}return s}(Lg(Ff(this),"next"));return Mr()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,s){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,s,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],s=this.anchor,i=this.focus,a=s.isBefore(i),[l,c]=Rf(this),d="",f=!0;for(let g=0;g<e.length;g++){let p=e[g];if(Y(p)&&!p.isInline()){f||(d+=`
9
- `);let m="";for(let _ of jn(p)){let x=wr(p,_);x!==null&&(m+=x.getTextContent())}m!==""?(d+=m,f=!1):f=!p.isEmpty()}else if(f=!1,te(p)){let m=p.getTextContent();p===n?p===r?s.type==="element"&&i.type==="element"&&i.offset!==s.offset||(m=l<c?m.slice(l,c):m.slice(c,l)):m=a?m.slice(l):m.slice(c):p===r&&(m=a?m.slice(0,c):m.slice(0,l)),d+=m}else!qe(p)&&!Lo(p)||p===r&&this.isCollapsed()||(d+=p.getTextContent())}return d}applyDOMRange(e){let n=Ve(),r=n.getEditorState()._selection,s=xC(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(s===null)return;let[i,a,l]=s;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),l&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,n=this.focus;return new Ss(xo(e.key,e.offset,e.type),xo(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Dr(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let n=Xt[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let n=this.format,r=this.style;if(!this.isCollapsed()){let g=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(te(g)&&(n=g.getFormat(),r=g.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Do()===null)return this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r),void D_(this,e,n,r)}this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r);let s=this.anchor.getNode();te(s)||q(398);let i=this.anchor.offset,a=s.getParentOrThrow(),l=s.getTextContentSize();if(Gn(s)||i===0&&(!s.canInsertTextBefore()||!a.canInsertTextBefore()&&!s.__prev)||i===l&&(!s.canInsertTextAfter()||!a.canInsertTextAfter()&&!s.__next)){if(s.isSegmented()&&i!==0&&i!==l){if(Do()!==null)s.setMode("normal").setFormat(n).setStyle(r);else{let p=Cn(s.getTextContent());p.setFormat(n),p.setStyle(r),s.replace(p),p.select(i,i)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(i===0){let p=s.getPreviousSibling();if(te(p)&&p.canInsertTextAfter()&&!Gn(p))p.select();else{let m=Cn();m.setFormat(n),m.setStyle(r),a.canInsertTextBefore()?s.insertBefore(m):a.insertBefore(m),m.select()}return void this.insertText(e)}if(i===l){let p=s.getNextSibling();if(te(p)&&p.canInsertTextBefore()&&!Gn(p))p.select(0,0);else{let m=Cn();m.setFormat(n),m.setStyle(r),a.canInsertTextAfter()?s.insertAfter(m):a.insertAfter(m),m.select(0,0)}return void this.insertText(e)}let g=Cn(e);return g.setFormat(n),g.setStyle(r),s.replace(g),void g.select()}if(e==="")return;let c=a.isInline()&&i===0&&!s.__prev,d=a.isInline()&&i===l&&!s.__next,f=s.getFormat()!==n||s.getStyle()!==r;if(c||d||f){if(s.getTextContent()!==""||c||d)return void D_(this,e,n,r);s.setFormat(n),s.setStyle(r)}s.spliceText(i,0,e,!0),s.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=ze()===this;ya(this,Ey(Ff(this))),e&&ze()!==this&&rn(this)}formatText(e,n=null){fC(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&Y(n)&&Jt(n)!==null){let x=n.isShadowRoot()?n.getFirstChild()??n.append(Mn()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&x!==null&&!Y(x)){let C=Mn();x.insertBefore(C),x=C}if(x!==null){x.selectStart();let C=ze();return ge(C)||q(369),C.insertNodes(e)}}if(this.anchor.type==="element"&&At(n)){let x=rf(e),C=x.getLastDescendant();return n.splice(this.anchor.offset,0,x.getChildren()),void(C!==null&&C.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),s=br(r,xn),i=e[e.length-1];if(Y(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let x=ga(this);s.splice(x,0,e),i.selectEnd()}return}if(!e.some((x)=>(Y(x)||qe(x))&&!x.isInline())){Y(s)||q(211,r.constructor.name,r.getType());let x=ga(this);return s.splice(x,0,e),void i.selectEnd()}if(Y(s)&&Jt(s)!==null){let x=ga(this),C=Df(e);s.splice(x,0,C);let y=C[C.length-1];return void(y!==void 0?y.selectEnd():s.select(x,x))}if(s===null){let x=rf(e),C=x.getLastDescendant(),y=Fr(this.anchor,"next");for(let N of x.getChildren())y=Oy(N,y);return void(C!==null&&C.selectEnd())}if(Y(s)&&!s.isParentRequired()&&!At(s.getParentOrThrow())){let x=ga(this),C=Df(e);s.splice(x,0,C);let y=C[C.length-1];return void(y!==void 0?y.selectEnd():s.select(x,x))}let a=rf(e),l=a.getLastDescendant(),c=a.getChildren(),d=!Y(s)||!s.isEmpty()?this.insertParagraph():null;d&&!s.isAttached()&&(r=this.anchor.getNode(),s=br(r,xn));let f=c[c.length-1],g=c[0];var p;Y(p=g)&&xn(p)&&!p.isEmpty()&&Y(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(Y(s)||q(211,r.constructor.name,r.getType()),s.append(...g.getChildren()),g=c[1]),g&&(s===null&&q(212,r.constructor.name,r.getType()),function(x,C){let y=C.getParentOrThrow().getLastChild(),N=C,T=[C];for(;N!==y;)N.getNextSibling()||q(140),N=N.getNextSibling(),T.push(N);let v=x;for(let R of T)v=v.insertAfter(R)}(s,g));let m=br(l,xn);d&&Y(m)&&(d.canMergeWhenEmpty()||xn(f))&&(m.append(...d.getChildren()),d.remove()),Y(s)&&s.isEmpty()&&s.remove(),l.selectEnd();let _=Y(s)?s.getLastChild():null;Lo(_)&&m!==s&&_.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&At(e)){let l=Mn();return e.splice(this.anchor.offset,0,[l]),l.select(),l}let n=ga(this),r=br(this.anchor.getNode(),xn);if(r!==null&&Jt(r)!==null)return null;Y(r)||q(213);let s=r.getChildAtIndex(n),i=s?[s,...s.getNextSiblings()]:[],a=r.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let n=Bc();if(this.insertNodes([n]),e){let r=n.getParentOrThrow(),s=n.getIndexWithinParent();r.select(s,s)}}extract(){let e=[...this.getNodes()],n=e.length,r=e[0],s=e[n-1],[i,a]=Rf(this),l=this.isBackward(),[c,d]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[f,g]=l?[a,i]:[i,a];if(n===0)return[];if(n===1){if(te(r)&&!this.isCollapsed()){let p=r.splitText(f,g),m=f===0?p[0]:p[1];return m?(c.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[r]}if(te(r)&&(f===r.getTextContentSize()?e.shift():f!==0&&([,r]=r.splitText(f),e[0]=r,c.set(r.getKey(),0,"text"))),te(s)){let p=s.getTextContent().length;g===0?e.pop():g!==p&&([s]=s.splitText(g),e[e.length-1]=s,d.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,n,r){if(Ac(this,e,n,r))return;let s=e==="move",i=Ve(),a=qn(Nn(i));if(!a)return;let{_blockCursorElement:l,_rootElement:c}=i,d=this.focus.getNode();c===null||l===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(l,i,c);let f=ui(i,this.focus.key),g=f;if(this.focus.type==="text"&&(g=te(d)?ar(d,f,i):null),this.dirty){let p=ui(i,this.anchor.key),m=p;if(this.anchor.type==="text"){let _=this.anchor.getNode();m=te(_)?ar(_,p,i):null}m&&g&&Oc(a,m,this.anchor.offset,g,this.focus.offset)}if(r==="character"&&te(d)&&d.isUnmergeable()){if(n?this.focus.offset===0:this.focus.offset===d.getTextContentSize()){let p=St(d,n?"previous":"next").getNodeAtCaret();if(te(p)){if(!s){let m=p.getTextContentSize();return n?this.focus.set(p.__key,m-1,"text"):this.focus.set(p.__key,1,"text"),void(this.dirty=!0)}{let m=i.getElementByKey(p.getKey()),_=m?ar(p,m,i):null;if(_){let x=n?_.length:0;Oc(a,_,x,_,x)}}}}}if(pC(a,e,n?"backward":"forward",r),a.rangeCount>0){let p=mi(a,i._rootElement),m=p||a.getRangeAt(0),_=this.anchor.getNode(),x=Kt(_)?_:Cg(_);if(this.applyDOMRange(m),this.dirty=!0,!s)hC(this,n,x),(p?a.direction!=="backward":a.anchorNode===m.startContainer&&a.anchorOffset===m.startOffset)||gC(this)}r==="lineboundary"&&Ac(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&Y(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){let s=n.getParent(),i=n.getNextSibling()||(s===null?null:s.getNextSibling());if(Y(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,s=r.getNode();if(this.forwardDeletion(r,s,e))return;let i=Dg(Fr(r,e?"previous":"next"));if(i.getTextSlices().every((l)=>l===null||l.distance===0)){let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(Yn(c))if(c.origin.isInline());else{if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){let d=wo(c);ya(this,Lr(d,d)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}else{if(l.type==="merge-block")break;if(kr(c)){if(Y(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(qe(c.origin)){if(c.origin.isIsolated());else if(jn(c.origin).length>0){if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),rn(d)}}else if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),rn(d)}else c.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:c,block:d}=l;if(jn(d).length>0)return;return c.origin.isEmpty()&&!d.isEmpty()&&c.origin.getParent()===d.getParent()?void c.origin.remove(!0):(ya(this,Lr(!c.origin.isEmpty()&&d.isEmpty()?Ts(St(d,c.direction)):i.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Jt(c)!==null)return;if(Y(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&w_(this,r.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(s=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,d=l.getTextContentSize();if(l.is(s)||e&&c!==d||!e&&c!==0)return void k_(l,e,c)}else if(s!==null&&s.isSegmented()){let c=r.offset,d=s.getTextContentSize();if(s.is(l)||e&&c!==0||!e&&c!==d)return void k_(s,e,c)}(function(c,d){let{anchor:f,focus:g}=c,p=f.getNode(),m=g.getNode();if(p===m&&f.type==="text"&&g.type==="text"){let _=f.offset,x=g.offset,C=_<x,y=C?_:x,N=C?x:_,T=N-1;if(y!==T)(function(v){return!(zC(v)||rR(v))})(p.getTextContent().slice(y,N))&&(d?g.set(g.key,T,g.type):f.set(f.key,T,f.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&Kt(r.getParent())&&r.getPreviousSibling()===null&&w_(this,r),uC()}}deleteLine(e){let n=Mf(this.anchor);if(n!==null&&qe(Hn(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);if(this.isCollapsed()&&of(this,e,"lineboundary"),this.isCollapsed())this.deleteCharacter(e);else br(this.anchor.getNode(),xn)!==br(this.focus.getNode(),xn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let n=this.focus.isBefore(this.anchor);return Mr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function gi(e){return e instanceof Fc}function dC(e,n){if(gi(e)){for(let N of e.getNodes())Tc(N)&&N.setFormat(n(N.getFormat()));return}if(e.isCollapsed())return e.setFormat(n(e.format)),void Bt(null);let r=[];for(let N of e.getNodes())te(N)?r.push(N):Y(N)?N.setTextFormat(n(N.getTextFormat())):Tc(N)&&N.setFormat(n(N.getFormat()));let s=r.length;if(s===0)return e.setFormat(n(e.format)),void Bt(null);let{anchor:i,focus:a}=e,l=e.isBackward(),c=l?a:i,d=l?i:a,f=0,g=r[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===g.getTextContentSize()&&(f=1,g=r[1],p=0),g==null)return;let m=s-1,_=r[m],x=d.type==="text"?d.offset:_.getTextContentSize();if(g.is(_)){if(p===x)return;let N=n(g.getFormat());if(Gn(g)||p===0&&x===g.getTextContentSize())g.setFormat(N);else{let T=g.splitText(p,x),v=p===0?T[0]:T[1];v.setFormat(N),c.type==="text"&&c.set(v.__key,0,"text"),d.type==="text"&&d.set(v.__key,x-p,"text")}return void(e.format=N)}p===0||Gn(g)||([,g]=g.splitText(p),p=0);let C=n(g.getFormat());g.setFormat(C);let y=n(_.getFormat());x>0&&(x===_.getTextContentSize()||Gn(_)||([_]=_.splitText(x)),_.setFormat(y));for(let N=f+1;N<m;N++){let T=r[N];T.setFormat(n(T.getFormat()))}c.type==="text"&&c.set(g.__key,p,"text"),d.type==="text"&&d.set(_.__key,x,"text"),e.format=C|y}function oR(e,n){let r=[];for(let[s,i]of Object.entries(n))typeof i=="boolean"&&r.push([s,i]);r.length!==0&&dC(e,(s)=>{for(let[i,a]of r)s=Dr(s,i,a?Xt[i]:0);return s})}function fC(e,n,r=null){let s=r===null&&ge(e)?Dr(e.format,n,null):r;dC(e,(i)=>Dr(i,n,s))}function $_(e){let n=e.offset;if(e.type==="text")return n;let r=e.getNode();return n===r.getChildrenSize()?r.getTextContent().length:0}function Rf(e){let n=e.getStartEndPoints();if(n===null)return[0,0];let[r,s]=n;return r.type==="element"&&s.type==="element"&&r.key===s.key&&r.offset===s.offset?[0,0]:[$_(r),$_(s)]}function w_(e,n){for(let r=n;r;r=r.getParent()){if(Y(r)){if(r.collapseAtStart(e))return!0;if(At(r))break}if(r.getPreviousSibling())break}return!1}function gC(e){let{focus:n,anchor:r}=e,{key:s,offset:i,type:a}=r;r.set(n.key,n.offset,n.type,!0),n.set(s,i,a,!0)}function pC(e,n,r,s){e.modify(n,r,s)}function hC(e,n,r){let s=e.getNodes(),i=s.filter((c)=>Pa(c,r));if(i.length===0||i.length===s.length)return!1;let a=n?i[0]:i[i.length-1],l=Y(a)?a:a.getParentOrThrow();return n?l.selectStart():l.selectEnd(),!0}function of(e,n,r){if(Ac(e,"extend",n,r))return;let s=Ve(),i=qn(Nn(s));if(!i||typeof i.modify!="function")return;let{_blockCursorElement:a,_rootElement:l}=s,c=e.anchor,d=e.focus.getNode();l===null||a===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(a,s,l);let f=(W)=>{let J=W.getNode(),G=s.getElementByKey(W.key);return G!==null&&W.type==="text"&&te(J)?ar(J,G,s):G},g=c.getNode(),p=f(c);if(p===null)return;let m=c.offset,_=e.isCollapsed(),x=e.focus,C=_?p:f(x);if(C===null)return;let y=x.offset;if(Oc(i,C,y,C,y),pC(i,"move",n?"backward":"forward",r),i.rangeCount===0)return;let N=mi(i,l)||i.getRangeAt(0),{startContainer:T,startOffset:v}=N;if(_&&r==="character"&&c.type==="text"&&te(g)&&g.isUnmergeable()){if(m===(n?0:g.getTextContentSize())){let W=St(g,n?"previous":"next").getNodeAtCaret();if(te(W)){let J=n?W.getTextContentSize()-1:1;return e.focus.set(W.__key,J,"text"),void(e.dirty=!0)}}}if(_&&r==="character"&&c.type==="text"){let W=n?0:g.getTextContentSize(),J=T===p?v:m!==W?W:-1;if(J>=0)return void(J!==m&&(e.focus.set(c.key,J,"text"),e.dirty=!0))}let[R,F,k,H]=n?[T,v,p,m]:[p,m,T,v],U=Kt(g)?g:Cg(g);e.applyDOMRange({collapsed:!1,endContainer:k,endOffset:H,startContainer:R,startOffset:F}),e.dirty=!0,!hC(e,n,U)&&n&&gC(e),r==="lineboundary"&&Ac(e,"extend",n,r,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),n=e.test.bind(e);if(n("❤️")&&n("#️⃣")&&n("\uD83D\uDC4D"))return n}catch(e){}return()=>!1})();function k_(e,n,r){let s=e,i=s.getTextContent().split(/(?=\s)/g),a=i.length,l=0,c=0;for(let f=0;f<a;f++){let g=f===a-1;if(c=l,l+=i[f].length,n&&l===r||l>r||g){i.splice(f,1),g&&(c=void 0);break}}let d=i.join("").trim();d===""?s.remove():(s.setTextContent(d),s.select(c,c))}function I_(e,n,r,s){let i,a=n,l=!1;if(Ct(e)){let c=!1,d=e.childNodes,f=d.length,g=s._blockCursorElement;a===f&&f>0&&(c=!0,a=f-1),hi(e,s)!==void 0||Ba(e,s)||(l=!0);let p=d[a],m=!1;if(p===g)p=d[a+1],m=!0;else if(g!==null){let _=g.parentNode;if(e===_)n>Array.prototype.indexOf.call(_.children,g)&&a--}if(i=oi(p),te(i))a=_o(i,c?"next":"previous");else{let _=oi(e);if(_===null)return null;if(Y(_)){let x=s.getElementByKey(_.getKey());x===null&&q(214),[_,a]=$n(_,x,s).resolveChildIndex(_,x,e,n),Y(_)||q(215),c&&a>=_.getChildrenSize()&&(a=Math.max(0,_.getChildrenSize()-1));let y=_.getChildAtIndex(a);if(Y(y)&&function(N,T,v){let R=N.getParent();return v===null||R===null||!R.canBeEmpty()||R!==v.getNode()}(y,0,r)){let N=c?y.getLastDescendant():y.getFirstDescendant();N===null?_=y:(y=N,_=Y(y)?y:y.getParentOrThrow()),a=0}te(y)?(i=y,_=null,a=_o(y,c?"next":"previous")):y!==_&&c&&!m&&(Y(_)||q(216),a=Math.min(_.getChildrenSize(),a+1))}else{let x=Hn(_),C=x!==null?x:_,y=C.getIndexWithinParent(),N=s.getElementByKey(_.getKey()),T="after";if(N!==null&&oi(e)===_){let v=$n(_,N,s);v.element!==N?T=v.resolveLeafPosition(N,e,n):n===0&&qe(_)&&(T="before")}a=T==="before"?y:y+1,_=C.getParentOrThrow()}if(Y(_))return[xo(_.__key,a,"element"),l]}}else i=oi(e);return te(i)?[xo(i.__key,_o(i,a,"clamp"),"text"),l]:null}function L_(e,n,r){let s=e.offset,i=e.getNode();if(s===0){let a=i.getPreviousSibling(),l=i.getParent();if(n){if((r||!n)&&a===null&&Y(l)&&l.isInline()){let c=l.getPreviousSibling();te(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else Y(a)&&!r&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):te(a)&&!i.isUnmergeable()&&e.set(a.__key,a.getTextContent().length,"text")}else if(s===i.getTextContent().length){let a=i.getNextSibling(),l=i.getParent();if(n&&Y(a)&&a.isInline())e.set(a.__key,0,"element");else if((r||n)&&a===null&&Y(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let c=l.getNextSibling();te(c)&&e.set(c.__key,0,"text")}}}function Mf(e){let n=ot(e.key);return n===null?null:hy(n)}function mC(e,n,r){let s=Mf(e),i=Mf(n);if(s===i||s!==null&&i!==null&&s.is(i))return!1;let a=r(s,i);if(s!==null)return Y(s)?n.set(s.getKey(),a?s.getChildrenSize():0,"element"):n.set(s.getKey(),a?s.getTextContentSize():0,"text"),!0;let l=Hn(i);if(l===null)return!1;let c=l.getParent();if(c===null)return!1;let d=l.getIndexWithinParent();return n.set(c.getKey(),a?d+1:d,"element"),!0}function _C(e){let n=mC(e.anchor,e.focus,(r,s)=>function(i,a,l,c){if(l!==null&&c!==null){let g=Hn(l),p=Hn(c);if(g!==null&&g.is(p)){for(let m of Wc(g).values()){if(m===l.getKey())return!0;if(m===c.getKey())return!1}return!0}return g===null||p===null||g.isBefore(p)}if(l!==null){let g=Hn(l),p=ot(a.key);return g===null||p===null||!(!g.is(p)&&!g.isParentOf(p))||g.isBefore(p)}let d=Hn(c),f=ot(i.key);return d!==null&&f!==null&&!d.is(f)&&!d.isParentOf(f)&&f.isBefore(d)}(e.anchor,e.focus,r,s));return n&&(e.dirty=!0),n}function xC(e,n,r,s,i,a){if(e===null||r===null||!qa(i,e,r))return null;let l=I_(e,n,ge(a)?a.anchor:null,i);if(l===null)return null;let c=I_(r,s,ge(a)?a.focus:null,i);if(c===null)return null;let[d,f]=l,[g,p]=c;if(d.type==="element"&&g.type==="element"){let _=oi(e),x=oi(r);if(qe(_)&&qe(x))return null}let m=i._slotsUsed&&mC(d,g,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(_,x){if(_.type==="text"&&x.type==="text"){let C=_.isBefore(x),y=_.is(x);L_(_,C,y),L_(x,!C,y),y&&x.set(_.key,_.offset,_.type)}}(d,g),[d,g,f||p||m]}function CC(e){return Y(e)&&!e.isInline()}function yC(e,n,r,s,i,a){let l=Bo(),c=new Ss(xo(e,n,i),xo(r,s,a),0,"");return c.dirty=!0,l._selection=c,c}function SC(){let e=xo("root",0,"element"),n=xo("root",0,"element");return new Ss(e,n,0,"")}function bc(){return new Fc(new Set)}function sR(e,n){return ka(null,e,n,null)}function ka(e,n,r,s){let i=r._window;if(i===null)return null;let a=s||i.event,l=a?a.type:void 0,c=l==="selectionchange",d=!df&&(c||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&a&&a.detail===3||l==="drop"||l===void 0),f,g,p,m;if(ge(e)&&!d)return e.clone();{if(n===null)return null;let R=Vn(n,r._rootElement);if(f=R.anchorNode,g=R.focusNode,p=R.anchorOffset,m=R.focusOffset,(c||l===void 0)&&ge(e)&&!qa(r,f,g))return e.clone()}let _=xC(f,p,g,m,r,e);if(_===null)return null;let[x,C,y]=_,N=0,T="";if(ge(e)){let R=e.anchor;if(x.key===R.key)N=e.format,T=e.style;else{let F=x.getNode();te(F)?(N=F.getFormat(),T=F.getStyle()):Y(F)&&(N=F.getTextFormat(),T=F.getTextStyle())}}let v=new Ss(x,C,N,T);return y&&(v.dirty=!0),v}function ze(){return Bo()._selection}function Ns(){return Ve()._editorState._selection}function us(e,n,r,s=1){let{anchor:i,focus:a}=e,l=i.getNode(),c=a.getNode();if(!n.is(l)&&!n.is(c))return;let d=n.__key;if(e.isCollapsed()){let f=i.offset;if(r<=f&&s>0||r<f&&s<0){let g=Math.max(0,f+s);i.set(d,g,"element"),a.set(d,g,"element"),F_(e)}}else{let f=e.isBackward(),g=f?a:i,p=g.getNode(),m=f?i:a,_=m.getNode();if(n.is(p)){let x=g.offset;(r<=x&&s>0||r<x&&s<0)&&g.set(d,Math.max(0,x+s),"element")}if(n.is(_)){let x=m.offset;(r<=x&&s>0||r<x&&s<0)&&m.set(d,Math.max(0,x+s),"element")}}F_(e)}function F_(e){let n=e.anchor,r=n.offset,s=e.focus,i=s.offset,a=n.getNode(),l=s.getNode();if(e.isCollapsed()){if(!Y(a))return;let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text"),s.set(f.__key,g,"text")}return}if(Y(a)){let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text")}}if(Y(l)){let c=l.getChildrenSize(),d=i>=c,f=d?l.getChildAtIndex(c-1):l.getChildAtIndex(i);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),s.set(f.__key,g,"text")}}}function vc(e,n,r,s,i){let a=null,l=0,c=null;s!==null?(a=s.__key,te(s)?(l=s.getTextContentSize(),c="text"):Y(s)&&(l=s.getChildrenSize(),c="element")):i!==null&&(a=i.__key,te(i)?c="text":Y(i)&&(c="element")),a!==null&&c!==null?e.set(a,l,c):(l=n.getIndexWithinParent(),l===-1&&(l=r.getChildrenSize()),e.set(r.__key,l,"element"))}function P_(e,n,r,s,i){e.type==="text"?e.set(r,e.offset+(n?0:i),"text"):e.offset>s.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Oc(e,n,r,s,i){try{e.setBaseAndExtent(n,r,s,i)}catch(a){}}function B_(e,n,r){let s=ui(e,n.getKey());if(Y(n)){let i=$n(n,s,e);return[i.element,r+i.getFirstChildOffset()]}return[s,r]}function NC(e,n,r,s,i,a){let l=a.getRootNode(),c=pi(l)||lr(l)?di(l):null;if(i.has(tC)&&c!==a||c!==null&&zc(c,c))return;let d=Vn(s,a),f;if(!ge(n))return void(e!==null&&qa(r,d.anchorNode,d.focusNode)&&s.removeAllRanges());let{anchor:g,focus:p}=n,m=g.getNode(),_=p.getNode(),[x,C]=B_(r,m,g.offset),[y,N]=B_(r,_,p.offset),{format:T,style:v}=n,R=n.isCollapsed(),F=x,k=y,H=!1;if(g.type==="text"?(F=te(m)?ar(m,x,r):null,H=m.getFormat()!==T||m.getStyle()!==v):ge(e)&&e.anchor.type==="text"&&(H=!0),p.type==="text"&&(k=te(_)?ar(_,y,r):null),F!==null&&k!==null){if(R&&(e===null||H||ge(e)&&(e.format!==T||e.style!==v))&&function(U,W,J,G,ne,ee){U._inputState.collapsedSelectionFormat={format:W,key:ne,offset:G,style:J,timeStamp:ee}}(r,T,v,C,g.key,performance.now()),(s.type!=="Range"||!R)&&d.anchorOffset===C&&d.focusOffset===N&&d.anchorNode===F&&d.focusNode===k){if(c===null||!a.contains(c)){let U=c!==null?fs(c):null;U!==null&&U!==r||i.has(Nc)||a.focus({preventScroll:!0})}if(g.type!=="element")return}if(Oc(s,F,C,k,N),ko&&n.isCollapsed()&&a!==null&&!i.has(Nc)){let U=kc(a);if(U===null||!a.contains(U)){let W=di(a.ownerDocument),J=W!==null?fs(W):null;J!==null&&J!==r||a.focus({preventScroll:!0})}}if(!i.has(nC)&&n.isCollapsed()&&a!==null&&a===kc(a)){let U=ge(n)&&n.anchor.type==="element"?F.childNodes[C]||null:(f===void 0&&(f=ey(s,a)),f);if(U!==null){let W;if(Co(U)){let J=U.ownerDocument.createRange();J.selectNode(U),W=J.getBoundingClientRect()}else W=U.getBoundingClientRect();(function(J,G,ne){let ee=Hc(ne),se=xg(ee);if(ee===null||se===null)return;let V=ne.getBoundingClientRect();if(G.bottom<V.top)return;let{top:fe,bottom:Ce}=G,Ae=0,oe=0,ae=ne;for(;ae!==null;){let ue=ae===ee.body;if(ue){let Ie=se.visualViewport;if(Ie){let _t=Ie.offsetTop;Ae=_t,oe=_t+Ie.height}else Ae=0,oe=Nn(J).innerHeight;let ht=se.getComputedStyle(ee.documentElement),Qt=parseFloat(ht.scrollPaddingTop),Be=parseFloat(ht.scrollPaddingBottom);isFinite(Qt)&&(Ae+=Qt),isFinite(Be)&&(oe-=Be)}else{let Ie=ae===ne?V:ae.getBoundingClientRect();Ae=Ie.top,oe=Ie.bottom}let we=0;if(fe<Ae?we=-(Ae-fe):Ce>oe&&(we=Ce-oe),we!==0)if(ue)se.scrollBy(0,we);else{let Ie=ae.scrollTop;ae.scrollTop+=we;let ht=ae.scrollTop-Ie;fe-=ht,Ce-=ht}if(ue)break;ae=Es(ae)}})(r,W,a)}}(function(U){U._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function iR(e){let n=ze()||Ns();n===null&&(n=Dn().selectEnd()),n.insertNodes(e)}function EC(e,n){for(let r of e.split(/(\r?\n|\t)/))r===`
6
+ `){if(Lo(l))l.selectEnd();else if(!l){let c=br(i,CC),d=c&&c.getNextSibling();Y(d)&&d.selectStart()}}else r==="\t"?sg(l)&&l.selectEnd():te(l)&&l.getTextContent()[0]===r&&l.select(1,1)}else i.getTextContent()[a]===r&&i.select(a+1,a+1)}function $a(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function S_(e){$a(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>$a(e),0)}function Zx(e,n){let r=Ng(e);if(Ct(r)&&Ba(r,n))return!0;let s=n.getRootElement();if(s===null)return!1;let i=di(s.ownerDocument);return i!==null&&s.contains(i)&&Ba(i,n)}function PA(e){let n=e.inputType,r=Jx(e),s=Ve(),i=s._inputState,a=ze();if(n==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if($a(i),e.preventDefault(),ge(a)&&!a.isCollapsed()){let p=a.isBackward()?a.anchor:a.focus;a.anchor.set(p.key,p.offset,p.type),a.focus.set(p.key,p.offset,p.type)}return!0}if(n==="deleteContentBackward"){if(a===null){let p=Ns();if(!ge(p))return!0;rn(p.clone())}if(ge(a)){let p=a.anchor.key===a.focus.key;if(function(m,_){return m.lastKeyCode==="MediaLast"&&_<m.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&s.isComposing()&&p){if(Bt(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Wn(s,()=>{Bt(null)})},30),ge(a)){let m=a.anchor.getNode();m.markDirty(),te(m)||q(142),qx(a,m)}}else{if(Bt(null),gs&&r!==null&&!r.collapsed&&(a.applyDOMRange(r),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let m=a.anchor.getNode(),_=m.getTextContent(),x=m.canInsertTextAfter(),C=a.anchor.offset===0&&a.focus.offset===_.length,y=Na&&p&&!C&&x;if(y&&a.isCollapsed()&&(y=!qe(GC(a.anchor,!0))),!y){ie(s,Ra,!0);let N=ze();Na&&ge(N)&&N.isCollapsed()&&(i.postDeleteSelectionToRestore=N,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!ge(a))return!0;let l=e.data;i.unprocessedBeforeInputData!==null&&hg(!1,s,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||Kt(a.anchor.getNode())||r===null||a.applyDOMRange(r),i.unprocessedBeforeInputData=null;let{anchor:c,focus:d}=a,f=c.getNode(),g=d.getNode();if(n==="insertText"||n==="insertTranspose"){if(l===`
7
+ `)e.preventDefault(),ie(s,xa,!1);else if(l===ds)e.preventDefault(),ie(s,Nf);else if(l==null&&e.dataTransfer){let p=e.dataTransfer.getData("text/plain");e.preventDefault(),a.insertRawText(p)}else l!=null&&Xx(a,r,l,e.timeStamp,!0)?(e.preventDefault(),ie(s,ai,l),y_(l)):i.unprocessedBeforeInputData=l;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ie(s,ai,e),y_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let p=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let m=s._compositionKey;Bt(null),p||ie(s,ai,e),cc(m);break}case"insertLineBreak":Bt(null),ie(s,xa,!1);break;case"insertParagraph":Bt(null),i.isInsertLineBreak&&!gs?(i.isInsertLineBreak=!1,ie(s,xa,!1)):ie(s,Nf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ie(s,qf,e);break;case"deleteByComposition":(function(p,m){return p!==m||Y(p)||Y(m)||!Fa(p)||!Fa(m)})(f,g)&&ie(s,ac,e);break;case"deleteByDrag":xs(Nc),ie(s,ac,e);break;case"deleteByCut":ie(s,ac,e);break;case"deleteContent":ie(s,Ra,!1);break;case"deleteWordBackward":ie(s,Ma,!0);break;case"deleteWordForward":ie(s,Ma,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ie(s,Da,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ie(s,Da,!1);break;case"formatStrikeThrough":ie(s,vr,"strikethrough");break;case"formatBold":ie(s,vr,"bold");break;case"formatItalic":ie(s,vr,"italic");break;case"formatUnderline":ie(s,vr,"underline");break;case"historyUndo":ie(s,Jf);break;case"historyRedo":ie(s,Zf)}return!0}function BA(e){let n=Ve(),r=n._inputState,s=ze(),i=e.data,a=Jx(e),l=!1;if(i!=null&&ge(s)){let c=qn(Nn(n)),d=c!==null?Vn(c,n._rootElement):null,f=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&!n.isComposing();f&&(r.hadOrphanedCompositionEvents=!0);let g=s.anchor.getNode(),p=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&n.isComposing()&&te(g)&&Gn(g);if(!f&&!p&&Xx(s,a,i,e.timeStamp,!1,d)){if(l=!0,r.compositionPhase==="ending-firefox"){let N=yc(n,i);if(r.compositionPhase="idle",N)return xs(Ec),X_(),!0}let m=s.anchor.getNode();if(c===null||d===null)return!0;let _=s.isBackward(),x=_?s.anchor.offset:s.focus.offset,C=_?s.focus.offset:s.anchor.offset;Sa&&!s.isCollapsed()&&te(m)&&d.anchorNode!==null&&m.getTextContent().slice(0,x)+i+m.getTextContent().slice(x+C)===HC(d.anchorNode)||ie(n,ai,i);let y=i.length;ko&&y>1&&e.inputType==="insertCompositionText"&&!n.isComposing()&&(s.anchor.offset-=y,s._cachedNodes=null,s._cachedIsBackward=null),Na&&n.isComposing()&&(r.lastKeyDownTimeStamp=0,Bt(null))}}if(!l)hg(!1,n,i!==null?i:void 0),r.compositionPhase==="ending-firefox"&&(yc(n,i||void 0),xs(Ec),r.compositionPhase="idle");return X_(),!0}function KA(e){let n=Ve(),r=n._inputState,s=ze();if(ge(s)&&!n.isComposing()){r.compositionPhase="composing",r.hadOrphanedCompositionEvents=!1;let i=s.anchor,a=s.anchor.getNode();if(Bt(i.key),xs(rC),e.timeStamp<r.lastKeyDownTimeStamp+30||i.type==="element"||!s.isCollapsed()||!Na&&(a.getFormat()!==s.format||te(a)&&a.getStyle()!==s.style)||te(a)&&(Gn(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){ie(n,ai,zf);let l=ze();ge(l)&&Bt(l.anchor.key)}}return!0}function zA(e){let n=Ve();return n._inputState.compositionPhase="idle",yc(n,e.data),xs(Ec),!0}function cc(e){if(e===null)return;let n=ot(e);if(!te(n)||n.getType()==="text"||Gn(n)||!n.isAttached())return;let r=ze(),s=ge(r)&&r.anchor.key===e?r.anchor.offset:null,i=Cn(n.getTextContent());if(i.setFormat(n.getFormat()),i.setStyle(n.getStyle()),n.replace(i),s!==null){let a=Math.min(s,i.getTextContentSize());i.select(a,a)}}function yc(e,n){let r=e._compositionKey;if(Bt(null),r!==null&&n!=null){if(n===""){let i=ot(r),a=e.getElementByKey(r),l=a!==null&&te(i)?ir(i,a,e):null;if(l!==null&&l.nodeValue!==null&&te(i)){let c=qn(Nn(e)),d=c&&Vn(c,e._rootElement),f=null,g=null;d!==null&&d.anchorNode===l&&(f=d.anchorOffset,g=d.focusOffset),mg(i,l.nodeValue,f,g,!0)}return cc(r),!1}if(n[n.length-1]===`
8
+ `){let i=ze();if(ge(i)||gi(i)){if(ge(i)){let a=i.focus;i.anchor.set(a.key,a.offset,a.type)}return ie(e,xc,null),cc(r),!1}}let s=ot(r);if(s!==null&&te(s)&&Gn(s)){s.markDirty();let i=ze(),a=s.getTextContentSize(),l=ge(i)&&i.anchor.key===r?i.anchor.offset:a;return s.select(l,l).insertText(n),!0}}return hg(!0,e,n),cc(r),!1}function UA(e){let n=Ve(),r=n._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){let s=J_(e);if(s&&Wn(n,()=>{yc(n,r.compositionEndData)}),r.compositionPhase="idle",r.compositionEndData="",s)return!0}if(function(s){return Qe(s,"ArrowRight",{shiftKey:"any"})}(e))ie(n,Rx,e);else if(function(s){return Qe(s,"ArrowRight",{...or,shiftKey:"any"})}(e))ie(n,Mx,e);else if(function(s){return Qe(s,"ArrowLeft",{shiftKey:"any"})}(e))ie(n,Dx,e);else if(function(s){return Qe(s,"ArrowLeft",{...or,shiftKey:"any"})}(e))ie(n,$x,e);else if(function(s){return Qe(s,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))ie(n,wx,e);else if(function(s){return Qe(s,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))ie(n,kx,e);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))r.isInsertLineBreak=!0,ie(n,xc,e);else if(function(s){return s.key===" "}(e))ie(n,Ix,e);else if(function(s){return Kn&&Qe(s,"o",{ctrlKey:!0})}(e))e.preventDefault(),r.isInsertLineBreak=!0,ie(n,xa,!0);else if(function(s){return Qe(s,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))r.isInsertLineBreak=!1,ie(n,xc,e);else if(function(s){return Qe(s,"Backspace",{shiftKey:"any"})||Kn&&Qe(s,"h",{ctrlKey:!0})}(e))J_(e)?ie(n,Lx,e)&&S_(r):(e.preventDefault(),ie(n,Ra,!0));else if(function(s){return s.key==="Escape"}(e))ie(n,Fx,e);else if(function(s){return Qe(s,"Delete",{})||Kn&&Qe(s,"d",{ctrlKey:!0})}(e))!function(s){return s.key==="Delete"}(e)?(e.preventDefault(),ie(n,Ra,!1)):ie(n,Px,e);else if(function(s){return Qe(s,"Backspace",q_)}(e))e.preventDefault(),ie(n,Ma,!0);else if(function(s){return Qe(s,"Delete",q_)}(e))e.preventDefault(),ie(n,Ma,!1);else if(function(s){return Kn&&Qe(s,"Backspace",{metaKey:!0})}(e))e.preventDefault(),ie(n,Da,!0);else if(function(s){return Kn&&(Qe(s,"Delete",{metaKey:!0})||Qe(s,"k",{ctrlKey:!0}))}(e))e.preventDefault(),ie(n,Da,!1);else if(function(s){return Qe(s,"b",or)}(e))e.preventDefault(),ie(n,vr,"bold");else if(function(s){return Qe(s,"u",or)}(e))e.preventDefault(),ie(n,vr,"underline");else if(function(s){return Qe(s,"i",or)}(e))e.preventDefault(),ie(n,vr,"italic");else if(function(s){return Qe(s,"Tab",{shiftKey:"any"})}(e))ie(n,Bx,e);else if(function(s){return Qe(s,"z",or)}(e))e.preventDefault(),ie(n,Jf);else if(function(s){if(Kn)return Qe(s,"z",{metaKey:!0,shiftKey:!0});return Qe(s,"y",{ctrlKey:!0})||Qe(s,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),ie(n,Zf);else{let s=n._editorState._selection;!function(i){return Qe(i,"a",or)}(e)?s===null||ge(s)||(!function(i){return Qe(i,"c",or)}(e)?function(i){return Qe(i,"x",or)}(e)&&(e.preventDefault(),ie(n,tg,e)):(e.preventDefault(),ie(n,eg,e))):(e.preventDefault(),ie(n,Wx,e)&&S_(r))}return function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey}(e)&&n.dispatchCommand(Yx,e),!0}function Qx(e){let n=e.__lexicalEventHandles;return n===void 0&&(n=[],e.__lexicalEventHandles=n),n}var li=new Map;function N_(e){let n=qC(e.target);if(n===null)return;let r=Hc(e.target),s=null,i=null,a=r!==null?Cc.get(r):void 0;if(r!==null){if(a!==void 0){let{editors:p,hasShadowEditor:m}=a;if(m===void 0){m=!1;for(let _ of p)if(_._rootElement!==null&&ar(_._rootElement.getRootNode())){m=!0;break}a.hasShadowEditor=m}if(m){let _=null,x=null;for(let C of p){let y=C._rootElement;if(y===null)continue;let N=Vn(n,y).anchorNode;if(N!==null&&fs(N)===C){if(ar(y.getRootNode())){s=C,i=N;break}_===null&&(_=C,x=N)}}s===null&&_!==null&&(s=_,i=x)}else{let _=n.anchorNode;_===null||Ct(_)&&_.shadowRoot!==null||(s=fs(_),s!==null&&(i=_))}}if(s===null){let p=di(r);s=p!==null?fs(p):null}}if(s===null)return;if(s._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let p of a.editors)p._inputState.isSelectionChangeFromMouseDown=!1;Wn(s,()=>{let p=Ns(),m=i??Vn(n,s._rootElement).anchorNode;if(Ct(m)||Co(m))rn(ka(p,n,s,e))})}let l=pg(s),c=l[l.length-1],d=c._key,f=li.get(d),g=f||c;g!==s&&C_(n,g,!1),C_(n,s,!0),s!==c?li.set(d,s):f&&li.delete(d)}function bf(e){e._lexicalHandled=!0}function E_(e){return e._lexicalHandled===!0}var T_=()=>{};function HA(e){let n=Tf.get(e);if(n===void 0)return void T_();let r=Cc.get(n);if(r===void 0)return void T_();Tf.delete(e);let s=Ja(e);Uc(s)?(function(a){if(a._parentEditor!==null){let l=pg(a),c=l[l.length-1]._key;li.get(c)===a&&li.delete(c)}else li.delete(a._key)}(s),r.editors.delete(s),r.hasShadowEditor=void 0,e.__lexicalEditor=null):s&&q(198);let i=Qx(e);for(let a=0;a<i.length;a++)i[a]();e.__lexicalEventHandles=[]}function vf(e,n,r){Wt();let s=e.__key,i=e.getParent();if(i===null)return void(Jt(e)!==null&&q(367,s,String(Jt(e))));let a=function(c){let d=ze();if(!ge(d)||!Y(c))return d;let{anchor:f,focus:g}=d,p=f.getNode(),m=g.getNode();return Pa(p,c)&&f.set(c.__key,0,"element"),Pa(m,c)&&g.set(c.__key,0,"element"),d}(e),l=!1;if(ge(a)&&n){let{anchor:c,focus:d}=a;c.key===s&&(vc(c,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0),d.key===s&&(vc(d,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0)}else gi(a)&&n&&e.isSelected()&&e.selectPrevious();if(ge(a)&&n&&!l){let c=e.getIndexWithinParent();Un(e),us(a,i,c,-1)}else Un(e);r||At(i)||i.canBeEmpty()||!i.isEmpty()||vf(i,n),n&&a&&Kt(i)&&i.isEmpty()&&i.selectEnd()}function WA(e){return e}var eC=Symbol.for("ephemeral");function Sc(e){return e[eC]||!1}var b_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class cn{__type;__key;__parent;__prev;__next;__state;[ba];static getType(){let{ownNodeType:e}=el(this);return e===void 0&&q(64,this.name),e}static clone(e){q(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||fy(this.constructor);return Object.assign(n,{extends:r}),typeof e=="string"&&Object.assign(n,{type:e}),{[e]:n}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",b_),Object.defineProperty(this,ba,b_),PC(this,e)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let n=ot(e);if(n===null)break;e=n.__parent!==null?n.__parent:Jt(n)}return!1}isSelected(e){let n=e||ze();if(n==null)return!1;let r=n.getNodes().some((s)=>s.__key===this.__key);if(te(this))return r;if(ge(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let s=this.getParent();if(qe(this)&&this.isInline()&&s){let i=n.isBackward()?n.focus:n.anchor;if(s.is(i.getNode())&&i.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:ot(e)}getParentOrThrow(){let e=this.getParent();return e===null&&q(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(At(n)||Jt(e)!==null)return Y(e)||e===this&&qe(e)||q(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&q(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:ot(e)}getPreviousSiblings(){let e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:ot(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=Y(this)?this:this.getParent(),r=Y(e)?e:e.getParent(),s=n&&r?Ic(n,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=Ic(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?kg(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(e){return Pa(e,this)}getNodesBetween(e){let n=this.isBefore(e),r=[],s=new Set,i=this;for(;i!==null;){let a=i.__key;if(s.has(a)||(s.add(a),r.push(i)),i===e)break;let l=Y(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}let c=n?i.getNextSibling():i.getPreviousSibling();if(c!==null){i=c;continue}let d=i.getParentOrThrow();if(s.has(d.__key)||r.push(d),d===e)break;let f=null,g=d;do{if(g===null&&q(68),f=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;f!==null||s.has(g.__key)||r.push(g)}while(f===null);i=f}return n||r.reverse(),r}isDirty(){let e=Ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Sc(this))return this;let e=ot(this.__key);return e===null&&q(113),e}getWritable(){if(Sc(this))return this;Wt();let e=Bo(),n=Ve(),r=e._nodeMap,s=this.__key,i=this.getLatest(),a=n._cloneNotNeeded,l=ze();if(l!==null&&l.setCachedNodes(null),a.has(s))return $c(i),i;let c=bg(i);return a.add(s),$c(c),r.set(s,c),c}getTextContent(){return _y(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){q(70)}updateDOM(e,n,r){q(71)}getDOMSlot(e){return new ri(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){q(18,this.name)}updateFromJSON(e){return function(n,r){let s=n.getWritable(),i=r.$,a=i;for(let l of Cx(s).flatKeys)l in r&&(a!==void 0&&a!==i||(a={...i}),a[l]=r[l]);return(s.__state||a)&&Wf(n).updateFromJSON(a),s}(this,e)}static transform(){return null}remove(e){vf(this,!0,e)}replace(e,n){Wt();let r=ze();r!==null&&(r=r.clone()),cf(this,e);let s=this.getLatest(),i=this.__key,a=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),d=c.__size,f=l.getParent(),g=f!==null?l.getIndexWithinParent():-1;Un(l),f!==null&&ge(r)&&us(r,f,g,-1);let p=s.getPreviousSibling(),m=s.getNextSibling(),{__prev:_,__next:x,__parent:C}=s;if(vf(s,!1,!0),p===null)c.__first=a;else p.getWritable().__next=a;if(l.__prev=_,m===null)c.__last=a;else m.getWritable().__prev=a;l.__next=x,l.__parent=C,c.__size=d;let y=0;n&&(Y(this)&&Y(l)||q(139),y=l.getChildrenSize(),l.splice(y,0,this.getChildren()));let N=jn(this);if(N.length>0){$o(this)&&$o(l)||q(368,this.__key,l.__key);for(let T of N){let v=wr(this,T);v!==null&&(xy(this,T),Og(l,T,v))}}if(ge(r)){rn(r);let T=r.anchor,v=r.focus;T.key===i&&(n&&T.type==="element"?T.set(l.__key,y+T.offset,"element"):R_(T,l)),v.key===i&&(n&&v.type==="element"?v.set(l.__key,y+v.offset,"element"):R_(v,l))}return Do()===i&&Bt(a),l}insertAfter(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.getParent(),a=ze(),l=!1,c=!1;if(i!==null){let m=e.getIndexWithinParent();if(ge(a)){let _=i.__key,{anchor:x,focus:C}=a;l=x.type==="element"&&x.key===_&&x.offset===m+1,c=C.type==="element"&&C.key===_&&C.offset===m+1}Un(s),n&&ge(a)&&us(a,i,m,-1)}else Un(s);let d=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),g=s.__key,p=r.__next;if(d===null)f.__last=g;else d.getWritable().__prev=g;if(f.__size++,r.__next=g,s.__next=p,s.__prev=r.__key,s.__parent=r.__parent,n&&ge(a)){let m=this.getIndexWithinParent();us(a,f,m+1);let _=f.__key;l&&a.anchor.set(_,m+2,"element"),c&&a.focus.set(_,m+2,"element")}return e}insertBefore(e,n=!0){Wt(),cf(this,e);let r=this.getWritable(),s=e.getWritable();sx(this.getParentOrThrow());let i=s.__key,a=ze(),l=s.getParent(),c=l!==null?s.getIndexWithinParent():-1;Un(s),l!==null&&n&&ge(a)&&us(a,l,c,-1);let d=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),g=r.__prev,p=this.getIndexWithinParent();if(d===null)f.__first=i;else d.getWritable().__next=i;if(f.__size++,r.__prev=i,s.__prev=g,s.__next=r.__key,s.__parent=r.__parent,n&&ge(a))us(a,this.getParentOrThrow(),p);return e}isParentRequired(){return!1}createParentElementNode(){return Mn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){Wt();let r=Hn(this);if(r!==null)return r.selectPrevious(e,n);let s=this.getPreviousSibling(),i=this.getParentOrThrow();if(s===null)return i.select(0,0);if(Y(s))return s.select();if(!te(s)){let a=s.getIndexWithinParent()+1;return i.select(a,a)}return s.select(e,n)}selectNext(e,n){Wt();let r=Hn(this);if(r!==null)return r.selectNext(e,n);let s=this.getNextSibling(),i=this.getParentOrThrow();if(s===null)return i.select();if(Y(s))return s.select(0,0);if(!te(s)){let a=s.getIndexWithinParent();return i.select(a,a)}return s.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}}function og(e){return e instanceof cn}var GA="historic",jA="history-push",uc="history-merge",YA="paste",VA="cut",tC="collaboration",XA="skip-collab",nC="skip-scroll-into-view",oC="skip-dom-selection",Nc="skip-selection-focus",rC="composition-start",Ec="composition-end",qA="!important";function Of(e){let n={};if(!e)return n;let r="",s="",i=null,a=!1,l=!1,c=!1,d=0,f=e.length,g=-1;for(let _=0;_<f;_++){let x=e[_];if(a)x==="*"&&e[_+1]==="/"&&(a=!1,_++);else if(l)g===-1&&(g=_),l=!1;else if(i===null)if(x!=="/"||e[_+1]!=="*")if(x!=='"'&&x!=="'")if(x!=="(")if(x!==")")if(c||x!==":"||d!==0){if(x===";"&&d===0){g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1);let C=r.trim(),y=s.trim();C!==""&&y!==""&&(n[C]=y),r="",s="",c=!1;continue}g===-1&&(g=_)}else g!==-1&&(r+=e.slice(g,_),g=-1),c=!0;else g===-1&&(g=_),d=Math.max(0,d-1);else g===-1&&(g=_),d++;else g===-1&&(g=_),i=x;else g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1),a=!0,_++;else g===-1&&(g=_),x==="\\"?l=!0:x===i&&(i=null)}g!==-1&&(c?s+=e.slice(g,f):r+=e.slice(g,f));let p=r.trim(),m=s.trim();return p!==""&&m!==""&&(n[p]=m),n}function sC(e,n,r){let s=r.trimEnd(),i=s.length-10;i>=0&&s.slice(i).toLowerCase()===qA?e.setProperty(n,s.slice(0,i).trim(),"important"):e.setProperty(n,r,"")}function JA(e,n){for(let r in n){let s=n[r];s==null?e.removeProperty(r):sC(e,r,s)}}function Af(e,n,r=""){if(n===r)return;let s=Of(r),i=Of(n);for(let a in i)delete s[a],sC(e,a,i[a]);for(let a in s)e.removeProperty(a)}function ef(e,n){return 16&n?"code":n&Kf?"mark":32&n?"sub":64&n?"sup":null}function tf(e,n){return 1&n?"strong":2&n?"em":"span"}function iC(e,n,r,s,i){let a=s.classList,l=ci(i,"base");l!==void 0&&a.add(...l),l=ci(i,"underlineStrikethrough");let c=!1,d=8&n&&4&n;l!==void 0&&(8&r&&4&r?(c=!0,d||a.add(...l)):d&&a.remove(...l));for(let f in Xt){let g=Xt[f];if(l=ci(i,f),l!==void 0)if(r&g){if(c&&(f==="underline"||f==="strikethrough")){n&g&&a.remove(...l);continue}((n&g)===0||d&&f==="underline"||f==="strikethrough")&&a.add(...l)}else n&g&&a.remove(...l)}}function aC(e,n,r){let s=r.isComposing(),i=e+(s?Ea:""),a=yo(),l=Tg(a).$getDOMSlot(r,n,a),c=l.getFirstChild();if(c===null||c.nodeType!==Node.TEXT_NODE)return void l.insertChild(Sn().createTextNode(i));let d=c,f=d.nodeValue;if(f!==i)if(s||ko){let[g,p,m]=function(_,x){let C=_.length,y=x.length,N=0,T=0;for(;N<C&&N<y&&_[N]===x[N];)N++;for(;T+N<C&&T+N<y&&_[C-T-1]===x[y-T-1];)T++;return[N,C-N-T,x.slice(N,y-T)]}(f,i);p!==0&&d.deleteData(g,p),d.insertData(g,m)}else d.nodeValue=i}function v_(e,n,r,s,i,a){aC(i,e,n);let l=a.theme.text;l!==void 0&&iC(0,0,s,e,l)}function rc(e,n){let r=Sn().createElement(n);return r.appendChild(e),r}function Tc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends cn{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:tR,priority:0}),b:()=>({conversion:QA,priority:0}),code:()=>({conversion:nr,priority:0}),em:()=>({conversion:nr,priority:0}),i:()=>({conversion:nr,priority:0}),mark:()=>({conversion:nr,priority:0}),s:()=>({conversion:nr,priority:0}),span:()=>({conversion:ZA,priority:0}),strong:()=>({conversion:nr,priority:0}),sub:()=>({conversion:nr,priority:0}),sup:()=>({conversion:nr,priority:0}),u:()=>({conversion:nr,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",n){super(n),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return fA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Do()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let n=Xt[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Dr(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,s=ef(0,r),i=tf(0,r),a=s===null?i:s,l=Sn().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Sn().createElement(i),l.appendChild(c)),v_(c,this,0,r,this.__text,e);let d=this.__style;return d!==""&&Af(l.style,d),l}updateDOM(e,n,r){let s=this.__text,i=e.__format,a=this.__format,l=ef(0,i),c=ef(0,a),d=tf(0,i),f=tf(0,a);if((l===null?d:l)!==(c===null?f:c))return!0;if(l===c&&d!==f){let x=n.firstChild;x==null&&q(48);let C=Sn().createElement(f);return v_(C,this,0,a,s,r),n.replaceChild(C,x),!1}let g=n;c!==null&&l!==null&&(g=n.firstChild,g==null&&q(49)),aC(s,g,this);let p=r.theme.text;p!==void 0&&i!==a&&iC(0,i,a,g,p);let m=e.__style,_=this.__style;return m!==_&&Af(n.style,_,m),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return Ct(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=rc(n,"b")),this.hasFormat("italic")&&(n=rc(n,"i")),this.hasFormat("strikethrough")&&(n=rc(n,"s")),this.hasFormat("underline")&&(n=rc(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Xt[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?cA[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Dr(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let n=dA[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){Wt();let r=e,s=n,i=ze(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!ge(i))return yC(l,r,l,s,"text","text");{let c=Do();c!==i.anchor.key&&c!==i.focus.key||Bt(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=e;c<0&&(c=l+c,c<0&&(c=0));let d=ze();if(s&&ge(d)){let g=e+l;d.setTextNodeRange(i,g,i,g)}let f=a.slice(0,c)+r+a.slice(c+n);return i.__text=f,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Wt();let n=this.getLatest(),r=n.getTextContent();if(r==="")return[];let s=n.__key,i=Do(),a=r.length;e.sort((H,U)=>H-U),e.push(a);let l=[],c=e.length;for(let H=0,U=0;H<a&&U<=c;U++){let W=e[U];W>H&&(l.push(r.slice(H,W)),H=W)}let d=l.length;if(d===1)return[n];let f=l[0],g=n.getParent(),p,m=n.getFormat(),_=n.getStyle(),x=n.__detail,C=!1,y=null,N=null,T=ze();if(ge(T)){let[H,U]=T.isBackward()?[T.focus,T.anchor]:[T.anchor,T.focus];H.type==="text"&&H.key===s&&(y=H),U.type==="text"&&U.key===s&&(N=U)}n.isSegmented()?(p=Cn(f),p.__format=m,p.__style=_,p.__detail=x,p.__state=l_(n,p),C=!0):p=n.setTextContent(f);let v=[p];for(let H=1;H<d;H++){let U=Cn(l[H]);U.__format=m,U.__style=_,U.__detail=x,U.__state=l_(n,U);let W=U.__key;i===s&&Bt(W),v.push(U)}let R=y?y.offset:null,F=N?N.offset:null,k=0;for(let H of v){if(!y&&!N)break;let U=k+H.getTextContentSize();if(y!==null&&R!==null&&R<=U&&R>=k&&(y.set(H.getKey(),R-k,"text"),R<U&&(y=null)),N!==null&&F!==null&&F<=U&&F>=k){N.set(H.getKey(),F-k,"text");break}k=U}if(g!==null){(function(W){let J=W.getPreviousSibling(),G=W.getNextSibling();J!==null&&$c(J),G!==null&&$c(G)})(this);let H=g.getWritable(),U=this.getIndexWithinParent();C?(H.splice(U,0,v),this.remove()):H.splice(U,1,v),ge(T)&&us(T,g,U,d-1)}return v}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||q(50);let r=this.__key,s=e.__key,i=this.__text,a=i.length;Do()===s&&Bt(r);let l=ze();if(ge(l)){let{anchor:g,focus:p}=l;g!==null&&g.key===s&&P_(g,n,r,e,a),p!==null&&p.key===s&&P_(p,n,r,e,a)}let c=e.__text,d=n?c+i:i+c;this.setTextContent(d);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function ZA(e){return{forChild:rg(e.style),node:null}}function QA(e){let n=e,r=n.style.fontWeight==="normal";return{forChild:rg(n.style,r?void 0:"bold"),node:null}}var O_=new WeakMap;function eR(e){if(!Ct(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function tR(e){let n=e;e.parentElement===null&&q(129);let r=n.textContent||"";if(function(s){let i,a=s.parentNode,l=[s];for(;a!==null&&(i=O_.get(a))===void 0&&!eR(a);)l.push(a),a=a.parentNode;let c=i===void 0?a:i;for(let d=0;d<l.length;d++)O_.set(l[d],c);return c}(n)!==null)return{node:ig(r)};if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!1))!==null;){let a=s.textContent||"";if(a.length>0){/[ \t\n]$/.test(a)&&(r=r.slice(1)),i=!1;break}}i&&(r=r.slice(1))}if(r[r.length-1]===" "){let s=n,i=!0;for(;s!==null&&(s=A_(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Cn(r)}}function A_(e,n){let r=e;for(;;){let s;for(;(s=n?r.nextSibling:r.previousSibling)===null;){let a=r.parentElement;if(a===null)return null;r=a}if(r=s,Ct(r)){let a=r.style.display;if(a===""&&!sy(r)||a!==""&&!a.startsWith("inline"))return null}let i=r;for(;(i=n?r.firstChild:r.lastChild)!==null;)r=i;if(Co(r))return r;if(r.nodeName==="BR")return null}}var nR={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nr(e){let n=nR[e.nodeName.toLowerCase()];return n===void 0?{node:null}:{forChild:rg(e.style,n),node:null}}function Cn(e=""){return Za(new ms(e))}function te(e){return e instanceof ms}function rg(e,n){let r=e.fontWeight,s=e.textDecoration.split(" "),i=r==="700"||r==="bold",a=s.includes("line-through"),l=e.fontStyle==="italic",c=s.includes("underline"),d=e.verticalAlign;return(f)=>te(f)||Tc(f)?(i&&!f.hasFormat("bold")&&f.toggleFormat("bold"),a&&!f.hasFormat("strikethrough")&&f.toggleFormat("strikethrough"),l&&!f.hasFormat("italic")&&f.toggleFormat("italic"),c&&!f.hasFormat("underline")&&f.toggleFormat("underline"),d!=="sub"||f.hasFormat("subscript")||f.toggleFormat("subscript"),d!=="super"||f.hasFormat("superscript")||f.toggleFormat("superscript"),n&&!f.hasFormat(n)&&f.toggleFormat(n),f):f}class Ga extends ms{$config(){return this.config("tab",{extends:ms})}constructor(e=void 0){super("\t",e),this.__detail=2}createDOM(e){let n=super.createDOM(e),r=ci(e.theme,"tab");if(r!==void 0)n.classList.add(...r);return n}setTextContent(e){return super.setTextContent("\t")}spliceText(e,n,r,s){return r===""&&n===0||r==="\t"&&n===1||q(286),this}setDetail(e){return e!==2&&q(127),this}setMode(e){return e!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function lC(){return Za(new Ga)}function sg(e){return e instanceof Ga}class cC{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){if(this.key===e.key)return this.offset<e.offset;return wg(wo(Fr(this,"next")),wo(Fr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&q(20),e}set(e,n,r,s){let i=this._selection,a=this.key;s&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,Mr()||(Do()===a&&Bt(e),i!==null&&(i.setCachedNodes(null),ge(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function xo(e,n,r){return new cC(e,n,r)}function nf(e,n){let r=n.__key,s=e.offset,i="element";if(te(n)){i="text";let a=n.getTextContentSize();s>a&&(s=a)}else if(!Y(n)){let a=n.getNextSibling();if(te(a))r=a.__key,s=0,i="text";else{let l=n.getParent();l&&(r=l.__key,s=n.getIndexWithinParent()+1)}}e.set(r,s,i)}function R_(e,n){if(Y(n)){let r=n.getLastDescendant();Y(r)||te(r)?nf(e,r):nf(e,n)}else nf(e,n)}function M_(e,n,r,s){let i=e.getNode(),a=i.getChildAtIndex(e.offset),l=Cn();if(l.setFormat(r),l.setStyle(s),wC(a))a.splice(0,0,[l]);else if(a!==null){let c=At(i)?Mn().append(l):l;a.insertBefore(c)}else if(At(i)){let c=i.getLastChild();Y(c)&&!c.isInline()&&c.isEmpty()?c.append(l):i.append(Mn().append(l))}else i.append(l);e.is(n)&&n.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function D_(e,n,r,s){let i=e.anchor.getNode();te(i)||q(398);let a=e.anchor.offset,l=Cn(n);l.setFormat(r),l.setStyle(s);let c=i.getParentOrThrow();if(a===0)c.isInline()&&!i.__prev?c.insertBefore(l):i.insertBefore(l,!1);else if(a===i.getTextContentSize())c.isInline()&&!i.__next?c.insertAfter(l):i.insertAfter(l,!1);else{let[d]=i.splitText(a);d.insertAfter(l,!1)}i.getTextContent()===""&&i.isAttached()&&i.remove(),l.selectEnd(),l.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-n.length,e.anchor.type)}class Fc{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!gi(e))return!1;let n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every((s)=>r.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Fc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let n=this.getNodes().filter((a)=>Jt(a)===null),r=n.length;if(r===0)return;let s=n[r-1],i;if(te(s))i=s.select();else{let a=s.getIndexWithinParent()+1;i=s.getParentOrThrow().select(a,a)}i.insertNodes(e);for(let a=0;a<r;a++)n[a].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=this._nodes,r=[];for(let s of n){let i=ot(s);i!==null&&r.push(i)}return Mr()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){let e=this.getNodes().filter((n)=>Jt(n)===null);if((ze()||Ns())===this&&e[0]){let n=St(e[0],"next");Ny(Lr(n,n))}for(let n of e)n.remove();uC()}}function uC(){let e=Dn();if(e.isEmpty()){let n=Mn();e.append(n),n.select()}}function ge(e){return e instanceof Ss}class Ss{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,n,r,s){this.anchor=e,this.focus=n,e._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ge(e)&&(this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=function(r){let s=[],[i,a]=r.getTextSlices();i&&s.push(i.caret.origin);let l=new Set,c=new Set;for(let d of r)if(Yn(d)){let{origin:f}=d;s.length===0?l.add(f):(c.add(f),s.push(f))}else{let{origin:f}=d;Y(f)&&c.has(f)||s.push(f)}if(a&&s.push(a.caret.origin),kr(r.focus)&&Y(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let d=cr(r.focus.origin,"previous");Yn(d)&&l.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(s[s.length-1]);d=fi(d))l.delete(d.origin),s.pop();for(;s.length>1;){let d=s[s.length-1];if(!Y(d)||c.has(d)||d.isEmpty()||l.has(d))break;s.pop()}if(s.length===0&&r.isCollapsed()){let d=wo(r.anchor),f=wo(r.anchor.getFlipped()),g=(m)=>mo(m)?m.origin:m.getNodeAtCaret(),p=g(d)||g(f)||(r.anchor.getNodeAtCaret()?d.origin:f.origin);s.push(p)}return s}(Ig(Ff(this),"next"));return Mr()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,s){return this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,s,"text"),this}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],s=this.anchor,i=this.focus,a=s.isBefore(i),[l,c]=Rf(this),d="",f=!0;for(let g=0;g<e.length;g++){let p=e[g];if(Y(p)&&!p.isInline()){f||(d+=`
9
+ `);let m="";for(let _ of jn(p)){let x=wr(p,_);x!==null&&(m+=x.getTextContent())}m!==""?(d+=m,f=!1):f=!p.isEmpty()}else if(f=!1,te(p)){let m=p.getTextContent();p===n?p===r?s.type==="element"&&i.type==="element"&&i.offset!==s.offset||(m=l<c?m.slice(l,c):m.slice(c,l)):m=a?m.slice(l):m.slice(c):p===r&&(m=a?m.slice(0,c):m.slice(0,l)),d+=m}else!qe(p)&&!Lo(p)||p===r&&this.isCollapsed()||(d+=p.getTextContent())}return d}applyDOMRange(e){let n=Ve(),r=n.getEditorState()._selection,s=xC(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(s===null)return;let[i,a,l]=s;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),l&&(this.dirty=!0),ni(this)}clone(){let e=this.anchor,n=this.focus;return new Ss(xo(e.key,e.offset,e.type),xo(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Dr(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let n=Xt[e];return(this.format&n)!==0}insertRawText(e){this.insertNodes(ig(e))}insertText(e){let n=this.format,r=this.style;if(!this.isCollapsed()){let g=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(te(g)&&(n=g.getFormat(),r=g.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Do()===null)return this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r),void D_(this,e,n,r)}this.anchor.type==="element"&&M_(this.anchor,this.focus,n,r);let s=this.anchor.getNode();te(s)||q(398);let i=this.anchor.offset,a=s.getParentOrThrow(),l=s.getTextContentSize();if(Gn(s)||i===0&&(!s.canInsertTextBefore()||!a.canInsertTextBefore()&&!s.__prev)||i===l&&(!s.canInsertTextAfter()||!a.canInsertTextAfter()&&!s.__next)){if(s.isSegmented()&&i!==0&&i!==l){if(Do()!==null)s.setMode("normal").setFormat(n).setStyle(r);else{let p=Cn(s.getTextContent());p.setFormat(n),p.setStyle(r),s.replace(p),p.select(i,i)}return void(e!==""&&this.insertText(e))}if(e==="")return;if(i===0){let p=s.getPreviousSibling();if(te(p)&&p.canInsertTextAfter()&&!Gn(p))p.select();else{let m=Cn();m.setFormat(n),m.setStyle(r),a.canInsertTextBefore()?s.insertBefore(m):a.insertBefore(m),m.select()}return void this.insertText(e)}if(i===l){let p=s.getNextSibling();if(te(p)&&p.canInsertTextBefore()&&!Gn(p))p.select(0,0);else{let m=Cn();m.setFormat(n),m.setStyle(r),a.canInsertTextAfter()?s.insertAfter(m):a.insertAfter(m),m.select(0,0)}return void this.insertText(e)}let g=Cn(e);return g.setFormat(n),g.setStyle(r),s.replace(g),void g.select()}if(e==="")return;let c=a.isInline()&&i===0&&!s.__prev,d=a.isInline()&&i===l&&!s.__next,f=s.getFormat()!==n||s.getStyle()!==r;if(c||d||f){if(s.getTextContent()!==""||c||d)return void D_(this,e,n,r);s.setFormat(n),s.setStyle(r)}s.spliceText(i,0,e,!0),s.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=ze()===this;ya(this,Ey(Ff(this))),e&&ze()!==this&&rn(this)}formatText(e,n=null){fC(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&Y(n)&&Jt(n)!==null){let x=n.isShadowRoot()?n.getFirstChild()??n.append(Mn()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&x!==null&&!Y(x)){let C=Mn();x.insertBefore(C),x=C}if(x!==null){x.selectStart();let C=ze();return ge(C)||q(369),C.insertNodes(e)}}if(this.anchor.type==="element"&&At(n)){let x=rf(e),C=x.getLastDescendant();return n.splice(this.anchor.offset,0,x.getChildren()),void(C!==null&&C.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),s=br(r,xn),i=e[e.length-1];if(Y(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let x=ga(this);s.splice(x,0,e),i.selectEnd()}return}if(!e.some((x)=>(Y(x)||qe(x))&&!x.isInline())){Y(s)||q(211,r.constructor.name,r.getType());let x=ga(this);return s.splice(x,0,e),void i.selectEnd()}if(Y(s)&&Jt(s)!==null){let x=ga(this),C=Df(e);s.splice(x,0,C);let y=C[C.length-1];return void(y!==void 0?y.selectEnd():s.select(x,x))}if(s===null){let x=rf(e),C=x.getLastDescendant(),y=Fr(this.anchor,"next");for(let N of x.getChildren())y=Oy(N,y);return void(C!==null&&C.selectEnd())}if(Y(s)&&!s.isParentRequired()&&!At(s.getParentOrThrow())){let x=ga(this),C=Df(e);s.splice(x,0,C);let y=C[C.length-1];return void(y!==void 0?y.selectEnd():s.select(x,x))}let a=rf(e),l=a.getLastDescendant(),c=a.getChildren(),d=!Y(s)||!s.isEmpty()?this.insertParagraph():null;d&&!s.isAttached()&&(r=this.anchor.getNode(),s=br(r,xn));let f=c[c.length-1],g=c[0];var p;Y(p=g)&&xn(p)&&!p.isEmpty()&&Y(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(Y(s)||q(211,r.constructor.name,r.getType()),s.append(...g.getChildren()),g=c[1]),g&&(s===null&&q(212,r.constructor.name,r.getType()),function(x,C){let y=C.getParentOrThrow().getLastChild(),N=C,T=[C];for(;N!==y;)N.getNextSibling()||q(140),N=N.getNextSibling(),T.push(N);let v=x;for(let R of T)v=v.insertAfter(R)}(s,g));let m=br(l,xn);d&&Y(m)&&(d.canMergeWhenEmpty()||xn(f))&&(m.append(...d.getChildren()),d.remove()),Y(s)&&s.isEmpty()&&s.remove(),l.selectEnd();let _=Y(s)?s.getLastChild():null;Lo(_)&&m!==s&&_.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&At(e)){let l=Mn();return e.splice(this.anchor.offset,0,[l]),l.select(),l}let n=ga(this),r=br(this.anchor.getNode(),xn);if(r!==null&&Jt(r)!==null)return null;Y(r)||q(213);let s=r.getChildAtIndex(n),i=s?[s,...s.getNextSiblings()]:[],a=r.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let n=Bc();if(this.insertNodes([n]),e){let r=n.getParentOrThrow(),s=n.getIndexWithinParent();r.select(s,s)}}extract(){let e=[...this.getNodes()],n=e.length,r=e[0],s=e[n-1],[i,a]=Rf(this),l=this.isBackward(),[c,d]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[f,g]=l?[a,i]:[i,a];if(n===0)return[];if(n===1){if(te(r)&&!this.isCollapsed()){let p=r.splitText(f,g),m=f===0?p[0]:p[1];return m?(c.set(m.getKey(),0,"text"),d.set(m.getKey(),m.getTextContentSize(),"text"),[m]):[]}return[r]}if(te(r)&&(f===r.getTextContentSize()?e.shift():f!==0&&([,r]=r.splitText(f),e[0]=r,c.set(r.getKey(),0,"text"))),te(s)){let p=s.getTextContent().length;g===0?e.pop():g!==p&&([s]=s.splitText(g),e[e.length-1]=s,d.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,n,r){if(Ac(this,e,n,r))return;let s=e==="move",i=Ve(),a=qn(Nn(i));if(!a)return;let{_blockCursorElement:l,_rootElement:c}=i,d=this.focus.getNode();c===null||l===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(l,i,c);let f=ui(i,this.focus.key),g=f;if(this.focus.type==="text"&&(g=te(d)?ir(d,f,i):null),this.dirty){let p=ui(i,this.anchor.key),m=p;if(this.anchor.type==="text"){let _=this.anchor.getNode();m=te(_)?ir(_,p,i):null}m&&g&&Oc(a,m,this.anchor.offset,g,this.focus.offset)}if(r==="character"&&te(d)&&d.isUnmergeable()){if(n?this.focus.offset===0:this.focus.offset===d.getTextContentSize()){let p=St(d,n?"previous":"next").getNodeAtCaret();if(te(p)){if(!s){let m=p.getTextContentSize();return n?this.focus.set(p.__key,m-1,"text"):this.focus.set(p.__key,1,"text"),void(this.dirty=!0)}{let m=i.getElementByKey(p.getKey()),_=m?ir(p,m,i):null;if(_){let x=n?_.length:0;Oc(a,_,x,_,x)}}}}}if(pC(a,e,n?"backward":"forward",r),a.rangeCount>0){let p=mi(a,i._rootElement),m=p||a.getRangeAt(0),_=this.anchor.getNode(),x=Kt(_)?_:Cg(_);if(this.applyDOMRange(m),this.dirty=!0,!s)hC(this,n,x),(p?a.direction!=="backward":a.anchorNode===m.startContainer&&a.anchorOffset===m.startOffset)||gC(this)}r==="lineboundary"&&Ac(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&Y(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){let s=n.getParent(),i=n.getNextSibling()||(s===null?null:s.getNextSibling());if(Y(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,s=r.getNode();if(this.forwardDeletion(r,s,e))return;let i=Dg(Fr(r,e?"previous":"next"));if(i.getTextSlices().every((l)=>l===null||l.distance===0)){let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(Yn(c))if(c.origin.isInline());else{if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){let d=wo(c);ya(this,Lr(d,d)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}else{if(l.type==="merge-block")break;if(kr(c)){if(Y(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(qe(c.origin)){if(c.origin.isIsolated());else if(jn(c.origin).length>0){if(Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),rn(d)}}else if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&Y(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),rn(d)}else c.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:c,block:d}=l;if(jn(d).length>0)return;return c.origin.isEmpty()&&!d.isEmpty()&&c.origin.getParent()===d.getParent()?void c.origin.remove(!0):(ya(this,Lr(!c.origin.isEmpty()&&d.isEmpty()?Ts(St(d,c.direction)):i.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Jt(c)!==null)return;if(Y(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(of(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&w_(this,r.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(s=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,d=l.getTextContentSize();if(l.is(s)||e&&c!==d||!e&&c!==0)return void k_(l,e,c)}else if(s!==null&&s.isSegmented()){let c=r.offset,d=s.getTextContentSize();if(s.is(l)||e&&c!==0||!e&&c!==d)return void k_(s,e,c)}(function(c,d){let{anchor:f,focus:g}=c,p=f.getNode(),m=g.getNode();if(p===m&&f.type==="text"&&g.type==="text"){let _=f.offset,x=g.offset,C=_<x,y=C?_:x,N=C?x:_,T=N-1;if(y!==T)(function(v){return!(zC(v)||rR(v))})(p.getTextContent().slice(y,N))&&(d?g.set(g.key,T,g.type):f.set(f.key,T,f.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&Kt(r.getParent())&&r.getPreviousSibling()===null&&w_(this,r),uC()}}deleteLine(e){let n=Mf(this.anchor);if(n!==null&&qe(Hn(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);if(this.isCollapsed()&&of(this,e,"lineboundary"),this.isCollapsed())this.deleteCharacter(e);else br(this.anchor.getNode(),xn)!==br(this.focus.getNode(),xn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;of(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let n=this.focus.isBefore(this.anchor);return Mr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function gi(e){return e instanceof Fc}function dC(e,n){if(gi(e)){for(let N of e.getNodes())Tc(N)&&N.setFormat(n(N.getFormat()));return}if(e.isCollapsed())return e.setFormat(n(e.format)),void Bt(null);let r=[];for(let N of e.getNodes())te(N)?r.push(N):Y(N)?N.setTextFormat(n(N.getTextFormat())):Tc(N)&&N.setFormat(n(N.getFormat()));let s=r.length;if(s===0)return e.setFormat(n(e.format)),void Bt(null);let{anchor:i,focus:a}=e,l=e.isBackward(),c=l?a:i,d=l?i:a,f=0,g=r[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===g.getTextContentSize()&&(f=1,g=r[1],p=0),g==null)return;let m=s-1,_=r[m],x=d.type==="text"?d.offset:_.getTextContentSize();if(g.is(_)){if(p===x)return;let N=n(g.getFormat());if(Gn(g)||p===0&&x===g.getTextContentSize())g.setFormat(N);else{let T=g.splitText(p,x),v=p===0?T[0]:T[1];v.setFormat(N),c.type==="text"&&c.set(v.__key,0,"text"),d.type==="text"&&d.set(v.__key,x-p,"text")}return void(e.format=N)}p===0||Gn(g)||([,g]=g.splitText(p),p=0);let C=n(g.getFormat());g.setFormat(C);let y=n(_.getFormat());x>0&&(x===_.getTextContentSize()||Gn(_)||([_]=_.splitText(x)),_.setFormat(y));for(let N=f+1;N<m;N++){let T=r[N];T.setFormat(n(T.getFormat()))}c.type==="text"&&c.set(g.__key,p,"text"),d.type==="text"&&d.set(_.__key,x,"text"),e.format=C|y}function oR(e,n){let r=[];for(let[s,i]of Object.entries(n))typeof i=="boolean"&&r.push([s,i]);r.length!==0&&dC(e,(s)=>{for(let[i,a]of r)s=Dr(s,i,a?Xt[i]:0);return s})}function fC(e,n,r=null){let s=r===null&&ge(e)?Dr(e.format,n,null):r;dC(e,(i)=>Dr(i,n,s))}function $_(e){let n=e.offset;if(e.type==="text")return n;let r=e.getNode();return n===r.getChildrenSize()?r.getTextContent().length:0}function Rf(e){let n=e.getStartEndPoints();if(n===null)return[0,0];let[r,s]=n;return r.type==="element"&&s.type==="element"&&r.key===s.key&&r.offset===s.offset?[0,0]:[$_(r),$_(s)]}function w_(e,n){for(let r=n;r;r=r.getParent()){if(Y(r)){if(r.collapseAtStart(e))return!0;if(At(r))break}if(r.getPreviousSibling())break}return!1}function gC(e){let{focus:n,anchor:r}=e,{key:s,offset:i,type:a}=r;r.set(n.key,n.offset,n.type,!0),n.set(s,i,a,!0)}function pC(e,n,r,s){e.modify(n,r,s)}function hC(e,n,r){let s=e.getNodes(),i=s.filter((c)=>Pa(c,r));if(i.length===0||i.length===s.length)return!1;let a=n?i[0]:i[i.length-1],l=Y(a)?a:a.getParentOrThrow();return n?l.selectStart():l.selectEnd(),!0}function of(e,n,r){if(Ac(e,"extend",n,r))return;let s=Ve(),i=qn(Nn(s));if(!i||typeof i.modify!="function")return;let{_blockCursorElement:a,_rootElement:l}=s,c=e.anchor,d=e.focus.getNode();l===null||a===null||!Y(d)||d.isInline()||d.canBeEmpty()||wc(a,s,l);let f=(W)=>{let J=W.getNode(),G=s.getElementByKey(W.key);return G!==null&&W.type==="text"&&te(J)?ir(J,G,s):G},g=c.getNode(),p=f(c);if(p===null)return;let m=c.offset,_=e.isCollapsed(),x=e.focus,C=_?p:f(x);if(C===null)return;let y=x.offset;if(Oc(i,C,y,C,y),pC(i,"move",n?"backward":"forward",r),i.rangeCount===0)return;let N=mi(i,l)||i.getRangeAt(0),{startContainer:T,startOffset:v}=N;if(_&&r==="character"&&c.type==="text"&&te(g)&&g.isUnmergeable()){if(m===(n?0:g.getTextContentSize())){let W=St(g,n?"previous":"next").getNodeAtCaret();if(te(W)){let J=n?W.getTextContentSize()-1:1;return e.focus.set(W.__key,J,"text"),void(e.dirty=!0)}}}if(_&&r==="character"&&c.type==="text"){let W=n?0:g.getTextContentSize(),J=T===p?v:m!==W?W:-1;if(J>=0)return void(J!==m&&(e.focus.set(c.key,J,"text"),e.dirty=!0))}let[R,F,k,H]=n?[T,v,p,m]:[p,m,T,v],U=Kt(g)?g:Cg(g);e.applyDOMRange({collapsed:!1,endContainer:k,endOffset:H,startContainer:R,startOffset:F}),e.dirty=!0,!hC(e,n,U)&&n&&gC(e),r==="lineboundary"&&Ac(e,"extend",n,r,"decorators")}var rR=(()=>{try{let e=new RegExp("\\p{Emoji}","u"),n=e.test.bind(e);if(n("❤️")&&n("#️⃣")&&n("\uD83D\uDC4D"))return n}catch(e){}return()=>!1})();function k_(e,n,r){let s=e,i=s.getTextContent().split(/(?=\s)/g),a=i.length,l=0,c=0;for(let f=0;f<a;f++){let g=f===a-1;if(c=l,l+=i[f].length,n&&l===r||l>r||g){i.splice(f,1),g&&(c=void 0);break}}let d=i.join("").trim();d===""?s.remove():(s.setTextContent(d),s.select(c,c))}function I_(e,n,r,s){let i,a=n,l=!1;if(Ct(e)){let c=!1,d=e.childNodes,f=d.length,g=s._blockCursorElement;a===f&&f>0&&(c=!0,a=f-1),hi(e,s)!==void 0||Ba(e,s)||(l=!0);let p=d[a],m=!1;if(p===g)p=d[a+1],m=!0;else if(g!==null){let _=g.parentNode;if(e===_)n>Array.prototype.indexOf.call(_.children,g)&&a--}if(i=oi(p),te(i))a=_o(i,c?"next":"previous");else{let _=oi(e);if(_===null)return null;if(Y(_)){let x=s.getElementByKey(_.getKey());x===null&&q(214),[_,a]=$n(_,x,s).resolveChildIndex(_,x,e,n),Y(_)||q(215),c&&a>=_.getChildrenSize()&&(a=Math.max(0,_.getChildrenSize()-1));let y=_.getChildAtIndex(a);if(Y(y)&&function(N,T,v){let R=N.getParent();return v===null||R===null||!R.canBeEmpty()||R!==v.getNode()}(y,0,r)){let N=c?y.getLastDescendant():y.getFirstDescendant();N===null?_=y:(y=N,_=Y(y)?y:y.getParentOrThrow()),a=0}te(y)?(i=y,_=null,a=_o(y,c?"next":"previous")):y!==_&&c&&!m&&(Y(_)||q(216),a=Math.min(_.getChildrenSize(),a+1))}else{let x=Hn(_),C=x!==null?x:_,y=C.getIndexWithinParent(),N=s.getElementByKey(_.getKey()),T="after";if(N!==null&&oi(e)===_){let v=$n(_,N,s);v.element!==N?T=v.resolveLeafPosition(N,e,n):n===0&&qe(_)&&(T="before")}a=T==="before"?y:y+1,_=C.getParentOrThrow()}if(Y(_))return[xo(_.__key,a,"element"),l]}}else i=oi(e);return te(i)?[xo(i.__key,_o(i,a,"clamp"),"text"),l]:null}function L_(e,n,r){let s=e.offset,i=e.getNode();if(s===0){let a=i.getPreviousSibling(),l=i.getParent();if(n){if((r||!n)&&a===null&&Y(l)&&l.isInline()){let c=l.getPreviousSibling();te(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else Y(a)&&!r&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):te(a)&&!i.isUnmergeable()&&e.set(a.__key,a.getTextContent().length,"text")}else if(s===i.getTextContent().length){let a=i.getNextSibling(),l=i.getParent();if(n&&Y(a)&&a.isInline())e.set(a.__key,0,"element");else if((r||n)&&a===null&&Y(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let c=l.getNextSibling();te(c)&&e.set(c.__key,0,"text")}}}function Mf(e){let n=ot(e.key);return n===null?null:hy(n)}function mC(e,n,r){let s=Mf(e),i=Mf(n);if(s===i||s!==null&&i!==null&&s.is(i))return!1;let a=r(s,i);if(s!==null)return Y(s)?n.set(s.getKey(),a?s.getChildrenSize():0,"element"):n.set(s.getKey(),a?s.getTextContentSize():0,"text"),!0;let l=Hn(i);if(l===null)return!1;let c=l.getParent();if(c===null)return!1;let d=l.getIndexWithinParent();return n.set(c.getKey(),a?d+1:d,"element"),!0}function _C(e){let n=mC(e.anchor,e.focus,(r,s)=>function(i,a,l,c){if(l!==null&&c!==null){let g=Hn(l),p=Hn(c);if(g!==null&&g.is(p)){for(let m of Wc(g).values()){if(m===l.getKey())return!0;if(m===c.getKey())return!1}return!0}return g===null||p===null||g.isBefore(p)}if(l!==null){let g=Hn(l),p=ot(a.key);return g===null||p===null||!(!g.is(p)&&!g.isParentOf(p))||g.isBefore(p)}let d=Hn(c),f=ot(i.key);return d!==null&&f!==null&&!d.is(f)&&!d.isParentOf(f)&&f.isBefore(d)}(e.anchor,e.focus,r,s));return n&&(e.dirty=!0),n}function xC(e,n,r,s,i,a){if(e===null||r===null||!qa(i,e,r))return null;let l=I_(e,n,ge(a)?a.anchor:null,i);if(l===null)return null;let c=I_(r,s,ge(a)?a.focus:null,i);if(c===null)return null;let[d,f]=l,[g,p]=c;if(d.type==="element"&&g.type==="element"){let _=oi(e),x=oi(r);if(qe(_)&&qe(x))return null}let m=i._slotsUsed&&mC(d,g,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(_,x){if(_.type==="text"&&x.type==="text"){let C=_.isBefore(x),y=_.is(x);L_(_,C,y),L_(x,!C,y),y&&x.set(_.key,_.offset,_.type)}}(d,g),[d,g,f||p||m]}function CC(e){return Y(e)&&!e.isInline()}function yC(e,n,r,s,i,a){let l=Bo(),c=new Ss(xo(e,n,i),xo(r,s,a),0,"");return c.dirty=!0,l._selection=c,c}function SC(){let e=xo("root",0,"element"),n=xo("root",0,"element");return new Ss(e,n,0,"")}function bc(){return new Fc(new Set)}function sR(e,n){return ka(null,e,n,null)}function ka(e,n,r,s){let i=r._window;if(i===null)return null;let a=s||i.event,l=a?a.type:void 0,c=l==="selectionchange",d=!df&&(c||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&a&&a.detail===3||l==="drop"||l===void 0),f,g,p,m;if(ge(e)&&!d)return e.clone();{if(n===null)return null;let R=Vn(n,r._rootElement);if(f=R.anchorNode,g=R.focusNode,p=R.anchorOffset,m=R.focusOffset,(c||l===void 0)&&ge(e)&&!qa(r,f,g))return e.clone()}let _=xC(f,p,g,m,r,e);if(_===null)return null;let[x,C,y]=_,N=0,T="";if(ge(e)){let R=e.anchor;if(x.key===R.key)N=e.format,T=e.style;else{let F=x.getNode();te(F)?(N=F.getFormat(),T=F.getStyle()):Y(F)&&(N=F.getTextFormat(),T=F.getTextStyle())}}let v=new Ss(x,C,N,T);return y&&(v.dirty=!0),v}function ze(){return Bo()._selection}function Ns(){return Ve()._editorState._selection}function us(e,n,r,s=1){let{anchor:i,focus:a}=e,l=i.getNode(),c=a.getNode();if(!n.is(l)&&!n.is(c))return;let d=n.__key;if(e.isCollapsed()){let f=i.offset;if(r<=f&&s>0||r<f&&s<0){let g=Math.max(0,f+s);i.set(d,g,"element"),a.set(d,g,"element"),F_(e)}}else{let f=e.isBackward(),g=f?a:i,p=g.getNode(),m=f?i:a,_=m.getNode();if(n.is(p)){let x=g.offset;(r<=x&&s>0||r<x&&s<0)&&g.set(d,Math.max(0,x+s),"element")}if(n.is(_)){let x=m.offset;(r<=x&&s>0||r<x&&s<0)&&m.set(d,Math.max(0,x+s),"element")}}F_(e)}function F_(e){let n=e.anchor,r=n.offset,s=e.focus,i=s.offset,a=n.getNode(),l=s.getNode();if(e.isCollapsed()){if(!Y(a))return;let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text"),s.set(f.__key,g,"text")}return}if(Y(a)){let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text")}}if(Y(l)){let c=l.getChildrenSize(),d=i>=c,f=d?l.getChildAtIndex(c-1):l.getChildAtIndex(i);if(te(f)){let g=0;d&&(g=f.getTextContentSize()),s.set(f.__key,g,"text")}}}function vc(e,n,r,s,i){let a=null,l=0,c=null;s!==null?(a=s.__key,te(s)?(l=s.getTextContentSize(),c="text"):Y(s)&&(l=s.getChildrenSize(),c="element")):i!==null&&(a=i.__key,te(i)?c="text":Y(i)&&(c="element")),a!==null&&c!==null?e.set(a,l,c):(l=n.getIndexWithinParent(),l===-1&&(l=r.getChildrenSize()),e.set(r.__key,l,"element"))}function P_(e,n,r,s,i){e.type==="text"?e.set(r,e.offset+(n?0:i),"text"):e.offset>s.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Oc(e,n,r,s,i){try{e.setBaseAndExtent(n,r,s,i)}catch(a){}}function B_(e,n,r){let s=ui(e,n.getKey());if(Y(n)){let i=$n(n,s,e);return[i.element,r+i.getFirstChildOffset()]}return[s,r]}function NC(e,n,r,s,i,a){let l=a.getRootNode(),c=pi(l)||ar(l)?di(l):null;if(i.has(tC)&&c!==a||c!==null&&zc(c,c))return;let d=Vn(s,a),f;if(!ge(n))return void(e!==null&&qa(r,d.anchorNode,d.focusNode)&&s.removeAllRanges());let{anchor:g,focus:p}=n,m=g.getNode(),_=p.getNode(),[x,C]=B_(r,m,g.offset),[y,N]=B_(r,_,p.offset),{format:T,style:v}=n,R=n.isCollapsed(),F=x,k=y,H=!1;if(g.type==="text"?(F=te(m)?ir(m,x,r):null,H=m.getFormat()!==T||m.getStyle()!==v):ge(e)&&e.anchor.type==="text"&&(H=!0),p.type==="text"&&(k=te(_)?ir(_,y,r):null),F!==null&&k!==null){if(R&&(e===null||H||ge(e)&&(e.format!==T||e.style!==v))&&function(U,W,J,G,ne,ee){U._inputState.collapsedSelectionFormat={format:W,key:ne,offset:G,style:J,timeStamp:ee}}(r,T,v,C,g.key,performance.now()),(s.type!=="Range"||!R)&&d.anchorOffset===C&&d.focusOffset===N&&d.anchorNode===F&&d.focusNode===k){if(c===null||!a.contains(c)){let U=c!==null?fs(c):null;U!==null&&U!==r||i.has(Nc)||a.focus({preventScroll:!0})}if(g.type!=="element")return}if(Oc(s,F,C,k,N),ko&&n.isCollapsed()&&a!==null&&!i.has(Nc)){let U=kc(a);if(U===null||!a.contains(U)){let W=di(a.ownerDocument),J=W!==null?fs(W):null;J!==null&&J!==r||a.focus({preventScroll:!0})}}if(!i.has(nC)&&n.isCollapsed()&&a!==null&&a===kc(a)){let U=ge(n)&&n.anchor.type==="element"?F.childNodes[C]||null:(f===void 0&&(f=ey(s,a)),f);if(U!==null){let W;if(Co(U)){let J=U.ownerDocument.createRange();J.selectNode(U),W=J.getBoundingClientRect()}else W=U.getBoundingClientRect();(function(J,G,ne){let ee=Hc(ne),se=xg(ee);if(ee===null||se===null)return;let V=ne.getBoundingClientRect();if(G.bottom<V.top)return;let{top:fe,bottom:Ce}=G,Ae=0,oe=0,ae=ne;for(;ae!==null;){let ue=ae===ee.body;if(ue){let Ie=se.visualViewport;if(Ie){let _t=Ie.offsetTop;Ae=_t,oe=_t+Ie.height}else Ae=0,oe=Nn(J).innerHeight;let ht=se.getComputedStyle(ee.documentElement),Qt=parseFloat(ht.scrollPaddingTop),Be=parseFloat(ht.scrollPaddingBottom);isFinite(Qt)&&(Ae+=Qt),isFinite(Be)&&(oe-=Be)}else{let Ie=ae===ne?V:ae.getBoundingClientRect();Ae=Ie.top,oe=Ie.bottom}let we=0;if(fe<Ae?we=-(Ae-fe):Ce>oe&&(we=Ce-oe),we!==0)if(ue)se.scrollBy(0,we);else{let Ie=ae.scrollTop;ae.scrollTop+=we;let ht=ae.scrollTop-Ie;fe-=ht,Ce-=ht}if(ue)break;ae=Es(ae)}})(r,W,a)}}(function(U){U._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function iR(e){let n=ze()||Ns();n===null&&(n=Dn().selectEnd()),n.insertNodes(e)}function EC(e,n){for(let r of e.split(/(\r?\n|\t)/))r===`
10
10
  `||r===`\r
11
11
  `?n.linebreak():r==="\t"?n.tab():r!==""&&n.text(r)}function ig(e){let n=[];return EC(e,{linebreak:()=>n.push(Bc()),tab:()=>n.push(lC()),text:(r)=>n.push(Cn(r))}),n}function aR(){let e=ze();return e===null?"":e.getTextContent()}function Df(e){let n=[];for(let r of e)Lo(r)||(!Y(r)&&!qe(r)||r.isInline()?n.push(r):Y(r)&&n.push(...Df(r.getChildren())));return n}function ga(e){let n=e;e.isCollapsed()||n.removeText();let r=ze();ge(r)&&(n=r),ge(n)||q(161);let s=n.anchor,i=s.getNode(),a=s.offset;for(;!xn(i)&&Jt(i)===null;){let l=i;if([i,a]=lR(i,a),l.is(i))break}return a}function lR(e,n){let r=e.getParent();if(!r){let i=Mn();return Dn().append(i),i.select(),[Dn(),0]}if(te(e)){let i=e.splitText(n);if(i.length===0)return[r,e.getIndexWithinParent()];let a=n===0?0:1;return[r,i[0].getIndexWithinParent()+a]}if(!Y(e)||n===0)return[r,e.getIndexWithinParent()];let s=e.getChildAtIndex(n);if(s){let i=new Ss(xo(e.__key,n,"element"),xo(e.__key,n,"element"),0,""),a=e.insertNewAfter(i);a&&a.append(s,...s.getNextSiblings())}return[r,e.getIndexWithinParent()+1]}function K_(e){return Lo(e)||VC(e)||te(e)||e.isParentRequired()}function rf(e){let n=Mn(),r=null;for(let s=0;s<e.length;s++){let i=e[s];if(K_(i)){if(r===null){r=i.createParentElementNode(),n.append(r);let a=e[s+1];if(Lo(i)&&(a===void 0||!K_(a)))continue}r.append(i)}else n.append(i),r=null}return n}function Ac(e,n,r,s,i="decorators-and-blocks"){if(n==="move"&&s==="character"&&!e.isCollapsed()){let[g,p]=r===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return p.set(g.key,g.offset,g.type),!0}let a=Fr(e.focus,r?"previous":"next"),l=s==="lineboundary",c=n==="move",d=a,f=i==="decorators-and-blocks";if(!Ty(d)){for(let g of d){f=!1;let{origin:p}=g;if(!qe(p)||p.isIsolated()||(d=g,!l||!p.isInline()))break}if(f)for(let g of Dg(a).iterNodeCarets(n==="extend"?"shadowRoot":"root")){if(Yn(g))g.origin.isInline()||(d=g);else{if(Y(g.origin))continue;qe(g.origin)&&!g.origin.isInline()&&(d=g)}break}}if(d===a)return!1;if(c&&!l&&qe(d.origin)&&d.origin.isKeyboardSelectable()){let g=bc();return g.add(d.origin.getKey()),rn(g),!0}return d=wo(d),c&&Ua(e.anchor,d),Ua(e.focus,d),f||!l}var Gt=null,Ot=null,yn=!1,sf=!1,dc=!1,af=new Set,fc=0,z_={characterData:!0,childList:!0,subtree:!0};function Mr(){return yn||Gt!==null&&Gt._readOnly}function Wt(){yn&&q(13)}function TC(){fc>99&&q(14)}function Bo(){return Gt===null&&q(195,vC()),Gt}function cR(e){Bo()!==null&&Ot===null&&(Ot=e),Ot!==e&&lx(378)}function Ve(){return Ot===null&&q(337,vC()),Ot}function bC(){Ve()._dirtyType=2}function vC(){let e=0,n=new Set,r=_s.version;if(typeof window<"u")for(let i of ZC(document)){let a=Ja(i);if(Uc(a))e++;else if(a){let l=String(a.constructor.version||"<0.17.1");l===r&&(l+=" (separately built, likely a bundler configuration issue)"),n.add(l)}}let s=` Detected on the page: ${e} compatible editor(s) with version ${r}`;return n.size&&(s+=` and incompatible editors with versions ${Array.from(n).join(", ")}`),s}function OC(){return Ot}function U_(e,n,r){let s=n.__type,i=dg(e,s),a=r.get(s);a===void 0&&(a=Array.from(i.transforms),r.set(s,a));let l=a.length;for(let c=0;c<l&&(a[c](n),n.isAttached());c++);}function H_(e,n){return e!==void 0&&e.__key!==n&&e.isAttached()}function AC(e,n){if(!n)return;let r=e._updateTags,s=n;Array.isArray(n)||(s=[n]);for(let i of s)r.add(i)}function uR(e){return Rc(e,Ve()._nodes)}function Rc(e,n){let r=e.type,s=n.get(r);s===void 0&&q(17,r);let i=s.klass;e.type!==i.getType()&&q(18,i.name);let a=i.importJSON(e),l=e.children;if(Y(a)&&Array.isArray(l))for(let d=0;d<l.length;d++){let f=Rc(l[d],n);a.append(f)}let c=e.$slots;if(c){$o(a)||q(379,i.name);for(let d in c)Og(a,d,Rc(c[d],n))}return a}function W_(e,n,r){let s=Gt,i=yn,a=Ot;Gt=n,yn=!0,Ot=e;try{return r()}finally{Gt=s,yn=i,Ot=a}}function Or(e,n){let r=dc;dc=!0;try{(function(s,i){let{_pendingEditorState:a,_rootElement:l}=s,c=s._headless||l===null;if(a===null)return void(!s._updating&&s._deferred.length>0&&G_(s,s._deferred));let d=s._editorState,f=d._selection,g=a._selection,p=s._dirtyType!==0,m=Gt,_=yn,x=Ot,{_updating:C,_observer:y}=s,N=null;if(s._pendingEditorState=null,s._editorState=a,!c&&p&&y!==null){Ot=s,Gt=a,yn=!1,s._updating=!0;try{let{_dirtyType:U,_dirtyElements:W,_dirtyLeaves:J}=s;y.disconnect(),N=vA(d,a,s,U,W,J)}catch(U){if(U instanceof Error&&s._onError(U),sf)throw U;return kC(s,null,l,a),mx(s),s._dirtyType=2,sf=!0,Or(s,d),void(sf=!1)}finally{y.observe(l,z_),s._updating=C,Gt=m,yn=_,Ot=x}}a._readOnly||(a._readOnly=!0);let{_dirtyLeaves:T,_dirtyElements:v,_normalizedNodes:R,_updateTags:F}=s;p&&(s._dirtyType=0,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements=new Map,s._normalizedNodes=new Set),s._updateTags=new Set,function(U,W){let J=U._decorators,G=U._pendingDecorators||J,ne=W._nodeMap,ee;for(ee in G)ne.has(ee)||(G===J&&(G=KC(U)),delete G[ee])}(s,a);let k=c?null:qn(Nn(s));if(s._editable&&k!==null&&(p||g===null||g.dirty||!g.is(f))&&l!==null&&!F.has(oC)){Ot=s,Gt=a;try{if(y!==null&&y.disconnect(),p||g===null||g.dirty){let U=s._blockCursorElement;U!==null&&wc(U,s,l),NC(f,g,s,k,F,l)}(function(U,W,J){let G=U._blockCursorElement;if(ge(J)&&J.isCollapsed()&&J.anchor.type==="element"&&W.contains(kc(W))){let ne=J.anchor,ee=ne.getNode(),se=ne.offset,V=!1,fe=null;if(se===ee.getChildrenSize())gc(ee.getChildAtIndex(se-1))&&(V=!0);else{let Ce=ee.getChildAtIndex(se);if(Ce!==null&&gc(Ce)){let Ae=Ce.getPreviousSibling();(Ae===null||gc(Ae))&&(V=!0,fe=U.getElementByKey(Ce.__key))}}if(V){let Ce=$n(ee,U.getElementByKey(ee.__key),U).element;return G===null&&(U._blockCursorElement=G=function(Ae){let oe=Ae.theme,ae=Sn().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ue=oe.blockCursor;if(ue!==void 0){if(typeof ue=="string"){let we=ol(ue);ue=oe.blockCursor=we}ue!==void 0&&ae.classList.add(...ue)}return ae}(U._config)),W.style.caretColor="transparent",void(fe===null?Ce.appendChild(G):Ce.insertBefore(G,fe))}}G!==null&&wc(G,U,W)})(s,l,g)}finally{y!==null&&y.observe(l,z_),Ot=x,Gt=m}}N!==null&&function(U,W,J,G,ne){let ee=Array.from(U._listeners.mutation),se=ee.length;for(let V=0;V<se;V++){let[fe,Ce]=ee[V];for(let Ae of Ce){let oe=W.get(Ae);oe!==void 0&&fe(oe,{dirtyLeaves:G,prevEditorState:ne,updateTags:J})}}}(s,N,F,T,d),ge(g)||g===null||f!==null&&f.is(g)||s.dispatchCommand(Gf);let H=s._pendingDecorators;if(H!==null&&(s._decorators=H,s._pendingDecorators=null,Ca("decorator",s,!0,H)),function(U,W,J){let G=V_(W),ne=V_(J);G!==ne&&Ca("textcontent",U,!0,ne)}(s,i||d,a),Ca("update",s,!0,{dirtyElements:v,dirtyLeaves:T,editorState:a,mutatedNodes:N,normalizedNodes:R,prevEditorState:i||d,tags:F}),!C)G_(s,s._deferred);(function(U){let W=U._updates;if(W.length===0)return void(U._cascadeCount=0);if(function(G){if(af.has(G))return;af.add(G),setTimeout(()=>{af.delete(G),G._cascadeCount=0},0)}(U),U._cascadeCount++>99)return U._updates=[],U._cascadeCount=0,void U._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${U._config.namespace}`));let J=W.shift();if(J){let[G,ne]=J;Ia(U,G,ne)}})(s)})(e,n)}finally{dc=r}}function Ca(e,n,r,...s){let i=n._updating;n._updating=r;try{let a=n._listeners[e],l=Array.from(a);for(let[c,d]of l){d&&d();let f=c(...s);a.has(c)?a.set(c,f):f&&f()}}finally{n._updating=i}}function RC(e,n,r,s){let i=pg(e),a;if(!dc)for(let l=0;l<i.length;l++)i[l]._updating||(i[l]._cascadeCount=0);for(let l=4;l>=0;l--)for(let c=0;c<i.length;c++){let d=i[c];if(c>0&&d._updating){a=d;break}let f=d._commands.get(n);if(f!==void 0){let g=f[l];if(g.size>0){let p=!1;if(Wn(d,()=>{for(let m of g)if(m(r,s))return void(p=!0)}),p)return p}}}return a&&a.update(()=>{RC(a,n,r,s)}),!1}function G_(e,n){if(e._deferred=[],n.length!==0){let r=e._updating;e._updating=!0;try{for(let s=0;s<n.length;s++)n[s]()}finally{e._updating=r}}}function j_(e,n){let r=e._updates,s=n||!1;for(;r.length!==0;){let i=r.shift();if(i){let[a,l]=i,c=e._pendingEditorState,d;l!==void 0&&(d=l.onUpdate,l.skipTransforms&&(s=!0),l.discrete&&(c===null&&q(191),c._flushSync=!0),d&&e._deferred.push(d),AC(e,l.tag)),c==null?Ia(e,a,l):a()}}return s}function Ia(e,n,r){let s=e._updateTags,i,a=!1,l=!1;r!==void 0&&(i=r.onUpdate,AC(e,r.tag),a=r.skipTransforms||!1,l=r.discrete||!1),i&&e._deferred.push(i);let{_editorState:c,_pendingEditorState:d}=e,f=!1;(d===null||d._readOnly)&&(d=e._pendingEditorState=MC(d||c),f=!0),d._flushSync=l;let g=Gt,p=yn,m=Ot,_=e._updating;Gt=d,yn=!1,e._updating=!0,Ot=e;let x=e._headless||e.getRootElement()===null;cg(null);try{f&&(x?c._selection!==null&&(d._selection=c._selection.clone()):d._selection=function(T,v){let R=T.getEditorState()._selection,F=qn(Nn(T));return ge(R)||R==null?ka(R,F,T,v):R.clone()}(e,r&&r.event||null));let y=e._compositionKey;n(),a=j_(e,a),function(T,v){let R=v.getEditorState()._selection,F=T._selection;if(ge(F)){let{anchor:k,focus:H}=F,U;if(k.type==="text"&&(U=k.getNode(),U.selectionTransform(R,F)),H.type==="text"){let W=H.getNode();U!==W&&W.selectionTransform(R,F)}}}(d,e),e._dirtyType!==0&&(a?function(T,v){let R=v._dirtyLeaves,F=T._nodeMap;for(let k of R){let H=F.get(k);te(H)&&H.isAttached()&&H.isSimpleText()&&!H.isUnmergeable()&&d_(H)}}(d,e):function(T,v){let{_dirtyLeaves:R,_dirtyElements:F}=v,k=T._nodeMap,H=Do(),U=new Map,W=R,J=W.size,G=F,ne=G.size;for(;J>0||ne>0;){if(J>0){v._dirtyLeaves=new Set;for(let ee of W){let se=k.get(ee);te(se)&&se.isAttached()&&se.isSimpleText()&&!se.isUnmergeable()&&d_(se),se!==void 0&&H_(se,H)&&U_(v,se,U),R.add(ee)}if(W=v._dirtyLeaves,J=W.size,J>0){fc++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,G.delete("root")&&G.set("root",!0);for(let ee of G){let se=ee[0],V=ee[1];if(F.set(se,V),!V)continue;let fe=k.get(se);fe!==void 0&&H_(fe,H)&&U_(v,fe,U)}W=v._dirtyLeaves,J=W.size,G=v._dirtyElements,ne=G.size,fc++}v._dirtyLeaves=R,v._dirtyElements=F}(d,e),j_(e),function(T,v,R,F){let k=T._nodeMap,H=v._nodeMap,U=[];for(let[G]of F){let ne=H.get(G);ne!==void 0&&(ne.isAttached()||(Y(ne)&&hc(ne,G,k,H,U,F),k.has(G)||F.delete(G),U.push(G)))}for(let G of R){let ne=H.get(G);ne===void 0||ne.isAttached()||($o(ne)&&ne.__slots!==null&&hc(ne,G,k,H,U,R),k.has(G)||R.delete(G),U.push(G))}for(let G of U)H.delete(G);let W=Ve(),J=W._compositionKey;J===null||H.has(J)||(W._compositionKey=null)}(c,d,e._dirtyLeaves,e._dirtyElements)),y!==e._compositionKey&&(d._flushSync=!0);let N=d._selection;if(ge(N)){e._slotsUsed&&_C(N);let T=d._nodeMap,v=N.anchor.key,R=N.focus.key;T.get(v)!==void 0&&T.get(R)!==void 0||q(19)}else gi(N)&&N._nodes.size===0&&(d._selection=null)}catch(y){return y instanceof Error&&e._onError(y),e._pendingEditorState=c,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Or(e)}finally{Gt=g,yn=p,Ot=m,e._updating=_,fc=0}e._dirtyType!==0||e._deferred.length>0||function(y,N){let T=N.getEditorState()._selection,v=y._selection;if(v!==null){if(v.dirty||!v.is(T))return!0}else if(T!==null)return!0;return!1}(d,e)?d._flushSync?(d._flushSync=!1,Or(e)):f&&AR(()=>{Or(e)}):(d._flushSync=!1,f&&(s.clear(),e._deferred=[],e._pendingEditorState=null))}function Wn(e,n,r){Ot===e&&r===void 0?Mr()?Ia(e,n,r):n():Ia(e,n,r)}function dR(e){if(At(e)){let n=null;for(let r of e.getChildren())n=r.isInline()?(n||r.replace(r.createParentElementNode())).append(r):null}}class Io extends cn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dR,extends:cn})}constructor(e){super(e),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="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&q(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return uA[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&jn(this).length===0}isDirty(){let e=Ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[];for(let r of jn(this)){let s=wr(this,r);Y(s)&&e.push(...s.getAllTextNodes())}let n=this.getFirstChild();for(;n!==null;){if(te(n)&&e.push(n),Y(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Y(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;Y(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let i=n[r-1];return Y(i)&&i.getLastDescendant()||i||null}let s=n[e];return Y(s)&&s.getFirstDescendant()||s||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:ot(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&q(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&q(96,this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,s;if(e<n/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=e;){if(s===e)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=n-1;r!==null&&s>=e;){if(s===e)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let e=_y(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContent(),Y(i)&&s!==r-1&&!i.isInline()&&(e+=ds)}return e}getTextContentSize(){let e=function(s){let i=0;for(let a of jn(s)){let l=wr(s,a);l!==null&&(i+=l.getTextContentSize())}return i}(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContentSize(),Y(i)&&s!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let n=pc[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){let n=Xt[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return Dr(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){Wt();let r=ze(),s=e,i=n,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){let c=this.getFirstChild();if(te(c)||Y(c))return c.select(0,0)}else if(!(e!==void 0&&e!==a||n!==void 0&&n!==a)){let c=this.getLastChild();if(te(c)||Y(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return ge(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):yC(l,s,l,i,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach((n)=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""&&pc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){Sc(this)&&q(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();e+n<=s||q(226,String(e),String(n),String(s));for(let m of r);let a=i.__key,l=[],c=[],d=this.getChildAtIndex(e+n),f=null,g=s-n+r.length;if(e!==0)if(e===s)f=this.getLastChild();else{let m=this.getChildAtIndex(e);m!==null&&(f=m.getPreviousSibling())}if(n>0){let m=f===null?this.getFirstChild():f.getNextSibling();for(let _=0;_<n;_++){m===null&&q(100);let x=m.getNextSibling(),C=m.__key;Un(m.getWritable()),c.push(C),m=x}}let p=f;for(let m of r){p!==null&&m.is(p)&&(f=p=p.getPreviousSibling());let _=m.getWritable();_.__parent===a&&g--,Un(_);let x=m.__key;if(p===null)i.__first=x,_.__prev=null;else{let C=p.getWritable();C.__next=x,_.__prev=C.__key}m.__key===a&&q(76),_.__parent=a,l.push(x),p=m}if(e+n===s){if(p!==null)p.getWritable().__next=null,i.__last=p.__key}else if(d!==null){let m=d.getWritable();if(p!==null){let _=p.getWritable();m.__prev=p.__key,_.__next=d.__key}else m.__prev=null}if(i.__size=g,c.length){let m=ze();if(ge(m)){let _=new Set(c),x=new Set(l),{anchor:C,focus:y}=m;Y_(C,_,x)&&vc(C,C.getNode(),this,f,d),Y_(y,_,x)&&vc(y,y.getNode(),this,f,d),g!==0||this.canBeEmpty()||At(this)||this.remove()}}return i}getDOMSlot(e){return new ii(e)}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){let r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px",n.setAttribute("data-lexical-indent",String(r)));let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||At(this)||this.getChildren().some(te)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){let r=$n(this,e,n),s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let a=n.getElementByKey(i.getKey());a!==null&&(s==null?(r.insertChild(a),s=a):s!==a&&r.replaceChild(a,s),s=s.nextSibling)}}}function Y(e){return e instanceof Io}function Y_(e,n,r){let s=e.getNode();for(;s;){let i=s.__key;if(n.has(i)&&!r.has(i))return!0;s=s.getParent()}return!1}class Pc extends cn{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&q(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function qe(e){return e instanceof Pc}class ja extends Io{__cachedText;$config(){return this.config("root",{extends:Io})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){let e=this.__cachedText;return e===null||!Mr()&&Ve()._dirtyType!==0?super.getTextContent():e}remove(){q(52)}replace(e){q(53)}insertBefore(e){q(54)}insertAfter(e){q(55)}updateDOM(e,n){return!1}splice(e,n,r){for(let s of r)Y(s)||qe(s)||q(282);return super.splice(e,n,r)}static importJSON(e){return Dn().updateFromJSON(e)}collapseAtStart(){return!0}}function Kt(e){return e instanceof ja}function MC(e){return new Ya(gx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Ya(new Map([["root",new ja]]),null,!1)}function $f(e){let n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&q(130,r.name),Y(e)){let i=n.children;Array.isArray(i)||q(59,r.name);let a=e.getChildren();for(let l=0;l<a.length;l++){let c=$f(a[l]);i.push(c)}}let s=jn(e);if(s.length>0){let i={};for(let a of s){let l=wr(e,a);l===null&&q(366,r.name,a),i[a]=$f(l)}n.$slots=i}return n}function fR(e){return e instanceof Ya}class Ya{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,n=null,r=!1){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,n){return W_(n&&n.editor||null,this,e)}clone(e){let n=new Ya(this._nodeMap,e===void 0?this._selection:e,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return W_(null,this,()=>({root:$f(Dn())}))}}class lg extends Io{$config(){return this.config("artificial",{extends:Io})}createDOM(e){return Sn().createElement("div")}}class Va extends cn{$config(){return this.config("linebreak",{importDOM:{br:(e)=>DC(e)||$C(e)?null:{conversion:gR,priority:0}}})}getTextContent(){return`
12
- `}createDOM(){return Sn().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Bc()}}function Bc(){return Za(new Va)}function Lo(e){return e instanceof Va}function DC(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Mc(r)){let s=n.lastChild;if(s===e||s.previousSibling===e&&Mc(s))return!0}}return!1}function $C(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Mc(r))return!1;let s=n.lastChild;if(s===e||s.previousSibling===e&&Mc(s))return!0}return!1}function Mc(e){return Co(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class Xa extends Io{$config(){return this.config("paragraph",{extends:Io,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let n=Sn().createElement("p"),r=ci(e.theme,"paragraph");if(r!==void 0)n.classList.add(...r);return n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){this.isEmpty()&&n.append(Sn().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let n=this.getChildren().find(te);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=Mn();r.setTextFormat(e.format),r.setTextStyle(e.style);let s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||te(e[0])&&e[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 pR(e){let n=Mn();if(cy(n,e),ay(e,n),n.getFormatType()===""){let r=e.getAttribute("align");r&&r&&r in pc&&n.setFormat(r)}return ly(n,e),{node:n}}function Mn(){return Za(new Xa)}function wC(e){return e instanceof Xa}function hR(e){console.warn(e)}var ti=0,mR=1,_R=2,xR=3,CR=4,yR=-8,SR=-7,NR=-6,ER=-5,TR=-4;function kC(e,n,r,s,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ag(),e._pendingEditorState=s,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let l=e._observer;l!==null&&(l.disconnect(),e._observer=null),n!==null&&(n.textContent="",function(c,d){let f=`__lexicalKey_${d._key}`;delete c[f]}(n,e)),r!==null&&(r.textContent="",a.set("root",r),BC(r,e,"root"))}function IC(e){let n=new Set,r=new Set;for(let{klass:s,ownNodeConfig:i}of tl(e)){let a=s.transform;if(!r.has(a)){r.add(a);let l=s.transform();l&&n.add(l)}if(i){let l=i.$transform;l&&n.add(l)}}return n}var La={$createDOM:(e,n)=>e.createDOM(n._config,n),$decorateDOM:(e,n,r,s)=>{},$exportDOM:(e,n)=>{let r=Kc(n,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(n,e):e.exportDOM(n)},$extractWithChild:(e,n,r,s,i)=>Y(e)&&e.extractWithChild(n,r,s),$getDOMSlot:(e,n,r)=>e.getDOMSlot(n),$getSlotTargetElement:(e,n,r,s)=>null,$shouldExclude:(e,n,r)=>Y(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,n,r)=>!n||e.isSelected(n),$updateDOM:(e,n,r,s)=>e.updateDOM(n,r,s._config)};function bR(e){let n=e||{},r=OC(),s=n.theme||{},i=e===void 0?r:n.parentEditor||null,a=n.disableEvents||!1,l=ag(),c=n.namespace||(i!==null?i._config.namespace:UC()),d=n.editorState,f=[ja,ms,Va,Ga,Xa,lg,...n.nodes||[]],{onError:g,onWarn:p,html:m}=n,_=n.editable===void 0||n.editable,x;if(e===void 0&&r!==null)x=r._nodes;else{x=new Map;for(let y=0;y<f.length;y++){let N=f[y],T=null,v=null;if(N&&typeof N=="object"){let k=N;N=k.replace,T=k.with,v=k.withKlass||null}if(typeof N!="function"||!N.prototype||!(N===cn||N.prototype instanceof cn)){let k="<unknown>";try{k=JSON.parse(fx)}catch(H){}q(365,String(y-f.length+(n.nodes?n.nodes.length:0)),typeof N=="function"?`${N.name}${typeof N.getType=="function"?` (type ${String(N.getType())})`:""}`:String(N),String(k))}el(N);let R=N.getType(),F=IC(N);x.set(R,{exportDOM:m&&m.export?m.export.get(N):void 0,klass:N,replace:T,replaceWithKlass:v,sharedNodeState:xx(f[y]),transforms:F})}}let C=new _s(l,i,x,{disableEvents:a,dom:{...La,...e&&e.dom},namespace:c,theme:s},g||console.error,p||hR,function(y,N){let T=new Map,v=new Set,R=(F)=>{Object.keys(F).forEach((k)=>{let H=T.get(k);H===void 0&&(H=[],T.set(k,H)),H.push(F[k])})};return y.forEach((F)=>{let k=F.klass.importDOM;if(k==null||v.has(k))return;v.add(k);let H=k.call(F.klass);H!==null&&R(H)}),N&&R(N),T}(x,m?m.import:void 0),_,e);return d!==void 0&&(C._pendingEditorState=d,C._dirtyType=2),function(y){y.registerCommand(jf,PA,ti),y.registerCommand(Yf,BA,ti),y.registerCommand(Vf,KA,ti),y.registerCommand(Xf,zA,ti),y.registerCommand(Qf,UA,ti)}(C),C}function vR(e,n){let r=e.get(n);e.delete(n),r&&r()}function pa(e,n,r){return e.set(n,r),vR.bind(null,e,n)}class _s{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,n,r,s,i,a,l,c,d){this._createEditorArgs=d,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Ta,this._updates=[],this._updating=!1,this._cascadeCount=0,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=s,this._nodes=r,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=UC(),this._onError=i,this._onWarn=a,this._htmlConversions=l,this._editable=c,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return pa(this._listeners.update,e)}registerEditableListener(e){return pa(this._listeners.editable,e)}registerDecoratorListener(e){return pa(this._listeners.decorator,e)}registerTextContentListener(e){return pa(this._listeners.textcontent,e)}registerRootListener(e){let n=this._listeners.root;return Fg(pa(n,e,e(this._rootElement,null)||void 0),()=>function(r,s,i){let a=r.get(s);a&&a(),r.set(s,s(...i)||void 0)}(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&q(35);let s=this._commands;s.has(e)||s.set(e,[new ei,new ei,new ei,new ei,new ei]);let i=s.get(e);i===void 0&&q(36,String(e));let a=function(c){return 7&c}(r),l=i[a];return a!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),i.every((c)=>c.size===0)&&s.delete(e)}}registerMutationListener(e,n,r){let s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(n);a===void 0&&(a=new Set,i.set(n,a)),a.add(s);let l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,s),()=>{a.delete(s),a.size===0&&i.delete(n)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return n===void 0&&q(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,s=kf(r).get(n.getType());if(!s)return;let i=new Map;for(let a of s.keys())i.set(a,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){let r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){let r=this.registerNodeTransformToKlass(e,n),s=[r],i=r.replaceWithKlass;if(i!=null){let a=this.registerNodeTransformToKlass(i,n);s.push(a)}return function(a,l){let c=kf(a.getEditorState()),d=[];for(let f of l){let g=c.get(f);g&&d.push(g)}if(d.length===0)return;a.update(()=>{for(let f of d)for(let g of f.keys()){let p=ot(g);p&&p.markDirty()}},a._pendingEditorState===null?{tag:uc}:void 0)}(this,s.map((a)=>a.klass.getType())),()=>{s.forEach((a)=>a.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...n){return ie(this,e,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=ci(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,kC(this,n,e,s,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||HA(n),r!=null&&n.classList.remove(...r)),e!==null){let i=xg(e),a=e.style;a.userSelect="text",a.whiteSpace="pre-wrap",a.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,mx(this),this._updateTags.add(uc),Or(this),this._config.disableEvents||function(l,c){let d=l.ownerDocument;Tf.set(l,d);let f=Cc.get(d);f===void 0&&(f={editors:new Set,hasShadowEditor:void 0},Cc.set(d,f)),f.editors.add(c),f.hasShadowEditor=void 0,l.__lexicalEditor=c;let g=Qx(l);g.push(FA.register(d));for(let p=0;p<Ef.length;p++){let[m,_]=Ef[p],x=typeof _=="function"?(C)=>{E_(C)||(bf(C),(c.isEditable()||m==="click")&&_(C,c))}:(C)=>{if(E_(C))return;bf(C);let y=c.isEditable();switch(m){case"cut":return y&&ie(c,tg,C);case"copy":return ie(c,eg,C);case"paste":return y&&ie(c,qf,C);case"dragstart":return y&&ie(c,zx,C);case"dragover":return y&&ie(c,Ux,C);case"dragend":return y&&ie(c,Hx,C);case"focus":return y&&ie(c,Gx,C);case"blur":return y&&ie(c,jx,C);case"drop":return y&&ie(c,Kx,C)}};g.push(ng(l,m,x))}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(uc),Or(this);Ca("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&q(38);let r=e;r._readOnly&&(r=MC(e),r._selection=e._selection?e._selection.clone():null),hx(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),Or(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Wn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[a,l]of r._nodeMap.entries())Y(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return function(r,s,i){let a=ag(),l=Gt,c=yn,d=Ot,{_dirtyElements:f,_dirtyLeaves:g,_cloneNotNeeded:p,_dirtyType:m}=s;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Gt=a,yn=!1,Ot=s,cg(null);try{let _=s._nodes;Rc(r.root,_),i&&i(),a._readOnly=!0,a._parsed=!0}catch(_){_ instanceof Error&&s._onError(_)}finally{s._dirtyElements=f,s._dirtyLeaves=g,s._cloneNotNeeded=p,s._dirtyType=m,Gt=l,yn=c,Ot=d}return a}(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){let[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&Or(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,s,i){r._updating?r._updates.push([s,i]):Ia(r,s,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Wn(this,()=>{let s=ze(),i=Dn();s!==null?s.dirty||rn(s.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),xs("focus"),YC(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=qn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ca("editable",this,!0,e),this._slotsUsed&&this.update(()=>bC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=fx;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),LC=1;function OR(){LC=1}function dg(e,n){let r=Kc(e,n);return r===void 0&&q(30,n),r}function Kc(e,n){return e._nodes.get(n)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function zc(e,n){let r=n!==void 0?n:(()=>{let a=e.getRootNode();return pi(a)||lr(a)?di(a):null})();if(!Ct(r))return!1;if(r.hasAttribute("data-lexical-slot"))return!1;let s=gg(r),i=r.nodeName;return og(s)&&(i==="INPUT"||i==="TEXTAREA"||r.contentEditable==="true"&&Ja(r)==null)}var RR=zc;function qa(e,n,r){let s=e.getRootElement();if(!s)return!1;try{if(!n||!s.contains(n)||!s.contains(r))return!1}catch(i){return!1}return fs(n)===e&&e.read("latest",()=>!zc(n))}function Uc(e){return e instanceof _s}function fs(e){let n=e;for(;n!=null;){let r=Ja(n);if(Uc(r))return r;n=Es(n)}return null}function Ja(e){return e?e.__lexicalEditor:null}function MR(e){return aA.test(e)?"rtl":lA.test(e)?"ltr":null}function Fa(e){return sg(e)||e.isToken()}function Gn(e){return Fa(e)||e.isSegmented()}function Co(e){return _i(e)&&e.nodeType===3}function pi(e){return _i(e)&&e.nodeType===9}function FC(e){let n=e;for(;n!=null;){if(Co(n))return n;n=n.firstChild}return null}function Dr(e,n,r){let s=Xt[n];if(r!==null&&(e&s)===(r&s))return e;let i=e^s;return n==="subscript"?i&=~Xt.superscript:n==="superscript"?i&=~Xt.subscript:n==="lowercase"?(i&=~Xt.uppercase,i&=~Xt.capitalize):n==="uppercase"?(i&=~Xt.lowercase,i&=~Xt.capitalize):n==="capitalize"&&(i&=~Xt.lowercase,i&=~Xt.uppercase),i}function DR(e){return te(e)||Lo(e)||qe(e)}function PC(e,n){let r=function(){let l=wf;return wf=null,l}();if((n=n||r&&r.__key)!=null)return void(e.__key=n);Wt(),TC();let s=Ve(),i=Bo(),a=""+LC++;i._nodeMap.set(a,e),Y(e)?s._dirtyElements.set(a,!0):s._dirtyLeaves.add(a),s._cloneNotNeeded.add(a),s._dirtyType===0&&(s._dirtyType=1),e.__key=a}function Un(e){Jt(e)!==null&&q(380,e.__key,String(Jt(e)));let n=e.getParent();if(n!==null){let r=e.getWritable(),s=n.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),l=a!==null?a.__key:null,c=i!==null?i.__key:null,d=i!==null?i.getWritable():null,f=a!==null?a.getWritable():null;i===null&&(s.__first=l),a===null&&(s.__last=c),d!==null&&(d.__next=l),f!==null&&(f.__prev=c),r.__prev=null,r.__next=null,r.__parent=null,s.__size--}}var $R=Un;function $c(e){TC(),Sc(e)&&q(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent!==null?n.__parent:$r(n)?n.__slotHost:null,s=Bo(),i=Ve(),a=s._nodeMap,l=i._dirtyElements;r!==null&&function(d,f,g){let p=d;for(;p!==null;){if(g.has(p))return;let m=f.get(p);if(m===void 0)break;g.set(p,!1),p=m.__parent!==null?m.__parent:$r(m)?m.__slotHost:null}}(r,a,l);let c=n.__key;i._dirtyType===0&&(i._dirtyType=1),Y(e)?l.set(c,!0):i._dirtyLeaves.add(c)}function Bt(e){Wt();let n=Ve(),r=n._compositionKey;if(e!==r){if(n._compositionKey=e,r!==null){let s=ot(r);s!==null&&s.getWritable()}if(e!==null){let s=ot(e);s!==null&&s.getWritable()}}}function Do(){if(Mr())return null;return Ve()._compositionKey}function ot(e,n){let r=(n||Bo())._nodeMap.get(e);return r===void 0?null:r}function fg(e,n){let r=hi(e,Ve());return r!==void 0?ot(r,n):null}function BC(e,n,r){e[`__lexicalKey_${n._key}`]=r}function hi(e,n){return e[`__lexicalKey_${n._key}`]}function gg(e,n){let r=e;for(;r!=null;){let s=fg(r,n);if(s!==null)return s;r=Es(r)}return null}function KC(e){let n=e._decorators,r=Object.assign({},n);return e._pendingDecorators=r,r}function V_(e){return e.read(()=>Dn().getTextContent())}function Dn(){return Bo()._nodeMap.get("root")}function rn(e){Wt();let n=Bo();e!==null&&(e.dirty=!0,e.setCachedNodes(null),ge(e)&&Ve()._slotsUsed&&_C(e)),n._selection=e}function X_(){Wt(),hx(Ve())}function oi(e){let n=function(r,s){let i=r;for(;i!=null;){let a=hi(i,s);if(a!==void 0)return a;i=Es(i)}return null}(e,Ve());return n===null?null:ot(n)}function zC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let n=[];for(let r=e;r!==null;r=r._parentEditor)n.push(r);return n}function UC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function HC(e){return Co(e)?e.nodeValue:null}function hg(e,n,r){let s=qn(Nn(n));if(s===null)return;let i=Vn(s,n._rootElement),a=i.anchorNode,{anchorOffset:l,focusOffset:c}=i;if(a!==null){let d=HC(a),f=gg(a);if(d!==null&&te(f)){if((d===Ea||d===zf)&&r){let g=r.length;d=r,l=g,c=g}d!==null&&mg(f,d,l,c,e)}}}function mg(e,n,r,s,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let l=a.isComposing();if(a.isToken()&&l)return;let c=n;if((l||i)&&(n.endsWith(Ea)&&(c=n.slice(0,-Ea.length)),i)){let f=zf,g;for(;(g=c.indexOf(f))!==-1;)c=c.slice(0,g)+c.slice(g+f.length),r!==null&&r>g&&(r=Math.max(g,r-f.length)),s!==null&&s>g&&(s=Math.max(g,s-f.length))}let d=a.getTextContent();if(i||c!==d){let f=ze();if(c===""){if(Bt(null),Ha||gs||Wa)a.remove();else{let C=Ve();lf(a,"",f),setTimeout(()=>{C.update(()=>{a.isAttached()&&a.getTextContent()===""&&a.remove()})},20)}return}let g=a.getParent(),p=Ns(),m=a.getTextContentSize(),_=Do(),x=a.getKey();if(a.isToken()&&!l||_!==null&&x===_&&!l||ge(p)&&(g!==null&&!g.canInsertTextBefore()&&p.anchor.offset===0||p.anchor.key===e.__key&&p.anchor.offset===0&&!a.canInsertTextBefore()&&!l||p.focus.key===e.__key&&p.focus.offset===m&&!a.canInsertTextAfter()&&!l))return void a.markDirty();if(!ge(f)||r===null||s===null)return void lf(a,c,f);if(f.setTextNodeRange(a,r,a,s),a.isSegmented()){let C=Cn(a.getTextContent());a.replace(C),a=C}lf(a,c,f)}}}function lf(e,n,r){if(e.setTextContent(n),ge(r)){let s=e.getKey(),i=!1;for(let a of["anchor","focus"]){let l=r[a];l.type==="text"&&l.key===s&&(l.offset=_o(e,l.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function sc(e,n,r){let s=n[r]||!1;return s==="any"||s===e[r]}function WC(e,n){return sc(e,n,"altKey")&&sc(e,n,"ctrlKey")&&sc(e,n,"shiftKey")&&sc(e,n,"metaKey")}function Qe(e,n,r){if(!WC(e,r))return!1;if(e.key.toLowerCase()===n.toLowerCase())return!0;if(n.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(n))return e.code===`Digit${n}`;let s="Key"+n.toUpperCase();return e.code===s}var or={ctrlKey:!Kn,metaKey:Kn},q_={altKey:Kn,ctrlKey:!Kn};function J_(e){return e.key==="Backspace"}function wR(e){let n=Dn();if(ge(e)){let{anchor:r,focus:s}=e,i=r.getNode();if(Kt(i))return r.set(i.getKey(),0,"element"),s.set(i.getKey(),i.getChildrenSize(),"element"),ni(e),e;let a=i.getTopLevelElementOrThrow(),l=a.getParent();if(l===null)return Y(a)&&(r.set(a.getKey(),0,"element"),s.set(a.getKey(),a.getChildrenSize(),"element"),ni(e)),e;let c=l;return r.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),ni(e),e}{let r=n.select(0,n.getChildrenSize());return rn(ni(r)),r}}function ci(e,n){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let r=e.__lexicalClassNameCache,s=r[n];if(s!==void 0)return s;let i=e[n];if(typeof i=="string"){let a=ol(i);return r[n]=a,a}return i}function _g(e,n,r,s,i){if(r.size===0)return;let{__type:a,__key:l}=s,c=n.get(a);c===void 0&&q(33,a);let d=c.klass,f=e.get(d);f===void 0&&(f=new Map,e.set(d,f));let g=f.get(l),p=g==="destroyed"&&i==="created";(g===void 0||p)&&f.set(l,p?"updated":i)}function kR(e){let n=e.getType(),r=Bo();if(r._readOnly){let a=kf(r).get(n);return a?Array.from(a.values()):[]}let s=r._nodeMap,i=[];for(let[,a]of s)a instanceof e&&a.__type===n&&a.isAttached()&&i.push(a);return i}function Z_(e,n,r){let s=e.getParent(),i=r,a=e;return s!==null&&(n&&r===0?(i=a.getIndexWithinParent(),a=s):n||r!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=s)),a.getChildAtIndex(n?i-1:i)}function GC(e,n){let r=e.offset;if(e.type==="element")return Z_(e.getNode(),n,r);{let s=e.getNode();if(n&&r===0||!n&&r===s.getTextContentSize()){let i=n?s.getPreviousSibling():s.getNextSibling();return i===null?Z_(s.getParentOrThrow(),n,s.getIndexWithinParent()+(n?0:1)):i}}return null}function jC(e){let n=Nn(e).event,r=n&&n.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function ie(e,n,...r){return RC(e,n,r[0],e)}function ui(e,n){let r=e._keyToDOMMap.get(n);return r===void 0&&q(75,n),r}function Es(e){let n=e.assignedSlot||e.parentElement;if(n!==null)return n;let r=e.parentNode;return lr(r)?r.host:null}function Hc(e){return pi(e)?e:Ct(e)?e.ownerDocument:null}function IR(e){return Ve()._updateTags.has(e)}function xs(e){Wt(),Ve()._updateTags.add(e)}function YC(e){Wt(),Ve()._deferred.push(e)}function Pa(e,n){let r=e.getParent();for(;r!==null;){if(r.is(n))return!0;r=r.getParent()}return!1}function xg(e){let n=Hc(e);return n?n.defaultView:null}function Nn(e){let n=e._window;return n===null&&q(78),n}function VC(e){return Y(e)&&e.isInline()||qe(e)&&e.isInline()}function Cg(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null&&Y(n))return n;let r=n.getParentOrThrow();if(At(r))return r;n=r}return n}function yg(e){return Y(e)&&e.isShadowRoot()}function At(e){return Kt(e)||yg(e)}function Sg(e,n=!1){let r=e.constructor.clone(e,ug);return PC(r,null),r.afterCloneFrom(e),n||r.resetOnCopyNodeFrom(e),r}function Za(e){let n=Ve(),r=e.getType(),s=Kc(n,r);s===void 0&&q(200,e.constructor.name,r);let{replace:i,replaceWithKlass:a}=s;if(i!==null){let l=i(e),c=l.constructor;return a!==null?l instanceof a||q(201,a.name,a.getType(),c.name,c.getType(),e.constructor.name,r):l instanceof e.constructor&&c!==e.constructor||q(202,c.name,c.getType(),e.constructor.name,r),l.__key===e.__key&&q(203,e.constructor.name,r,c.name,c.getType()),l}return e}function cf(e,n){!Kt(e.getParent())||Y(n)||qe(n)||q(99)}function XC(e){let n=ot(e);return n===null&&q(63,e),n}function gc(e){if(!e||e.isInline())return!1;if(qe(e))return!0;if(Y(e)){if(e.isShadowRoot()){let n=e.getParent();return!(Y(n)&&n.isShadowRoot())}return!e.canBeEmpty()}return!1}function wc(e,n,r){r.style.removeProperty("caret-color"),n._blockCursorElement=null;let s=e.parentElement;s!==null&&s.removeChild(e)}function qn(e){return Xn?(e||window).getSelection():null}function qC(e){let n=xg(e);return n?n.getSelection():null}function lr(e){return ry(e)&&"host"in e}var LR=[];function JC(e){let n=e.getRootNode();if(n===e||!lr(n))return LR;let r=[n],s=n.host;for(;;){let i=s.getRootNode();if(i===s||!lr(i))break;r.push(i),s=i.host}return r}function*ZC(e){let n=[e],r;for(;r=n.pop();){yield*r.querySelectorAll('[data-lexical-editor="true"]');let s=(pi(r)?r:r.ownerDocument).createTreeWalker(r,NodeFilter.SHOW_ELEMENT),i;for(;i=s.nextNode();)i.shadowRoot&&n.push(i.shadowRoot)}}function QC(e){return e!==null?e.ownerDocument:document}function Sn(){let e=OC();return QC(e!==null?e._rootElement:null)}function mi(e,n){if(n===null||typeof e.getComposedRanges!="function")return null;let r=JC(n);if(r.length===0)return null;let s=e.getComposedRanges;try{let i=s.call(e,{shadowRoots:r})[0];if(i!==void 0)return i}catch(i){}try{let i=s.apply(e,r)[0];if(i!==void 0)return i}catch(i){}return null}function ey(e,n){let r=mi(e,n);if(r!==null){let s=ty(r);if(s!==null)return s}return e.rangeCount>0?e.getRangeAt(0):null}function Vn(e,n){let r=mi(e,n);return r===null?e:ny(r,oy(e))}function FR(e,n){let r=mi(e,n);if(r===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let s=ty(r)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ny(r,oy(e)),range:s}}function ty(e){let n=e.startContainer.ownerDocument;if(n===null)return null;let r=n.createRange();try{return r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset),r}catch(s){return null}}function ny(e,n){let{startContainer:r,startOffset:s,endContainer:i,endOffset:a}=e;return n==="backward"?{anchorNode:i,anchorOffset:a,direction:n,focusNode:r,focusOffset:s}:{anchorNode:r,anchorOffset:s,direction:n,focusNode:i,focusOffset:a}}function oy(e){return e.direction}function kc(e){let n=e.getRootNode();return pi(n)||lr(n)?n.activeElement:null}function di(e){let n=e.activeElement;for(;n!==null&&n.shadowRoot!==null;){let r=n.shadowRoot.activeElement;if(r===null)break;n=r}return n}function Ng(e){let n=e.target;if(n!==null&&Ct(n)&&n.shadowRoot!==null&&typeof e.composedPath=="function"){let r=e.composedPath();if(r.length>0)return r[0]}return n}function PR(e,n){let r=e.getChildAtIndex(n);r==null&&(r=e),At(e)&&q(102);let s=(l)=>{let c=l.getParentOrThrow(),d=At(c),f=l!==r||d?Sg(l):l;if(d)return Y(l)&&Y(f)||q(133),l.insertAfter(f),[l,f,f];{let[g,p,m]=s(c),_=l.getNextSiblings();return m.append(f,..._),[g,p,f]}},[i,a]=s(r);return[i,a]}function BR(e){return Ct(e)&&e.tagName==="A"}function KR(e){return Ct(e)&&e.tagName==="TR"}function zR(e){return Ct(e)&&(e.tagName==="TD"||e.tagName==="TH")}function Ct(e){return _i(e)&&e.nodeType===1}function _i(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ry(e){return _i(e)&&e.nodeType===11}var UR=/^(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;function sy(e){return!(!Ct(e)||!e.style.display.startsWith("inline"))||UR.test(e.nodeName)}var HR=/^(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;function Eg(e){return(!Ct(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function xn(e){if(qe(e)&&!e.isInline())return!0;if(!Y(e)||At(e))return!1;let n=e.getFirstChild(),r=n===null||Lo(n)||te(n)||n.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function yo(){return Ve()}function Tg(e=yo()){return e._config.dom||La}function $n(e,n,r=yo()){let s=Tg(r).$getDOMSlot(e,n,r);return Y(e)&&(iy(s)||q(344,e.getKey(),e.getType())),s}function WR(e,n,r,s){let i=e.read("latest",()=>{let a=ot(n);return a!==null?function(l,c,d=yo()){let f=wr(l,c);if(f===null)return null;let g=d.getElementByKey(f.getKey());return g!==null?g.parentElement:null}(a,r,e):null});return i!==null&&(i.parentElement!==s&&s.appendChild(i),i.style.display=""),i}function GR(e,n,r){r.style.display="none";let s=e.getElementByKey(n);s!==null&&r.parentElement!==s&&s.insertBefore(r,s.firstChild)}function iy(e){return e instanceof ii}function ar(e,n,r=yo()){return FC($n(e,n,r).element)}var Q_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||q(192);let n=Q_.get(e);return n||(n=function(r){let s=new Map;for(let[i,a]of r._nodeMap){let l=a.__type,c=s.get(l);c||(c=new Map,s.set(l,c)),c.set(i,a)}return s}(e),Q_.set(e,n)),n}function bg(e){let n=e.constructor.clone(e,ug);return n.afterCloneFrom(e),n}function YR(e){return(n=bg(e))[eC]=!0,n;var n}function ay(e,n){let r=e.getAttribute("data-lexical-indent");if(r!==null){let a=parseInt(r,10);if(Number.isFinite(a)&&a>=0)return void n.setIndent(a)}let s=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(s/40);n.setIndent(i)}function ly(e,n){let r=n.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function cy(e,n){let r=n.style.textAlign;return r&&r in pc?e.setFormat(r):e}function uy(e,n){e.__lexicalUnmanaged=!0,n&&n.captureSelection!==void 0&&(e.__lexicalCapturedSelection=n.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function dy(e,n=yo()){let r=n.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=n:delete e.__lexicalEditor}function Ba(e,n){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(Ct(r)&&r.hasAttribute("data-lexical-slot"))return!1;if(hi(r,n)!==void 0)return!1;r=Es(r)}return!1}function ha(e,n){return function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}(e,n)&&e[n]!==cn[n]}var ex=new WeakMap,tx=Symbol("lexical.synthesizedGetType");function el(e){let n=ex.get(e);if(n)return n;let r=e.prototype!=null&&e_ in e.prototype?e.prototype[e_]():void 0,s=function(f){if(!(f===cn||f.prototype instanceof cn)){let g="<unknown>",p="<unknown>";try{g=f.getType()}catch(m){}try{_s.version&&(p=JSON.parse(_s.version))}catch(m){}q(290,f.name,g,p)}return f===Pc||f===Io||f===cn}(e),i=!s&&ha(e,"getType")?e.getType:void 0,a=i&&!(tx in i)?i.call(e):void 0,l,c=a;if(r)if(a)l=r[a];else{for(let[f,g]of Object.entries(r))c=f,l=g;if(!l)for(let f of Object.getOwnPropertySymbols(r)){let g=r[f];if(g){l=g;break}}}if(!s&&c){if(!ha(e,"getType")){let f=e,g=function(){return this!==f?cn.getType.call(this):c};g[tx]=!0,e.getType=g}if(ha(e,"clone")||(e.clone=(f,g)=>{cg(f);let p=new e;return g!==ug&&p.afterCloneFrom(f),p}),ha(e,"importJSON")||(e.importJSON=l&&l.$importJSON||((f)=>new e().updateFromJSON(f))),!ha(e,"importDOM")&&l){let{importDOM:f}=l;f&&(e.importDOM=()=>f)}}let d={klass:e,ownNodeConfig:l,ownNodeType:c};return ex.set(e,d),d}function*tl(e){for(let n=e;n&&(n===cn||og(n.prototype));){let r=el(n);yield r,n=r.ownNodeConfig&&r.ownNodeConfig.extends||fy(n)}}function VR(e){let n=new Map,r=new Map;for(let s of e){let{ownNodeType:i}=el(s);i&&(r.set(i,s),n.set(i,new Set))}for(let[s,i]of r)for(let{ownNodeType:a}of tl(i)){let l=a&&n.get(a);l&&l.add(s)}return n}function XR(e){let n=yo();return Wt(),new(n.resolveRegisteredNodeAfterReplacements(n.getRegisteredNode(e))).klass}var br=(e,n)=>{let r=e;for(;r!=null&&!Kt(r);){if(n(r))return r;r=r.getParent()}return null};function Ka(e,n){let r=[],s=e.__first;for(;s!==null;){let i=n===null?ot(s):n.get(s);i==null&&q(174),r.push(s),s=i.__next}return r}function fy(e){let n=Object.getPrototypeOf(e);if(typeof n=="function"&&n!==Function.prototype)return n;let r=e.prototype&&Object.getPrototypeOf(e.prototype);return r?r.constructor:null}var gy=new Map;function $o(e){return Y(e)||qe(e)}function $r(e){return Y(e)||qe(e)}function Jt(e){let n=e.getLatest();return $r(n)?n.__slotHost:null}function Hn(e){let n=Jt(e);if(n===null)return null;let r=ot(n);return Y(r)||qe(r)||q(370),r}function py(e){let n=Hn(e);if(n===null)return null;let r=e.getLatest().__key;for(let[s,i]of Wc(n))if(i===r)return s;return null}function hy(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null)return n;n=n.getParent()}return null}function Wc(e){let n=e.getLatest();return $o(n)&&n.__slots!==null?n.__slots:gy}function jn(e){return Array.from(Wc(e).keys())}function wr(e,n){let r=Wc(e).get(n);return r===void 0?null:ot(r)}var qR=["__proto__","constructor","prototype"],nx=Symbol("slotMapOwner");function If(e){let n=e.__slots;return n!==null&&n[nx]===e||(n=new Map(n),n[nx]=e,e.__slots=n),n}var ox=new WeakMap,JR=[];function my(e){for(let{ownNodeConfig:n}of tl(e)){let r=n&&n.slots;if(r)return r}return JR}function _y(e){let n="";for(let r of jn(e)){let s=wr(e,r);s!==null&&(n+=s.getTextContent())}return n}function rx(e,n,r){let s=r.get(e),i=r.get(n);return s!==void 0?i!==void 0?s-i:-1:i!==void 0?1:e<n?-1:e>n?1:0}function ZR(e){let n=e.__slots;if(n===null||n.size<2)return;let r=function(l){let c=ox.get(l);if(c===void 0){let d=my(l),f=new Map;for(let g of d)qR.includes(g)&&q(371,l.name,g),f.has(g)&&q(372,l.name,g),f.set(g,f.size);c=f,ox.set(l,c)}return c}(e.constructor),s=null,i=!0;for(let l of n.keys()){if(s!==null&&rx(s,l,r)>0){i=!1;break}s=l}if(i)return;let a=Array.from(n).sort(([l],[c])=>rx(l,c,r));n.clear();for(let[l,c]of a)n.set(l,c)}function Og(e,n,r){n!=="__proto__"&&n!=="constructor"&&n!=="prototype"||q(373,n);let s=e.getLatest();if(s.__slots!==null&&s.__slots.get(n)===r.getLatest().__key)return s;(!Y(r)&&!qe(r)||r.isInline())&&q(374,r.__key);let i=e.getWritable(),a=If(i),l=a.get(n);l!==void 0&&Cy(l);let c=r.getWritable(),d=Hn(c);if(d!==null){let f=py(c);f!==null&&If(d.getWritable()).delete(f),c.__slotHost=null}return Un(c),c.__slotHost=i.__key,a.set(n,c.__key),ZR(i),function(){let f=yo();f._slotsUsed=!0,f._pendingEditorState&&(f._pendingEditorState._slotsUsed=!0)}(),i}function xy(e,n){let r=e.getWritable();if(r.__slots===null)return r;let s=r.__slots.get(n);return s!==void 0&&(Cy(s),If(r).delete(n)),r}function sx(e,n){}function Cy(e){let n=ot(e);if(n===null)return;let r=n.getWritable();$r(r)||q(377,e),r.__slotHost=null,r.remove()}var QR={next:"previous",previous:"next"};class nl{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:kr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return St(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return St(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){let s=r===this.direction?n:Array.from(n).reverse(),i=this,a=this.getParentAtCaret(),l=new Map;for(let c=i.getAdjacentCaret();c!==null&&l.size<e;c=c.getAdjacentCaret()){let d=c.origin.getWritable();l.set(d.getKey(),d)}for(let c of s){if(l.size>0){let d=i.getNodeAtCaret();if(d)if(l.delete(d.getKey()),l.delete(c.getKey()),d.is(c)||i.origin.is(c));else{let f=c.getParent();f&&f.is(a)&&c.remove(),d.replace(c)}else d===null&&q(263,Array.from(l).join(" "))}else i.insert(c);i=St(c,this.direction)}for(let c of l.values())c.remove();return this}}class za extends nl{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:cr(e,this.direction)}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||cr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof za&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Kt,shadowRoot:At};function Pr(e){return QR[e]}function Ag(e,n="root"){return e===null||eM[n](e)?null:Jt(e)===null?e:null}class Cs extends nl{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:St(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Y(this.origin)?cr(this.origin,this.direction):null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||cr(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Cs&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ys extends nl{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ir(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ir(this.origin,Pr(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ys&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return St(this.origin,this.direction)}}function mo(e){return e instanceof ys}function tM(e){return e instanceof nl}function kr(e){return e instanceof Cs}function Yn(e){return e instanceof za}var nM={next:class extends ys{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ys{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},oM={next:class extends Cs{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Cs{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rM={next:class extends za{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends za{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function St(e,n){return e?new oM[n](e):null}function Ir(e,n,r){return e?new nM[n](e,_o(e,r)):null}function _o(e,n,r="error"){let s=e.getTextContentSize(),i=n==="next"?s:n==="previous"?0:n;return(i<0||i>s)&&(r!=="clamp"&&lx(284,String(n),String(s),e.getKey()),i=i<0?0:s),i}function Lf(e,n){return new Mg(e,n)}function cr(e,n){return Y(e)?new rM[n](e):null}function yy(e){return e&&e.getChildCaret()||e}function fi(e){return e&&yy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){let e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new Rg(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(s)=>{let i=this[s].getLatest();return mo(i)?function(a,l){let{direction:c,origin:d}=a,f=_o(d,l==="focus"?Pr(c):c);return Lf(a,f-a.offset)}(i,s):null},n=e("anchor"),r=e("focus");if(n&&r){let{caret:s}=n,{caret:i}=r;if(s.isSameNodeCaret(i))return[Lf(s,i.offset-s.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=mo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=mo(r),i=(a)=>a.isSameNodeCaret(r)?null:fi(a)||a.getParentCaret(e);return $g({hasNext:(a)=>a!==null&&!(s&&r.isSameNodeCaret(a)),initial:n.isSameNodeCaret(r)?null:i(n),map:(a)=>a,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){let{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){let[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:n}}=this,[r,s]=this.getSliceIndices(),i=e.getTextContent();return Ir(e.setTextContent(i.slice(0,r)+i.slice(s)),n,r)}}function sM(e){return e instanceof Mg}function Dg(e){return Lr(e,St(Dn(),e.direction))}function Sy(e){return Lr(e,e)}function Lr(e,n){return e.direction!==n.direction&&q(265),new Rg(e,n,e.direction)}function $g(e){let{initial:n,hasNext:r,step:s,map:i}=e,a=n;return{[Symbol.iterator](){return this},next(){if(!r(a))return{done:!0,value:void 0};let l={done:!1,value:i(a)};return a=s(a),l}}}function wg(e,n){let r=Ic(e.origin,n.origin);switch(r===null&&q(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{let s=e.type==="text",i=n.type==="text";return s&&i?function(a,l){return Math.sign(a-l)}(e.offset,n.offset):e.type===n.type?0:s?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return n.type==="child"?1:-1;case"branch":return Ig(r)}}function Ig(e){let{a:n,b:r}=e,s=n.__key,i=r.__key,a=n,l=r;for(;a&&l;a=a.getNextSibling(),l=l.getNextSibling()){if(a.__key===i)return-1;if(l.__key===s)return 1}return a===null?1:-1}function ic(e,n){return n.is(e)}function ix(e){return Y(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ic(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[s,i]=ix(e);s;i=s,s=s.getParent())r.set(s,i);for(let[s,i]=ix(n);s;i=s,s=s.getParent()){let a=r.get(s);if(a!==void 0)return a===null?(ic(e,s)||q(276),{commonAncestor:s,type:"ancestor"}):i===null?(ic(n,s)||q(277),{commonAncestor:s,type:"descendant"}):((Y(a)||ic(e,a))&&(Y(i)||ic(n,i))&&s.is(a.getParent())&&s.is(i.getParent())||q(278),{a,b:i,commonAncestor:s,type:"branch"})}return null}function Fr(e,n){let{type:r,key:s,offset:i}=e,a=XC(e.key);return r==="text"?(te(a)||q(266,a.getType(),s),Ir(a,n,i)):(Y(a)||q(267,a.getType(),s),by(a,e.offset,n))}function Ua(e,n){let{origin:r,direction:s}=n,i=s==="next";mo(n)?e.set(r.getKey(),n.offset,"text"):kr(n)?te(r)?e.set(r.getKey(),_o(r,s),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(Yn(n)&&Y(r)||q(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function Ny(e){let n=ze(),r=ge(n)?n:SC();return ya(r,e),rn(r),r}function ya(e,n){Ua(e.anchor,n.anchor),Ua(e.focus,n.focus)}function Ff(e){let{anchor:n,focus:r}=e,s=Fr(n,"next"),i=Fr(r,"next"),a=wg(s,i)<=0?"next":"previous";return Lr(Fo(s,a),Fo(i,a))}function Ts(e){let{direction:n,origin:r}=e,s=St(r,Pr(n)).getNodeAtCaret();return s?St(s,n):cr(r.getParentOrThrow(),n)}function ax(e,n="root"){let r=[e];for(let s=Yn(e)?e.getParentCaret(n):e.getSiblingCaret();s!==null;s=s.getParentCaret(n))r.push(Ts(s));return r}function uf(e){return!!e&&e.origin.isAttached()}function Ey(e,n="removeEmptySlices"){if(e.isCollapsed())return e;let r="root",s="next",i=n,a=Lg(e,s),l=ax(a.anchor,r),c=ax(a.focus.getFlipped(),r),d=new Set,f=[];for(let C of a.iterNodeCarets(r))if(Yn(C))d.add(C.origin.getKey());else if(kr(C)){let{origin:y}=C;Y(y)&&!d.has(y.getKey())||f.push(y)}let g=new Set;for(let C of f){let y=C.getParent();y===null||d.has(y.getKey())||g.add(y),Un(C)}for(let C of g)!C.canBeEmpty()&&!At(C)&&C.isEmpty()&&C.isAttached()&&C.remove();for(let C of a.getTextSlices()){if(!C)continue;let{origin:y}=C.caret,N=y.getTextContentSize(),T=Ts(St(y,s)),v=y.getMode();if(Math.abs(C.distance)===N&&i==="removeEmptySlices"||v==="token"&&C.distance!==0)T.remove();else if(C.distance!==0){i="removeEmptySlices";let R=C.removeTextSlice(),F=C.caret.origin;if(v==="segmented"){let k=R.origin,H=Cn(k.getTextContent()).setStyle(k.getStyle()).setFormat(k.getFormat());T.replaceOrInsert(H),R=Ir(H,s,R.offset)}F.is(l[0].origin)&&(l[0]=R),F.is(c[0].origin)&&(c[0]=R.getFlipped())}}let p,m;for(let C of l)if(uf(C)){p=wo(C);break}for(let C of c)if(uf(C)){m=wo(C);break}let _=function(C,y,N){if(!C||!y)return null;let T=C.getParentAtCaret(),v=y.getParentAtCaret();if(!T||!v)return null;let R=T.getParents().reverse();R.push(T);let F=v.getParents().reverse();F.push(v);let k=Math.min(R.length,F.length),H;for(H=0;H<k&&R[H]===F[H];H++);let U=(G,ne)=>{let ee;for(let se=H;se<G.length;se++){let V=G[se];if(At(V))return;!ee&&ne(V)&&(ee=V)}return ee},W=U(R,xn),J=W&&U(F,(G)=>N.has(G.getKey())&&xn(G));if(J&&jn(J).length>0)return null;return W&&J?[W,J]:null}(p,m,d);if(_){let[C,y]=_;cr(C,"previous").splice(0,y.getChildren());let N=y.getParent();for(y.remove(!0);N&&N.isEmpty();){let T=N;N=N.getParent(),T.remove(!0)}}else if(m){let C=function(T){if(Yn(T)){let v=T.origin;if(xn(v))return v}else{let v=T.getParentAtCaret();if(v&&xn(v))return v}return null}(m),y=C&&C.getParent(),N=C&&C.getParents().findLast(yg);if(C&&y&&!Kt(y)&&C.isEmpty()&&d.has(C.getKey())&&jn(C).length===0&&(!N||d.has(N.getKey()))){C.remove(!0);let T=y;for(;T&&!Kt(T)&&T.isEmpty();){let v=T.getParent();if(v&&Kt(v)&&v.getChildrenSize()<=1)break;let R=T;T=v,R.remove(!0)}}}let x=[p,m,...l,...c].find(uf);if(x)return Sy(Fo(wo(x),e.direction));q(269,JSON.stringify(l.map((C)=>C.origin.__key)))}function wo(e){let n=function(i){let a=i;for(;Yn(a);){let l=fi(a);if(!Yn(l))break;a=l}return a}(e.getLatest()),{direction:r}=n;if(te(n.origin))return mo(n)?n:Ir(n.origin,r,r);let s=n.getAdjacentCaret();return kr(s)&&te(s.origin)?Ir(s.origin,r,Pr(r)):n}function Ty(e){return mo(e)&&e.offset!==_o(e.origin,e.direction)}function Fo(e,n){return e.direction===n?e:e.getFlipped()}function Lg(e,n){return e.direction===n?e:Lr(Fo(e.focus,n),Fo(e.anchor,n))}function by(e,n,r){let s=cr(e,"next");for(let i=0;i<n;i++){let a=s.getAdjacentCaret();if(a===null)break;s=a}return Fo(s,r)}function iM(e,n="root"){let r=0,s=e,i=fi(s);for(;i===null;){if(r--,i=s.getParentCaret(n),!i)return null;s=i,i=fi(s)}return i&&[i,r]}function aM(e){let{origin:n,offset:r,direction:s}=e;if(r===_o(n,s))return e.getSiblingCaret();if(r===_o(n,Pr(s)))return Ts(e.getSiblingCaret());let[i]=n.splitText(r);return te(i)||q(281),Fo(St(i,"next"),s)}function lM(e,n){return!0}function vy(e,{$copyElementNode:n=Sg,$splitTextPointCaretNext:r=aM,rootMode:s="shadowRoot",$shouldSplit:i=lM,removeEmptyDestination:a=!1}={}){if(mo(e))return r(e);let l=e.getParentCaret(s);if(l){let{origin:c}=l;if(Yn(e)){let f=Ts(l);if(a&&c.isEmpty())return c.remove(),f;if(!c.canBeEmpty()||!i(c,"first"))return f}let d=function(f){let g=[];for(let p=f.getAdjacentCaret();p;p=p.getAdjacentCaret())g.push(p.origin);return g}(e);(d.length>0||!a&&c.canBeEmpty()&&i(c,"last"))&&l.insert(n(c).splice(0,0,d))}return l}function Oy(e,n,r){let s=Fo(n,"next");mo(s)&&(s.offset===0?s=St(s.origin,"previous").getFlipped():s.offset===s.origin.getTextContentSize()&&(s=St(s.origin,"next"))),s.origin.is(e)&&(kr(s)||q(342,e.getKey(),e.getType()),s=Ts(s)),(e.is(s.getNodeAtCaret())||e.is(s.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=s;i;i=vy(i,r))s=i;return mo(s)&&q(283),s.insert(e.isInline()?Mn().append(e):e),Fo(St(e.getLatest(),"next"),n.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,n){return[e,n]}function fM(e){return e}function gM(e,n){if(!n||e===n)return e;for(let r in n)if(e[r]!==n[r])return{...e,...n};return e}function ol(...e){let n=[];for(let r of e)if(r&&typeof r=="string")for(let[s]of r.matchAll(/\S+/g))n.push(s);return n}function pM(e,...n){let r=ol(...n);r.length>0&&e.classList.add(...r)}function hM(e,...n){let r=ol(...n);r.length>0&&e.classList.remove(...r)}function Fg(...e){return()=>{for(let n=e.length-1;n>=0;n--)e[n]();e.length=0}}function mM(e,n,r){return Fg(...Object.entries(n).map(([s,i])=>ng(e,s,i,r)))}var M=Pg,{$addUpdateTag:rl,$applyNodeReplacement:un,$assumeActiveEditor:Ay,$caretFromPoint:dn,$caretRangeFromSelection:ur,$cloneWithProperties:Gc,$cloneWithPropertiesEphemeral:Ry,$comparePointCaretNext:Br,$copyNode:jt,$create:jc,$createChildrenArray:V1,$createLineBreakNode:fn,$createNodeSelection:Yc,$createParagraphNode:Se,$createPoint:Jn,$createRangeSelection:Kr,$createRangeSelectionFromDom:My,$createTabNode:gn,$createTextNode:yt,$extendCaretToRange:bs,$findMatchingParent:he,$formatText:Dy,$fullReconcile:xi,$generateNodesFromRawText:sl,$getAdjacentChildCaret:il,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:$y,$getCaretRange:Zn,$getCaretRangeInDirection:dr,$getCharacterOffsets:wy,$getChildCaret:bt,$getChildCaretAtIndex:Bg,$getChildCaretOrSelf:Kg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:ky,$getDOMTextNode:Iy,$getDocument:Xe,$getEditor:Ge,$getEditorDOMRenderConfig:zg,$getNearestNodeFromDOMNode:vt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Rt,$getNodeByKeyOrThrow:Ly,$getNodeFromDOMNode:Fy,$getPreviousSelection:En,$getRoot:Je,$getSelection:X,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:Qn,$getSlotHost:Vc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Ko,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Xc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:al,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:zr,$insertNodes:qc,$isBlockElementNode:Ur,$isChildCaret:zo,$isDecoratorNode:wt,$isEditorState:Py,$isElementDOMSlot:iL,$isElementNode:Q,$isExtendableTextPointCaret:ll,$isInlineElementOrDecoratorNode:Ug,$isInlineFormattable:aL,$isLeafNode:cl,$isLexicalNode:Hg,$isLineBreakNode:Ue,$isNodeCaret:lL,$isNodeSelection:Ze,$isParagraphNode:wn,$isRangeSelection:j,$isRootNode:So,$isRootOrShadowRoot:Mt,$isSelectionCapturedInDecoratorInput:By,$isShadowRootNode:Jc,$isSiblingCaret:No,$isSlotChild:cL,$isSlotHost:ul,$isTabNode:Yt,$isTextNode:re,$isTextPointCaret:Hr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Wg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:Ky,$nodesOfType:gL,$normalizeCaret:kt,$normalizeSelection__EXPERIMENTAL:Uo,$onUpdate:zy,$parseSerializedNode:Uy,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:Hy,$rewindSiblingCaret:Ho,$selectAll:Wr,$setCompositionKey:mL,$setDirectionFromDOM:Tn,$setFormatFromDOM:eo,$setPointFromCaret:Wo,$setSelection:mt,$setSelectionFromCaretRange:kn,$setSlot:_L,$setState:to,$setTextFormat:Wy,$splitAtPointCaretNext:Zc,$splitNode:Gy,$updateDOMSelection:jy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:dl,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Rs,CAN_UNDO_COMMAND:Ms,CAN_USE_BEFORE_INPUT:fl,CAN_USE_DOM:pn,CLEAR_EDITOR_COMMAND:Qc,CLEAR_HISTORY_COMMAND:Yy,CLICK_COMMAND:yi,COLLABORATION_TAG:Vy,COMMAND_PRIORITY_BEFORE_CRITICAL:Xy,COMMAND_PRIORITY_BEFORE_EDITOR:eu,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:Te,COMMAND_PRIORITY_HIGH:In,COMMAND_PRIORITY_LOW:Pe,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:tu,COMPOSITION_START_COMMAND:qy,COMPOSITION_START_TAG:nu,CONTROLLED_TEXT_INSERTION_COMMAND:ou,COPY_COMMAND:Ni,CUT_COMMAND:ru,CUT_TAG:su,DEFAULT_EDITOR_DOM_CONFIG:Gg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:iu,DELETE_WORD_COMMAND:au,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:Jy,DRAGSTART_COMMAND:Zy,DROP_COMMAND:Qy,DecoratorNode:lu,ElementNode:ct,FOCUS_COMMAND:eS,FORMAT_ELEMENT_COMMAND:cu,FORMAT_TEXT_COMMAND:Go,HISTORIC_TAG:Ti,HISTORY_MERGE_TAG:Gr,HISTORY_PUSH_TAG:uu,INDENT_CONTENT_COMMAND:no,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:jg,INSERT_PARAGRAPH_COMMAND:jr,INSERT_TAB_COMMAND:Ds,INTERNAL_$isBlock:gl,IS_ALL_FORMATTING:AL,IS_ANDROID:tS,IS_ANDROID_CHROME:nS,IS_APPLE:pl,IS_APPLE_WEBKIT:du,IS_BOLD:hl,IS_CHROME:oS,IS_CODE:rS,IS_FIREFOX:$s,IS_HIGHLIGHT:sS,IS_IOS:ml,IS_ITALIC:_l,IS_SAFARI:fu,IS_STRIKETHROUGH:xl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:Cl,KEY_ARROW_DOWN_COMMAND:jo,KEY_ARROW_LEFT_COMMAND:Yr,KEY_ARROW_RIGHT_COMMAND:bi,KEY_ARROW_UP_COMMAND:oo,KEY_BACKSPACE_COMMAND:vi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Oi,KEY_ESCAPE_COMMAND:Ai,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:Vr,LineBreakNode:iS,MOVE_TO_END:yl,MOVE_TO_START:Ri,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:Yo,PASTE_COMMAND:Mi,PASTE_TAG:_u,ParagraphNode:aS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:lS,RootNode:Cu,SELECTION_CHANGE_COMMAND:ro,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:Di,SET_TEXT_FORMAT_COMMAND:cS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:uS,SKIP_SCROLL_INTO_VIEW_TAG:dS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:$i,TabNode:Nu,TextNode:Ln,UNDO_COMMAND:Eu,addClassNamesToElement:et,buildImportMap:Yg,configExtension:sn,createCommand:bn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Vo,declarePeerDependency:fS,defineExtension:_e,findAllLexicalElementsDeep:gS,flipDirection:pS,getActiveElement:Eo,getActiveElementDeep:hS,getComposedEventTarget:Sl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:Fn,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ws,getDOMSelectionRange:mS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:_S,getDOMTextNode:xS,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:Nl,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:Is,getStaticNodeConfig:CS,getStyleObjectFromCSS:Xr,getTextDirection:yS,getTransformSetFromKlass:WL,isBlockDomNode:Ls,isCurrentlyReadOnlyMode:SS,isDOMCapturingSelection:GL,isDOMDocumentNode:qr,isDOMNode:io,isDOMShadowRoot:Au,isDOMTextNode:Fs,isDOMUnmanaged:jL,isDocumentFragment:Vg,isExactShortcutMatch:NS,isHTMLAnchorElement:wi,isHTMLElement:ye,isHTMLTableCellElement:YL,isHTMLTableRowElement:ES,isInlineDomNode:ki,isLastChildInBlockNode:TS,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:bS,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:vS,iterStaticNodeConfigChain:OS,makeStepwiseIterator:Xg,mergeRegister:De,mountSlotContainer:qL,normalizeClassNames:Ii,registerEventListener:ao,registerEventListeners:Jr,removeClassNamesFromElement:an,removeFromParent:JL,resetRandomKey:ZL,safeCast:We,setDOMStyleFromCSS:fr,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Zr,shallowMergeConfig:zt,stopLexicalPropagation:qg,toggleTextFormatType:Jg,tokenizeRawText:Li,unmountSlotContainer:eF}=M;var Zg={};Oe(Zg,{LexicalComposer:()=>xM});S();var _M=pn?He:h,Du={tag:Gr};function xM({initialConfig:e,children:n}){let r=D(()=>{let{theme:s,namespace:i,nodes:a,onError:l,onWarn:c,editorState:d,html:f}=e,g=Qm(null,s),p=Tu({editable:e.editable,html:f,namespace:i,nodes:a,onError:(m)=>l(m,p),...c?{onWarn:(m)=>c(m,p)}:{},theme:s});return function(m,_){if(_===null)return;if(_===void 0)m.update(()=>{let x=Je();if(x.isEmpty()){let C=Se();x.append(C);let y=m.getRootElement(),N=pn&&y!==null?Eo(y):null;(X()!==null||N!==null&&N===y)&&C.select()}},Du);else if(_!==null)switch(typeof _){case"string":{let x=m.parseEditorState(_);m.setEditorState(x,Du);break}case"object":m.setEditorState(_,Du);break;case"function":m.update(()=>{Je().isEmpty()&&_(m)},Du)}}(p,d),[p,g]},[]);return _M(()=>{let s=e.editable,[i]=r;i.setEditable(s===void 0||s)},[]),t(Zm.Provider,{value:r,children:n})}var CM=Zg,AS=CM.LexicalComposer;var Qg={};Oe(Qg,{useLexicalEditable:()=>NM});S();var yM=pn?He:h;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(n)=>e.registerEditableListener(n)}}function NM(){return function(e){let[n]=st(),r=D(()=>e(n),[n,e]),[s,i]=u(()=>r.initialValueFn()),a=b(s);return yM(()=>{let{initialValueFn:l,subscribe:c}=r,d=l();return a.current!==d&&(a.current=d,i(d)),c((f)=>{a.current=f,i(f)})},[r,e]),s}(SM)}var EM=Qg,RS=EM.useLexicalEditable;var sp={};Oe(sp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Gc,$copyBlockFormatIndent:()=>FS,$ensureForwardRangeSelection:()=>LS,$forEachSelectedTextNode:()=>IS,$getComputedStyleForElement:()=>np,$getComputedStyleForParent:()=>op,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>PS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>rp,$isParentRTL:()=>vM,$moveCaretSelection:()=>zS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>Wr,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>kS,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>wS,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});function tp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function MS(e){let n=e;for(;n!=null;){if(n.nodeType===Node.TEXT_NODE)return n;n=n.firstChild}return null}function DS(e){let n=e.parentNode;if(n==null)throw Error("Should never happen");return[n,Array.from(n.childNodes).indexOf(e)]}function TM(e,n,r,s,i){let a=n.getKey(),l=s.getKey(),c=Is(e.getRootElement()).createRange(),d=e.getElementByKey(a),f=e.getElementByKey(l),g=r,p=i;if(re(n)&&(d=MS(d)),re(s)&&(f=MS(f)),n===void 0||s===void 0||d===null||f===null)return null;d.nodeName==="BR"&&([d,g]=DS(d)),f.nodeName==="BR"&&([f,p]=DS(f));let m=d.firstChild;d===f&&m!=null&&m.nodeName==="BR"&&g===0&&p===0&&(p=1);try{c.setStart(d,g),c.setEnd(f,p)}catch(_){return null}return!c.collapsed||g===p&&a===l||(c.setStart(f,p),c.setEnd(d,g)),c}function bM(e,n){let r=e.getRootElement();if(r===null)return[];let s=r.getBoundingClientRect(),i=getComputedStyle(r),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),l=Array.from(n.getClientRects()),c,d=l.length;l.sort((f,g)=>{let p=f.top-g.top;return Math.abs(p)<=3?f.left-g.left:p});for(let f=0;f<d;f++){let g=l[f],p=c&&c.top<=g.top&&c.top+c.height>g.top&&c.left+c.width>g.left,m=g.width+a===s.width;p||m?(l.splice(f--,1),d--):c=g}return l}function wS(e){let n="";for(let r in e)r&&(n+=`${r}: ${e[r]};`);return n}function np(e){let n=Ge().getElementByKey(e.getKey());if(n===null)return null;let r=n.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(n)}function op(e){return np(So(e)?e:e.getParentOrThrow())}function vM(e){let n=op(e);return n!==null&&n.direction==="rtl"}function OM(e,n,r="self"){let s=e.getStartEndPoints();if(n.isSelected(e)&&!Wg(n)&&s!==null){let[i,a]=s,l=e.isBackward(),c=i.getNode(),d=a.getNode(),f=n.is(c),g=n.is(d);if(f||g){let[p,m]=wy(e),_=c.is(d),x=n.is(l?d:c),C=n.is(l?c:d),y,N=0;if(_)N=p>m?m:p,y=p>m?p:m;else if(x)N=l?m:p,y=void 0;else if(C)N=0,y=l?p:m;let T=n.__text.slice(N,y);T!==n.__text&&(r==="clone"&&(n=Ry(n)),n.__text=T)}}return n}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return Q(n)||tp(177),e.offset===n.getChildrenSize()}function kS(e,n,r){let s=n.getNode(),i=r;if(Q(s)){let a=s.getDescendantByIndex(n.offset);a!==null&&(s=a)}for(;i>0&&s!==null;){if(Q(s)){let f=s.getLastDescendant();f!==null&&(s=f)}let a=s.getPreviousSibling(),l=0;if(a===null){let f=s.getParentOrThrow(),g=f.getPreviousSibling();for(;g===null;){if(f=f.getParent(),f===null){a=null;break}g=f.getPreviousSibling()}f!==null&&(l=f.isInline()?0:2,a=g)}let c=s.getTextContent();c===""&&Q(s)&&!s.isInline()&&(c=`
12
+ `}createDOM(){return Sn().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function gR(e){return{node:Bc()}}function Bc(){return Za(new Va)}function Lo(e){return e instanceof Va}function DC(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Mc(r)){let s=n.lastChild;if(s===e||s.previousSibling===e&&Mc(s))return!0}}return!1}function $C(e){let n=e.parentElement;if(n!==null&&Eg(n)){let r=n.firstChild;if(r===e||r.nextSibling===e&&Mc(r))return!1;let s=n.lastChild;if(s===e||s.previousSibling===e&&Mc(s))return!0}return!1}function Mc(e){return Co(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class Xa extends Io{$config(){return this.config("paragraph",{extends:Io,importDOM:{p:()=>({conversion:pR,priority:0})}})}createDOM(e){let n=Sn().createElement("p"),r=ci(e.theme,"paragraph");if(r!==void 0)n.classList.add(...r);return n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(Ct(n)){this.isEmpty()&&n.append(Sn().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let n=this.getChildren().find(te);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=Mn();r.setTextFormat(e.format),r.setTextStyle(e.style);let s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||te(e[0])&&e[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 pR(e){let n=Mn();if(cy(n,e),ay(e,n),n.getFormatType()===""){let r=e.getAttribute("align");r&&r&&r in pc&&n.setFormat(r)}return ly(n,e),{node:n}}function Mn(){return Za(new Xa)}function wC(e){return e instanceof Xa}function hR(e){console.warn(e)}var ti=0,mR=1,_R=2,xR=3,CR=4,yR=-8,SR=-7,NR=-6,ER=-5,TR=-4;function kC(e,n,r,s,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ag(),e._pendingEditorState=s,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let l=e._observer;l!==null&&(l.disconnect(),e._observer=null),n!==null&&(n.textContent="",function(c,d){let f=`__lexicalKey_${d._key}`;delete c[f]}(n,e)),r!==null&&(r.textContent="",a.set("root",r),BC(r,e,"root"))}function IC(e){let n=new Set,r=new Set;for(let{klass:s,ownNodeConfig:i}of tl(e)){let a=s.transform;if(!r.has(a)){r.add(a);let l=s.transform();l&&n.add(l)}if(i){let l=i.$transform;l&&n.add(l)}}return n}var La={$createDOM:(e,n)=>e.createDOM(n._config,n),$decorateDOM:(e,n,r,s)=>{},$exportDOM:(e,n)=>{let r=Kc(n,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(n,e):e.exportDOM(n)},$extractWithChild:(e,n,r,s,i)=>Y(e)&&e.extractWithChild(n,r,s),$getDOMSlot:(e,n,r)=>e.getDOMSlot(n),$getSlotTargetElement:(e,n,r,s)=>null,$shouldExclude:(e,n,r)=>Y(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,n,r)=>!n||e.isSelected(n),$updateDOM:(e,n,r,s)=>e.updateDOM(n,r,s._config)};function bR(e){let n=e||{},r=OC(),s=n.theme||{},i=e===void 0?r:n.parentEditor||null,a=n.disableEvents||!1,l=ag(),c=n.namespace||(i!==null?i._config.namespace:UC()),d=n.editorState,f=[ja,ms,Va,Ga,Xa,lg,...n.nodes||[]],{onError:g,onWarn:p,html:m}=n,_=n.editable===void 0||n.editable,x;if(e===void 0&&r!==null)x=r._nodes;else{x=new Map;for(let y=0;y<f.length;y++){let N=f[y],T=null,v=null;if(N&&typeof N=="object"){let k=N;N=k.replace,T=k.with,v=k.withKlass||null}if(typeof N!="function"||!N.prototype||!(N===cn||N.prototype instanceof cn)){let k="<unknown>";try{k=JSON.parse(fx)}catch(H){}q(365,String(y-f.length+(n.nodes?n.nodes.length:0)),typeof N=="function"?`${N.name}${typeof N.getType=="function"?` (type ${String(N.getType())})`:""}`:String(N),String(k))}el(N);let R=N.getType(),F=IC(N);x.set(R,{exportDOM:m&&m.export?m.export.get(N):void 0,klass:N,replace:T,replaceWithKlass:v,sharedNodeState:xx(f[y]),transforms:F})}}let C=new _s(l,i,x,{disableEvents:a,dom:{...La,...e&&e.dom},namespace:c,theme:s},g||console.error,p||hR,function(y,N){let T=new Map,v=new Set,R=(F)=>{Object.keys(F).forEach((k)=>{let H=T.get(k);H===void 0&&(H=[],T.set(k,H)),H.push(F[k])})};return y.forEach((F)=>{let k=F.klass.importDOM;if(k==null||v.has(k))return;v.add(k);let H=k.call(F.klass);H!==null&&R(H)}),N&&R(N),T}(x,m?m.import:void 0),_,e);return d!==void 0&&(C._pendingEditorState=d,C._dirtyType=2),function(y){y.registerCommand(jf,PA,ti),y.registerCommand(Yf,BA,ti),y.registerCommand(Vf,KA,ti),y.registerCommand(Xf,zA,ti),y.registerCommand(Qf,UA,ti)}(C),C}function vR(e,n){let r=e.get(n);e.delete(n),r&&r()}function pa(e,n,r){return e.set(n,r),vR.bind(null,e,n)}class _s{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,n,r,s,i,a,l,c,d){this._createEditorArgs=d,this._parentEditor=n,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Ta,this._updates=[],this._updating=!1,this._cascadeCount=0,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=s,this._nodes=r,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=UC(),this._onError=i,this._onWarn=a,this._htmlConversions=l,this._editable=c,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return pa(this._listeners.update,e)}registerEditableListener(e){return pa(this._listeners.editable,e)}registerDecoratorListener(e){return pa(this._listeners.decorator,e)}registerTextContentListener(e){return pa(this._listeners.textcontent,e)}registerRootListener(e){let n=this._listeners.root;return Lg(pa(n,e,e(this._rootElement,null)||void 0),()=>function(r,s,i){let a=r.get(s);a&&a(),r.set(s,s(...i)||void 0)}(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&q(35);let s=this._commands;s.has(e)||s.set(e,[new ei,new ei,new ei,new ei,new ei]);let i=s.get(e);i===void 0&&q(36,String(e));let a=function(c){return 7&c}(r),l=i[a];return a!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),i.every((c)=>c.size===0)&&s.delete(e)}}registerMutationListener(e,n,r){let s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(n);a===void 0&&(a=new Set,i.set(n,a)),a.add(s);let l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,s),()=>{a.delete(s),a.size===0&&i.delete(n)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return n===void 0&&q(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,s=kf(r).get(n.getType());if(!s)return;let i=new Map;for(let a of s.keys())i.set(a,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){let r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){let r=this.registerNodeTransformToKlass(e,n),s=[r],i=r.replaceWithKlass;if(i!=null){let a=this.registerNodeTransformToKlass(i,n);s.push(a)}return function(a,l){let c=kf(a.getEditorState()),d=[];for(let f of l){let g=c.get(f);g&&d.push(g)}if(d.length===0)return;a.update(()=>{for(let f of d)for(let g of f.keys()){let p=ot(g);p&&p.markDirty()}},a._pendingEditorState===null?{tag:uc}:void 0)}(this,s.map((a)=>a.klass.getType())),()=>{s.forEach((a)=>a.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...n){return ie(this,e,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=ci(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,kC(this,n,e,s,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||HA(n),r!=null&&n.classList.remove(...r)),e!==null){let i=xg(e),a=e.style;a.userSelect="text",a.whiteSpace="pre-wrap",a.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,mx(this),this._updateTags.add(uc),Or(this),this._config.disableEvents||function(l,c){let d=l.ownerDocument;Tf.set(l,d);let f=Cc.get(d);f===void 0&&(f={editors:new Set,hasShadowEditor:void 0},Cc.set(d,f)),f.editors.add(c),f.hasShadowEditor=void 0,l.__lexicalEditor=c;let g=Qx(l);g.push(FA.register(d));for(let p=0;p<Ef.length;p++){let[m,_]=Ef[p],x=typeof _=="function"?(C)=>{E_(C)||(bf(C),(c.isEditable()||m==="click")&&_(C,c))}:(C)=>{if(E_(C))return;bf(C);let y=c.isEditable();switch(m){case"cut":return y&&ie(c,tg,C);case"copy":return ie(c,eg,C);case"paste":return y&&ie(c,qf,C);case"dragstart":return y&&ie(c,zx,C);case"dragover":return y&&ie(c,Ux,C);case"dragend":return y&&ie(c,Hx,C);case"focus":return y&&ie(c,Gx,C);case"blur":return y&&ie(c,jx,C);case"drop":return y&&ie(c,Kx,C)}};g.push(ng(l,m,x))}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(uc),Or(this);Ca("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&q(38);let r=e;r._readOnly&&(r=MC(e),r._selection=e._selection?e._selection.clone():null),hx(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),Or(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Wn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[a,l]of r._nodeMap.entries())Y(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(e,n){return function(r,s,i){let a=ag(),l=Gt,c=yn,d=Ot,{_dirtyElements:f,_dirtyLeaves:g,_cloneNotNeeded:p,_dirtyType:m}=s;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Gt=a,yn=!1,Ot=s,cg(null);try{let _=s._nodes;Rc(r.root,_),i&&i(),a._readOnly=!0,a._parsed=!0}catch(_){_ instanceof Error&&s._onError(_)}finally{s._dirtyElements=f,s._dirtyLeaves=g,s._cloneNotNeeded=p,s._dirtyType=m,Gt=l,yn=c,Ot=d}return a}(typeof e=="string"?JSON.parse(e):e,this,n)}read(...e){let[n,r]=e.length===1?["force-commit",e[0]]:e;return n==="force-commit"&&Or(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(r,{editor:this})}update(e,n){(function(r,s,i){r._updating?r._updates.push([s,i]):Ia(r,s,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Wn(this,()=>{let s=ze(),i=Dn();s!==null?s.dirty||rn(s.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),xs("focus"),YC(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=qn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ca("editable",this,!0,e),this._slotsUsed&&this.update(()=>bC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=fx;var wf=null;function cg(e){wf=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),LC=1;function OR(){LC=1}function dg(e,n){let r=Kc(e,n);return r===void 0&&q(30,n),r}function Kc(e,n){return e._nodes.get(n)}var AR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function zc(e,n){let r=n!==void 0?n:(()=>{let a=e.getRootNode();return pi(a)||ar(a)?di(a):null})();if(!Ct(r))return!1;if(r.hasAttribute("data-lexical-slot"))return!1;let s=gg(r),i=r.nodeName;return og(s)&&(i==="INPUT"||i==="TEXTAREA"||r.contentEditable==="true"&&Ja(r)==null)}var RR=zc;function qa(e,n,r){let s=e.getRootElement();if(!s)return!1;try{if(!n||!s.contains(n)||!s.contains(r))return!1}catch(i){return!1}return fs(n)===e&&e.read("latest",()=>!zc(n))}function Uc(e){return e instanceof _s}function fs(e){let n=e;for(;n!=null;){let r=Ja(n);if(Uc(r))return r;n=Es(n)}return null}function Ja(e){return e?e.__lexicalEditor:null}function MR(e){return aA.test(e)?"rtl":lA.test(e)?"ltr":null}function Fa(e){return sg(e)||e.isToken()}function Gn(e){return Fa(e)||e.isSegmented()}function Co(e){return _i(e)&&e.nodeType===3}function pi(e){return _i(e)&&e.nodeType===9}function FC(e){let n=e;for(;n!=null;){if(Co(n))return n;n=n.firstChild}return null}function Dr(e,n,r){let s=Xt[n];if(r!==null&&(e&s)===(r&s))return e;let i=e^s;return n==="subscript"?i&=~Xt.superscript:n==="superscript"?i&=~Xt.subscript:n==="lowercase"?(i&=~Xt.uppercase,i&=~Xt.capitalize):n==="uppercase"?(i&=~Xt.lowercase,i&=~Xt.capitalize):n==="capitalize"&&(i&=~Xt.lowercase,i&=~Xt.uppercase),i}function DR(e){return te(e)||Lo(e)||qe(e)}function PC(e,n){let r=function(){let l=wf;return wf=null,l}();if((n=n||r&&r.__key)!=null)return void(e.__key=n);Wt(),TC();let s=Ve(),i=Bo(),a=""+LC++;i._nodeMap.set(a,e),Y(e)?s._dirtyElements.set(a,!0):s._dirtyLeaves.add(a),s._cloneNotNeeded.add(a),s._dirtyType===0&&(s._dirtyType=1),e.__key=a}function Un(e){Jt(e)!==null&&q(380,e.__key,String(Jt(e)));let n=e.getParent();if(n!==null){let r=e.getWritable(),s=n.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),l=a!==null?a.__key:null,c=i!==null?i.__key:null,d=i!==null?i.getWritable():null,f=a!==null?a.getWritable():null;i===null&&(s.__first=l),a===null&&(s.__last=c),d!==null&&(d.__next=l),f!==null&&(f.__prev=c),r.__prev=null,r.__next=null,r.__parent=null,s.__size--}}var $R=Un;function $c(e){TC(),Sc(e)&&q(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent!==null?n.__parent:$r(n)?n.__slotHost:null,s=Bo(),i=Ve(),a=s._nodeMap,l=i._dirtyElements;r!==null&&function(d,f,g){let p=d;for(;p!==null;){if(g.has(p))return;let m=f.get(p);if(m===void 0)break;g.set(p,!1),p=m.__parent!==null?m.__parent:$r(m)?m.__slotHost:null}}(r,a,l);let c=n.__key;i._dirtyType===0&&(i._dirtyType=1),Y(e)?l.set(c,!0):i._dirtyLeaves.add(c)}function Bt(e){Wt();let n=Ve(),r=n._compositionKey;if(e!==r){if(n._compositionKey=e,r!==null){let s=ot(r);s!==null&&s.getWritable()}if(e!==null){let s=ot(e);s!==null&&s.getWritable()}}}function Do(){if(Mr())return null;return Ve()._compositionKey}function ot(e,n){let r=(n||Bo())._nodeMap.get(e);return r===void 0?null:r}function fg(e,n){let r=hi(e,Ve());return r!==void 0?ot(r,n):null}function BC(e,n,r){e[`__lexicalKey_${n._key}`]=r}function hi(e,n){return e[`__lexicalKey_${n._key}`]}function gg(e,n){let r=e;for(;r!=null;){let s=fg(r,n);if(s!==null)return s;r=Es(r)}return null}function KC(e){let n=e._decorators,r=Object.assign({},n);return e._pendingDecorators=r,r}function V_(e){return e.read(()=>Dn().getTextContent())}function Dn(){return Bo()._nodeMap.get("root")}function rn(e){Wt();let n=Bo();e!==null&&(e.dirty=!0,e.setCachedNodes(null),ge(e)&&Ve()._slotsUsed&&_C(e)),n._selection=e}function X_(){Wt(),hx(Ve())}function oi(e){let n=function(r,s){let i=r;for(;i!=null;){let a=hi(i,s);if(a!==void 0)return a;i=Es(i)}return null}(e,Ve());return n===null?null:ot(n)}function zC(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pg(e){let n=[];for(let r=e;r!==null;r=r._parentEditor)n.push(r);return n}function UC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function HC(e){return Co(e)?e.nodeValue:null}function hg(e,n,r){let s=qn(Nn(n));if(s===null)return;let i=Vn(s,n._rootElement),a=i.anchorNode,{anchorOffset:l,focusOffset:c}=i;if(a!==null){let d=HC(a),f=gg(a);if(d!==null&&te(f)){if((d===Ea||d===zf)&&r){let g=r.length;d=r,l=g,c=g}d!==null&&mg(f,d,l,c,e)}}}function mg(e,n,r,s,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let l=a.isComposing();if(a.isToken()&&l)return;let c=n;if((l||i)&&(n.endsWith(Ea)&&(c=n.slice(0,-Ea.length)),i)){let f=zf,g;for(;(g=c.indexOf(f))!==-1;)c=c.slice(0,g)+c.slice(g+f.length),r!==null&&r>g&&(r=Math.max(g,r-f.length)),s!==null&&s>g&&(s=Math.max(g,s-f.length))}let d=a.getTextContent();if(i||c!==d){let f=ze();if(c===""){if(Bt(null),Ha||gs||Wa)a.remove();else{let C=Ve();lf(a,"",f),setTimeout(()=>{C.update(()=>{a.isAttached()&&a.getTextContent()===""&&a.remove()})},20)}return}let g=a.getParent(),p=Ns(),m=a.getTextContentSize(),_=Do(),x=a.getKey();if(a.isToken()&&!l||_!==null&&x===_&&!l||ge(p)&&(g!==null&&!g.canInsertTextBefore()&&p.anchor.offset===0||p.anchor.key===e.__key&&p.anchor.offset===0&&!a.canInsertTextBefore()&&!l||p.focus.key===e.__key&&p.focus.offset===m&&!a.canInsertTextAfter()&&!l))return void a.markDirty();if(!ge(f)||r===null||s===null)return void lf(a,c,f);if(f.setTextNodeRange(a,r,a,s),a.isSegmented()){let C=Cn(a.getTextContent());a.replace(C),a=C}lf(a,c,f)}}}function lf(e,n,r){if(e.setTextContent(n),ge(r)){let s=e.getKey(),i=!1;for(let a of["anchor","focus"]){let l=r[a];l.type==="text"&&l.key===s&&(l.offset=_o(e,l.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function sc(e,n,r){let s=n[r]||!1;return s==="any"||s===e[r]}function WC(e,n){return sc(e,n,"altKey")&&sc(e,n,"ctrlKey")&&sc(e,n,"shiftKey")&&sc(e,n,"metaKey")}function Qe(e,n,r){if(!WC(e,r))return!1;if(e.key.toLowerCase()===n.toLowerCase())return!0;if(n.length>1)return!1;if(e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(n))return e.code===`Digit${n}`;let s="Key"+n.toUpperCase();return e.code===s}var or={ctrlKey:!Kn,metaKey:Kn},q_={altKey:Kn,ctrlKey:!Kn};function J_(e){return e.key==="Backspace"}function wR(e){let n=Dn();if(ge(e)){let{anchor:r,focus:s}=e,i=r.getNode();if(Kt(i))return r.set(i.getKey(),0,"element"),s.set(i.getKey(),i.getChildrenSize(),"element"),ni(e),e;let a=i.getTopLevelElementOrThrow(),l=a.getParent();if(l===null)return Y(a)&&(r.set(a.getKey(),0,"element"),s.set(a.getKey(),a.getChildrenSize(),"element"),ni(e)),e;let c=l;return r.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),ni(e),e}{let r=n.select(0,n.getChildrenSize());return rn(ni(r)),r}}function ci(e,n){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let r=e.__lexicalClassNameCache,s=r[n];if(s!==void 0)return s;let i=e[n];if(typeof i=="string"){let a=ol(i);return r[n]=a,a}return i}function _g(e,n,r,s,i){if(r.size===0)return;let{__type:a,__key:l}=s,c=n.get(a);c===void 0&&q(33,a);let d=c.klass,f=e.get(d);f===void 0&&(f=new Map,e.set(d,f));let g=f.get(l),p=g==="destroyed"&&i==="created";(g===void 0||p)&&f.set(l,p?"updated":i)}function kR(e){let n=e.getType(),r=Bo();if(r._readOnly){let a=kf(r).get(n);return a?Array.from(a.values()):[]}let s=r._nodeMap,i=[];for(let[,a]of s)a instanceof e&&a.__type===n&&a.isAttached()&&i.push(a);return i}function Z_(e,n,r){let s=e.getParent(),i=r,a=e;return s!==null&&(n&&r===0?(i=a.getIndexWithinParent(),a=s):n||r!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=s)),a.getChildAtIndex(n?i-1:i)}function GC(e,n){let r=e.offset;if(e.type==="element")return Z_(e.getNode(),n,r);{let s=e.getNode();if(n&&r===0||!n&&r===s.getTextContentSize()){let i=n?s.getPreviousSibling():s.getNextSibling();return i===null?Z_(s.getParentOrThrow(),n,s.getIndexWithinParent()+(n?0:1)):i}}return null}function jC(e){let n=Nn(e).event,r=n&&n.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function ie(e,n,...r){return RC(e,n,r[0],e)}function ui(e,n){let r=e._keyToDOMMap.get(n);return r===void 0&&q(75,n),r}function Es(e){let n=e.assignedSlot||e.parentElement;if(n!==null)return n;let r=e.parentNode;return ar(r)?r.host:null}function Hc(e){return pi(e)?e:Ct(e)?e.ownerDocument:null}function IR(e){return Ve()._updateTags.has(e)}function xs(e){Wt(),Ve()._updateTags.add(e)}function YC(e){Wt(),Ve()._deferred.push(e)}function Pa(e,n){let r=e.getParent();for(;r!==null;){if(r.is(n))return!0;r=r.getParent()}return!1}function xg(e){let n=Hc(e);return n?n.defaultView:null}function Nn(e){let n=e._window;return n===null&&q(78),n}function VC(e){return Y(e)&&e.isInline()||qe(e)&&e.isInline()}function Cg(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null&&Y(n))return n;let r=n.getParentOrThrow();if(At(r))return r;n=r}return n}function yg(e){return Y(e)&&e.isShadowRoot()}function At(e){return Kt(e)||yg(e)}function Sg(e,n=!1){let r=e.constructor.clone(e,ug);return PC(r,null),r.afterCloneFrom(e),n||r.resetOnCopyNodeFrom(e),r}function Za(e){let n=Ve(),r=e.getType(),s=Kc(n,r);s===void 0&&q(200,e.constructor.name,r);let{replace:i,replaceWithKlass:a}=s;if(i!==null){let l=i(e),c=l.constructor;return a!==null?l instanceof a||q(201,a.name,a.getType(),c.name,c.getType(),e.constructor.name,r):l instanceof e.constructor&&c!==e.constructor||q(202,c.name,c.getType(),e.constructor.name,r),l.__key===e.__key&&q(203,e.constructor.name,r,c.name,c.getType()),l}return e}function cf(e,n){!Kt(e.getParent())||Y(n)||qe(n)||q(99)}function XC(e){let n=ot(e);return n===null&&q(63,e),n}function gc(e){if(!e||e.isInline())return!1;if(qe(e))return!0;if(Y(e)){if(e.isShadowRoot()){let n=e.getParent();return!(Y(n)&&n.isShadowRoot())}return!e.canBeEmpty()}return!1}function wc(e,n,r){r.style.removeProperty("caret-color"),n._blockCursorElement=null;let s=e.parentElement;s!==null&&s.removeChild(e)}function qn(e){return Xn?(e||window).getSelection():null}function qC(e){let n=xg(e);return n?n.getSelection():null}function ar(e){return ry(e)&&"host"in e}var LR=[];function JC(e){let n=e.getRootNode();if(n===e||!ar(n))return LR;let r=[n],s=n.host;for(;;){let i=s.getRootNode();if(i===s||!ar(i))break;r.push(i),s=i.host}return r}function*ZC(e){let n=[e],r;for(;r=n.pop();){yield*r.querySelectorAll('[data-lexical-editor="true"]');let s=(pi(r)?r:r.ownerDocument).createTreeWalker(r,NodeFilter.SHOW_ELEMENT),i;for(;i=s.nextNode();)i.shadowRoot&&n.push(i.shadowRoot)}}function QC(e){return e!==null?e.ownerDocument:document}function Sn(){let e=OC();return QC(e!==null?e._rootElement:null)}function mi(e,n){if(n===null||typeof e.getComposedRanges!="function")return null;let r=JC(n);if(r.length===0)return null;let s=e.getComposedRanges;try{let i=s.call(e,{shadowRoots:r})[0];if(i!==void 0)return i}catch(i){}try{let i=s.apply(e,r)[0];if(i!==void 0)return i}catch(i){}return null}function ey(e,n){let r=mi(e,n);if(r!==null){let s=ty(r);if(s!==null)return s}return e.rangeCount>0?e.getRangeAt(0):null}function Vn(e,n){let r=mi(e,n);return r===null?e:ny(r,oy(e))}function FR(e,n){let r=mi(e,n);if(r===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let s=ty(r)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ny(r,oy(e)),range:s}}function ty(e){let n=e.startContainer.ownerDocument;if(n===null)return null;let r=n.createRange();try{return r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset),r}catch(s){return null}}function ny(e,n){let{startContainer:r,startOffset:s,endContainer:i,endOffset:a}=e;return n==="backward"?{anchorNode:i,anchorOffset:a,direction:n,focusNode:r,focusOffset:s}:{anchorNode:r,anchorOffset:s,direction:n,focusNode:i,focusOffset:a}}function oy(e){return e.direction}function kc(e){let n=e.getRootNode();return pi(n)||ar(n)?n.activeElement:null}function di(e){let n=e.activeElement;for(;n!==null&&n.shadowRoot!==null;){let r=n.shadowRoot.activeElement;if(r===null)break;n=r}return n}function Ng(e){let n=e.target;if(n!==null&&Ct(n)&&n.shadowRoot!==null&&typeof e.composedPath=="function"){let r=e.composedPath();if(r.length>0)return r[0]}return n}function PR(e,n){let r=e.getChildAtIndex(n);r==null&&(r=e),At(e)&&q(102);let s=(l)=>{let c=l.getParentOrThrow(),d=At(c),f=l!==r||d?Sg(l):l;if(d)return Y(l)&&Y(f)||q(133),l.insertAfter(f),[l,f,f];{let[g,p,m]=s(c),_=l.getNextSiblings();return m.append(f,..._),[g,p,f]}},[i,a]=s(r);return[i,a]}function BR(e){return Ct(e)&&e.tagName==="A"}function KR(e){return Ct(e)&&e.tagName==="TR"}function zR(e){return Ct(e)&&(e.tagName==="TD"||e.tagName==="TH")}function Ct(e){return _i(e)&&e.nodeType===1}function _i(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ry(e){return _i(e)&&e.nodeType===11}var UR=/^(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;function sy(e){return!(!Ct(e)||!e.style.display.startsWith("inline"))||UR.test(e.nodeName)}var HR=/^(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;function Eg(e){return(!Ct(e)||!e.style.display.startsWith("inline"))&&HR.test(e.nodeName)}function xn(e){if(qe(e)&&!e.isInline())return!0;if(!Y(e)||At(e))return!1;let n=e.getFirstChild(),r=n===null||Lo(n)||te(n)||n.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function yo(){return Ve()}function Tg(e=yo()){return e._config.dom||La}function $n(e,n,r=yo()){let s=Tg(r).$getDOMSlot(e,n,r);return Y(e)&&(iy(s)||q(344,e.getKey(),e.getType())),s}function WR(e,n,r,s){let i=e.read("latest",()=>{let a=ot(n);return a!==null?function(l,c,d=yo()){let f=wr(l,c);if(f===null)return null;let g=d.getElementByKey(f.getKey());return g!==null?g.parentElement:null}(a,r,e):null});return i!==null&&(i.parentElement!==s&&s.appendChild(i),i.style.display=""),i}function GR(e,n,r){r.style.display="none";let s=e.getElementByKey(n);s!==null&&r.parentElement!==s&&s.insertBefore(r,s.firstChild)}function iy(e){return e instanceof ii}function ir(e,n,r=yo()){return FC($n(e,n,r).element)}var Q_=new WeakMap,jR=new Map;function kf(e){if(!e._readOnly&&e.isEmpty())return jR;e._readOnly||q(192);let n=Q_.get(e);return n||(n=function(r){let s=new Map;for(let[i,a]of r._nodeMap){let l=a.__type,c=s.get(l);c||(c=new Map,s.set(l,c)),c.set(i,a)}return s}(e),Q_.set(e,n)),n}function bg(e){let n=e.constructor.clone(e,ug);return n.afterCloneFrom(e),n}function YR(e){return(n=bg(e))[eC]=!0,n;var n}function ay(e,n){let r=e.getAttribute("data-lexical-indent");if(r!==null){let a=parseInt(r,10);if(Number.isFinite(a)&&a>=0)return void n.setIndent(a)}let s=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(s/40);n.setIndent(i)}function ly(e,n){let r=n.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function cy(e,n){let r=n.style.textAlign;return r&&r in pc?e.setFormat(r):e}function uy(e,n){e.__lexicalUnmanaged=!0,n&&n.captureSelection!==void 0&&(e.__lexicalCapturedSelection=n.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function dy(e,n=yo()){let r=n.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=n:delete e.__lexicalEditor}function Ba(e,n){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(Ct(r)&&r.hasAttribute("data-lexical-slot"))return!1;if(hi(r,n)!==void 0)return!1;r=Es(r)}return!1}function ha(e,n){return function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}(e,n)&&e[n]!==cn[n]}var ex=new WeakMap,tx=Symbol("lexical.synthesizedGetType");function el(e){let n=ex.get(e);if(n)return n;let r=e.prototype!=null&&e_ in e.prototype?e.prototype[e_]():void 0,s=function(f){if(!(f===cn||f.prototype instanceof cn)){let g="<unknown>",p="<unknown>";try{g=f.getType()}catch(m){}try{_s.version&&(p=JSON.parse(_s.version))}catch(m){}q(290,f.name,g,p)}return f===Pc||f===Io||f===cn}(e),i=!s&&ha(e,"getType")?e.getType:void 0,a=i&&!(tx in i)?i.call(e):void 0,l,c=a;if(r)if(a)l=r[a];else{for(let[f,g]of Object.entries(r))c=f,l=g;if(!l)for(let f of Object.getOwnPropertySymbols(r)){let g=r[f];if(g){l=g;break}}}if(!s&&c){if(!ha(e,"getType")){let f=e,g=function(){return this!==f?cn.getType.call(this):c};g[tx]=!0,e.getType=g}if(ha(e,"clone")||(e.clone=(f,g)=>{cg(f);let p=new e;return g!==ug&&p.afterCloneFrom(f),p}),ha(e,"importJSON")||(e.importJSON=l&&l.$importJSON||((f)=>new e().updateFromJSON(f))),!ha(e,"importDOM")&&l){let{importDOM:f}=l;f&&(e.importDOM=()=>f)}}let d={klass:e,ownNodeConfig:l,ownNodeType:c};return ex.set(e,d),d}function*tl(e){for(let n=e;n&&(n===cn||og(n.prototype));){let r=el(n);yield r,n=r.ownNodeConfig&&r.ownNodeConfig.extends||fy(n)}}function VR(e){let n=new Map,r=new Map;for(let s of e){let{ownNodeType:i}=el(s);i&&(r.set(i,s),n.set(i,new Set))}for(let[s,i]of r)for(let{ownNodeType:a}of tl(i)){let l=a&&n.get(a);l&&l.add(s)}return n}function XR(e){let n=yo();return Wt(),new(n.resolveRegisteredNodeAfterReplacements(n.getRegisteredNode(e))).klass}var br=(e,n)=>{let r=e;for(;r!=null&&!Kt(r);){if(n(r))return r;r=r.getParent()}return null};function Ka(e,n){let r=[],s=e.__first;for(;s!==null;){let i=n===null?ot(s):n.get(s);i==null&&q(174),r.push(s),s=i.__next}return r}function fy(e){let n=Object.getPrototypeOf(e);if(typeof n=="function"&&n!==Function.prototype)return n;let r=e.prototype&&Object.getPrototypeOf(e.prototype);return r?r.constructor:null}var gy=new Map;function $o(e){return Y(e)||qe(e)}function $r(e){return Y(e)||qe(e)}function Jt(e){let n=e.getLatest();return $r(n)?n.__slotHost:null}function Hn(e){let n=Jt(e);if(n===null)return null;let r=ot(n);return Y(r)||qe(r)||q(370),r}function py(e){let n=Hn(e);if(n===null)return null;let r=e.getLatest().__key;for(let[s,i]of Wc(n))if(i===r)return s;return null}function hy(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null)return n;n=n.getParent()}return null}function Wc(e){let n=e.getLatest();return $o(n)&&n.__slots!==null?n.__slots:gy}function jn(e){return Array.from(Wc(e).keys())}function wr(e,n){let r=Wc(e).get(n);return r===void 0?null:ot(r)}var qR=["__proto__","constructor","prototype"],nx=Symbol("slotMapOwner");function If(e){let n=e.__slots;return n!==null&&n[nx]===e||(n=new Map(n),n[nx]=e,e.__slots=n),n}var ox=new WeakMap,JR=[];function my(e){for(let{ownNodeConfig:n}of tl(e)){let r=n&&n.slots;if(r)return r}return JR}function _y(e){let n="";for(let r of jn(e)){let s=wr(e,r);s!==null&&(n+=s.getTextContent())}return n}function rx(e,n,r){let s=r.get(e),i=r.get(n);return s!==void 0?i!==void 0?s-i:-1:i!==void 0?1:e<n?-1:e>n?1:0}function ZR(e){let n=e.__slots;if(n===null||n.size<2)return;let r=function(l){let c=ox.get(l);if(c===void 0){let d=my(l),f=new Map;for(let g of d)qR.includes(g)&&q(371,l.name,g),f.has(g)&&q(372,l.name,g),f.set(g,f.size);c=f,ox.set(l,c)}return c}(e.constructor),s=null,i=!0;for(let l of n.keys()){if(s!==null&&rx(s,l,r)>0){i=!1;break}s=l}if(i)return;let a=Array.from(n).sort(([l],[c])=>rx(l,c,r));n.clear();for(let[l,c]of a)n.set(l,c)}function Og(e,n,r){n!=="__proto__"&&n!=="constructor"&&n!=="prototype"||q(373,n);let s=e.getLatest();if(s.__slots!==null&&s.__slots.get(n)===r.getLatest().__key)return s;(!Y(r)&&!qe(r)||r.isInline())&&q(374,r.__key);let i=e.getWritable(),a=If(i),l=a.get(n);l!==void 0&&Cy(l);let c=r.getWritable(),d=Hn(c);if(d!==null){let f=py(c);f!==null&&If(d.getWritable()).delete(f),c.__slotHost=null}return Un(c),c.__slotHost=i.__key,a.set(n,c.__key),ZR(i),function(){let f=yo();f._slotsUsed=!0,f._pendingEditorState&&(f._pendingEditorState._slotsUsed=!0)}(),i}function xy(e,n){let r=e.getWritable();if(r.__slots===null)return r;let s=r.__slots.get(n);return s!==void 0&&(Cy(s),If(r).delete(n)),r}function sx(e,n){}function Cy(e){let n=ot(e);if(n===null)return;let r=n.getWritable();$r(r)||q(377,e),r.__slotHost=null,r.remove()}var QR={next:"previous",previous:"next"};class nl{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:kr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return St(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return St(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){let s=r===this.direction?n:Array.from(n).reverse(),i=this,a=this.getParentAtCaret(),l=new Map;for(let c=i.getAdjacentCaret();c!==null&&l.size<e;c=c.getAdjacentCaret()){let d=c.origin.getWritable();l.set(d.getKey(),d)}for(let c of s){if(l.size>0){let d=i.getNodeAtCaret();if(d)if(l.delete(d.getKey()),l.delete(c.getKey()),d.is(c)||i.origin.is(c));else{let f=c.getParent();f&&f.is(a)&&c.remove(),d.replace(c)}else d===null&&q(263,Array.from(l).join(" "))}else i.insert(c);i=St(c,this.direction)}for(let c of l.values())c.remove();return this}}class za extends nl{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:cr(e,this.direction)}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||cr(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof za&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var eM={root:Kt,shadowRoot:At};function Pr(e){return QR[e]}function Ag(e,n="root"){return e===null||eM[n](e)?null:Jt(e)===null?e:null}class Cs extends nl{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:St(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Y(this.origin)?cr(this.origin,this.direction):null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pr(this.direction);return St(this.getNodeAtCaret(),e)||cr(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Cs&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ys extends nl{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ir(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return St(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ir(this.origin,Pr(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ys&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Cs||e instanceof ys)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return St(this.origin,this.direction)}}function mo(e){return e instanceof ys}function tM(e){return e instanceof nl}function kr(e){return e instanceof Cs}function Yn(e){return e instanceof za}var nM={next:class extends ys{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ys{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},oM={next:class extends Cs{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Cs{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rM={next:class extends za{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends za{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function St(e,n){return e?new oM[n](e):null}function Ir(e,n,r){return e?new nM[n](e,_o(e,r)):null}function _o(e,n,r="error"){let s=e.getTextContentSize(),i=n==="next"?s:n==="previous"?0:n;return(i<0||i>s)&&(r!=="clamp"&&lx(284,String(n),String(s),e.getKey()),i=i<0?0:s),i}function Lf(e,n){return new Mg(e,n)}function cr(e,n){return Y(e)?new rM[n](e):null}function yy(e){return e&&e.getChildCaret()||e}function fi(e){return e&&yy(e.getAdjacentCaret())}class Rg{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){let e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new Rg(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=(s)=>{let i=this[s].getLatest();return mo(i)?function(a,l){let{direction:c,origin:d}=a,f=_o(d,l==="focus"?Pr(c):c);return Lf(a,f-a.offset)}(i,s):null},n=e("anchor"),r=e("focus");if(n&&r){let{caret:s}=n,{caret:i}=r;if(s.isSameNodeCaret(i))return[Lf(s,i.offset-s.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=mo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=mo(r),i=(a)=>a.isSameNodeCaret(r)?null:fi(a)||a.getParentCaret(e);return $g({hasNext:(a)=>a!==null&&!(s&&r.isSameNodeCaret(a)),initial:n.isSameNodeCaret(r)?null:i(n),map:(a)=>a,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Mg{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){let{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){let[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:n}}=this,[r,s]=this.getSliceIndices(),i=e.getTextContent();return Ir(e.setTextContent(i.slice(0,r)+i.slice(s)),n,r)}}function sM(e){return e instanceof Mg}function Dg(e){return Lr(e,St(Dn(),e.direction))}function Sy(e){return Lr(e,e)}function Lr(e,n){return e.direction!==n.direction&&q(265),new Rg(e,n,e.direction)}function $g(e){let{initial:n,hasNext:r,step:s,map:i}=e,a=n;return{[Symbol.iterator](){return this},next(){if(!r(a))return{done:!0,value:void 0};let l={done:!1,value:i(a)};return a=s(a),l}}}function wg(e,n){let r=Ic(e.origin,n.origin);switch(r===null&&q(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{let s=e.type==="text",i=n.type==="text";return s&&i?function(a,l){return Math.sign(a-l)}(e.offset,n.offset):e.type===n.type?0:s?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return n.type==="child"?1:-1;case"branch":return kg(r)}}function kg(e){let{a:n,b:r}=e,s=n.__key,i=r.__key,a=n,l=r;for(;a&&l;a=a.getNextSibling(),l=l.getNextSibling()){if(a.__key===i)return-1;if(l.__key===s)return 1}return a===null?1:-1}function ic(e,n){return n.is(e)}function ix(e){return Y(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ic(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[s,i]=ix(e);s;i=s,s=s.getParent())r.set(s,i);for(let[s,i]=ix(n);s;i=s,s=s.getParent()){let a=r.get(s);if(a!==void 0)return a===null?(ic(e,s)||q(276),{commonAncestor:s,type:"ancestor"}):i===null?(ic(n,s)||q(277),{commonAncestor:s,type:"descendant"}):((Y(a)||ic(e,a))&&(Y(i)||ic(n,i))&&s.is(a.getParent())&&s.is(i.getParent())||q(278),{a,b:i,commonAncestor:s,type:"branch"})}return null}function Fr(e,n){let{type:r,key:s,offset:i}=e,a=XC(e.key);return r==="text"?(te(a)||q(266,a.getType(),s),Ir(a,n,i)):(Y(a)||q(267,a.getType(),s),by(a,e.offset,n))}function Ua(e,n){let{origin:r,direction:s}=n,i=s==="next";mo(n)?e.set(r.getKey(),n.offset,"text"):kr(n)?te(r)?e.set(r.getKey(),_o(r,s),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(Yn(n)&&Y(r)||q(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function Ny(e){let n=ze(),r=ge(n)?n:SC();return ya(r,e),rn(r),r}function ya(e,n){Ua(e.anchor,n.anchor),Ua(e.focus,n.focus)}function Ff(e){let{anchor:n,focus:r}=e,s=Fr(n,"next"),i=Fr(r,"next"),a=wg(s,i)<=0?"next":"previous";return Lr(Fo(s,a),Fo(i,a))}function Ts(e){let{direction:n,origin:r}=e,s=St(r,Pr(n)).getNodeAtCaret();return s?St(s,n):cr(r.getParentOrThrow(),n)}function ax(e,n="root"){let r=[e];for(let s=Yn(e)?e.getParentCaret(n):e.getSiblingCaret();s!==null;s=s.getParentCaret(n))r.push(Ts(s));return r}function uf(e){return!!e&&e.origin.isAttached()}function Ey(e,n="removeEmptySlices"){if(e.isCollapsed())return e;let r="root",s="next",i=n,a=Ig(e,s),l=ax(a.anchor,r),c=ax(a.focus.getFlipped(),r),d=new Set,f=[];for(let C of a.iterNodeCarets(r))if(Yn(C))d.add(C.origin.getKey());else if(kr(C)){let{origin:y}=C;Y(y)&&!d.has(y.getKey())||f.push(y)}let g=new Set;for(let C of f){let y=C.getParent();y===null||d.has(y.getKey())||g.add(y),Un(C)}for(let C of g)!C.canBeEmpty()&&!At(C)&&C.isEmpty()&&C.isAttached()&&C.remove();for(let C of a.getTextSlices()){if(!C)continue;let{origin:y}=C.caret,N=y.getTextContentSize(),T=Ts(St(y,s)),v=y.getMode();if(Math.abs(C.distance)===N&&i==="removeEmptySlices"||v==="token"&&C.distance!==0)T.remove();else if(C.distance!==0){i="removeEmptySlices";let R=C.removeTextSlice(),F=C.caret.origin;if(v==="segmented"){let k=R.origin,H=Cn(k.getTextContent()).setStyle(k.getStyle()).setFormat(k.getFormat());T.replaceOrInsert(H),R=Ir(H,s,R.offset)}F.is(l[0].origin)&&(l[0]=R),F.is(c[0].origin)&&(c[0]=R.getFlipped())}}let p,m;for(let C of l)if(uf(C)){p=wo(C);break}for(let C of c)if(uf(C)){m=wo(C);break}let _=function(C,y,N){if(!C||!y)return null;let T=C.getParentAtCaret(),v=y.getParentAtCaret();if(!T||!v)return null;let R=T.getParents().reverse();R.push(T);let F=v.getParents().reverse();F.push(v);let k=Math.min(R.length,F.length),H;for(H=0;H<k&&R[H]===F[H];H++);let U=(G,ne)=>{let ee;for(let se=H;se<G.length;se++){let V=G[se];if(At(V))return;!ee&&ne(V)&&(ee=V)}return ee},W=U(R,xn),J=W&&U(F,(G)=>N.has(G.getKey())&&xn(G));if(J&&jn(J).length>0)return null;return W&&J?[W,J]:null}(p,m,d);if(_){let[C,y]=_;cr(C,"previous").splice(0,y.getChildren());let N=y.getParent();for(y.remove(!0);N&&N.isEmpty();){let T=N;N=N.getParent(),T.remove(!0)}}else if(m){let C=function(T){if(Yn(T)){let v=T.origin;if(xn(v))return v}else{let v=T.getParentAtCaret();if(v&&xn(v))return v}return null}(m),y=C&&C.getParent(),N=C&&C.getParents().findLast(yg);if(C&&y&&!Kt(y)&&C.isEmpty()&&d.has(C.getKey())&&jn(C).length===0&&(!N||d.has(N.getKey()))){C.remove(!0);let T=y;for(;T&&!Kt(T)&&T.isEmpty();){let v=T.getParent();if(v&&Kt(v)&&v.getChildrenSize()<=1)break;let R=T;T=v,R.remove(!0)}}}let x=[p,m,...l,...c].find(uf);if(x)return Sy(Fo(wo(x),e.direction));q(269,JSON.stringify(l.map((C)=>C.origin.__key)))}function wo(e){let n=function(i){let a=i;for(;Yn(a);){let l=fi(a);if(!Yn(l))break;a=l}return a}(e.getLatest()),{direction:r}=n;if(te(n.origin))return mo(n)?n:Ir(n.origin,r,r);let s=n.getAdjacentCaret();return kr(s)&&te(s.origin)?Ir(s.origin,r,Pr(r)):n}function Ty(e){return mo(e)&&e.offset!==_o(e.origin,e.direction)}function Fo(e,n){return e.direction===n?e:e.getFlipped()}function Ig(e,n){return e.direction===n?e:Lr(Fo(e.focus,n),Fo(e.anchor,n))}function by(e,n,r){let s=cr(e,"next");for(let i=0;i<n;i++){let a=s.getAdjacentCaret();if(a===null)break;s=a}return Fo(s,r)}function iM(e,n="root"){let r=0,s=e,i=fi(s);for(;i===null;){if(r--,i=s.getParentCaret(n),!i)return null;s=i,i=fi(s)}return i&&[i,r]}function aM(e){let{origin:n,offset:r,direction:s}=e;if(r===_o(n,s))return e.getSiblingCaret();if(r===_o(n,Pr(s)))return Ts(e.getSiblingCaret());let[i]=n.splitText(r);return te(i)||q(281),Fo(St(i,"next"),s)}function lM(e,n){return!0}function vy(e,{$copyElementNode:n=Sg,$splitTextPointCaretNext:r=aM,rootMode:s="shadowRoot",$shouldSplit:i=lM,removeEmptyDestination:a=!1}={}){if(mo(e))return r(e);let l=e.getParentCaret(s);if(l){let{origin:c}=l;if(Yn(e)){let f=Ts(l);if(a&&c.isEmpty())return c.remove(),f;if(!c.canBeEmpty()||!i(c,"first"))return f}let d=function(f){let g=[];for(let p=f.getAdjacentCaret();p;p=p.getAdjacentCaret())g.push(p.origin);return g}(e);(d.length>0||!a&&c.canBeEmpty()&&i(c,"last"))&&l.insert(n(c).splice(0,0,d))}return l}function Oy(e,n,r){let s=Fo(n,"next");mo(s)&&(s.offset===0?s=St(s.origin,"previous").getFlipped():s.offset===s.origin.getTextContentSize()&&(s=St(s.origin,"next"))),s.origin.is(e)&&(kr(s)||q(342,e.getKey(),e.getType()),s=Ts(s)),(e.is(s.getNodeAtCaret())||e.is(s.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=s;i;i=vy(i,r))s=i;return mo(s)&&q(283),s.insert(e.isInline()?Mn().append(e):e),Fo(St(e.getLatest(),"next"),n.direction)}function cM(e){return e}function uM(...e){return e}function dM(e,n){return[e,n]}function fM(e){return e}function gM(e,n){if(!n||e===n)return e;for(let r in n)if(e[r]!==n[r])return{...e,...n};return e}function ol(...e){let n=[];for(let r of e)if(r&&typeof r=="string")for(let[s]of r.matchAll(/\S+/g))n.push(s);return n}function pM(e,...n){let r=ol(...n);r.length>0&&e.classList.add(...r)}function hM(e,...n){let r=ol(...n);r.length>0&&e.classList.remove(...r)}function Lg(...e){return()=>{for(let n=e.length-1;n>=0;n--)e[n]();e.length=0}}function mM(e,n,r){return Lg(...Object.entries(n).map(([s,i])=>ng(e,s,i,r)))}var M=Fg,{$addUpdateTag:rl,$applyNodeReplacement:un,$assumeActiveEditor:Ay,$caretFromPoint:dn,$caretRangeFromSelection:ur,$cloneWithProperties:Gc,$cloneWithPropertiesEphemeral:Ry,$comparePointCaretNext:Br,$copyNode:jt,$create:jc,$createChildrenArray:V1,$createLineBreakNode:fn,$createNodeSelection:Yc,$createParagraphNode:Se,$createPoint:Jn,$createRangeSelection:Kr,$createRangeSelectionFromDom:My,$createTabNode:gn,$createTextNode:yt,$extendCaretToRange:bs,$findMatchingParent:he,$formatText:Dy,$fullReconcile:xi,$generateNodesFromRawText:sl,$getAdjacentChildCaret:il,$getAdjacentNode:X1,$getAdjacentSiblingOrParentSiblingCaret:vs,$getCaretInDirection:$y,$getCaretRange:Zn,$getCaretRangeInDirection:dr,$getCharacterOffsets:wy,$getChildCaret:bt,$getChildCaretAtIndex:Bg,$getChildCaretOrSelf:Kg,$getCollapsedCaretRange:Os,$getCommonAncestor:q1,$getCommonAncestorResultBranchOrder:J1,$getDOMSlot:ky,$getDOMTextNode:Iy,$getDocument:Xe,$getEditor:Ge,$getEditorDOMRenderConfig:zg,$getNearestNodeFromDOMNode:vt,$getNearestRootOrShadowRoot:Z1,$getNodeByKey:Rt,$getNodeByKeyOrThrow:Ly,$getNodeFromDOMNode:Fy,$getPreviousSelection:En,$getRoot:Je,$getSelection:X,$getSiblingCaret:it,$getSlot:Ci,$getSlotFrame:Qn,$getSlotHost:Vc,$getSlotNameWithinHost:Q1,$getSlotNames:As,$getState:Ko,$getStateChange:eL,$getTextContent:tL,$getTextNodeOffset:nL,$getTextPointCaret:Xc,$getTextPointCaretSlice:oL,$getWritableNodeState:rL,$hasAncestor:al,$hasUpdateTag:sL,$insertNodeToNearestRootAtCaret:zr,$insertNodes:qc,$isBlockElementNode:Ur,$isChildCaret:zo,$isDecoratorNode:wt,$isEditorState:Py,$isElementDOMSlot:iL,$isElementNode:Q,$isExtendableTextPointCaret:ll,$isInlineElementOrDecoratorNode:Ug,$isInlineFormattable:aL,$isLeafNode:cl,$isLexicalNode:Hg,$isLineBreakNode:Ue,$isNodeCaret:lL,$isNodeSelection:Ze,$isParagraphNode:wn,$isRangeSelection:j,$isRootNode:So,$isRootOrShadowRoot:Mt,$isSelectionCapturedInDecoratorInput:By,$isShadowRootNode:Jc,$isSiblingCaret:No,$isSlotChild:cL,$isSlotHost:ul,$isTabNode:Yt,$isTextNode:re,$isTextPointCaret:Hr,$isTextPointCaretSlice:uL,$isTokenOrSegmented:Wg,$isTokenOrTab:dL,$markSlotEditable:fL,$needsBlockCursorBeside:Ky,$nodesOfType:gL,$normalizeCaret:kt,$normalizeSelection__EXPERIMENTAL:Uo,$onUpdate:zy,$parseSerializedNode:Uy,$removeFromParent:pL,$removeSlot:hL,$removeTextFromCaretRange:Hy,$rewindSiblingCaret:Ho,$selectAll:Wr,$setCompositionKey:mL,$setDirectionFromDOM:Tn,$setFormatFromDOM:eo,$setPointFromCaret:Wo,$setSelection:mt,$setSelectionFromCaretRange:kn,$setSlot:_L,$setState:to,$setTextFormat:Wy,$splitAtPointCaretNext:Zc,$splitNode:Gy,$updateDOMSelection:jy,$updateRangeSelectionFromCaretRange:xL,ArtificialNode__DO_NOT_USE:dl,BEFORE_INPUT_COMMAND:CL,BLUR_COMMAND:yL,CAN_REDO_COMMAND:Ms,CAN_UNDO_COMMAND:Ds,CAN_USE_BEFORE_INPUT:fl,CAN_USE_DOM:pn,CLEAR_EDITOR_COMMAND:Qc,CLEAR_HISTORY_COMMAND:Yy,CLICK_COMMAND:yi,COLLABORATION_TAG:Vy,COMMAND_PRIORITY_BEFORE_CRITICAL:Xy,COMMAND_PRIORITY_BEFORE_EDITOR:eu,COMMAND_PRIORITY_BEFORE_HIGH:SL,COMMAND_PRIORITY_BEFORE_LOW:NL,COMMAND_PRIORITY_BEFORE_NORMAL:EL,COMMAND_PRIORITY_CRITICAL:Si,COMMAND_PRIORITY_EDITOR:Te,COMMAND_PRIORITY_HIGH:In,COMMAND_PRIORITY_LOW:Pe,COMMAND_PRIORITY_NORMAL:TL,COMPOSITION_END_COMMAND:bL,COMPOSITION_END_TAG:tu,COMPOSITION_START_COMMAND:qy,COMPOSITION_START_TAG:nu,CONTROLLED_TEXT_INSERTION_COMMAND:ou,COPY_COMMAND:Ni,CUT_COMMAND:ru,CUT_TAG:su,DEFAULT_EDITOR_DOM_CONFIG:Gg,DELETE_CHARACTER_COMMAND:Ei,DELETE_LINE_COMMAND:iu,DELETE_WORD_COMMAND:au,DRAGEND_COMMAND:vL,DRAGOVER_COMMAND:Jy,DRAGSTART_COMMAND:Zy,DROP_COMMAND:Qy,DecoratorNode:lu,ElementNode:ct,FOCUS_COMMAND:eS,FORMAT_ELEMENT_COMMAND:cu,FORMAT_TEXT_COMMAND:Go,HISTORIC_TAG:Ti,HISTORY_MERGE_TAG:Gr,HISTORY_PUSH_TAG:uu,INDENT_CONTENT_COMMAND:no,INPUT_COMMAND:OL,INSERT_LINE_BREAK_COMMAND:jg,INSERT_PARAGRAPH_COMMAND:jr,INSERT_TAB_COMMAND:$s,INTERNAL_$isBlock:gl,IS_ALL_FORMATTING:AL,IS_ANDROID:tS,IS_ANDROID_CHROME:nS,IS_APPLE:pl,IS_APPLE_WEBKIT:du,IS_BOLD:hl,IS_CHROME:oS,IS_CODE:rS,IS_FIREFOX:ws,IS_HIGHLIGHT:sS,IS_IOS:ml,IS_ITALIC:_l,IS_SAFARI:fu,IS_STRIKETHROUGH:xl,IS_SUBSCRIPT:gu,IS_SUPERSCRIPT:pu,IS_UNDERLINE:Cl,KEY_ARROW_DOWN_COMMAND:jo,KEY_ARROW_LEFT_COMMAND:Yr,KEY_ARROW_RIGHT_COMMAND:bi,KEY_ARROW_UP_COMMAND:oo,KEY_BACKSPACE_COMMAND:vi,KEY_DELETE_COMMAND:hu,KEY_DOWN_COMMAND:RL,KEY_ENTER_COMMAND:Oi,KEY_ESCAPE_COMMAND:Ai,KEY_MODIFIER_COMMAND:ML,KEY_SPACE_COMMAND:mu,KEY_TAB_COMMAND:Vr,LineBreakNode:iS,MOVE_TO_END:yl,MOVE_TO_START:Ri,NODE_STATE_DIRECT:DL,NODE_STATE_KEY:$L,NODE_STATE_LATEST:wL,OUTDENT_CONTENT_COMMAND:Yo,PASTE_COMMAND:Mi,PASTE_TAG:_u,ParagraphNode:aS,REDO_COMMAND:xu,REMOVE_TEXT_COMMAND:lS,RootNode:Cu,SELECTION_CHANGE_COMMAND:ro,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:yu,SELECT_ALL_COMMAND:Di,SET_TEXT_FORMAT_COMMAND:cS,SKIP_COLLAB_TAG:kL,SKIP_DOM_SELECTION_TAG:uS,SKIP_SCROLL_INTO_VIEW_TAG:dS,SKIP_SELECTION_FOCUS_TAG:Su,TEXT_TYPE_TO_FORMAT:$i,TabNode:Nu,TextNode:Ln,UNDO_COMMAND:Eu,addClassNamesToElement:et,buildImportMap:Yg,configExtension:sn,createCommand:bn,createEditor:Tu,createRefCountedRegistry:IL,createSharedNodeState:LL,createState:Vo,declarePeerDependency:fS,defineExtension:_e,findAllLexicalElementsDeep:gS,flipDirection:pS,getActiveElement:Eo,getActiveElementDeep:hS,getComposedEventTarget:Sl,getComposedStaticRange:FL,getDOMOwnerDocument:PL,getDOMSelection:Fn,getDOMSelectionFromTarget:BL,getDOMSelectionPoints:ks,getDOMSelectionRange:mS,getDOMSelectionRangeAndPoints:KL,getDOMShadowRoots:_S,getDOMTextNode:xS,getDeclaredSlots:zL,getEditorPropertyFromDOMNode:bu,getNearestEditorFromDOMNode:vu,getParentElement:Nl,getRegisteredNode:UL,getRegisteredNodeOrThrow:HL,getRegisteredSubtypeMap:Ou,getRootOwnerDocument:Is,getStaticNodeConfig:CS,getStyleObjectFromCSS:Xr,getTextDirection:yS,getTransformSetFromKlass:WL,isBlockDomNode:Ls,isCurrentlyReadOnlyMode:SS,isDOMCapturingSelection:GL,isDOMDocumentNode:qr,isDOMNode:io,isDOMShadowRoot:Au,isDOMTextNode:Fs,isDOMUnmanaged:jL,isDocumentFragment:Vg,isExactShortcutMatch:NS,isHTMLAnchorElement:wi,isHTMLElement:ye,isHTMLTableCellElement:YL,isHTMLTableRowElement:ES,isInlineDomNode:ki,isLastChildInBlockNode:TS,isLexicalEditor:Ru,isModifierMatch:VL,isOnlyChildInBlockNode:bS,isSelectionCapturedInDecoratorInput:XL,isSelectionWithinEditor:vS,iterStaticNodeConfigChain:OS,makeStepwiseIterator:Xg,mergeRegister:De,mountSlotContainer:qL,normalizeClassNames:Ii,registerEventListener:ao,registerEventListeners:Jr,removeClassNamesFromElement:an,removeFromParent:JL,resetRandomKey:ZL,safeCast:We,setDOMStyleFromCSS:fr,setDOMStyleObject:QL,setDOMUnmanaged:Mu,setNodeIndentFromDOM:Zr,shallowMergeConfig:zt,stopLexicalPropagation:qg,toggleTextFormatType:Jg,tokenizeRawText:Li,unmountSlotContainer:eF}=M;var Zg={};Oe(Zg,{LexicalComposer:()=>xM});S();var _M=pn?He:h,Du={tag:Gr};function xM({initialConfig:e,children:n}){let r=D(()=>{let{theme:s,namespace:i,nodes:a,onError:l,onWarn:c,editorState:d,html:f}=e,g=Qm(null,s),p=Tu({editable:e.editable,html:f,namespace:i,nodes:a,onError:(m)=>l(m,p),...c?{onWarn:(m)=>c(m,p)}:{},theme:s});return function(m,_){if(_===null)return;if(_===void 0)m.update(()=>{let x=Je();if(x.isEmpty()){let C=Se();x.append(C);let y=m.getRootElement(),N=pn&&y!==null?Eo(y):null;(X()!==null||N!==null&&N===y)&&C.select()}},Du);else if(_!==null)switch(typeof _){case"string":{let x=m.parseEditorState(_);m.setEditorState(x,Du);break}case"object":m.setEditorState(_,Du);break;case"function":m.update(()=>{Je().isEmpty()&&_(m)},Du)}}(p,d),[p,g]},[]);return _M(()=>{let s=e.editable,[i]=r;i.setEditable(s===void 0||s)},[]),t(Zm.Provider,{value:r,children:n})}var CM=Zg,AS=CM.LexicalComposer;var Qg={};Oe(Qg,{useLexicalEditable:()=>NM});S();var yM=pn?He:h;function SM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(n)=>e.registerEditableListener(n)}}function NM(){return function(e){let[n]=st(),r=D(()=>e(n),[n,e]),[s,i]=u(()=>r.initialValueFn()),a=b(s);return yM(()=>{let{initialValueFn:l,subscribe:c}=r,d=l();return a.current!==d&&(a.current=d,i(d)),c((f)=>{a.current=f,i(f)})},[r,e]),s}(SM)}var EM=Qg,RS=EM.useLexicalEditable;var sp={};Oe(sp,{$addNodeStyle:()=>RM,$cloneWithProperties:()=>Gc,$copyBlockFormatIndent:()=>FS,$ensureForwardRangeSelection:()=>LS,$forEachSelectedTextNode:()=>IS,$getComputedStyleForElement:()=>np,$getComputedStyleForParent:()=>op,$getSelectionStyleValueForProperty:()=>FM,$isAtEdgeOfElement:()=>PS,$isAtNodeEnd:()=>AM,$isParentElementRTL:()=>rp,$isParentRTL:()=>vM,$moveCaretSelection:()=>zS,$moveCharacter:()=>IM,$patchStyleText:()=>MM,$selectAll:()=>Wr,$setBlocksType:()=>DM,$shouldOverrideDefaultCharacterSelection:()=>kM,$sliceSelectedTextNodeContent:()=>OM,$trimTextContentFromAnchor:()=>kS,$wrapNodes:()=>wM,createDOMRange:()=>TM,createRectsFromDOMRange:()=>bM,getCSSFromStyleObject:()=>wS,getStyleObjectFromCSS:()=>PM,trimTextContentFromAnchor:()=>BM});function tp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function MS(e){let n=e;for(;n!=null;){if(n.nodeType===Node.TEXT_NODE)return n;n=n.firstChild}return null}function DS(e){let n=e.parentNode;if(n==null)throw Error("Should never happen");return[n,Array.from(n.childNodes).indexOf(e)]}function TM(e,n,r,s,i){let a=n.getKey(),l=s.getKey(),c=Is(e.getRootElement()).createRange(),d=e.getElementByKey(a),f=e.getElementByKey(l),g=r,p=i;if(re(n)&&(d=MS(d)),re(s)&&(f=MS(f)),n===void 0||s===void 0||d===null||f===null)return null;d.nodeName==="BR"&&([d,g]=DS(d)),f.nodeName==="BR"&&([f,p]=DS(f));let m=d.firstChild;d===f&&m!=null&&m.nodeName==="BR"&&g===0&&p===0&&(p=1);try{c.setStart(d,g),c.setEnd(f,p)}catch(_){return null}return!c.collapsed||g===p&&a===l||(c.setStart(f,p),c.setEnd(d,g)),c}function bM(e,n){let r=e.getRootElement();if(r===null)return[];let s=r.getBoundingClientRect(),i=getComputedStyle(r),a=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),l=Array.from(n.getClientRects()),c,d=l.length;l.sort((f,g)=>{let p=f.top-g.top;return Math.abs(p)<=3?f.left-g.left:p});for(let f=0;f<d;f++){let g=l[f],p=c&&c.top<=g.top&&c.top+c.height>g.top&&c.left+c.width>g.left,m=g.width+a===s.width;p||m?(l.splice(f--,1),d--):c=g}return l}function wS(e){let n="";for(let r in e)r&&(n+=`${r}: ${e[r]};`);return n}function np(e){let n=Ge().getElementByKey(e.getKey());if(n===null)return null;let r=n.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(n)}function op(e){return np(So(e)?e:e.getParentOrThrow())}function vM(e){let n=op(e);return n!==null&&n.direction==="rtl"}function OM(e,n,r="self"){let s=e.getStartEndPoints();if(n.isSelected(e)&&!Wg(n)&&s!==null){let[i,a]=s,l=e.isBackward(),c=i.getNode(),d=a.getNode(),f=n.is(c),g=n.is(d);if(f||g){let[p,m]=wy(e),_=c.is(d),x=n.is(l?d:c),C=n.is(l?c:d),y,N=0;if(_)N=p>m?m:p,y=p>m?p:m;else if(x)N=l?m:p,y=void 0;else if(C)N=0,y=l?p:m;let T=n.__text.slice(N,y);T!==n.__text&&(r==="clone"&&(n=Ry(n)),n.__text=T)}}return n}function AM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return Q(n)||tp(177),e.offset===n.getChildrenSize()}function kS(e,n,r){let s=n.getNode(),i=r;if(Q(s)){let a=s.getDescendantByIndex(n.offset);a!==null&&(s=a)}for(;i>0&&s!==null;){if(Q(s)){let f=s.getLastDescendant();f!==null&&(s=f)}let a=s.getPreviousSibling(),l=0;if(a===null){let f=s.getParentOrThrow(),g=f.getPreviousSibling();for(;g===null;){if(f=f.getParent(),f===null){a=null;break}g=f.getPreviousSibling()}f!==null&&(l=f.isInline()?0:2,a=g)}let c=s.getTextContent();c===""&&Q(s)&&!s.isInline()&&(c=`
13
13
 
14
- `);let d=c.length;if(!re(s)||i>=d){let f=s.getParent();s.remove(),f==null||f.getChildrenSize()!==0||So(f)||f.remove(),i-=d+l,s=a}else{let f=s.getKey(),g=e.read("latest",()=>{let _=Rt(f);return re(_)&&_.isSimpleText()?_.getTextContent():null}),p=d-i,m=c.slice(0,p);if(g!==null&&g!==c){let _=En(),x=s;if(s.isSimpleText())s.setTextContent(g);else{let C=yt(g);s.replace(C),x=C}if(j(_)&&_.isCollapsed()){let C=_.anchor.offset;x.select(C,C)}}else if(s.isSimpleText()){let _=n.key===f,x=n.offset;x<i&&(x=d);let C=_?x-i:0,y=_?x:p;if(_&&C===0){let[N]=s.splitText(C,y);N.remove()}else{let[,N]=s.splitText(C,y);N.remove()}}else{let _=yt(m);s.replace(_)}i=0}}}var RM=()=>{};function $u(e,n){(j(e)?e.isCollapsed():re(e)||Q(e))||tp(280);let r=Xr(j(e)?e.style:re(e)?e.getStyle():e.getTextStyle()),s=wS(Object.entries(n).reduce((i,[a,l])=>(typeof l=="function"?i[a]=l(r[a],e):l===null?delete i[a]:i[a]=l,i),{...r}));j(e)||re(e)?e.setStyle(s):e.setTextStyle(s)}function MM(e,n){if(j(e)&&e.isCollapsed()){$u(e,n);let s=e.anchor.getNode();Q(s)&&s.isEmpty()&&$u(s,n)}IS((s)=>{$u(s,n)});let r=e.getNodes();if(r.length>0){let s=new Set;for(let i of r){if(!Q(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let a=i.getKey();s.has(a)||(s.add(a),$u(i,n))}}}function IS(e){let n=X();if(!n)return;let r=new Map,s=(a)=>r.get(a.getKey())||[0,a.getTextContentSize()];if(j(n))for(let a of ur(n).getTextSlices())a&&r.set(a.caret.origin.getKey(),a.getSliceIndices());let i=n.getNodes();for(let a of i){if(!re(a)||!a.canHaveFormat())continue;let[l,c]=s(a);if(c!==l)if(Wg(a)||l===0&&c===a.getTextContentSize())e(a);else e(a.splitText(l,c)[l===0?0:1])}j(n)&&n.anchor.type==="text"&&n.focus.type==="text"&&n.anchor.key===n.focus.key&&LS(n)}function LS(e){if(e.isBackward()){let{anchor:n,focus:r}=e,{key:s,offset:i,type:a}=n;n.set(r.key,r.offset,r.type),r.set(s,i,a)}}function FS(e,n){let r=e.getFormatType(),s=e.getIndent();r!==n.getFormatType()&&n.setFormat(r),s!==n.getIndent()&&n.setIndent(s)}function PS(e,n,r){let s=dn(e,r);if(ll(s))return!1;for(;s;s=s.getParentCaret()){let i=s.getParentAtCaret();if(!i||s.getNodeAtCaret())return!1;if(n.is(i))return!0}return!1}function DM(e,n,r=FS){if(!e)return;let s=e.getStartEndPoints(),i=!1,a=null,l=new Map;if(s){let[c,d]=s,f=he(c.getNode(),gl);a=he(d.getNode(),gl);let g=e.isBackward()?"previous":"next";i=Q(a)&&!a.is(f)&&function(p,m,_){let x=p.getNode();return(!Q(x)||!x.isEmpty())&&PS(p,m,_)}(d,a,pS(g)),Q(f)&&l.set(f.getKey(),f),Q(a)&&!i&&l.set(a.getKey(),a)}for(let c of e.getNodes())if(Q(c)&&gl(c)){if(i&&c.is(a))continue;l.set(c.getKey(),c)}else if(!s){let d=he(c,gl);Q(d)&&l.set(d.getKey(),d)}for(let c of l.values()){let d=n();r(c,d),c.replace(d,!0)}}function $S(e){return e.getNode().isAttached()}function $M(e){let n=e;for(;n!==null&&!Mt(n);){let r=n.getLatest(),s=n.getParent();r.getChildrenSize()===0&&n.remove(!0),n=s}}function wM(e,n,r=null){let s=e.getStartEndPoints(),i=s?s[0]:null,a=e.getNodes(),l=a.length;if(i!==null&&(l===0||l===1&&i.type==="element"&&i.getNode().getChildrenSize()===0)){let f=i.type==="text"?i.getNode().getParentOrThrow():i.getNode(),g=f.getChildren(),p=n();return p.setFormat(f.getFormatType()),p.setIndent(f.getIndent()),g.forEach((m)=>p.append(m)),r&&(p=r.append(p)),void f.replace(p)}let c=null,d=[];for(let f=0;f<l;f++){let g=a[f];Mt(g)?(ep(e,d,d.length,n,r),d=[],c=g):c===null||c!==null&&al(g,c)?d.push(g):(ep(e,d,d.length,n,r),d=[g])}ep(e,d,d.length,n,r)}function ep(e,n,r,s,i=null){if(n.length===0)return;let a=n[0],l=new Map,c=[],d=Q(a)?a:a.getParentOrThrow(),f=d.isInline()?d.getParentOrThrow():d,g=!1;for(;f!==null;){let C=f.getPreviousSibling();if(C!==null){f=C,g=!0;break}if(f=f.getParentOrThrow(),Mt(f))break}let p=new Set;for(let C=0;C<r;C++){let y=n[C];Q(y)&&y.getChildrenSize()===0&&p.add(y.getKey())}let m=new Set;for(let C=0;C<r;C++){let y=n[C],N=y.getParent();if(N!==null&&N.isInline()&&(N=N.getParent()),N!==null&&cl(y)&&!m.has(y.getKey())){let T=N.getKey();if(l.get(T)===void 0){let v=s();v.setFormat(N.getFormatType()),v.setIndent(N.getIndent()),c.push(v),l.set(T,v);let R=N.getChildren();v.splice(v.getChildrenSize(),0,R);for(let F of R)if(m.add(F.getKey()),Q(F))for(let k of F.getChildrenKeys())m.add(k);$M(N)}}else if(p.has(y.getKey())){Q(y)||tp(179);let T=s();T.setFormat(y.getFormatType()),T.setIndent(y.getIndent()),c.push(T),y.remove(!0)}}if(i!==null)for(let C=0;C<c.length;C++){let y=c[C];i.append(y)}let _=null;if(Mt(f))if(g)if(i!==null)f.insertAfter(i);else for(let C=c.length-1;C>=0;C--){let y=c[C];f.insertAfter(y)}else{let C=f,y=C.getFirstChild();if(Q(y)&&(f=y),y===null)if(i)C.append(i);else for(let N=0;N<c.length;N++){let T=c[N];C.append(T),_=T}else if(i!==null)y.insertBefore(i);else for(let N=0;N<c.length;N++){let T=c[N];y.insertBefore(T),_=T}}else if(i)f.insertAfter(i);else for(let C=c.length-1;C>=0;C--){let y=c[C];f.insertAfter(y),_=y}let x=En();j(x)&&$S(x.anchor)&&$S(x.focus)?mt(x.clone()):_!==null?_.selectEnd():e.dirty=!0}function BS(e){let n=KS(e);return n!==null&&n.writingMode==="vertical-rl"}function KS(e){let n=e.anchor.getNode();return Q(n)?np(n):op(n)}function kM(e,n){let r=BS(e)?!n:n;rp(e)&&(r=!r);let s=dn(e.focus,r?"previous":"next");if(ll(s))return!1;if(Hr(s)&&!Yt(s.origin)&&s.origin.isUnmergeable()){let i=s.getNodeAtCaret();if(re(i)&&!Yt(i))return!0}for(let i of bs(s)){if(zo(i))return!i.origin.isInline();if(!Q(i.origin)){if(wt(i.origin))return!0;break}}return!1}function zS(e,n,r,s){e.modify(n?"extend":"move",r,s)}function rp(e){let n=KS(e);return n!==null&&n.direction==="rtl"}function IM(e,n,r){let s=rp(e),i;i=BS(e)||s?!r:r,zS(e,n,i,"character")}function LM(e,n,r){let s=e.getStyle(),i=Xr(s);return i!==null&&i[n]||r}function FM(e,n,r=""){let s=null,i=e.getNodes(),a,l;if(j(e)){if(e.isCollapsed()&&e.style!==""){let x=Xr(e.style);if(x!==null&&n in x)return x[n]}let{anchor:c,focus:d}=e,f=e.isBackward(),g=f?d.getNode():c.getNode(),p=f?c.getNode():d.getNode(),m=f?d.offset:c.offset,_=f?c.offset:d.offset;re(g)&&m===g.getTextContentSize()&&(a=g),_===0&&(l=p)}for(let c=0;c<i.length;c++){let d=i[c];if(re(d)&&!d.is(c===0?a:l)){let f=LM(d,n,r);if(s===null)s=f;else if(s!==f){s="";break}}}return s===null?r:s}var PM=Xr,BM=kS;var ut=sp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:ip,$isAtNodeEnd:ap,$isParentElementRTL:SF,$isParentRTL:El,$moveCaretSelection:NF,$moveCharacter:lp,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Fi,$shouldOverrideDefaultCharacterSelection:cp,$sliceSelectedTextNodeContent:Ps,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:US,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ut;var mp={};Oe(mp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>XS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>qS,$filter:()=>aD,$findMatchingParent:()=>he,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>JS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>zr,$isAtEndOfNode:()=>rN,$isAtStartOfNode:()=>oN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>hp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>ZS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>QS,$splitNode:()=>Gy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>fl,CAN_USE_DOM:()=>pn,IS_ANDROID:()=>tS,IS_ANDROID_CHROME:()=>nS,IS_APPLE:()=>pl,IS_APPLE_WEBKIT:()=>du,IS_CHROME:()=>oS,IS_FIREFOX:()=>$s,IS_IOS:()=>ml,IS_SAFARI:()=>fu,addClassNamesToElement:()=>et,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>GS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Ls,isHTMLAnchorElement:()=>wi,isHTMLElement:()=>ye,isInlineDomNode:()=>ki,isMimeType:()=>VS,makeStateWrapper:()=>mD,markSelection:()=>YS,mediaFileReader:()=>WM,mergeRegister:()=>De,objectKlassEquals:()=>pp,positionNodeOnRange:()=>jS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>an,selectionAlwaysOnDisplay:()=>UM});function dp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function GS(e){let n=(s,i)=>i.left>=s.left-1&&i.top>=s.top-1&&i.right<=s.right+1&&i.bottom<=s.bottom+1,r=[];for(let s of Array.from(e))if(!(s.width<0.5||s.height<0.5||r.some((i)=>n(s,i)))){for(let i=r.length-1;i>=0;i--)n(r[i],s)&&r.splice(i,1);r.push(s)}return r}function Xo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function jS(e,n,r){let s=null,i=null,a=null,l=[],c=Is(e.getRootElement()).createElement("div");function d(){s===null&&dp(182),i===null&&dp(183);let{left:p,top:m}=i.getBoundingClientRect(),_=GS(US(e,n));var x,C;c.isConnected||(C=c,(x=i).insertBefore(C,x.firstChild));let y=!1;for(let N=0;N<_.length;N++){let T=_[N],v=l[N]||Is(s).createElement("div"),R=v.style;R.position!=="absolute"&&(R.position="absolute",y=!0);let F=Xo(T.left-p);R.left!==F&&(R.left=F,y=!0);let k=Xo(T.top-m);R.top!==k&&(v.style.top=k,y=!0);let H=Xo(T.width);R.width!==H&&(v.style.width=H,y=!0);let U=Xo(T.height);R.height!==U&&(v.style.height=U,y=!0),v.parentNode!==c&&(c.append(v),y=!0),l[N]=v}for(;l.length>_.length;){let N=l.pop();N!=null&&N.remove()}y&&r(l)}function f(){i=null,s=null,a!==null&&a.disconnect(),a=null,c.remove();for(let p of l)p.remove();l=[]}c.style.position="relative";let g=e.registerRootListener(function p(){let m=e.getRootElement();if(m===null)return f();let _=m.parentElement;if(!ye(_))return f();f(),s=m,i=_,a=new MutationObserver((x)=>{let C=e.getRootElement(),y=C&&C.parentElement;if(C!==s||y!==i)return p();for(let N of x)if(!c.contains(N.target))return d()}),a.observe(_,KM),d()});return()=>{g(),f()}}function HS(e,n,r,s){if(n.type!=="text"&&Q(r)){let i=ky(r,s,e);return[i.element,i.getFirstChildOffset()+n.offset]}return[(re(r)?Iy(r,s,e):xS(s))||s,n.offset]}function zM(e){for(let n of e){let r=n.style;r.background!=="Highlight"&&(r.background="Highlight"),r.color!=="HighlightText"&&(r.color="HighlightText"),r.marginTop!==Xo(-1.5)&&(r.marginTop=Xo(-1.5)),r.paddingTop!==Xo(4)&&(r.paddingTop=Xo(4)),r.paddingBottom!==Xo(0)&&(r.paddingBottom=Xo(0))}}function YS(e,n=zM){let r=null,s=null,i=null,a=null,l=null,c=null,d=()=>{};function f(g){g.read(()=>{let p=X();if(!j(p))return r=null,i=null,a=null,c=null,d(),void(d=()=>{});let[m,_]=function(U){let W=U.getStartEndPoints();return U.isBackward()?[W[1],W[0]]:W}(p),x=m.getNode(),C=x.getKey(),y=m.offset,N=_.getNode(),T=N.getKey(),v=_.offset,R=e.getElementByKey(C),F=e.getElementByKey(T),k=r===null||R!==s||y!==i||C!==r.getKey(),H=a===null||F!==l||v!==c||T!==a.getKey();if((k||H)&&R!==null&&F!==null){let U=function(W,J,G,ne,ee,se,V){let fe=(W._window?W._window.document:document).createRange();return fe.setStart(...HS(W,J,G,ne)),fe.setEnd(...HS(W,ee,se,V)),fe}(e,m,x,R,_,N,F);d(),d=jS(e,U,n)}r=x,s=R,i=y,a=N,l=F,c=v},{editor:e})}return f(e.getEditorState()),De(e.registerUpdateListener(({editorState:g})=>f(g)),()=>{d()})}function UM(e,n){let r=null,s=()=>{let i=e.getRootElement(),a=i!==null?i.ownerDocument.defaultView:null,l=a!==null?a.getSelection():null,c=l!==null?ws(l,i).anchorNode:null;c!==null&&i!==null&&i.contains(c)?r!==null&&(r(),r=null):r===null&&(r=YS(e,n))};return e.registerRootListener((i)=>{if(i){let a=i.ownerDocument,l=De(ao(a,"selectionchange",s),()=>{r!==null&&r()});return s(),l}})}function HM(e,n){let r=e.ownerDocument,s=r.defaultView||window,i=s.getComputedStyle(e),a=i.position==="absolute",l=n?/(auto|scroll|hidden)/:/(auto|scroll)/;if(i.position==="fixed")return r.body;for(let c=e;c=Nl(c);)if(i=s.getComputedStyle(c),(!a||i.position!=="static")&&l.test(i.overflow+i.overflowY+i.overflowX))return c;return r.body}function VS(e,n){for(let r of n)if(e.type.startsWith(r))return!0;return!1}function WM(e,n){let r=e[Symbol.iterator]();return new Promise((s,i)=>{let a=[],l=()=>{let{done:c,value:d}=r.next();if(c)return s(a);let f=new FileReader;f.addEventListener("error",i),f.addEventListener("load",()=>{let g=f.result;typeof g=="string"&&a.push({file:d,result:g}),l()}),VS(d,n)?f.readAsDataURL(d):l()};l()})}function GM(e,n){return Array.from(XS(e,n))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,n){return Array.from(ZS(e,n))}function XS(e,n){return wu("next",e,n)}function VM(e,n){return Array.from(qS(e,n))}function*qS(e,n){for(let r of wu("next",e,n)){yield r;let{node:s,depth:i}=r;if(ul(s)&&!s.is(n))for(let a of As(s)){let l=Ci(s,a);l!==null&&(yield*fp(l,i+1))}}}function*fp(e,n){yield{depth:n,node:e};let r=n+1;if(ul(e))for(let s of As(e)){let i=Ci(e,s);i!==null&&(yield*fp(i,r))}if(Q(e))for(let s of e.getChildren())yield*fp(s,r)}function WS(e,n){let r=vs(it(e,n));return r&&r[0]}function wu(e,n,r){let s=Je(),i=n||s,a=Q(i)?bt(i,e):it(i,e),l=JS(i),c=r?il(Kg(it(r,e)))||WS(r,e):WS(i,e),d=l;return Xg({hasNext:(f)=>f!==null,initial:a,map:(f)=>({depth:d,node:f.origin}),step:(f)=>{if(f.isSameNodeCaret(c))return null;zo(f)&&d++;let g=vs(f);return!g||g[0].isSameNodeCaret(c)?null:(d+=g[1],g[0])}})}function XM(e){let n=vs(it(e,"next"));return n&&[n[0].origin,n[1]]}function JS(e){let n=-1;for(let r=e;r!==null;r=r.getParent()??Vc(r))n++;return n}function qM(e){let n=Kg(it(e,"previous")),r=vs(n,"root");return r&&r[0].origin}function ZS(e,n){return wu("previous",e,n)}function JM(e,n){return Array.from(QS(e,n))}function*QS(e,n){let r=[];for(let s of wu("previous",e,n)){for(;r.length>0&&s.depth<=r[r.length-1].depth;){let l=r.pop();yield*gp(l.node,l.depth+1)}yield s;let{node:i,depth:a}=s;ul(i)&&As(i).length>0&&!i.is(n)&&r.push({depth:a,node:i})}for(;r.length>0;){let s=r.pop();yield*gp(s.node,s.depth+1)}}function*gp(e,n){let r=As(e);for(let s=r.length-1;s>=0;s--){let i=Ci(e,r[s]);i!==null&&(yield*eN(i,n))}}function*eN(e,n){yield{depth:n,node:e};let r=n+1;if(Q(e)){let s=e.getChildren();for(let i=s.length-1;i>=0;i--)yield*eN(s[i],r)}ul(e)&&(yield*gp(e,r))}function ZM(e,n){let r=e;for(;r!=null;){if(r instanceof n)return r;r=r.getParent()}return null}function QM(e){let n=he(e,(r)=>Q(r)&&!r.isInline());return Q(n)||dp(4,e.__key),n}function eD(e,n){let r=dr(j(n)?ur(n):n,"next"),s=Qn(r.anchor.origin),i=Qn(e.getLatest());if(s===null?i!==null:!s.is(i))return!1;let a=kt(bt(e,"next")),l=$y(kt(bt(e,"previous")),"next");return Br(r.anchor,a)<=0&&Br(r.focus,l)>=0}function tD(e,n,r,s){let i=(a)=>a instanceof n;return e.registerNodeTransform(n,(a)=>{let l=((c)=>{let d=c.getChildren();for(let p=0;p<d.length;p++){let m=d[p];if(i(m))return null}let f=c,g=c;for(;f!==null;)if(g=f,f=f.getParent(),i(f))return{child:g,parent:f};return null})(a);if(l!==null){let{child:c,parent:d}=l;if(c.is(a)){s(d,a);let f=c.getNextSiblings(),g=f.length;if(d.insertAfter(c),g!==0){let p=r(d);c.insertAfter(p);for(let m=0;m<g;m++)p.append(f[m])}d.canBeEmpty()||d.getChildrenSize()!==0||d.remove()}}})}function nD(e,n){let r=new Map,s=e._pendingEditorState;for(let[a,l]of n._nodeMap)r.set(a,Gc(l));s&&(s._nodeMap=r),xi();let i=n._selection;mt(i===null?null:i.clone())}function oD(e){let n=X()||En(),r;if(j(n))r=dn(n.focus,"next");else{if(n!=null){let l=n.getNodes(),c=l[l.length-1];c&&(r=it(c,"next"))}r=r||bt(Je(),"previous").getFlipped().insert(Se())}let s=zr(e,r),i=il(s),a=zo(i)?kt(i):s;return kn(Os(a)),e.getLatest()}function rD(e){let n=X();if(!j(n))return void(n&&n.insertNodes([e]));let r=ur(n),s=dr(Hy(r),"next").anchor;if(Hr(s)){let a=Zc(s);if(!a)return;s=a}let i=s.getFlipped();i.insert(e),kn(Zn(i,i))}function sD(e,n){let r=n();return e.replace(r),r.append(e),r}function pp(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function iD(e){let n=null;if(pp(e,DragEvent)?n=e.dataTransfer:pp(e,ClipboardEvent)&&(n=e.clipboardData),n===null)return[!1,[],!1];let r=n.types,s=r.includes("Files"),i=r.includes("text/html")||r.includes("text/plain");return[s,Array.from(n.files),i]}function aD(e,n){let r=[];for(let s=0;s<e.length;s++){let i=n(e[s]);i!==null&&r.push(i)}return r}function lD(e){let n=X();if(!j(n))return!1;let r=new Set,s=n.getNodes();for(let i=0;i<s.length;i++){let a=s[i],l=a.getKey();if(r.has(l))continue;let c=he(a,(f)=>Q(f)&&!f.isInline());if(c===null)continue;let d=c.getKey();c.canIndent()&&!r.has(d)&&(r.add(d),e(c))}return r.size>0}function cD(e,n){bt(e,"next").insert(n)}var up=!($s||!pn)&&void 0;function uD(e,n=!1){let r=1;if(function(){if(up===void 0){let s=document.createElement("div");s.style.position="absolute",s.style.opacity="0",s.style.width="100px",s.style.left="-1000px",document.body.appendChild(s);let i=s.getBoundingClientRect();s.style.setProperty("zoom","2"),up=s.getBoundingClientRect().width===i.width,document.body.removeChild(s)}return up}()||n){let s=e&&e.ownerDocument.defaultView||window;for(;e;)r*=Number(s.getComputedStyle(e).getPropertyValue("zoom")),e=Nl(e)}return r}function dD(e){return e._parentEditor!==null}function fD(e,n){return tN(e,n,null)}function tN(e,n,r){let s=!1;for(let i of hp(e))n(i)?r!==null&&r(i):(s=!0,Q(i)&&tN(i,n,r||((a)=>i.insertAfter(a))),i.remove());return s}function gD(e,n){let r=[],s=Array.from(e).reverse();for(let i=s.pop();i!==void 0;i=s.pop())if(n(i))r.push(i);else if(Q(i))for(let a of hp(i))s.push(a);return r}function pD(e){return nN(bt(e,"next"))}function hp(e){return nN(bt(e,"previous"))}function nN(e){return Xg({hasNext:No,initial:e.getAdjacentCaret(),map:(n)=>n.origin.getLatest(),step:(n)=>n.getAdjacentCaret()})}function hD(e){Ho(it(e,"next")).splice(1,e.getChildren())}function mD(e){let n=(s)=>Ko(s,e),r=(s,i)=>to(s,e,i);return{$get:n,$set:r,accessors:[n,r],makeGetterMethod:()=>function(){return n(this)},makeSetterMethod:()=>function(s){return r(this,s)},stateConfig:e}}function _D(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getFirstChild()===s&&oN(r.anchor,s))return s.insertBefore(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function xD(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getLastChild()===s&&rN(r.anchor,s))return s.insertAfter(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function oN(e,n){return ip(e,n,"previous")}function rN(e,n){return ip(e,n,"next")}var de=mp,{$descendantsMatching:Tl,$dfs:sN,$dfsIterator:IF,$dfsWithSlots:LF,$dfsWithSlotsIterator:FF,$filter:PF,$findMatchingParent:BF,$firstToLastIterator:KF,$getAdjacentCaret:zF,$getAdjacentSiblingOrParentSiblingCaret:UF,$getDepth:HF,$getNearestBlockElementAncestorOrThrow:ku,$getNearestNodeOfType:Iu,$getNextRightPreorderNode:WF,$getNextSiblingOrParentSibling:GF,$handleIndentAndOutdent:bl,$insertFirst:iN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:vl,$isEditorIsNestedEditor:qF,$lastToFirstIterator:JF,$onEscapeDown:_p,$onEscapeUp:xp,$restoreEditorState:ZF,$reverseDfs:QF,$reverseDfsIterator:eP,$reverseDfsWithSlots:tP,$reverseDfsWithSlotsIterator:nP,$splitNode:oP,$unwrapAndFilterDescendants:Cp,$unwrapNode:rP,$wrapNodeInElement:sP,CAN_USE_BEFORE_INPUT:iP,CAN_USE_DOM:aP,IS_ANDROID:lP,IS_ANDROID_CHROME:cP,IS_APPLE:uP,IS_APPLE_WEBKIT:dP,IS_CHROME:fP,IS_FIREFOX:gP,IS_IOS:pP,IS_SAFARI:hP,addClassNamesToElement:mP,calculateZoomLevel:aN,dedupeSelectionRects:_P,eventFiles:Bs,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:Pn,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:lN}=de;var Ip={};Oe(Ip,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>kp,$defaultShouldInsertAfter:()=>EN,$getExtensionDependency:()=>kN,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>LN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>zi,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>IN,InitialStateExtension:()=>$N,LexicalBuilder:()=>pr,NestedEditorExtension:()=>GD,NodeSelectionDataSelectedExtension:()=>jD,NodeSelectionExtension:()=>Rp,NormalizeInlineElementsExtension:()=>YD,NormalizeTripleClickSelectionExtension:()=>XD,PreventSelectAllExtension:()=>Mp,RootElementExtension:()=>JD,SelectBlockExtension:()=>ZD,SelectionAlwaysOnDisplayExtension:()=>QD,TabIndentationExtension:()=>e$,WatchEditableExtension:()=>t$,applyFormatFromStyle:()=>vD,applyFormatToDom:()=>vN,batch:()=>mN,buildEditorFromExtensions:()=>LD,computed:()=>CN,configExtension:()=>sn,declarePeerDependency:()=>fS,defineExtension:()=>_e,effect:()=>Zt,getExtensionDependencyFromEditor:()=>wN,getKnownTypesAndNodes:()=>TN,getPeerDependencyFromEditor:()=>wp,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>To,registerClearEditor:()=>NN,registerTabIndentation:()=>PN,safeCast:()=>We,shallowMergeConfig:()=>zt,signal:()=>Qr,untracked:()=>bp,watchedSignal:()=>Rl});var CD=Symbol.for("preact-signals");function Hu(){if(gr>1)return void gr--;let e,n=!1;for(!function(){let r=Ku;for(Ku=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o}();Al!==void 0;){let r=Al;for(Al=void 0,zu++;r!==void 0;){let s=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&_N(r))try{r.c()}catch(i){n||(e=i,n=!0)}r=s}}if(zu=0,gr--,n)throw e}function mN(e){if(gr>0)return e();Op=++yD,gr++;try{return e()}finally{Hu()}}var nt,Al;function bp(e){let n=nt;nt=void 0;try{return e()}finally{nt=n}}var Ku,gr=0,zu=0,yD=0,Op=0,Bu=0;function cN(e){if(nt===void 0)return;let n=e.n;return n===void 0||n.t!==nt?(n={i:0,S:e,p:nt.s,n:void 0,t:nt,e:void 0,x:void 0,r:n},nt.s!==void 0&&(nt.s.n=n),nt.s=n,e.n=n,32&nt.f&&e.S(n),n):n.i===-1?(n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=nt.s,n.n=void 0,nt.s.n=n,nt.s=n),n):void 0}function hn(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function Qr(e,n){return new hn(e,n)}function _N(e){for(let n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function uN(e){for(let n=e.s;n!==void 0;n=n.n){let r=n.S.n;if(r!==void 0&&(n.r=r),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function xN(e){let n,r=e.s;for(;r!==void 0;){let s=r.p;r.i===-1?(r.S.U(r),s!==void 0&&(s.n=r.n),r.n!==void 0&&(r.n.p=s)):n=r,r.S.n=r.r,r.r!==void 0&&(r.r=void 0),r=s}e.s=n}function Ks(e,n){hn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function CN(e,n){return new Ks(e,n)}function yN(e){let n=e.m;if(e.m=void 0,typeof n=="function"){gr++;let r=nt;nt=void 0;try{n()}catch(s){throw e.f&=-2,e.f|=8,Dp(e),s}finally{nt=r,Hu()}}}function Dp(e){for(let n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,yN(e)}function SD(e){if(nt!==this)throw Error("Out-of-order effect");xN(this),nt=e,this.f&=-2,8&this.f&&Dp(this),Hu()}function Ki(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n==null?void 0:n.name}function Zt(e,n){let r=new Ki(e,n);try{r.c()}catch(i){throw r.d(),i}let s=r.d.bind(r);return s[Symbol.dispose]=s,s}function To(e,n={}){let r={};for(let s in e){let i=n[s],a=Qr(i===void 0?e[s]:i);r[s]=a}return r}hn.prototype.brand=CD,hn.prototype.h=function(){return!0},hn.prototype.S=function(e){let n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:bp(()=>{var r;(r=this.W)==null||r.call(this)}))},hn.prototype.U=function(e){if(this.t!==void 0){let{e:n,x:r}=e;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&bp(()=>{var s;(s=this.Z)==null||s.call(this)}))}},hn.prototype.subscribe=function(e){return Zt(()=>{let n=this.value,r=nt;nt=void 0;try{e(n)}finally{nt=r}},{name:"sub"})},hn.prototype.valueOf=function(){return this.value},hn.prototype.toString=function(){return this.value+""},hn.prototype.toJSON=function(){return this.value},hn.prototype.peek=function(){let e=nt;nt=void 0;try{return this.value}finally{nt=e}},Object.defineProperty(hn.prototype,"value",{get(){let e=cN(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(zu>100)throw Error("Cycle detected");(function(n){gr!==0&&zu===0&&n.l!==Op&&(n.l=Op,Ku={S:n,v:n.v,i:n.i,o:Ku})})(this),this.v=e,this.i++,Bu++,gr++;try{for(let n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Hu()}}}}),Ks.prototype=new hn,Ks.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===Bu)return!0;if(this.g=Bu,this.f|=1,this.i>0&&!_N(this))return this.f&=-2,!0;let e=nt;try{uN(this),nt=this;let n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return nt=e,xN(this),this.f&=-2,!0},Ks.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let n=this.s;n!==void 0;n=n.n)n.S.S(n)}hn.prototype.S.call(this,e)},Ks.prototype.U=function(e){if(this.t!==void 0&&(hn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let n=this.s;n!==void 0;n=n.n)n.S.U(n)}},Ks.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ks.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=cN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ki.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}},Ki.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,yN(this),uN(this),gr++;let e=nt;return nt=this,SD.bind(this,e)},Ki.prototype.N=function(){2&this.f||(this.f|=2,this.u=Al,Al=this)},Ki.prototype.d=function(){this.f|=8,1&this.f||Dp(this)},Ki.prototype.dispose=function(){this.d()};var ND=_e({build:(e,n,r)=>To(n),config:We({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,n,r){let s=r.getOutput();return Zt(()=>s.disabled.value?void 0:e.registerRootListener((i)=>{e.focus(()=>{let a=i!==null?Eo(i):null;i===null||a!==null&&i.contains(a)||i.focus({preventScroll:!0})},{defaultSelection:s.defaultSelection.peek()})}))}});function SN(){let e=Je(),n=X(),r=Se();e.clear(),e.append(r),n!==null&&r.select(),j(n)&&(n.format=0)}function NN(e,n=SN){return e.registerCommand(Qc,()=>(n(),!0),Te)}var ED=_e({build:(e,n,r)=>To(n),config:We({$onClear:SN}),name:"@lexical/extension/ClearEditor",register(e,n,r){let{$onClear:s}=r.getOutput();return Zt(()=>NN(e,s.value))}});function EN(e){return!!wt(e)||!(!Q(e)||!e.isShadowRoot())}function dN(e,n,r,s){return!!e.isEditable()&&(r.target===n&&e.read("latest",()=>{let i=Je().getLastChild();if(i===null)return!1;let a=e.getElementByKey(i.getKey());return a!==null&&(!(r.clientY<=a.getBoundingClientRect().bottom)&&s(i))}))}var TD=_e({build:(e,n)=>To(n),config:We({$shouldInsertAfter:EN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(i===null)return;return Jr(i,{click:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&(a.preventDefault(),qg(a),e.update(()=>{let l=Je().getLastChild();if(l===null)return;if(!s.$shouldInsertAfter.peek()(l))return;let c=Se();l.insertAfter(c),c.select()}))},mousedown:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&a.preventDefault()}},!0)})})});function TN(e){let n=new Set,r=new Set;for(let s of bN(e)){let i=typeof s=="function"?s:s.replace;CS(i),n.add(i.getType()),r.add(i)}return{nodes:r,types:n}}function bN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var yp=Vo("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends lu{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:lu,stateConfigs:[{flat:!0,stateConfig:yp}]})}getFormat(e){return Ko(this,yp,e)}getFormatFlags(e,n){return Jg(this.getFormat(),e,n)}hasFormat(e){let n=$i[e];return(this.getFormat()&n)!==0}setFormat(e){return to(this,yp,e)}toggleFormat(e){let n=this.getFormat(),r=Jg(n,e,null);return this.setFormat(r)}isInline(){return!0}createDOM(e,n){return Xe().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,n,r){let s=n.fontWeight,i=n.textDecoration.split(" "),a=s==="700"||s==="bold",l=i.includes("line-through"),c=n.fontStyle==="italic",d=i.includes("underline"),f=n.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),c&&!e.hasFormat("italic")&&e.toggleFormat("italic"),d&&!e.hasFormat("underline")&&e.toggleFormat("underline"),f!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),f!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),r&&!e.hasFormat(r)&&e.toggleFormat(r),e}function vN(e,n,r=RD){let s=n;for(let[i,a]of Object.entries(r))e.hasFormat(a)&&(s=AD(s,i));return s}var OD=vN;function AD(e,n){let r=e.ownerDocument.createElement(n);return r.appendChild(e),r}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=_e({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function Rl(e,n){let r;return Qr(e(),{unwatched(){r&&(r(),r=void 0)},watched(){this.value=e(),r=n(this)}})}var Uu=_e({build:(e)=>Rl(()=>e.getEditorState(),(n)=>e.registerUpdateListener((r)=>{n.value=r.editorState})),name:"@lexical/extension/EditorState"});function tt(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ON;try{ON="0.49.0+prod.esm"}catch(e){}var DD=ON??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function AN(e,n){if(e&&n&&!Array.isArray(n)&&typeof e=="object"&&typeof n=="object"){let r=e,s=n;for(let i in s)!$D.has(i)&&Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=AN(r[i],s[i]));return e}return n}var $p=0,Ap=1,RN=2,Sp=3,Fu=4,Pi=5,Np=6,Ol=7;function Ep(e){return e.id===$p}function MN(e){return e.id===RN}function wD(e){return function(n){return n.id===Ap}(e)||tt(305,String(e.id),String(Ap)),Object.assign(e,{id:RN})}var kD=new Set;class DN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:$p}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):zt;for(let r of this.configs)e=n(e,r);return e}init(e){let n=this.state;MN(n)||tt(306,String(n.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(l,c,d){return Object.assign(l,{config:c,id:Sp,registerState:d})}(n,this.mergeConfigs(),r),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,r)),this.state=function(l,c,d){return Object.assign(l,{id:Fu,initResult:c,registerState:d})}(i,a,s)}build(e){let n=this.state,r;n.id!==Fu&&tt(307,String(n.id),String(Pi)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));let s={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=function(i,a,l){return Object.assign(i,{id:Pi,output:a,registerState:l})}(n,r,s)}register(e,n){this._signal=n;let r=this.state;r.id!==Pi&&tt(308,String(r.id),String(Pi));let s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(i){return Object.assign(i,{id:Np})}(r),()=>{let i=this.state;i.id!==Ol&&tt(309,String(r.id),String(Ol)),this.state=function(a){return Object.assign(a,{id:Pi})}(i),s&&s()}}afterRegistration(e){let n=this.state,r;return n.id!==Np&&tt(310,String(n.id),String(Np)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=function(s){return Object.assign(s,{id:Ol})}(n),r}getSignal(){return this._signal===void 0&&tt(311),this._signal}getInitResult(){this.extension.init===void 0&&tt(312,this.extension.name);let e=this.state;return function(n){return n.id>=Fu}(e)||tt(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(n){return n.id>=Sp}(e)||tt(314,String(e.id),String(Sp)),{config:e.config}}getPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){let e=this.state;return function(n){return n.id>=Ol}(e)||tt(316,String(e.id),String(Ol)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||kD}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(n){return n.id>=Pi})(e)||tt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var fN={tag:Gr};function ID(){let e=Je();e.isEmpty()&&e.append(Se())}var $N=_e({config:We({setOptions:fN,updateOptions:fN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},s){let i=s.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:a}=i;if(Py(a))e.setEditorState(a,r);else if(typeof a=="function")e.update(()=>{a(e)},n);else if(a&&(typeof a=="string"||typeof a=="object")){let l=e.parseEditorState(a);e.setEditorState(l,r)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,Ln,iS,Nu,aS]}),gN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return pr.fromExtensions(e).buildEditor()}function pN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var Tp=DD;class pr{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Tp,this.roots=e;for(let n of e)this.addExtension(n)}static fromExtensions(e){let n=[Pu($N)];for(let r of e)n.push(Pu(r));return new pr(n)}static maybeFromEditor(e){let n=e[gN];return n&&(n.PACKAGE_VERSION!==Tp&&tt(292,n.PACKAGE_VERSION,Tp),n instanceof pr||tt(293)),n}static fromEditor(e){let n=pr.maybeFromEditor(e);return n===void 0&&tt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,onWarn:r,...s}=this.buildCreateEditorArgs(),i=Object.assign(Tu({...s,...n?{onError:(a)=>{n(a,i)}}:{},...r?{onWarn:(a)=>{r(a,i)}}:{}}),{[gN]:this});for(let a of this.sortedExtensionReps())a.build(i);return i}buildEditor(){let e=pN;function n(){try{e()}finally{e=pN}}let r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=De(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&tt(295,e.name),n}addEdge(e,n,r){let s=this.outgoingConfigEdges.get(e);s?s.set(n,r):this.outgoingConfigEdges.set(e,new Map([[n,r]]));let i=this.incomingEdges.get(n);i?i.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&tt(296);let n=Pu(e),[r]=n;typeof r.name!="string"&&tt(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&tt(298,r.name),!s){s=new DN(this,r),this.extensionNameMap.set(r.name,s);let i=this.conflicts.get(r.name);typeof i=="string"&&tt(299,r.name,i);for(let a of r.conflictsWith||[])this.extensionNameMap.has(a)&&tt(299,r.name,a),this.conflicts.set(a,r.name);for(let a of r.dependencies||[]){let l=Pu(a);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(let[a,l]of r.peerDependencies||[])this.addEdge(r.name,a,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],n=(r,s)=>{let i=r.state;if(MN(i))return;let a=r.extension.name;var l;Ep(i)||tt(300,a,s||"[unknown]"),Ep(l=i)||tt(304,String(l.id),String($p)),i=Object.assign(l,{id:Ap}),r.state=i;let c=this.outgoingConfigEdges.get(a);if(c)for(let d of c.keys()){let f=this.extensionNameMap.get(d);f&&n(f,a)}i=wD(i),r.state=i,e.push(r)};for(let r of this.extensionNameMap.values())Ep(r.state)&&n(r);for(let r of e)for(let[s,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){let a=this.extensionNameMap.get(s);if(a)for(let l of i)a.configs.add(l)}for(let[r,...s]of this.roots)if(s.length>0){let i=this.extensionNameMap.get(r.name);i===void 0&&tt(301,r.name);for(let a of s)i.configs.add(a)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let n=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],i=r.signal;for(let a of n){let l=a.register(e,i);l&&s.push(l)}for(let a of n){let l=a.afterRegistration(e);l&&s.push(l)}return De(...s)}buildCreateEditorArgs(){let e={},n=new Set,r=new Map,s=new Map,i={},a={},l=this.sortedExtensionReps();for(let f of l){let{extension:g}=f;if(g.onError!==void 0&&(e.onError=g.onError),g.onWarn!==void 0&&(e.onWarn=g.onWarn),g.disableEvents!==void 0&&(e.disableEvents=g.disableEvents),g.parentEditor!==void 0&&(e.parentEditor=g.parentEditor),g.editable!==void 0&&(e.editable=g.editable),g.namespace!==void 0&&(e.namespace=g.namespace),g.$initialEditorState!==void 0&&(e.$initialEditorState=g.$initialEditorState),g.nodes)for(let p of bN(g)){if(typeof p!="function"){let m=r.get(p.replace);m&&tt(302,g.name,p.replace.name,m.extension.name),r.set(p.replace,f)}n.add(p)}if(g.html){if(g.html.export)for(let[p,m]of g.html.export.entries())s.set(p,m);g.html.import&&Object.assign(i,g.html.import)}g.theme&&AN(a,g.theme)}Object.keys(a).length>0&&(e.theme=a),n.size&&(e.nodes=[...n]);let c=Object.keys(i).length>0,d=s.size>0;(c||d)&&(e.html={},c&&(e.html.import=i),d&&(e.html.export=s));for(let f of l)f.init(e);return e.onError||(e.onError=FD),e}}function wN(e,n){let r=pr.fromEditor(e).getExtensionRep(n);return r===void 0&&tt(303,n.name),r.getExtensionDependency()}function wp(e,n){let r=pr.maybeFromEditor(e);if(!r)return;let s=r.extensionNameMap.get(n);return s?s.getExtensionDependency():void 0}function PD(e,n){let r=wp(e,n);return r===void 0&&tt(291,n),r}function kN(e){return wN(Ge(),e)}function BD(e){return kN(e).output}function KD(e){return wp(Ge(),e)}var zD=new Set,Rp=_e({build(e,n,r){let s=r.getDependency(Uu).output,i=Qr({watchedNodeKeys:new Map}),a=Rl(()=>{},()=>Zt(()=>{let l=a.peek(),{watchedNodeKeys:c}=i.value,d,f=!1;s.value.read(()=>{if(X())for(let[g,p]of c.entries()){if(p.size===0){c.delete(g);continue}let m=Rt(g),_=m&&m.isSelected()||!1;f=f||_!==(!!l&&l.has(g)),_&&(d=d||new Set,d.add(g))}}),!f&&d&&l&&d.size===l.size||(a.value=d)}));return{watchNodeKey:function(l){let c=CN(()=>(a.value||zD).has(l)),{watchedNodeKeys:d}=i.peek(),f=d.get(l),g=f!==void 0;return f=f||new Set,f.add(c),g||(d.set(l,f),i.value={watchedNodeKeys:d}),c}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),IN=bn("INSERT_HORIZONTAL_RULE_COMMAND");class zi extends lu{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:Xe().createElement("hr")}}createDOM(e){let n=Xe().createElement("hr");return et(n,e.theme.hr),n}getTextContent(){return`
15
- `}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:kp()}}function kp(){return jc(zi)}function LN(e){return e instanceof zi}var HD=_e({dependencies:[Uu,Rp],name:"@lexical/extension/HorizontalRule",nodes:()=>[zi],register(e,n,r){let{watchNodeKey:s}=r.getDependency(Rp).output,i=Qr({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return De(e.registerCommand(IN,(l)=>{let c=X();if(!j(c))return!1;if(c.focus.getNode()!==null){let d=kp();Lu(d)}return!0},Te),e.registerCommand(yi,(l)=>{if(io(l.target)){let c=Fy(l.target);if(LN(c))return function(d,f=!1){let g=X(),p=d.isSelected(),m=d.getKey(),_;f&&Ze(g)?_=g:(_=Yc(),mt(_)),p?_.delete(m):_.add(m)}(c,l.shiftKey),!0}return!1},Pe),e.registerMutationListener(zi,(l,c)=>{mN(()=>{let d=!1,{nodeSelections:f}=i.peek();for(let[g,p]of l.entries())if(p==="destroyed")f.delete(g),d=!0;else{let m=f.get(g),_=e.getElementByKey(g);m?m.domNode.value=_:(d=!0,f.set(g,{domNode:Qr(_),selectedSignal:s(g)}))}d&&(i.value={nodeSelections:f})})}),Zt(()=>{let l=[];for(let{domNode:c,selectedSignal:d}of i.value.nodeSelections.values())l.push(Zt(()=>{let f=c.value;if(f)d.value?et(f,a):an(f,a)}));return De(...l)}))}}),WD=_e({build:(e)=>({composingTextNode:Qr(null),compositionKey:Qr(null)}),name:"@lexical/extension/IME",register(e,n,r){let{compositionKey:s,composingTextNode:i}=r.getOutput(),a=e.registerCommand(qy,()=>{let f=X();return j(f)&&(s.value=f.anchor.key),!1},eu),l=Zt(()=>{let f=s.value;i.value=f!==null?e.read("latest",()=>{let g=Rt(f);return re(g)?g:null}):null}),c=e.registerUpdateListener(({tags:f,editorState:g})=>{f.has(nu)&&g.read(()=>{let p=X();if(!j(p))return;let m=p.anchor.getNode();re(m)&&(i.value=m)})}),d=e.registerRootListener((f)=>{if(f===null)return void(s.value=null);return ao(f,"compositionend",()=>{s.value=null})});return De(a,l,c,d)}}),GD=_e({build:(e,n)=>To({inheritEditableFromParent:n.inheritEditableFromParent}),config:We({$getParentEditor:function(){let e=Ge();return pr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,n,r)=>{let s=n.$getParentEditor();e.parentEditor=s,e.theme=e.theme||s._config.theme},name:"@lexical/extension/NestedEditor",register:(e,n,r)=>Zt(()=>{let s=e._parentEditor;if(s&&r.getOutput().inheritEditableFromParent.value)return e.setEditable(s.isEditable()),s.registerEditableListener(e.setEditable.bind(e))})}),jD=_e({config:We({attribute:"data-selected",nodes:[]}),init(e,n){let r=new Set,s=Ou(TN(e).nodes);for(let i of n.nodes){let a=i.getType(),l=s.get(a);l===void 0&&tt(339,i.name,a),r.add(a);for(let c of l)r.add(c)}return{matchTypes:r}},mergeConfig:(e,n)=>zt(e,{...n,...n.nodes&&{nodes:[...e.nodes,...n.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,n,r){let{attribute:s}=n,{matchTypes:i}=r.getInitResult(),a=new Map,l=(d)=>{let f=new Set;d.read(()=>{let g=X();if(Ze(g))for(let p of g.getNodes())i.has(p.getType())&&f.add(p.getKey())});for(let[g,p]of a)f.has(g)||(p.removeAttribute(s),a.delete(g));for(let g of f){let p=e.getElementByKey(g);p!==null&&(p.setAttribute(s,"true"),a.set(g,p))}};l(e.getEditorState());let c=e.registerUpdateListener(({editorState:d})=>l(d));return()=>{c();for(let d of a.values())d.removeAttribute(s);a.clear()}}});function hN(e){Q(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=_e({build:(e,n,r)=>To(n),config:We({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value){let i=[];for(let{klass:a,transforms:l}of e._nodes.values())a.prototype instanceof ct&&a.prototype.isInline!==ct.prototype.isInline&&(l.add(hN),i.push(()=>l.delete(hN)));return()=>i.forEach((a)=>a())}})}}),VD=new Set([Su,dS]),XD=_e({build:(e,n,r)=>To(n),config:We({$fixFocusOverselection:function(){let e=X();if(j(e)&&!e.isCollapsed()){let n=dr(ur(e),"next"),r=n.focus;for(Hr(r)&&n.anchor.origin!==r.origin&&r.offset===0&&(r=Ho(r.getSiblingCaret())),No(r)&&n.anchor.origin!==r.origin&&Ue(r.origin)&&(r=Ho(r));zo(r)&&n.anchor.origin!==r.origin;)r=Ho(it(r.origin,"next"));if(No(r)&&Q(r.origin)&&(r=kt(bt(r.origin,"previous")).getFlipped()),r=kt(r),!r.isSamePointCaret(n.focus)){let s=kn(Zn(n.anchor,r)),i=Ge().getRootElement(),a=i&&Fn(i.ownerDocument.defaultView);a&&jy(En(),s,Ge(),a,VD,i)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(!i)return;let a=0,l=(c)=>{if(c?c.detail===3:a>0){let d=s.dateNow.peek()();a=c&&c.type==="mousedown"||d-a<=s.thresholdMsec.peek()?d:0}return a};return De(e.registerCommand(ro,()=>(l(null)&&(a=0,s.$fixFocusOverselection.peek()()),!1),Xy),Jr(i,{mousedown:l,mouseup:l},!0))})})});function qD(e){let n=e.target;NS(e,"a",{ctrlKey:!pl,metaKey:pl})&&ye(n)&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.addEventListener("keydown",qg,{once:!0})}var Mp=_e({build:(e,n,r)=>To(n),config:We({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return e.registerRootListener((i)=>{if(i)return ao(i,"keydown",qD,!0)})})}}),JD=_e({build:(e)=>Rl(()=>e.getRootElement(),(n)=>e.registerRootListener((r)=>{n.value=r})),name:"@lexical/extension/RootElement"}),ZD=_e({build:(e,n,r)=>To(n),config:We({cascadeSelection:!1,disabled:!1}),dependencies:[Mp],name:"@lexical/extension/SelectBlock",register:(e,n,r)=>{let s=r.getOutput(),i=r.getDependency(Mp).output;return De(Zt(()=>{i.disabled.value=s.disabled.value}),Zt(()=>{if(!s.disabled.value)return e.registerCommand(Di,(a,l)=>{if(l!==e){if(!s.cascadeSelection.peek())return!1;return!!l.read("pending",()=>{let m=X();return j(m)&&vl(Je(),m)})&&(Wr(),!0)}let c=X();if(Ze(c)){let m=c.getNodes(),_=m[0];if(!_)return!1;let x=_.getTopLevelElement();return!x||So(x)||x.is(_)||m.length>1&&(d=x,!m.every((C)=>d.is(C.getTopLevelElement())))?Wr():Q(x)&&x.select(0,x.getChildrenSize()),!0}var d;if(!j(c))return!1;let f=c.anchor.getNode(),g=f.getTopLevelElement();if(g&&g.is(c.focus.getNode().getTopLevelElement())&&!vl(g,c))return g.select(0,g.getChildrenSize()),!0;let p=Qn(f);for(;p!==null;){if(Q(p)&&!vl(p,c))return p.select(0,p.getChildrenSize()),!0;let m=Vc(p);p=m===null?null:Qn(m)}return vl(Je(),c)||Wr(),!0},Pe)}))}}),QD=_e({build:(e,n,r)=>To(n),config:We({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return lN(e,s.onReposition.value)})}});function FN(e){return e.canIndent()}function PN(e,n,r=FN){return De(e.registerCommand(Vr,(s)=>{let i=X();if(!j(i))return!1;s.preventDefault();let a=function(l){if(l.getNodes().filter((m)=>Ur(m)&&m.canIndent()).length>0)return!0;let{anchor:c,focus:d}=l,f=d.isBefore(c)?d:c,g=f.getNode(),p=ku(g);if(p.canIndent()){let m=p.getKey(),_=Kr();if(_.anchor.set(m,0,"element"),_.focus.set(m,0,"element"),_=Uo(_),_.anchor.is(f))return!0}return!1}(i)?s.shiftKey?Yo:no:Ds;return e.dispatchCommand(a)},Te),e.registerCommand(no,()=>{let s=typeof n=="number"?n:n?n.peek():null,i=X();if(!j(i))return!1;let a=typeof r=="function"?r:r.peek();return bl((l)=>{if(a(l)){let c=l.getIndent()+1;(!s||c<s)&&l.setIndent(c)}})},Si))}var e$=_e({build:(e,n,r)=>To(n),config:We({$canIndent:FN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,n,r){let{disabled:s,maxIndent:i,$canIndent:a}=r.getOutput();return Zt(()=>{if(!s.value)return PN(e,i,a)})}}),t$=_e({build:(e)=>Rl(()=>e.isEditable(),(n)=>e.registerEditableListener((r)=>{n.value=r})),name:"@lexical/extension/WatchEditable"});var Ne=Ip,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:BN,$getPeerDependency:KN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:zN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:UN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:HN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:WN,NormalizeTripleClickSelectionExtension:GN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:Lp,buildEditorFromExtensions:sB,computed:iB,configExtension:jN,declarePeerDependency:aB,defineExtension:lB,effect:Nt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:YN,getPeerDependencyFromEditor:lo,getPeerDependencyFromEditorOrThrow:uB,namedSignals:Dt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:zs,untracked:pB,watchedSignal:VN}=Ne;var Fp={};Oe(Fp,{ReactProviderExtension:()=>n$});var n$=_e({name:"@lexical/react/ReactProvider"});var o$=Fp,XN=o$.ReactProviderExtension;var Bp={};Oe(Bp,{$canShowPlaceholder:()=>JN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Pp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>qN,registerLexicalTextEntity:()=>l$});function qN(){return Je().getTextContent()}function Pp(e,n=!0){if(e)return!1;let r=qN();return n&&(r=r.trim()),r===""}function r$(e,n){return()=>Pp(e,n)}function JN(e){if(!Pp(e,!1))return!1;let n=Je().getChildren(),r=n.length;if(r>1)return!1;for(let s=0;s<r;s++){let i=n[s];if(wt(i))return!1;if(Q(i)){if(!wn(i))return!1;if(i.__indent!==0)return!1;let a=i.getChildren(),l=a.length;for(let c=0;c<l;c++){let d=a[s];if(!re(d))return!1}}}return!0}function s$(e){return()=>JN(e)}function i$(e,n){let r=e.getFirstChild(),s=0;e:for(;r!==null;){if(Q(r)){let l=r.getFirstChild();if(l!==null){r=l;continue}}else if(re(r)){let l=r.getTextContentSize();if(s+l>n)return{node:r,offset:n-s};s+=l}let i=r.getNextSibling();if(i!==null){r=i;continue}let a=r.getParent();for(;a!==null;){let l=a.getNextSibling();if(l!==null){r=l;continue e}a=a.getParent()}break}return null}function a$(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,n,r,s){let i=(l)=>l instanceof r,a=(l)=>{let c=yt(l.getTextContent());c.setFormat(l.getFormat()),l.replace(c)};return[e.registerNodeTransform(Ln,(l)=>{if(!l.isSimpleText())return;let c,d=l.getPreviousSibling(),f=l.getTextContent(),g=l;if(re(d)){let m=d.getTextContent(),_=n(m+f);if(i(d)){if(_===null||((x)=>x.getLatest().__mode)(d)!==0)return void a(d);{let x=_.end-m.length;if(x>0){let C=m+f.slice(0,x);if(d.select(),d.setTextContent(C),x===f.length)l.remove();else{let y=f.slice(x);l.setTextContent(y)}return}}}else if(_===null||_.start<m.length)return}let p=0;for(;;){c=n(f);let m,_=c===null?"":f.slice(c.end);if(f=_,_===""){let C=g.getNextSibling();if(re(C)){_=g.getTextContent()+C.getTextContent();let y=n(_);if(y===null)return void(i(C)?a(C):C.markDirty());if(y.start!==0)return}}if(c===null)return;if(c.start===0&&re(d)&&d.isTextEntity()){p+=c.end;continue}c.start===0?[m,g]=g.splitText(c.end):[,m,g]=g.splitText(c.start+p,c.end+p),m===void 0&&a$(165,"nodeToReplace");let x=s(m);if(x.setFormat(m.getFormat()),m.replace(x),g==null)return;p=0,d=x}}),e.registerNodeTransform(r,(l)=>{let c=l.getTextContent(),d=n(c);if(d===null||d.start!==0)return void a(l);if(c.length>d.end)return void l.splitText(d.end);let f=l.getPreviousSibling();re(f)&&f.isTextEntity()&&(a(f),a(l));let g=l.getNextSibling();re(g)&&g.isTextEntity()&&(a(g),i(l)&&a(l))})]}var Us=Bp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=Us;var Kp={};Oe(Kp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>eE});var c$={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Xu=Symbol.for("@lexical/dragon/WindowState");function u$(e=function(){return typeof window<"u"?window:void 0}()){return e?QN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function QN(e,n,r){let s=function(i){let a=i[Xu];return a===void 0&&(a={dispose:()=>{},editors:new Map,installs:new Set},i[Xu]=a),a}(e);if(s.installs.size===0){let i=f$.bind(e);e.addEventListener("message",i,!0),s.dispose=()=>{e.removeEventListener("message",i,!0)}}if(s.installs.add(n),r){let i=s.editors.get(r)||new Set;i.add(n),s.editors.set(r,i)}return d$.bind(null,e,s,n,r)}function d$(e,n,r,s){if(s){let i=n.editors.get(s);i&&i.delete(r)&&i.size===0&&n.editors.delete(s)}n.installs.delete(r)&&n.installs.size===0&&(n.dispose(),delete e[Xu])}function ZN(e){return e&&e.ownerDocument.defaultView}function eE(e){let n=VN(()=>ZN(e.getRootElement()),(r)=>e.registerRootListener((s)=>{r.value=ZN(s)}));return Nt(()=>{let r=n.value;if(r)return QN(r,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let n=function(s){let i=s[Xu];if(i===void 0)return null;let a=bu(hS(s.document));return Ru(a)&&i.editors.has(a)?a:null}(this);if(n===null)return;let r=e.data;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch(i){return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let a=i.args;if(Array.isArray(a)){let[l,c,d,f,g,p]=a;if(![l,c,f,g].every(Number.isFinite)||typeof d!="string"&&d!==-1)return;n.update(()=>{let m=X();if(j(m)){let _=m.anchor,x=_.getNode(),C=0,y=0;if(re(x)&&l>=0&&c>=0&&(C=l,y=l+c,m.setTextNodeRange(x,C,x,y)),typeof d!="string"||C===y&&d===""||(m.insertRawText(d),x=_.getNode()),re(x)){let N=x.getTextContentSize();C=Math.min(Math.max(f,0),N),y=f<0||g<0?C:Math.min(f+g,N),m.setTextNodeRange(x,C,x,y)}if(typeof p=="string"&&g>0&&!m.isCollapsed()){let N=c$[p];N!==void 0&&m.formatText(N)}e.stopImmediatePropagation()}})}}}}}var g$=_e({build:(e,n,r)=>Dt(n),config:We({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,n,r)=>Nt(()=>r.getOutput().disabled.value?void 0:eE(e))});var zp=Kp,{DragonExtension:tE,installDragonSupport:AB,registerDragonSupport:nE}=zp;var oh={};Oe(oh,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>LE,$generateDOMFromNodes:()=>VE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>IE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>mE,$isBlockLevel:()=>Wi,$propagateTextAlignToBlockChildren:()=>FE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Qp,$withRenderContext:()=>Zp,BlockSchema:()=>BE,CoreImportExtension:()=>jE,CoreImportRules:()=>UE,DOMImportExtension:()=>nh,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>$E,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>AE,ImportWhitespaceConfig:()=>DE,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>qp,RenderContextRoot:()=>CE,RootSchema:()=>KE,contextUpdater:()=>m$,contextValue:()=>Ml,createImportState:()=>Ws,createRenderState:()=>Xp,defaultIsInline:()=>ME,defaultPreservesWhitespace:()=>RE,defineImportRule:()=>_r,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>OE,sel:()=>uw});function Hs(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hi;function es(e,n){let{key:r}=n;return e&&r in e?e[r]:n.defaultValue}function Yp(e){return Hi&&Hi.editor===e?Hi:void 0}function Zu(e,n){let r=Yp(n);return r&&r[e]}function p$(e,n){if("cfg"in n){let{cfg:r,updater:s}=n;return[r,s(es(e,r))]}return n}function qu(e,n){let r=n;for(let s of e){let[i,a]=p$(r,s),l=i.key;if(r===n&&es(r,i)===a)continue;let c=r===n||r===void 0?h$(n):r;c[l]=a,r=c}return r}function h$(e){return Object.create(e||null)}function Ml(e,n){return[e,n]}function m$(e,n){return{cfg:e,updater:n}}function gE(e,n,r,s=Ge()){let i=Hi,a=Yp(s);try{return Hi={...a,editor:s,[e]:n},r()}finally{Hi=i}}function pE(e,n=()=>{}){return(r,s=Ge())=>(i)=>{let a=Yp(s),l=a&&a[e],c=qu(r,l||n(s));return c&&c!==l?gE(e,c,i,s):i()}}function hE(e,n,r,s){return Object.assign(Vo(Symbol(n),{isEqual:s,parse:r}),{[e]:!0})}var mE=(e,n,r)=>{_E(e),r()};function _E(e){if(!qr(e))return;let n=e;if(n.querySelector("style")===null)return;let r=new Map;function s(i){let a=r.get(i);if(a===void 0){a=new Set;for(let l=0;l<i.style.length;l++)a.add(i.style[l]);r.set(i,a)}return a}try{for(let i of Array.from(n.styleSheets)){let a;try{a=i.cssRules}catch(l){continue}for(let l of Array.from(a)){if(!Pn(l,CSSStyleRule))continue;let c;try{c=n.querySelectorAll(l.selectorText)}catch(d){continue}for(let d of Array.from(c)){if(!ye(d))continue;let f=s(d);for(let g=0;g<l.style.length;g++){let p=l.style[g];f.has(p)||d.style.setProperty(p,l.style.getPropertyValue(p),l.style.getPropertyPriority(p))}}}}}catch(i){}}var Vp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),xE="@lexical/html/DOMImport",Dl=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Xp(e,n,r){return hE(Qu,e,n,r)}var CE=Xp("root",Boolean),qp=Xp("isExport",Boolean);function yE(e){let n=lo(e,Vp);return n?n.output.defaults:void 0}function x$(e,n=Ge()){return es(function(r){return Zu(Qu,r)||yE(r)}(n),e)}function Jp(e){let n=lo(e,Vp);return n?n.output.runtime:void 0}function C$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n)}function y$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n(es(s.editorContext,e)))}function ed(e=Ge()){let n=Jp(e);return n?n.getSessionConfig():zg(e)}var Zp=pE(Qu,yE);function S$(e,n,r){return{...n,...r,nodes:e}}function N$(e){return(n)=>n instanceof e}function E$(e,{nodes:n}){if(n==="*")return _$;let r={},s=[];for(let i of n)if("getType"in i){let a=i.getType();if(r){let l=e.get(a);l===void 0&&Hs(339,i.name,a);for(let c of l)r[c]=!0}s.push(N$(i))}else r=void 0,s.push(i);return r||(s.length===1?s[0]:(i)=>{for(let a of s)if(a(i))return!0;return!1})}function oE(e){return(n,r,s)=>e(n,s)}function Up(e){return(n,r,s,i)=>e(n,r,i)}function rE(e){return(n,r,s,i,a)=>e(n,r,s,a)}function T$(e){return(n,r,s,i,a,l)=>e(n,r,s,i,l)}function sE(e,n){return(r,s)=>{let i=()=>e(r,s),a=n(r);return a?a(r,i,s):i()}}function Hp(e,n){return(r,s,i)=>{let a=()=>e(r,s,i),l=n(r);return l?l(r,s,a,i):a()}}var b$=Hp,v$=Up;function iE(e,n){return(r,s,i,a)=>{let l=()=>e(r,s,i,a),c=n(r);return c?c(r,s,i,l,a):l()}}function O$(e,n){return(r,s,i,a,l)=>{let c=()=>e(r,s,i,a,l),d=n(r);return d?d(r,s,i,a,c,l):c()}}function A$(e,n){return(r,s,i,a)=>{e(r,s,i,a);let l=n(r);l&&l(r,s,i,a)}}function mr(e,n,r,s,i){let a=r[n];for(let l of e[n])if(typeof l[0]=="function"){let[c,d]=l;a=s(a,(f)=>c(f)&&d||void 0)}else{let c=l[1],d={};for(let f in c){let g=c[f];g&&(d[f]=g.reduce((p,m)=>s(p,()=>m),a))}a=s(a,(f)=>{let g=d[f.getType()];return g&&i(g)})}r[n]=a}function R$(e,n,r,s){if(!s)return;let i=e[n];if(typeof r=="function")i.push([r,s]);else{let a=i[i.length-1],l;a&&a[0]==="types"?l=a[1]:(l={},i.push(["types",l]));for(let c in r){let d=l[c]||[];l[c]=d,d.push(s)}}}function M$(e){return e.nodes==="*"}function D$(e,n){let r=Ou(YN(e).nodes),s={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let i of function(a){let l=[],c=[],d=[];for(let p of a)if(M$(p))l.push(p);else if(Array.isArray(p.nodes))for(let m of p.nodes)Hg(m.prototype)?d.push(p.nodes.length===1?p:{...p,nodes:[m]}):c.push(p.nodes.length===1?p:{...p,nodes:[m]});let f=new Map,g=(p)=>{let m=f.get(p);if(m===void 0){m=-1;for(let _ of OS(p))m++;f.set(p,m)}return m};return d.sort((p,m)=>g(p.nodes[0])-g(m.nodes[0])),[...d,...c,...l]}(n)){let a=E$(r,i);for(let l in s)R$(s,l,a,i[l])}return s}function $$(e){return e}function Wp(e,{overrides:n}){let r=D$(e,n),s={...Gg,...e.dom};return mr(r,"$createDOM",s,sE,oE),mr(r,"$exportDOM",s,sE,oE),mr(r,"$extractWithChild",s,O$,T$),mr(r,"$getDOMSlot",s,b$,v$),mr(r,"$shouldExclude",s,Hp,Up),mr(r,"$shouldInclude",s,Hp,Up),mr(r,"$getSlotTargetElement",s,iE,rE),mr(r,"$updateDOM",s,iE,rE),mr(r,"$decorateDOM",s,A$,$$),s}function SE(e){return{get:(n)=>es(e,n)}}function aE(e){let n=Object.create(null);return qu(e,n)||n}function Gp(e,n){let r=SE(n);return e.filter((s)=>!(s.disabledForEditor&&s.disabledForEditor(r)))}function w$(e){if(e.nodes==="*")return()=>!0;let n=e.nodes.map((r)=>{let s=r;return Hg(s.prototype)?(i)=>i instanceof s:r});return(r)=>n.some((s)=>s(r))}class NE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,n,r,s){this.editor=e,this.initialEditorConfig=n,this.overrides=r,this.editorContext=s,this.installed=Gp(r,s),this.hasSessionGates=r.some((i)=>i.disabledForSession)}setContextValue(e,n){let r=this.installed;this.editorContext[e.key]=n;let s=Gp(this.overrides,this.editorContext);if(function(d,f){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(d[g]!==f[g])return!1;return!0}(r,s))return;let i=function(d,f){let g=new Set(d),p=new Set(f),m=[];for(let _ of d)p.has(_)||m.push(_);for(let _ of f)g.has(_)||m.push(_);return m}(r,s);this.installed=s,this.sessionCache.clear();let a=Wp(this.initialEditorConfig,{overrides:s});this.editor._config.dom=a;let l=function(d){let f=[];for(let g of d)(g.$createDOM||g.$getDOMSlot||g.$decorateDOM)&&f.push(w$(g));return f.length===0?null:(g)=>f.some((p)=>p(g))}(i);if(!l)return;let c=a.$updateDOM;a.$updateDOM=(d,f,g,p)=>!!l(d)||c(d,f,g,p),this.editor.update(xi,{discrete:!0}),a.$updateDOM=c}getSessionConfig(){let e=this.editor._config.dom||Gg;if(!this.hasSessionGates)return e;let n=SE(Zu(Qu,this.editor)||this.editorContext),r=[],s=[];if(this.installed.forEach((l,c)=>{l.disabledForSession&&l.disabledForSession(n)?r.push(String(c)):s.push(l)}),r.length===0)return e;let i=r.join(","),a=this.sessionCache.get(i);return a||(a=Wp(this.initialEditorConfig,{overrides:s}),this.sessionCache.set(i,a)),a}}var k$=_e({build(e,n,r){let{initialEditorConfig:s}=r.getInitResult(),i=aE(n.contextDefaults);return{defaults:i,runtime:new NE(e,s,n.overrides,i)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=Xe().createElement("div");return e.role="textbox",{element:e}}]])},init(e,n){let r={dom:e.dom,nodes:e.nodes},s=aE(n.contextDefaults),i=Gp(n.overrides,s);return e.dom=Wp(e,{overrides:i}),{initialEditorConfig:r}},mergeConfig(e,n){let r=zt(e,n);for(let s of["overrides","contextDefaults"])n[s]&&(r[s]=[...e[s],...n[s]]);return r},name:Vp}),td=Symbol.for("@lexical/html/SelectorImpl");function $l(e,n){let r={kind:"element",predicate:(s=n,s.length===0?ye:s.length===1?s[0]:(a,l)=>{for(let c of s)if(!c(a,l))return!1;return!0}),tags:e};var s;let i=(a)=>$l(e,[...n,a]);return{[td]:r,attr:(a,l,c)=>i(jp(a,l,c)),classAll:(...a)=>i(TE(a)),classAny:(...a)=>i(function(l){let c=EE(l);if(c.length===0)return()=>!1;return(d)=>{if(!ye(d))return!1;let f=d.classList;for(let g of c)if(f.contains(g))return!0;return!1}}(a)),styleAny:(a,l,c)=>i(function(d,f,g){if(typeof f=="string")return(p)=>ye(p)&&p.style.getPropertyValue(d)===f;if(f instanceof RegExp){let p=g&&g.capture,m=f;return(_,x)=>{if(!ye(_))return!1;let C=_.style.getPropertyValue(d);if(!C)return!1;let y=C.match(m);return y!==null&&(p!==void 0&&(x[p]=y),!0)}}Hs(362,JSON.stringify(d))}(a,l,c))}}function EE(e){let n=[];for(let r of e)r&&n.push(r);return n}function TE(e){let n=EE(e);return n.length===0?()=>!0:(r)=>{if(!ye(r))return!1;let s=r.classList;for(let i of n)if(!s.contains(i))return!1;return!0}}function jp(e,n,r){if(n===!0)return(s)=>ye(s)&&s.hasAttribute(e);if(typeof n=="string")return(s)=>ye(s)&&s.getAttribute(e)===n;if(n instanceof RegExp){let s=r&&r.capture,i=n;return(a,l)=>{if(!ye(a))return!1;let c=a.getAttribute(e);if(c==null)return!1;let d=c.match(i);return d!==null&&(s!==void 0&&(l[s]=d),!0)}}Hs(361,JSON.stringify(e))}var I$={kind:"text",predicate:Fs,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},Ui={any:()=>$l(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Hs(363);let n=new Set;for(let r of e)n.add(r.toUpperCase());return $l(n,[])},text:()=>L$};function B$(e,n){return ye(e)&&e.nodeName===n.toUpperCase()}var bE=/[A-Za-z0-9_-]/;class vE{constructor(e,n){this.source=e,this.pos=n}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&bE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let r=this.source.slice(n,this.pos);return this.pos++,r.replace(/\\(.)/g,"$1")}assert(e,n){e||Hs(364,String(this.pos+1),n,this.source)}}function K$(e){let n=new Set,r=[],s=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(bE.test(e.peek())){let i=e.readIdent();i&&n.add(i.toUpperCase())}for(;!e.eof();){let i=e.peek();if(i==="."){e.consume();let a=e.readIdent();e.assert(a!=="",'expected class name after "."'),s.push(a)}else if(i==="#"){e.consume();let a=e.readIdent();e.assert(a!=="",'expected id after "#"'),r.push(jp("id",a))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();let a=e.readIdent();e.assert(a!=="",'expected attribute name after "["'),e.skipWhitespace();let l=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let c=e.peek();c==='"'||c==="'"?l=e.readQuoted():(l=e.readIdent(),e.assert(l!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),r.push(jp(a,l))}}}return s.length>0&&r.push(TE(s)),{predicates:r,tags:n}}function OE(e){let n=new vE(e,0),r=[];for(;;){let i=K$(n);if(r.push(i),n.skipWhitespace(),n.eof())break;n.assert(n.peek()===",",'expected "," (selector lists are the only supported combinator)'),n.consume(),n.skipWhitespace()}if(r.length===1)return $l(r[0].tags,r[0].predicates);let s=new Set;if(r.every((i)=>i.tags.size>0))for(let i of r)for(let a of i.tags)s.add(a);return $l(s,[(i,a)=>{for(let l of r){let c=i.nodeName;if(l.tags.size>0&&!l.tags.has(c))continue;let d=!0;for(let f of l.predicates)if(!f(i,a)){d=!1;break}if(d)return!0}return!1}])}function _r(e){return e}function Ws(e,n,r){return hE(Dl,e,n,r)}var z$=Ws("importSource",()=>"unknown"),U$=Ws("importSourceDataTransfer",()=>null),Ju=Ws("textFormat",()=>0),AE=Ws("textStyle",()=>({}));function RE(e){if(!ye(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function ME(e){if(Fs(e))return!0;if(!ye(e))return!1;let n=e.style.display;return n?n.startsWith("inline"):!Ls(e)&&ki(e)}var DE=Ws("whitespaceConfig",()=>({isInline:ME,preservesWhitespace:RE})),$E=Ws("importOverlays",()=>[]);class wE{constructor(e){this.record=e}get(e){return es(this.record,e)}set(e,n){this.record[e.key]=n}update(e,n){this.record[e.key]=n(es(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function kE(e){let n=lo(e,xE);return n?n.output.defaults:void 0}function IE(e,n=Ge()){return es(function(r){return Zu(Dl,r)||kE(r)}(n),e)}var Qp=pE(Dl,kE);function Wi(e){return Ur(e)||wt(e)&&!e.isInline()}function LE(e,n){let r=[],s=[],i=()=>{s.length!==0&&(r.push(n().splice(0,0,s)),s=[])};for(let a of e)if(Wi(a)){if(i(),Q(a)){let l=LE(a.getChildren(),n);a.splice(0,a.getChildrenSize(),l)}r.push(a)}else s.push(a);return i(),r}function FE(e,n){if(!ye(n))return e;let r=n.style.textAlign;if(!eh(r))return e;for(let s of e)Ur(s)&&s.getFormatType()===""&&s.setFormat(r);return e}function PE(e,n,r){e.length===1&&Ue(e[0])&&(e=[]);let s=Se();if(ye(r)){let i=r.style.textAlign;eh(i)&&s.setFormat(i)}return[s.splice(0,0,e)]}var BE={$accepts:Wi,$packageRun:PE,name:"BlockSchema"},H$={$accepts:(e)=>!Wi(e),name:"InlineSchema"},W$={$accepts:Wi,$packageRun:(e)=>e,name:"NestedBlockSchema"},KE={$accepts:Wi,$packageRun:PE,name:"RootSchema"},Gs=Ui,G$=new Set(["center","end","justify","left","right","start"]);function eh(e){return G$.has(e)}var j$={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Y$={CODE:rS,MARK:sS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=_r({$import:(e,n)=>{let r=e.get(Ju),s=j$[n.nodeName],i=function(m){return{fontStyle:m.style.fontStyle,fontWeight:m.style.fontWeight,textDecoration:m.style.textDecoration,verticalAlign:m.style.verticalAlign}}(n),a=s?(l=s,{fontStyle:(c=i).fontStyle||l.fontStyle,fontWeight:c.fontWeight||l.fontWeight,textDecoration:c.textDecoration||l.textDecoration,verticalAlign:c.verticalAlign||l.verticalAlign}):i;var l,c;let d=(f=r,g=function(m){let _=0,x=0,{fontWeight:C,fontStyle:y,textDecoration:N,verticalAlign:T}=m;if(C==="700"||C==="bold"?_|=hl:C!=="normal"&&C!=="400"||(x|=hl),y==="italic"?_|=_l:y==="normal"&&(x|=_l),N){let v=N.split(" ");v.includes("underline")&&(_|=Cl),v.includes("line-through")&&(_|=xl),v.includes("none")&&(x|=Cl|xl)}return T==="sub"?(_|=gu,x|=pu):T==="super"?(_|=pu,x|=gu):T==="baseline"&&(x|=gu|pu),{clear:x,set:_}}(a),f&~g.clear|g.set);var f,g;let p=Y$[n.nodeName];return p&&(d|=p),d===r?e.$importChildren(n):e.$importChildren(n,{context:[Ml(Ju,d)]})},match:Gs.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function lE(e,n,r){let s=e;for(;;){let i=null;for(;(i=n?s.nextSibling:s.previousSibling)===null;){let l=s.parentNode;if(l===null)return null;s=l}if(s=i,!r.isInline(s))return null;let a=s;for(;(a=n?s.firstChild:s.lastChild)!==null;)s=a;if(Fs(s))return s;if(s.nodeName==="BR")return null}}function cE(e,n){return n!==0&&re(e)?e.setFormat(n):e}function uE(e,n){if(re(e)){let r=function(s){let i="";for(let a in s)V$.has(a)||(i+=`${a}: ${s[a]}; `);return i.trimEnd()}(n);r!==""&&e.setStyle(r)}return e}var q$=_r({$import:(e,n)=>{let r=e.get(Ju),s=e.get(AE),i=e.get(DE);if(function(c,d){let f=c.parentNode;for(;f!==null;){if(d.preservesWhitespace(f))return!0;f=f.parentNode}return!1}(n,i)){let c=sl(n.textContent||"");for(let d of c)cE(d,r),uE(d,s);return c}let a=function(c,d){let f=(c.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(f.length===0)return"";if(f[0]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!1,d))!==null;){let m=g.textContent||"";if(m.length>0){/[ \t\n]$/.test(m)&&(f=f.slice(1)),p=!1;break}}p&&(f=f.slice(1))}if(f.length>0&&f[f.length-1]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!0,d))!==null;)if((g.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){p=!1;break}p&&(f=f.slice(0,-1))}return f}(n,i);if(a==="")return[];let l=yt(a);return cE(l,r),uE(l,s),[l]},match:Gs.text(),name:"@lexical/html/#text"}),J$=_r({$import:()=>[],match:Gs.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=_r({$import:(e,n)=>bS(n)||TS(n)?[]:[fn()],match:Gs.tag("br"),name:"@lexical/html/br"}),Q$=_r({$import:(e,n)=>{let r=Se();if(eo(r,n),Zr(n,r),r.getFormatType()===""){let s=n.getAttribute("align");s&&eh(s)&&r.setFormat(s)}return Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:Gs.tag("p"),name:"@lexical/html/p"}),zE=_r({$import:(e,n,r)=>Ge().hasNode(ju)?[Gu()]:r(),match:Gs.tag("hr"),name:"@lexical/html/hr"}),UE=[J$,Q$,zE,_r({$import:(e,n,r)=>Ls(n)?FE(e.$importChildren(n,{schema:BE}),n):r(),match:Gs.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,n){let r=[],s=0,i=0;for(;s<e.length&&i<n.length;)e[s]<=n[i]?r.push(e[s++]):r.push(n[i++]);for(;s<e.length;)r.push(e[s++]);for(;i<n.length;)r.push(n[i++]);return r}function HE(e){let n=[],r=new Map,s=[],i=[],a=[],l=new Set;e.forEach((d,f)=>{let g=function(m){let _=m[td];return _===void 0&&Hs(360),_}(d.match),p=d.name||function(m,_){if(m.kind==="text")return`#text@${_}`;if(m.kind==="comment")return`#comment@${_}`;if(m.tags.size===0)return`*@${_}`;return`${Array.from(m.tags).join(",").toLowerCase()}@${_}`}(g,f);if(d.name&&l.add(d.name),n.push({$import:d.$import,name:p,predicate:g.predicate}),g.kind==="text")i.push(f);else if(g.kind==="comment")a.push(f);else if(g.tags.size===0)s.push(f);else for(let m of g.tags){let _=r.get(m);_||(_=[],r.set(m,_)),_.push(f)}});let c=new Map;if(s.length===0)for(let[d,f]of r)c.set(d,f);else for(let[d,f]of r)c.set(d,ew(f,s));return{byTag:c,commentIndices:a,rules:n,textIndices:i,wildcardIndices:s}}function dE(e,n){return Fs(n)?e.textIndices:n.nodeType===8?e.commentIndices:ye(n)?e.byTag.get(n.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function WE(e){let n=[];for(let r of e)if(nw(r))for(let s of r.rules)n.push(s);else n.push(r);return n}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let n=WE(e);return{__type:"CompiledOverlayRules",dispatch:HE(n),rules:n}}var rw=Object.freeze({});function sw(e,n){return{$importChildren:(s,i)=>function(a,l,c){let d=c&&c.rules?c.rules.dispatch:void 0;d&&a.overlays.push(d);try{let f=()=>GE(a,l,c);return c&&c.context?Qp(c.context,a.editor)(f):f()}finally{d&&a.overlays.pop()}}(e,s,i),$importOne:(s,i)=>th(e,s,i),captures:n,get:(s)=>IE(s,e.editor),session:e.session}}function GE(e,n,r){let s=r&&r.$onChild,i=[];for(let c of Array.from(n.childNodes)){let d=th(e,c,void 0);for(let f of d){let g=s?s(f):f;g!=null&&i.push(g)}}let a=r&&r.$after?r.$after(i):i,l=r&&r.schema;return l?function(c,d,f,g){let p=[],m=null,_=()=>{if(m===null)return;let x=m;if(m=null,c.$packageRun){let C=c.$packageRun(x,f,g);if(C.length>0){for(let y of C)p.push(y);return}}if(c.onReject==="hoist")for(let C of x)p.push(C)};for(let x of d)c.$accepts(x,f)?(_(),p.push(x)):(m===null&&(m=[]),m.push(x));return _(),c.$finalize?c.$finalize(p,f):p}(l,a,null,n):a}function th(e,n,r){let s=()=>function(i,a){let l=function(g,p){let m=[];for(let x=g.overlays.length-1;x>=0;x--){let C=g.overlays[x],y=dE(C,p);y.length>0&&m.push({dispatch:C,indices:y})}let _=dE(g.dispatch,p);return _.length>0&&m.push({dispatch:g.dispatch,indices:_}),m}(i,a);if(l.length===0)return fE(i,a);let c=0,d=0,f=()=>{for(;c<l.length;){let{dispatch:g,indices:p}=l[c];for(;d<p.length;){let m=p[d++],_=g.rules[m],x={};if(_.predicate(a,x)){let C=sw(i,Object.keys(x).length===0?rw:x);try{return _.$import(C,a,f)}catch(y){throw y}}}c++,d=0}return fE(i,a)};return f()}(e,n);return r&&r.context?Qp(r.context,e.editor)(s):s()}function fE(e,n){if(n.childNodes.length===0)return[];let r=[];for(let s of Array.from(n.childNodes)){let i=th(e,s,void 0);for(let a of i)r.push(a)}return r}var iw=_r({$import:(e,n)=>e.$importChildren(n),match:Ui.any(),name:"@lexical/html/default-hoist"}),nh=_e({build(e,n){let r=HE(WE(n.rules)),s=qu(n.contextDefaults,void 0),i=n.preprocess;return{$generateNodesFromDOM:(a,l)=>{let c=Zu(Dl,e)||s,d=l&&l.context?qu(l.context,c):c,f=d!==void 0&&d!==c?d:Object.create(c||null),g=new wE(f),p={session:g};return function(m,_,x){let C=m.length-1,y=()=>{for(;C>=0;)return void(0,m[C--])(_,x,y)};y()}(l&&l.preprocess?[...i,...l.preprocess]:i,a,p),gE(Dl,f,()=>function(m,_,x,C){return GE({dispatch:m,editor:_,overlays:C.get($E).map((y)=>y.dispatch),session:C},qr(x)?x.body:x,{schema:KE})}(r,e,a,g),e)},defaults:s}},config:{contextDefaults:[],preprocess:[mE],rules:[iw]},mergeConfig:(e,n)=>zt(e,{...n,...n.contextDefaults&&{contextDefaults:[...e.contextDefaults,...n.contextDefaults]},...n.preprocess&&{preprocess:[...e.preprocess,...n.preprocess]},...n.rules&&{rules:[...n.rules,...e.rules]}}),name:xE});function aw(e,n){return BN(nh).$generateNodesFromDOM(e,n)}var jE=_e({dependencies:[sn(nh,{rules:UE})],name:"@lexical/html/CoreImport"}),lw=[zE],cw=_e({dependencies:[UN,jE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:Ui.any,comment:Ui.comment,css:OE,tag:Ui.tag,text:Ui.text},YE=new Set(["STYLE","SCRIPT"]);function dw(e,n){_E(n);let r=qr(n)?n.body.childNodes:n.childNodes,s=[],i=[];for(let a of r)if(!YE.has(a.nodeName)){let l=XE(a,e,i,!1);if(l!==null)for(let c of l)s.push(c)}return function(a){for(let l of a)l.getParent()&&l.getNextSibling()instanceof dl&&l.insertAfter(fn());for(let l of a){let c=l.getParent();c&&c.splice(l.getIndexWithinParent(),1,l.getChildren())}}(i),s}function VE(e,n=null,r=Ge()){return Zp([Ml(qp,!0)],r)(()=>{let s=Je(),i=ed(r),a=j(n)?Qn(n.anchor.getNode()):null,l=e.append.bind(e);for(let c of(Q(a)?a:s).getChildren())nd(r,c,l,n,i);return e})}function fw(e,n=Je()){let r=Ge();return Zp([Ml(qp,!0),Ml(CE,!0)],r)(()=>{let s=ed(r),i=e.append.bind(e);return nd(r,n,i,null,s),e})}function gw(e,n=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hs(338),Ay(e),VE(Xe().createElement("div"),n,e).innerHTML}function nd(e,n,r,s=null,i=zg(e)){let a=i.$shouldInclude(n,s,e),l=i.$shouldExclude(n,s,e),c=n;s!==null&&re(n)&&(c=Ps(s,n,"clone"));let d=i.$exportDOM(c,e),{element:f,after:g,append:p,$getChildNodes:m}=d;if(!f)return!1;let _=Xe().createDocumentFragment(),x=m?m():Q(c)?c.getChildren():[],C=a&&Ze(s)&&Q(n)?null:s,y=_.append.bind(_);for(let N of x){let T=nd(e,N,y,C,i);!a&&T&&i.$extractWithChild(n,N,s,"html",e)&&(a=!0)}if(a&&!l){if((ye(f)||Vg(f))&&(p?p(_):f.append(_)),r(f),g){let N=g.call(c,f);N&&(Vg(f)?f.replaceChildren(N):f.replaceWith(N))}}else r(_);return a}function pw(e,n,r,s=null){return nd(e,n,r.append.bind(r),s,ed(e))}function XE(e,n,r,s,i=new Map,a){let l=[];if(YE.has(e.nodeName))return l;let c=null,d=function(x,C){let{nodeName:y}=x,N=C._htmlConversions.get(y.toLowerCase()),T=null;if(N!==void 0)for(let v of N){let R=v(x);R!==null&&(T===null||(T.priority||0)<=(R.priority||0))&&(T=R)}return T!==null?T.conversion:null}(e,n),f=d?d(e):null,g=null;if(f!==null){g=f.after;let x=f.node;if(c=Array.isArray(x)?x[x.length-1]:x,c!==null){for(let[,C]of i)if(c=C(c,a),!c)break;c&&l.push(...Array.isArray(x)?x:[c])}f.forChild!=null&&i.set(e.nodeName,f.forChild)}let p=e.childNodes,m=[],_=(c==null||!Mt(c))&&(c!=null&&Ur(c)||s);for(let x=0;x<p.length;x++)m.push(...XE(p[x],n,r,_,new Map(i),c));if(g!=null&&(m=g(m)),Ls(e)&&(m=hw(e,m,_?()=>{let x=new dl;return r.push(x),x}:Se)),c==null)if(m.length>0)for(let x of m)l.push(x);else Ls(e)&&function(x){if(x.nextSibling==null||x.previousSibling==null)return!1;return ki(x.nextSibling)&&ki(x.previousSibling)}(e)&&l.push(fn());else Q(c)&&c.append(...m);return l}function hw(e,n,r){let s=e.style.textAlign,i=[],a=[];for(let l=0;l<n.length;l++){let c=n[l];if(Ur(c))s&&!c.getFormat()&&c.setFormat(s),i.push(c);else if(a.push(c),l===n.length-1||l<n.length-1&&Ur(n[l+1])){let d=r();d.setFormat(s),d.append(...a),i.push(d),a=[]}}return i}var be=oh,{$appendNodeToHTML:kB,$distributeInlineWrapper:qE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:JE,$generateNodesFromDOM:ZE,$generateNodesFromDOMViaExtension:QE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:eT,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:tT,CoreImportExtension:co,CoreImportRules:GB,DOMImportExtension:qo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:nT,ImportSource:oT,ImportSourceDataTransfer:rT,ImportTextFormat:rh,ImportTextStyle:sh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Gi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:ft,defineOverlayRules:ih,domOverride:iK,isElementOfTag:ah,parseSelector:aK,sel:gt}=be;var fh={};Oe(fh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>pT,$generateNodesFromSerializedNodes:()=>hT,$getClipboardDataFromSelection:()=>mT,$getHtmlContent:()=>uh,$getLexicalContent:()=>dh,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>uT,$insertDataTransferForRichText:()=>dT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>ch,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>ST,caretFromPoint:()=>aT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>_T});function aT(e,n,r=null){let s=Is(r),i=r?_S(r):[],a=r!==null&&i.length>0;if(a&&typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n,{shadowRoots:i});if(l!==null&&function(c,d){for(let f=c;f!==null;){if(f===d)return!0;f=Nl(f)}return!1}(l.offsetNode,r))return{node:l.offsetNode,offset:l.offset}}if(a){let l=r.getRootNode();if(Au(l)){let c=l.elementFromPoint(e,n);if(c!==null&&r.contains(c)){let d=function(f,g,p,m){let _=m.createRange(),x=(H)=>g<H.top?H.top-g:g>H.bottom?g-H.bottom:0,C=(H)=>f<H.left?H.left-f:f>H.right?f-H.right:0,y=m.createTreeWalker(p,NodeFilter.SHOW_TEXT),N=null,T=1/0,v=1/0;for(let H=y.nextNode();H;H=y.nextNode()){_.selectNodeContents(H);for(let U of _.getClientRects()){let W=x(U),J=C(U);(W<T||W===T&&J<v)&&(T=W,v=J,N=H)}}if(N===null)return null;let R=0,F=1/0,k=1/0;for(let H=0;H<=N.length;H++){_.setStart(N,H),_.collapse(!0);let U=_.getBoundingClientRect(),W=x(U),J=Math.abs(f-U.left);(W<F||W===F&&J<k)&&(F=W,k=J,R=H)}return{node:N,offset:R}}(e,n,c,s);if(d!==null)return d}}}if(typeof s.caretRangeFromPoint=="function"){let l=s.caretRangeFromPoint(e,n);return l===null?null:{node:l.startContainer,offset:l.startOffset}}if(typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n);return l===null?null:{node:l.offsetNode,offset:l.offset}}return null}function Yi(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rd={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function lT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(n)=>n}).createHTML(e);return e}var sT=(e,n)=>{if(!j(n))return n.insertRawText(e),!0;let r=(s)=>{let i=X();j(i)&&s(i)};return Li(e,{linebreak:()=>r((s)=>s.insertParagraph()),tab:()=>r((s)=>s.insertNodes([gn()])),text:(s)=>r((i)=>i.insertText(s))}),!0},sd={"application/x-lexical-editor":[(e,n,r)=>{try{let s=Ge(),i=JSON.parse(e);if(i&&i.namespace===s._config.namespace&&Array.isArray(i.nodes))return id(s,hT(i.nodes),n),!0}catch(s){console.error(s)}return r()}],"text/html":[(e,n,r)=>{try{let s=Ge(),i=new DOMParser().parseFromString(lT(e),"text/html");return id(s,ZE(s,i),n),!0}catch(s){return console.error(s),r()}}],"text/plain":[sT],"text/uri-list":[sT]};function mw(e,n,r,s){if(!e)return!1;let i=(a)=>!!e[a]&&e[a](n,r,i.bind(null,a-1),s);return i(e.length-1)}function cT(e,n,r){let s=n.getData("text/plain");for(let i of function(a){return Object.keys(a.$importMimeType).filter((l)=>a.$importMimeType[l]!==void 0).sort((l,c)=>{let d=a.priority[l],f=a.priority[c];return d===void 0&&f===void 0?l<c?-1:l>c?1:0:d===void 0?1:f===void 0?-1:d-f})}(e)){let a=n.getData(i);if(a&&((i!=="text/html"||a!==s)&&mw(e.$importMimeType[i],a,r,n)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,n)=>cT({$importMimeType:sd,priority:rd},e,n),priority:rd},ch=_e({build:(e,n)=>({$importMimeType:n.$importMimeType,$insertDataTransfer:(r,s)=>cT(n,r,s),priority:n.priority}),config:We({$importMimeType:sd,priority:rd}),mergeConfig(e,n){let r=zt(e,n);if(n.$importMimeType){let s={...e.$importMimeType};for(let[i,a]of Object.entries(n.$importMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$importMimeType=s}return n.priority&&(r.priority={...e.priority,...n.priority}),r},name:"@lexical/clipboard/Import"}),xw=_e({dependencies:[co,jN(ch,{$importMimeType:{"text/html":[(e,n,r,s)=>{let i=new DOMParser().parseFromString(lT(e),"text/html"),a=QE(i,{context:[Gi(oT,"paste"),Gi(rT,s)]});return id(Ge(),a,n),!0}]}})],name:"@lexical/clipboard/DOMImport"});function uh(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?"":JE(e,n)}function dh(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?null:JSON.stringify(pT(e,n))}function uT(e,n){let r=e.getData("text/plain")||e.getData("text/uri-list");r!=null&&n.insertRawText(r)}function dT(e,n,r){(function(){let s=KN(ch.name);return s?s.output:_w})().$insertDataTransfer(e,n)}var fT="application/x-lexical-drag";function Cw(e,n){let r={editorKey:n.getKey()};e.setData(fT,JSON.stringify(r))}function gT(e,n,r){let s=e.dataTransfer;if(s===null)return!1;let i=function(f){let g=f.getData(fT);if(!g)return null;let p;try{p=JSON.parse(g)}catch(_){return null}return(m=p)!==null&&typeof m=="object"&&"editorKey"in m&&typeof m.editorKey=="string"?p:null;var m}(s);if(i===null)return!1;let a=function(f,g){let p=aT(f.clientX,f.clientY,g.getRootElement());if(p===null)return null;let m=vt(p.node);if(m===null)return null;if(re(m))return Xc(m,"next",p.offset);if(Q(m))return Bg(m,p.offset,"next");let _=m.getParent();return _===null?null:Bg(_,m.getIndexWithinParent()+1,"next")}(e,n);if(a===null)return!1;let l=Zc(a);if(l===null)return!1;let c=i.editorKey===n.getKey(),d=X();if(c){if(!j(d)||d.isCollapsed())return!1;if(function(f,g){let{anchor:p,focus:m}=dr(ur(g),"next");return Br(p,f)<0&&Br(f,m)<0}(a,d))return e.preventDefault(),!0;d.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(r(s,kn(Os(l)),n),!c){let f=n.getRootElement(),g=f?f.ownerDocument:null,p=g?function(m,_){for(let x of gS(_)){let C=bu(x);if(Ru(C)&&C.getKey()===m&&ye(x))return x}return null}(i.editorKey,g):null;p!==null&&p.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,n){return gT(e,n,dT)}function Sw(e,n){return gT(e,n,(r,s)=>uT(r,s))}function id(e,n,r){e.dispatchCommand(yu,{nodes:n,selection:r})||(r.insertNodes(n),function(s){if(j(s)&&s.isCollapsed()){let i=s.anchor,a=null,l=dn(i,"previous");if(l)if(Hr(l))a=l.origin;else{let c=Zn(l,bt(Je(),"next").getFlipped());for(let d of c){if(re(d.origin)){a=d.origin;break}if(Q(d.origin)&&!d.origin.isInline())break}}if(a&&re(a)){let c=a.getFormat(),d=a.getStyle();s.format===c&&s.style===d||(s.format=c,s.style=d,s.dirty=!0)}}}(r))}function lh(e,n,r,s=[]){let i=n===null||r.isSelected(n),a=Q(r)&&r.excludeFromCopy("html"),l=r;n!==null&&re(l)&&(l=Ps(n,l,"clone"));let c=Q(l)?l.getChildren():[],d=function(g){let p=g.exportJSON(),m=g.constructor;if(p.type!==m.getType()&&Yi(58,m.name),Q(g)){let _=p.children;Array.isArray(_)||Yi(59,m.name)}return p}(l);re(l)&&l.getTextContentSize()===0&&(i=!1);let f=i&&Ze(n)&&Q(r)?null:n;for(let g=0;g<c.length;g++){let p=c[g],m=lh(e,f,p,d.children);!i&&Q(r)&&m&&r.extractWithChild(p,n,"clone")&&(i=!0)}if(i&&!a){let g=As(l);if(g.length>0){let p={};for(let m of g){let _=Ci(l,m);_===null&&Yi(366,l.constructor.name,m);let x=[];lh(e,null,_,x),x.length===1&&x[0].type===_.getType()||Yi(385,m,l.constructor.name,String(x.length),String(x.length>0?x[0].type:"none")),p[m]=x[0]}d.$slots=p}}if(i&&!a)s.push(d);else if(Array.isArray(d.children))for(let g=0;g<d.children.length;g++){let p=d.children[g];s.push(p)}return i}function pT(e,n){let r=[],s=Je(),i=j(n)?n.anchor.getNode():Ze(n)?n.getNodes()[0]??null:null,a=i!==null?Qn(i):null,l=(Q(a)?a:s).getChildren();for(let c=0;c<l.length;c++)lh(e,n,l[c],r);return{namespace:e._config.namespace,nodes:r}}function hT(e){let n=[];for(let r of e)n.push(Uy(r));return n}var ji=null;async function Nw(e,n,r){if(ji!==null)return!1;if(n!==null)return new Promise((f,g)=>{e.update(()=>{f(iT(e,n,r))})});let s=e.getRootElement(),i=e._window||window,a=i.document,l=Fn(i);if(s===null||l===null)return!1;let c=a.createElement("span");c.style.position="fixed",c.style.top="-1000px",c.append(a.createTextNode("#")),s.append(c);let d=a.createRange();return d.setStart(c,0),d.setEnd(c,1),l.removeAllRanges(),l.addRange(d),new Promise((f,g)=>{let p=e.registerCommand(Ni,(m)=>(Pn(m,ClipboardEvent)&&(p(),ji!==null&&(i.clearTimeout(ji),ji=null),f(iT(e,m,r))),!0),Si);ji=i.setTimeout(()=>{p(),ji=null,f(!1)},50),a.execCommand("copy"),c.remove()})}function iT(e,n,r){if(r===void 0){let i=Fn(e._window),a=X();if(!a||a.isCollapsed())return!1;if(!i)return!1;let l=ws(i,e.getRootElement()),{anchorNode:c,focusNode:d}=l;if(c!==null&&d!==null&&!vS(e,c,d))return!1;r=mT(a)}n.preventDefault();let s=n.clipboardData;return s!==null&&(_T(s,r),!0)}var Ew=[["text/html",uh],["application/x-lexical-editor",dh]];function mT(e=X()){return function(n,r){let s={"text/plain":""};for(let[i,a]of Object.entries(n))if(a){let l=yT(a,r);l!==null&&(s[i]=l)}return s}(xT(),e)}function _T(e,n){for(let[r]of Ew)n[r]===void 0&&e.setData(r,"");for(let r in n){let s=n[r];s!==void 0&&e.setData(r,s)}}function xT(e=Ge()){let n=lo(e,ST.name);return n?n.output:CT}var CT={"application/x-lexical-editor":[(e,n)=>e?dh(Ge(),e):n()],"text/html":[(e,n)=>e?uh(Ge(),e):n()],"text/plain":[(e,n)=>e?e.getTextContent():n()]};function yT(e,n){let r=(s)=>e[s]?e[s](n,r.bind(null,s-1)):null;return r(e.length-1)}function Tw(e,n=X()){return yT(xT()[e]||[],n)}var ST=_e({build:(e,n,r)=>n.$exportMimeType,config:We({$exportMimeType:CT}),mergeConfig(e,n){let r=zt(e,n);if(n.$exportMimeType){let s={...e.$exportMimeType};for(let[i,a]of Object.entries(n.$exportMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$exportMimeType=s}return r},name:"@lexical/clipboard/GetClipboardData"});var It=fh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:NT,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:gh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:ET,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:wl,setLexicalClipboardDataTransfer:TT}=It;var hh={};Oe(hh,{$createHeadingNode:()=>Ji,$createQuoteNode:()=>Il,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>ph,HeadingNode:()=>Ll,QuoteNode:()=>kl,RichTextExtension:()=>wT,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>$T,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Bs,quoteShadowRootState:()=>fd,registerRichText:()=>kT});var bw=ft({$import:(e,n)=>{let r=Ji(n.nodeName.toLowerCase());return Zr(n,r),eo(r,n),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:gt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=ft({$import:(e,n)=>{let r=Il();return eo(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:gt.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=ft({$import:(e,n)=>{let r=Il({shadowRoot:!0});return eo(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n,{schema:tT}))]},match:gt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),$T=[bw,vw,ft({$import:(e,n,r)=>{let s=n.firstChild;return s&&(ye(i=s)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt")?e.$importChildren(n):r();var i},match:gt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),ft({$import:(e,n,r)=>n.style.fontSize!=="26pt"?r():[Ji("h1").splice(0,0,e.$importChildren(n))],match:gt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,n){return e&&n!==null?zt(e,n):n}var wT=_e({build:(e,n)=>Dt(n),config:We({escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}}}),conflictsWith:["@lexical/plain-text"],dependencies:[tE,WN,GN,co,sn(qo,{rules:$T})],mergeConfig:function(e,n){let r=zt(e,n);return n.escapeFormatTriggers&&(r.escapeFormatTriggers=function(s,i){let a=zt(s,i);for(let l of Object.keys(i))a[l]=Aw(s[l],i[l]);return a}(e.escapeFormatTriggers,n.escapeFormatTriggers)),r},name:"@lexical/rich-text",nodes:()=>[Ll,kl],register:(e,n,r)=>Nt(()=>kT(e,r.getOutput().escapeFormatTriggers))}),Rw=_e({dependencies:[wT],name:"@lexical/rich-text/Import"}),ph=bn("DRAG_DROP_PASTE_FILE"),fd=Vo("shadowRoot",{parse:Boolean});class kl extends ct{$config(){return this.config("quote",{extends:ct,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Ko(this,fd)}setIsShadowRoot(e){return to(this,fd,e)}createDOM(e){let n=Xe().createElement("blockquote");return et(n,e.theme.quote),n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){return super.exportJSON()}static importJSON(e){return Il().updateFromJSON(e)}insertNewAfter(e,n){let r=Se(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Il(e){let n=un(new kl);return e&&e.shadowRoot?n.setIsShadowRoot(!0):n}function Mw(e){return e instanceof kl}class Ll extends ct{__tag;$config(){return this.config("heading",{extends:ct,importDOM:{h1:()=>({conversion:Vi,priority:0}),h2:()=>({conversion:Vi,priority:0}),h3:()=>({conversion:Vi,priority:0}),h4:()=>({conversion:Vi,priority:0}),h5:()=>({conversion:Vi,priority:0}),h6:()=>({conversion:Vi,priority:0}),p:(e)=>{let n=e.firstChild;return n!==null&&bT(n)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>bT(e)?{conversion:()=>({node:Ji("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let n=this.getWritable();return n.__tag=e,n}createDOM(e){let n=this.__tag,r=Xe().createElement(n),s=e.theme.heading;if(s!==void 0){let i=s[n];et(r,i)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,s=this.getLastDescendant(),i=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Se():Ji(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let l=Se();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Se();this.getChildren().forEach((n)=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}}function bT(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Vi(e){let n=e.nodeName.toLowerCase(),r=null;return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6"||(r=Ji(n),Zr(e,r),eo(r,e),Tn(r,e)),{node:r}}function Dw(e){let n=Il();return eo(n,e),Zr(e,n),Tn(n,e),{node:n}}function Ji(e="h1"){return un(new Ll(e))}function $w(e){return e instanceof Ll}function vT(e){let n=vt(e);return wt(n)}function Xi(e,n,r,s){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type==="text"){let c=e.anchor.getNode();if(re(c)){a=c;let d=e.anchor.offset,f=d===c.getTextContentSize()&&c.getNextSibling()===null,g=d===0&&c.getPreviousSibling()===null;i=r==="end"&&f||r==="start"&&g||r==="both"&&(f||g)}}let l=!1;for(let[c,d]of Object.entries(s)){if(d==null||!d[n])continue;let f=c;if(d.onlyAtBoundary){if(!(i&&a&&re(a)&&a.hasFormat(f)))continue;l=!0}e.hasFormat(f)&&e.toggleFormat(f)}l&&e.setStyle("")}var ww={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function cd(e,n){return function(r,s){if(!r.isCollapsed())return!1;let i=dn(r.focus,s),a=he(i.origin,Jc);if(!a)return!1;let l=r.focus.getNode();if(!a.is(l)&&!al(l,a))return!1;let c=Zn(i,it(a,s));if(c.getTextSlices().some((p)=>p&&p.getTextContentSize()>0))return!1;let d=Zn(c.anchor.getSiblingCaret(),c.focus),f=d.anchor.origin;for(let p of d){if(!No(p)||!p.origin.is(f.getParent()))return!1;f=p.origin}let g=a;for(let p of bs(it(a,s))){if(!p.origin.is(g.getParent())){if(Ky(p.origin)){let m=it(g,s);return kn(Zn(m,m)),!0}break}if(!Jc(p.origin))break;g=p.origin}return!1}(e,n)||function(r,s){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;let i=dn(r.anchor,s).getNodeAtCaret();return!(!Jc(i)||i.isInline()||(kn(Os(kt(bt(i,s)))),0))}(e,n)}function OT(e){return wt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let n=Yc();n.add(e),mt(n)}function AT(e,n){if(!e.isCollapsed())return!1;let r=e.focus,s=r.getNode(),i=n?"previous":"next",a=dn(r,i);if(r.type==="element"&&Q(s)&&Mt(s)){let N=a.getNodeAtCaret();return!(N===null||!OT(N))&&(ud(N.__key),!0)}let l=he(Q(s)?s:s.getParentOrThrow(),(N)=>Q(N)&&!N.isInline()&&Mt(N.getParent()));if(l===null)return!1;let c=it(l,i).getNodeAtCaret();if(c===null||!OT(c))return!1;if(l.getTextContentSize()===0)return ud(c.__key),!0;let d=Ge().getRootElement();if(d===null)return!1;let f=Fn(d.ownerDocument.defaultView);if(f===null||f.rangeCount===0)return!1;let{anchorNode:g,anchorOffset:p,focusNode:m,focusOffset:_}=f;f.modify("move",n?"backward":"forward","line");let{anchorNode:x,anchorOffset:C}=f;if(x===null)return RT(f,g,p,m,_),!1;let y=vt(x);if(RT(f,g,p,m,_),y===null)return!1;if(x===g&&C===p)return ud(c.__key),!0;return!y.is(l)&&!al(y,l)&&(ud(c.__key),!0)}function RT(e,n,r,s,i){n!==null&&s!==null&&e.setBaseAndExtent(n,r,s,i)}function MT(e,n){if(!e.isCollapsed())return!1;let r=e.focus.getNode(),s=he(Q(r)?r:r.getParentOrThrow(),(y)=>Q(y)&&!y.isInline());if(s===null)return!1;let i=Ge(),a=i.getRootElement();if(a===null)return!1;let l=a.ownerDocument.defaultView;if(l===null)return!1;let c=!1;for(let y of s.getChildren())if(Q(y)&&y.isInline()){let N=i.getElementByKey(y.getKey());if(N!==null){let T=l.getComputedStyle(N).display;if(T==="inline-grid"||T==="inline-flex"){c=!0;break}}}if(!c)return!1;let d=it(s,n?"previous":"next").getNodeAtCaret();if(d===null||!Q(d)){if(n){let y=s.getFirstDescendant();re(y)?y.select(0,0):s.select(0,0)}else{let y=s.getLastDescendant();if(re(y)){let N=y.getTextContentSize();y.select(N,N)}else{let N=s.getChildrenSize();s.select(N,N)}}return!0}let f=i.getElementByKey(d.getKey());if(f===null)return!1;let g=Fn(l);if(g===null||g.rangeCount===0)return!1;let p=g.getRangeAt(0).cloneRange();p.collapse(!0);let m=p.getBoundingClientRect(),_=f.getBoundingClientRect(),x=_.top+_.height/2;if(m.height>0){let y=ld(m.left,x,a);if(y!==null&&f.contains(y.node)){let N=a.ownerDocument.createRange();return N.setStart(y.node,y.offset),N.collapse(!0),e.applyDOMRange(N),e.dirty=!0,!0}}let C=n?d.getLastDescendant():d.getFirstDescendant();if(re(C)){let y=n?C.getTextContentSize():0;C.select(y,y)}else{let y=d.getChildrenSize();d.select(n?y:0,n?y:0)}return!0}function dd(e,n){let r=it(e,n),s=r.getAdjacentCaret();s!==null&&Q(s.origin)&&!s.origin.isInline()&&s.origin.isShadowRoot()?kn(Os(r)):n==="next"?e.selectNext(0,0):e.selectPrevious()}function DT(e,n,r){r.preventDefault(),r.stopPropagation();let s=e.getNodes();if(s.length===0)return!0;let i=s.map((d)=>it(d,"next")).sort(Br),a=(n?i[0]:i[i.length-1]).origin,l=he(a,(d)=>d!==a&&Q(d)&&!d.isInline())??Je(),c=n?0:l.getChildrenSize();return l.select(c,c),!0}function kT(e,n=zs(ww)){return De(e.registerCommand(yi,()=>{let r=X();return Ze(r)?(r.clear(),!0):(j(r)&&Xi(r,"click","both",n.peek()),!1)},Te),e.registerCommand(Ei,(r)=>{let s=X();return j(s)?(s.deleteCharacter(r),!0):!!Ze(s)&&(s.deleteNodes(),!0)},Te),e.registerCommand(au,(r)=>{let s=X();return!!j(s)&&(s.deleteWord(r),!0)},Te),e.registerCommand(iu,(r)=>{let s=X();return!!j(s)&&(s.deleteLine(r),!0)},Te),e.registerCommand(ou,(r)=>{let s=X();if(typeof r=="string")s!==null&&s.insertText(r);else{if(s===null)return!1;let i=r.dataTransfer;if(i!=null)gh(i,s,e);else if(j(s)){let a=r.data;return a&&s.insertText(a),!0}}return!0},Te),e.registerCommand(lS,()=>{let r=X();return!!j(r)&&(r.removeText(),!0)},Te),e.registerCommand(Go,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(Dy(s,r),!0)},Te),e.registerCommand(cS,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(Wy(s,r),!0)},Te),e.registerCommand(cu,(r)=>{let s=X();if(!j(s)&&!Ze(s))return!1;let i=s.getNodes();for(let a of i){let l=he(a,(c)=>Q(c)&&!c.isInline());l!==null&&l.setFormat(r)}return!0},Te),e.registerCommand(jg,(r)=>{let s=X();return!!j(s)&&(s.insertLineBreak(r),!0)},Te),e.registerCommand(jr,()=>{let r=X();return!!j(r)&&(r.insertParagraph(),!0)},Te),e.registerCommand(Ds,()=>{let r=gn(),s=X();return j(s)&&(r.setFormat(s.format),r.setStyle(s.style)),qc([r]),!0},Te),e.registerCommand(no,()=>bl((r)=>{let s=r.getIndent();r.setIndent(s+1)}),Te),e.registerCommand(Yo,()=>bl((r)=>{let s=r.getIndent();s>0&&r.setIndent(Math.max(0,s-1))}),Te),e.registerCommand(oo,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"previous"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===0}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"previous"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!0))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!0))return r.preventDefault(),!0}return!1},Te),e.registerCommand(jo,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"next"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===Je().getChildrenSize()}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"next"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!1))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!1))return r.preventDefault(),!0}return!1},Te),e.registerCommand(Yr,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],El(i[0])?"next":"previous"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,El(s.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","start",n.peek()),cp(s,!0)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!0),!0}return!1},Te),e.registerCommand(bi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],El(i[0])?"previous":"next"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,El(s.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","end",n.peek()),cp(s,!1)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!1),!0}return!1},Te),e.registerCommand(vi,(r)=>{let s=X();if(!Ze(s)&&vT(r.target))return!1;if(j(s)){if(function(i){if(!i.isCollapsed())return!1;let{anchor:a}=i;if(a.offset!==0)return!1;let l=a.getNode();if(So(l))return!1;let c=ku(l);return c.getIndent()>0&&(c.is(l)||l.is(c.getFirstDescendant()))}(s))return r.preventDefault(),e.dispatchCommand(Yo);if(ml&&fl)return!1}else if(!Ze(s))return!1;return r.preventDefault(),e.dispatchCommand(Ei,!0)},Te),e.registerCommand(hu,(r)=>{let s=X();return!(!Ze(s)&&vT(r.target))&&(!(!j(s)&&!Ze(s))&&(r.preventDefault(),e.dispatchCommand(Ei,!1)))},Te),e.registerCommand(Oi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();i.length===1&&wt(i[0])&&!i[0].isInline()&&(s=i[0].selectNext())}if(!j(s))return!1;if(Xi(s,"enter","both",n.peek()),r!==null){if((ml||fu||du)&&fl)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(jg,!1)}return e.dispatchCommand(jr)},Te),e.registerCommand(Ai,()=>{let r=X();return!!j(r)&&(e.blur(),!0)},Te),e.registerCommand(Qy,(r)=>{let[,s]=Bs(r);if(s.length>0){let{clientX:i,clientY:a}=r,l=ld(i,a,e.getRootElement());if(l!==null){let{offset:c,node:d}=l,f=vt(d);if(f!==null){let g=Kr();if(re(f))g.anchor.set(f.getKey(),c,"text"),g.focus.set(f.getKey(),c,"text");else{let m=f.getParentOrThrow().getKey(),_=f.getIndexWithinParent()+1;g.anchor.set(m,_,"element"),g.focus.set(m,_,"element")}let p=Uo(g);mt(p)}e.dispatchCommand(ph,s)}return r.preventDefault(),!0}return NT(r,e)},Te),e.registerCommand(Zy,(r)=>{let[s]=Bs(r),i=X();return!(s&&!j(i))&&(j(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(TT(r.dataTransfer,ad(i)),ET(r.dataTransfer,e)),!0)},Te),e.registerCommand(Jy,(r)=>{let[s]=Bs(r),i=X();if(s&&!j(i))return!1;let{clientX:a,clientY:l}=r,c=ld(a,l,e.getRootElement());if(c!==null){let d=vt(c.node);wt(d)&&r.preventDefault()}return!0},Te),e.registerCommand(Di,()=>{let r=X();return Wr(j(r)&&Qn(r.anchor.getNode())!==null?r:null),!0},Te),e.registerCommand(Ni,(r)=>(wl(e,Pn(r,ClipboardEvent)?r:null),!0),Te),e.registerCommand(ru,(r)=>(async function(s,i){await wl(i,Pn(s,ClipboardEvent)?s:null),i.update(()=>{let a=X();j(a)?a.removeText():Ze(a)&&a.getNodes().forEach((l)=>l.remove())},{tag:su})}(r,e),!0),Te),e.registerCommand(Mi,(r)=>{let[,s,i]=Bs(r);if(s.length>0&&!i)return e.dispatchCommand(ph,s),!0;if(io(r.target)&&By(r.target))return!1;return X()!==null&&(function(a,l){a.preventDefault(),l.update(()=>{let c=X(),d=Pn(a,InputEvent)||Pn(a,KeyboardEvent)?null:a.clipboardData;d!=null&&c!==null&&gh(d,c,l)},{tag:_u})}(r,e),!0)},Te),e.registerCommand(mu,()=>{let r=X();return j(r)&&Xi(r,"space","both",n.peek()),!1},Te),e.registerCommand(Vr,()=>{let r=X();return j(r)&&Xi(r,"tab","both",n.peek()),!1},Te),e.registerCommand(yl,(r)=>{let s=X();if(Ze(s))return DT(s,!1,r);if(!j(s))return!1;let{anchor:i}=s;if(i.type!=="element"||i.offset!==0)return!1;let a=i.getNode();if(!Q(a))return!1;let l=a.getFirstChild();if(!wt(l)||!l.isInline())return!1;let c=a.getKey(),d=a.selectEnd();return r.shiftKey&&d.anchor.set(c,0,"element"),r.preventDefault(),r.stopPropagation(),!0},Te),e.registerCommand(Ri,(r)=>{let s=X();if(Ze(s))return DT(s,!0,r);if(!j(s))return!1;let{anchor:i,focus:a}=s,l=he(a.getNode(),(f)=>Q(f)&&!f.isInline());if(l===null)return!1;let c=l.getFirstChild();if(!wt(c)||!c.isInline())return!1;if(he(i.getNode(),(f)=>Q(f)&&!f.isInline())!==l)return!1;let d=l.getKey();return(a.type!=="element"||a.key!==d||a.offset!==0)&&(s.focus.set(d,0,"element"),r.shiftKey||s.anchor.set(d,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},Te))}var On=hh,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:Fl,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:IT}=On;var _h={};Oe(_h,{RichTextPlugin:()=>Fw});S();function kw(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var mh=pn?He:h;function Iw({editor:e,ErrorBoundary:n}){return function(r,s){let[i,a]=u(()=>r.getDecorators());return mh(()=>r.registerDecoratorListener((l)=>{tn(()=>{a(l)})}),[r]),h(()=>{a(r.getDecorators())},[r]),D(()=>{let l=[],c=Object.keys(i);for(let d=0;d<c.length;d++){let f=c[d],g=t(s,{onError:(m)=>r._onError(m),children:t(aa,{fallback:null,children:i[f]})}),p=r.getElementByKey(f);p!==null&&l.push(Qa(g,p,f))}return l},[s,i,r])}(e,n)}function Lw({editor:e,ErrorBoundary:n}){return function(r){let s=HN.maybeFromEditor(r);if(s&&s.hasExtensionByName(XN.name)){for(let i of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(i)&&kw(320,i);return!0}return!1}(e)?null:t(Iw,{editor:e,ErrorBoundary:n})}function LT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:n=null,ErrorBoundary:r}){let[s]=st();return function(i){mh(()=>De(IT(i),nE(i)),[i])}(s),o(Z,{children:[e,t(Pw,{content:n}),t(Lw,{editor:s,ErrorBoundary:r})]})}function Pw({content:e}){let[n]=st(),r=function(i){let[a,l]=u(()=>LT(i));return mh(()=>{function c(){let d=LT(i);l(d)}return c(),De(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a}(n),s=RS();return r?typeof e=="function"?e(s):e:null}var Bw=_h,FT=Bw.RichTextPlugin;var xh={};Oe(xh,{ContentEditable:()=>zw,ContentEditableElement:()=>KT});S();var BT=pn?He:h;function Kw({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:s,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:l,ariaInvalid:c,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:g,ariaOwns:p,ariaRequired:m,autoCapitalize:_,className:x,id:C,role:y="textbox",spellCheck:N=!0,style:T,tabIndex:v,"data-testid":R,...F},k){let[H,U]=u(e.isEditable()),W=P((G)=>{G&&G.ownerDocument&&G.ownerDocument.defaultView?e.setRootElement(G):e.setRootElement(null)},[e]),J=D(()=>function(...G){return(ne)=>{for(let ee of G)typeof ee=="function"?ee(ne):ee!=null&&(ee.current=ne)}}(k,W),[W,k]);return BT(()=>(U(e.isEditable()),e.registerEditableListener((G)=>{U(G)})),[e]),t("div",{"aria-activedescendant":H?n:void 0,"aria-autocomplete":H?r:"none","aria-controls":H?s:void 0,"aria-describedby":i,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":H&&y==="combobox"?!!l:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":g,"aria-owns":H?p:void 0,"aria-readonly":!H||void 0,"aria-required":m,autoCapitalize:_,className:x,contentEditable:H,"data-testid":R,id:C,ref:J,role:y,spellCheck:N,style:T,tabIndex:v??(H?void 0:-1),...F})}var KT=O(Kw);function PT(e){return e.read("latest",Vu(e.isComposing()))}var zw=O(Uw);function Uw(e,n){let{placeholder:r,...s}=e,[i]=st();return o(Z,{children:[t(KT,{editor:i,...s,ref:n}),r!=null&&t(Hw,{editor:i,content:r})]})}function Hw({content:e,editor:n}){let r=function(l){let[c,d]=u(()=>PT(l));return BT(()=>{function f(){let g=PT(l);d(g)}return f(),De(l.registerUpdateListener(()=>{f()}),l.registerEditableListener(()=>{f()}))},[l]),c}(n),[s,i]=u(n.isEditable());if(He(()=>(i(n.isEditable()),n.registerEditableListener((l)=>{i(l)})),[n]),!r)return null;let a=null;return typeof e=="function"?a=e(s):e!==null&&(a=e),a===null?null:t("div",{"aria-hidden":!0,children:a})}var zT=xh,{ContentEditable:UT,ContentEditableElement:az}=zT;var Ch={};Oe(Ch,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>GT,registerHistory:()=>WT});function Ww(e,n,r,s,i){if(e===null||r.size===0&&s.size===0&&!i)return 0;let a=n._selection,l=e._selection;if(i)return 1;if(!(j(a)&&j(l)&&l.isCollapsed()&&a.isCollapsed()))return 0;let c=function(N,T,v){let R=N._nodeMap,F=[];for(let k of T){let H=R.get(k);H!==void 0&&F.push(H)}for(let[k,H]of v){if(!H)continue;let U=R.get(k);U===void 0||So(U)||F.push(U)}return F}(n,r,s);if(c.length===0)return 0;if(c.length>1){let N=n._nodeMap,T=N.get(a.anchor.key),v=N.get(l.anchor.key);return T&&v&&!e._nodeMap.has(T.__key)&&re(T)&&T.__text.length===1&&a.anchor.offset===1?2:0}let d=c[0],f=e._nodeMap.get(d.__key);if(!re(f)||!re(d)||f.__mode!==d.__mode)return 0;let g=f.__text,p=d.__text;if(g===p)return 0;let m=a.anchor,_=l.anchor;if(m.key!==_.key||m.type!=="text")return 0;let x=m.offset,C=_.offset,y=p.length-g.length;return y===1&&C===x-1?2:y===-1&&C===x+1?3:y===-1&&C===x?4:0}function Gw(e,n,r){let s=r(),i=0,a=s,l=0,c=null;return(d,f,g,p,m,_)=>{let x=r();if(_.has(nu)&&(a=s,l=i,c=d),_.has(Ti))return i=0,s=x,2;_.has(tu)&&c&&(s=a,i=l,d=c);let C=_.has(_u)||_.has(su)?0:Ww(d,f,p,m,e.isComposing()),y=(()=>{let N=g===null||g.editor===e,T=_.has(uu);if(!T&&N&&_.has(Gr))return 0;if(C===1)return 2;if(d===null)return 1;let v=f._selection;if(!(p.size>0||m.size>0))return v!==null?0:2;let R=typeof n=="number"?n:n.peek();if(T===!1&&C!==0&&C===i&&x<s+R&&N)return 0;if(p.size===1){if(function(F,k,H){let U=k._nodeMap.get(F),W=H._nodeMap.get(F),J=k._selection,G=H._selection;return!(j(J)&&j(G)&&J.anchor.type==="element"&&J.focus.type==="element"&&G.anchor.type==="text"&&G.focus.type==="text"||!re(U)||!re(W)||U.__parent!==W.__parent)&&JSON.stringify(k.read(()=>U.exportJSON()))===JSON.stringify(H.read(()=>W.exportJSON()))}(Array.from(p)[0],d,f))return 0}return 1})();return s=x,i=C,y}}function HT(e,n){e.undoStack=[],e.redoStack=[],e.current=null,n&&n(e)}function WT(e,n,r,s=Date.now,i,a=null){let l=Gw(e,r,s),c=()=>{i&&i(n)};return c(),De(e.registerCommand(Eu,()=>(function(d,f,g){let{redoStack:p,undoStack:m}=f;if(m.length!==0){let _=f.current,x=m.pop();_!==null&&(p.push(_),d.dispatchCommand(Rs,!0)),m.length===0&&d.dispatchCommand(Ms,!1),f.current=x||null,g&&g(f),x&&x.editor.setEditorState(x.editorState,{tag:Ti})}}(e,n,i),!0),Te),e.registerCommand(xu,()=>(function(d,f,g){let{redoStack:p,undoStack:m}=f;if(p.length!==0){let _=f.current;_!==null&&(m.push(_),d.dispatchCommand(Ms,!0));let x=p.pop();p.length===0&&d.dispatchCommand(Rs,!1),f.current=x||null,g&&g(f),x&&x.editor.setEditorState(x.editorState,{tag:Ti})}}(e,n,i),!0),Te),e.registerCommand(Qc,()=>(HT(n,i),!1),Te),e.registerCommand(Yy,()=>(HT(n,i),e.dispatchCommand(Rs,!1),e.dispatchCommand(Ms,!1),!0),Te),e.registerUpdateListener(({editorState:d,prevEditorState:f,dirtyLeaves:g,dirtyElements:p,tags:m})=>{let{current:_,redoStack:x,undoStack:C}=n,y=_===null?null:_.editorState;if(_!==null&&d===y)return;let N=l(f,d,_,g,p,m);if(N===1){if(x.length!==0&&(n.redoStack=[],e.dispatchCommand(Rs,!1)),_!==null){C.push({..._});let T=typeof a=="number"||a===null?a:a.peek();T!==null&&C.length>T&&C.splice(0,C.length-T),e.dispatchCommand(Ms,!0)}}else if(N===2)return;n.current={editor:e,editorState:d},c()}))}function GT(){return{current:null,redoStack:[],undoStack:[]}}var xd=_e({build:(e,{delay:n,createInitialHistoryState:r,disabled:s,maxDepth:i,now:a},l)=>({...Dt({delay:n,disabled:s,historyState:r(e),maxDepth:i,now:a}),...l.getInitResult()}),config:We({createInitialHistoryState:GT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:zs(!1),canUndo:zs(!1)}),name:"@lexical/history/History",register:(e,n,r)=>{let{canUndo:s,canRedo:i}=r.getInitResult(),a=r.getOutput(),l=(c)=>Lp(()=>{s.value=c!=null&&c.undoStack.length>0,i.value=c!=null&&c.redoStack.length>0});return Nt(()=>{if(!a.disabled.value)return WT(e,a.historyState.value,a.delay,()=>a.now.peek()(),l,a.maxDepth);l(null)})}}),jw=_e({build:(e,{disabled:n,parentEditor:r})=>Dt({disabled:n,parentEditor:r||e._parentEditor}),config:We({disabled:!1,parentEditor:null}),dependencies:[sn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,n,r)=>Nt(()=>{let{disabled:s,parentEditor:i}=r.getOutput();if(!s.value){let{output:a}=r.getDependency(xd),l=function(d){return d?lo(d,xd.name):null}(i.value);if(!l)return;let c=l.output;Lp(()=>{a.delay.value=c.delay.value,a.historyState.value=c.historyState.value,a.now.value=c.now.value,a.disabled.value=c.disabled.value})}})});var Cd=Ch,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:jT}=Cd;var yh={};Oe(yh,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});S();function Yw({delay:e,externalHistoryState:n}){let[r]=st();return function(s,i,a=1000){let l=D(()=>i||yd(),[i]);h(()=>jT(s,l,a),[a,s,l])}(r,n,e),null}var YT=yh,{HistoryPlugin:VT,createEmptyHistoryState:xz}=YT;var bh={};Oe(bh,{$createListItemNode:()=>vo,$createListNode:()=>bo,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>a0,$insertList:()=>Nd,$isListItemNode:()=>Le,$isListNode:()=>$e,$removeList:()=>s0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>c0,INSERT_ORDERED_LIST_COMMAND:()=>C0,INSERT_UNORDERED_LIST_COMMAND:()=>x0,ListExtension:()=>Th,ListImportExtension:()=>nk,ListImportRules:()=>m0,ListItemNode:()=>Ys,ListNode:()=>Qi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>y0,UPDATE_LIST_START_COMMAND:()=>_0,registerCheckList:()=>u0,registerList:()=>S0,registerListStrictIndentTransform:()=>N0});function ts(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let n=1,r=e.getParent();for(;r!=null;){if(Le(r)){let s=r.getParent();if($e(s)){n++,r=s.getParent();continue}ts(40)}return n}return n}function Sh(e){let n=e.getParent();$e(n)||ts(40);let r=n,s=n;for(;s!==null;)s=s.getParent(),$e(s)&&(r=s);return r}function o0(e){let n=[],r=e.getChildren().filter(Le);for(let s=0;s<r.length;s++){let i=r[s],a=i.getFirstChild();$e(a)?n=n.concat(o0(a)):n.push(i)}return n}function uo(e){return Le(e)&&$e(e.getFirstChild())}function r0(e,n){return Le(e)&&(n.length===0||n.length===1&&e.is(n[0])&&e.getChildrenSize()===0)}function Nd(e){let n=X();if(n!==null){let r=n.getNodes();if(j(n)){let[i]=n.getStartEndPoints(),a=i.getNode(),l=a.getParent();if(Mt(a)){let c=a.getFirstChild();if(c)r=c.selectStart().getNodes();else{let d=Se();a.append(d),r=d.select().getNodes()}}else if(r0(a,r)){let c=bo(e);if(Mt(l)){a.replace(c);let d=vo();Q(a)&&(d.setFormat(a.getFormatType()),d.setIndent(a.getIndent())),c.append(d)}else if(Le(a)){let d=a.getParentOrThrow();js(c,d.getChildren()),d.replace(c)}return}}let s=new Set;for(let i=0;i<r.length;i++){let a=r[i];if(Q(a)&&a.isEmpty()&&!Le(a)&&!s.has(a.getKey())){XT(a,e);continue}let l=cl(a)?a.getParent():Le(a)&&a.isEmpty()?a:null;for(;l!=null;){let c=l.getKey();if($e(l)){if(!s.has(c)){let d=bo(e);js(d,l.getChildren()),l.replace(d),s.add(c)}break}{let d=l.getParent();if(Mt(d)&&!s.has(c)){s.add(c),XT(l,e);break}l=d}}}}}function js(e,n){e.splice(e.getChildrenSize(),0,n)}function XT(e,n){if($e(e))return e;let r=e.getPreviousSibling(),s=e.getNextSibling(),i=vo(),a;if(js(i,e.getChildren()),$e(r)&&n===r.getListType())r.append(i),$e(s)&&n===s.getListType()&&(js(r,s.getChildren()),s.remove()),a=r;else if($e(s)&&n===s.getListType())s.getFirstChildOrThrow().insertBefore(i),a=s;else{let c=bo(n);c.append(i),e.replace(c),a=c}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let l=X();return j(l)&&(a.getKey()===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,"element"),a.getKey()===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,"element")),e.remove(),a}function Eh(e,n){let r=e.getLastChild(),s=n.getFirstChild();r&&s&&uo(r)&&uo(s)&&(Eh(r.getFirstChild(),s.getFirstChild()),s.remove());let i=n.getChildren();i.length>0&&e.append(...i),n.remove()}function s0(){let e=X();if(j(e)){let n=new Set,r=e.getNodes(),s=e.anchor.getNode();if(r0(s,r))n.add(Sh(s));else for(let i=0;i<r.length;i++){let a=r[i];if(cl(a)){let l=Iu(a,Ys);l!=null&&n.add(Sh(l))}}for(let i of n){let a=i,l=o0(i);for(let c of l){let d=Se().setTextStyle(e.style).setTextFormat(e.format);js(d,c.getChildren()),a.insertAfter(d),a=d,c.__key===e.anchor.key&&Wo(e.anchor,kt(bt(d,"next"))),c.__key===e.focus.key&&Wo(e.focus,kt(bt(d,"next"))),c.remove()}i.remove()}}}function i0(e){let n=e.getListType()!=="check",r=e.getStart();for(let s of e.getChildren())Le(s)&&(s.getValue()!==r&&s.setValue(r),n&&s.getLatest().__checked!=null&&s.setChecked(void 0),$e(s.getFirstChild())||r++)}function Vw(e){let n=new Set;if(uo(e)||n.has(e.getKey()))return;let r=e.getParent(),s=e.getNextSibling(),i=e.getPreviousSibling();if(uo(s)&&uo(i)){let a=i.getFirstChild();if($e(a)){a.append(e);let l=s.getFirstChild();if($e(l))js(a,l.getChildren()),s.remove(),n.add(s.getKey())}}else if(uo(s)){let a=s.getFirstChild();if($e(a)){let l=a.getFirstChild();l!==null&&l.insertBefore(e)}}else if(uo(i)){let a=i.getFirstChild();$e(a)&&a.append(e)}else if($e(r)){let a=jt(e),l=jt(r);a.append(l),l.append(e),i?i.insertAfter(a):s?s.insertBefore(a):r.append(a)}}function qT(e){if(uo(e))return;let n=e.getParent(),r=n?n.getParent():void 0;if($e(r?r.getParent():void 0)&&Le(r)&&$e(n)){let s=n?n.getFirstChild():void 0,i=n?n.getLastChild():void 0;if(e.is(s))r.insertBefore(e),n.isEmpty()&&r.remove();else if(e.is(i))r.insertAfter(e),n.isEmpty()&&r.remove();else{let a=jt(e),l=jt(n);a.append(l),e.getPreviousSiblings().forEach((f)=>l.append(f));let c=jt(e),d=jt(n);c.append(d),js(d,e.getNextSiblings()),r.insertBefore(a),r.insertAfter(c),r.replace(e)}}}function a0(e=!1){let n=X();if(!j(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),s=null;if(Le(r)&&r.getChildrenSize()===0)s=r;else if(re(r)){let f=r.getParent();Le(f)&&f.getChildren().every((g)=>re(g)&&g.getTextContent().trim()==="")&&(s=f)}if(s===null)return!1;let i=Sh(s),a=s.getParent();$e(a)||ts(40);let l=a.getParent(),c;if(Mt(l))c=Se(),i.insertAfter(c);else{if(!Le(l))return!1;c=jt(l),l.insertAfter(c)}c.setTextStyle(n.style).setTextFormat(n.format).select();let d=s.getNextSiblings();if(d.length>0){let f=e?function(p,m){return p.getStart()+m.getIndexWithinParent()}(a,s):1,g=jt(a).setStart(f);if(Le(c)){let p=jt(c);p.append(g),c.insertAfter(p)}else c.insertAfter(g);g.append(...d)}return function(f){let g=f;for(;g.getNextSibling()==null&&g.getPreviousSibling()==null;){let p=g.getParent();if(p==null||!Le(p)&&!$e(p))break;g=p}g.remove()}(s),!0}class Ys extends ct{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let n=e.getParent();if($e(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){let r=e.createParentElementNode();$e(r)||ts(340);let s=[e];for(let i of["previous","next"]){s.reverse();for(let{origin:a}of it(e,i)){if(!Le(a))break;s.push(a)}}e.insertBefore(r),r.splice(0,0,s),Mt(n)||(zr(r,Ho(it(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:ct,importDOM:Yg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let n=Xe().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(a,l){let c=l.getParent();!$e(c)||c.getListType()!=="check"||$e(l.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),a.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,function(a,l,c){let d=l.list;if(!d)return;let f=d.listitem,g=d.nested&&d.nested.listitem,p=c.getParent(),m=$e(p)&&p.getListType()==="check",_=c.getChecked(),x=c.getChildren().some((N)=>$e(N)),C=[];d.listitemChecked!==void 0&&C.push(d.listitemChecked),d.listitemUnchecked!==void 0&&C.push(d.listitemUnchecked),g!==void 0&&C.push(...Ii(g)),C.length>0&&an(a,...C);let y=[];if(f!==void 0&&y.push(...Ii(f)),m){let N=_?d.listitemChecked:d.listitemUnchecked;N!==void 0&&y.push(N)}g!==void 0&&x&&y.push(...Ii(g)),y.length>0&&et(a,...y)}(n,r.theme,this);let s=e?e.__style:"",i=this.__style;s!==i&&fr(n.style,i,s),function(a,l,c){let d=l.__textStyle,f=c?c.__textStyle:"";if(c!==null&&f===d)return;let g=Xr(d);for(let p in g)a.style.setProperty(`--listitem-marker-${p}`,g[p]);if(f!=="")for(let p in Xr(f))p in g||a.style.removeProperty(`--listitem-marker-${p}`)}(n,this,e)}updateDOM(e,n,r){let s=n;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();return s&&(n.dir=s),uo(this)?{after(i){if(ye(i)){let a=i.previousElementSibling;if(ye(a)&&a.nodeName==="LI"){for(;i.firstChild;)a.append(i.firstChild);i.remove()}}return i},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(Q(r)&&this.canMergeWith(r)){let s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,n){if(Le(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!$e(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let a=jt(r),l=this.getNextSibling();for(;l;){let c=l;l=l.getNextSibling(),a.append(c)}r.insertAfter(e),e.insertAfter(a)}let s=this.__key,i=0;if(n&&(Q(e)||ts(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&Q(e)){let a=X();if(j(a))for(let l of a.getStartEndPoints())l.key===s&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if($e(r)||ts(39),Le(e))return super.insertAfter(e,n);let s=this.getNextSiblings();if(r.insertAfter(e,n),s.length!==0){let i=jt(r);s.forEach((a)=>i.append(a)),e.insertAfter(i,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&uo(n)&&uo(r)&&(Eh(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(uo(this))return!1;let n=this.getParentOrThrow();if(Le(n.getParentOrThrow()))return qT(this),!0;let r=Se().append(...this.getChildren()),s=this.getNextSiblings();if(s.length>0){let i=jt(n);i.append(...s),n.insertAfter(i)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();return n.__value=e,n}getChecked(){let e=this.getLatest(),n,r=this.getParent();return $e(r)&&(n=r.getListType()),n==="check"?Boolean(e.__checked):void 0}setChecked(e){let n=this.getWritable();return n.__checked=e,n}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let n=e.getParentOrThrow(),r=0;for(;Le(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&ts(117),(e=Math.floor(e))>=0||ts(199);let n=this.getIndent();for(;n!==e;)n<e?(Vw(this),n++):(qT(this),n--);return this}canInsertAfter(e){return Le(e)}canReplaceWith(e){return Le(e)}canMergeWith(e){return Le(e)||wn(e)}extractWithChild(e,n){if(!j(n))return!1;let r=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return bo("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let s of e.children)if(s.tagName==="INPUT")return JT(s)}if(e.classList.contains("joplin-checkbox")){for(let s of e.children)if(s.classList.contains("checkbox-wrapper")&&s.children.length>0&&s.children[0].tagName==="INPUT")return JT(s.children[0])}let n=e.getAttribute("aria-checked"),r=vo(n==="true"||n!=="false"&&void 0);return eo(r,e),{after:l0.bind(null,r),node:Tn(r,e)}}function JT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let n=vo(e.hasAttribute("checked"));return{after:l0.bind(null,n),node:n}}function l0(e,n){let r=n[0];return n.length===1&&wn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function vo(e){return un(new Ys(void 0,e))}function Le(e){return e instanceof Ys}class Qi extends ct{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(n){let r=n.getNextSibling();$e(r)&&n.getListType()===r.getListType()&&Eh(n,r)})(e),i0(e)},extends:ct,importDOM:Yg({ol:()=>({conversion:QT,priority:0}),ul:()=>({conversion:QT,priority:0})})})}constructor(e="number",n=1,r){super(r);let s=qw[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let n=this.getWritable();return n.__start=e,n}createDOM(e,n){let r=this.__tag,s=Xe().createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,ZT(s,e.theme,this),s}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(ZT(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let n=this.createDOM(e._config,e);return ye(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let s=r;for(let i=0;i<r.length;i++){let a=r[i];Le(a)||(s===r&&(s=[...r]),s[i]=this.createListItemNode().append(!Q(a)||$e(a)||a.isInline()?a:yt(a.getTextContent())))}return super.splice(e,n,s)}extractWithChild(e){return Le(e)}createListItemNode(){return vo()}}function ZT(e,n,r){let s=[],i=[],a=n.list;if(a!==void 0){let l=a[`${r.__tag}Depth`]||[],c=Sd(r)-1,d=c%l.length,f=l[d],g=a[r.__tag],p,{nested:m,checklist:_}=a;if(m!==void 0&&m.list&&(p=m.list),g!==void 0&&s.push(g),_!==void 0&&r.__listType==="check"&&s.push(_),f!==void 0){s.push(...Ii(f));for(let x=0;x<l.length;x++)x!==d&&i.push(r.__tag+x)}if(p!==void 0){let x=Ii(p);c>1?s.push(...x):i.push(...x)}}i.length>0&&an(e,...i),s.length>0&&et(e,...s)}function QT(e){let n;if(function(r){return ye(r)&&r.nodeName.toLowerCase()==="ol"}(e)){let r=e.start;n=bo("number",r)}else n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(let s of r.childNodes)if(ye(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(e)?bo("check"):bo("bullet");return Tn(n,e),{after:(r)=>function(s,i){let a=i.createListItemNode.bind(i),l=[];for(let c=0;c<s.length;c++){let d=s[c];if(Le(d)){l.push(d);let f=d.getChildren();f.length>1&&f.forEach((g)=>{$e(g)&&l.push(a().append(g))})}else l.push(a().append(d))}return l}(r,n),node:n}}var qw={ol:"number",ul:"bullet"};function bo(e="number",n=1){return un(new Qi(e,n))}function $e(e){return e instanceof Qi}var c0=bn("INSERT_CHECK_LIST_COMMAND");function u0(e,n){let r=n&&n.disableTakeFocusOnClick||!1,s=typeof r=="boolean"?()=>r:r.peek.bind(r),i=(f)=>{let g=f.target;if(!ye(g))return!1;let p=g.__lexicalCheckListLastHandled;return p!==void 0&&f.timeStamp-p<500},a=(f)=>{let g=f.target;ye(g)&&(g.__lexicalCheckListLastHandled=f.timeStamp)},l=(f)=>{i(f)||(a(f),e0(f,s()))},c=(f)=>{f.pointerType==="touch"&&(i(f)||(a(f),e0(f,s())))},d=(f)=>{(function(g,p){d0(g,()=>{g.preventDefault(),p&&g.stopPropagation()})})(f,s())};return De(e.registerCommand(c0,()=>(Nd("check"),!0),Pe),e.registerCommand(jo,(f)=>t0(f,e,!1),Pe),e.registerCommand(oo,(f)=>t0(f,e,!0),Pe),e.registerCommand(Ai,()=>{if(Nh(e)!=null){let f=e.getRootElement();return f!=null&&f.focus(),!0}return!1},Pe),e.registerCommand(mu,(f)=>{let g=Nh(e);return!(g==null||!e.isEditable())&&(e.update(()=>{let p=vt(g);Le(p)&&(f.preventDefault(),p.toggleChecked())}),!0)},Pe),e.registerCommand(Yr,(f)=>e.read("latest",()=>{let g=X();if(j(g)&&g.isCollapsed()){let{anchor:p}=g,m=p.type==="element";if(m||p.offset===0){let _=p.getNode(),x=he(_,(C)=>Q(C)&&!C.isInline());if(Le(x)){let C=x.getParent();if($e(C)&&C.getListType()==="check"&&(m||x.getFirstDescendant()===_)){let y=e.getElementByKey(x.__key);if(y!=null&&Eo(y)!==y)return y.focus(),f.preventDefault(),!0}}}}return!1}),Pe),e.registerRootListener((f)=>{if(f!==null)return De(Jr(f,{click:l,pointerup:c}),Jr(f,{mousedown:d,pointerdown:d},{capture:!0}),ao(f,"touchstart",d,{capture:!0,passive:!1}))}))}function d0(e,n){let r=e.target;if(!ye(r))return;let s=r.firstChild;if(ye(s)&&(s.tagName==="UL"||s.tagName==="OL"))return;let i=r.parentNode;if(!i||i.__lexicalListType!=="check")return;let a=null,l=null;if("clientX"in e)a=e.clientX;else if("touches"in e){let _=e.touches;_.length>0&&(a=_[0].clientX,l="touch")}if(a==null)return;let c=r.getBoundingClientRect(),d=a/aN(r),f=r.ownerDocument.defaultView,g=f?f.getComputedStyle(r,"::before"):{width:"0px"},p=parseFloat(g.width),m=l==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(r.dir==="rtl"?d<c.right+m&&d>c.right-p-m:d>c.left-m&&d<c.left+p+m)&&n()}function e0(e,n){d0(e,()=>{if(ye(e.target)){let r=e.target,s=vu(r);s!=null&&s.isEditable()&&s.update(()=>{let i=vt(r);Le(i)&&(n?(rl(Su),rl(uS)):r.focus(),i.toggleChecked())})}})}function Nh(e){let n=e.getRootElement(),r=n?Eo(n):null;return ye(r)&&r.tagName==="LI"&&r.parentNode!=null&&r.parentNode.__lexicalListType==="check"?r:null}function t0(e,n,r){let s=Nh(n);return s!=null&&n.update(()=>{let i=vt(s);if(!Le(i))return;let a=function(l,c){let d=c?l.getPreviousSibling():l.getNextSibling(),f=l;for(;d==null&&Le(f);)f=f.getParentOrThrow().getParent(),f!=null&&(d=c?f.getPreviousSibling():f.getNextSibling());for(;Le(d);){let g=c?d.getLastChild():d.getFirstChild();if(!$e(g))return d;d=c?g.getLastChild():g.getFirstChild()}return null}(i,r);if(a!=null){a.selectStart();let l=n.getElementByKey(a.__key);l!=null&&(e.preventDefault(),setTimeout(()=>{l.focus()},0))}}),!1}function Jw(e){let n=[];for(let r of e)if(Le(r)){n.push(r);let s=r.getChildren();if(s.length>1)for(let i of s)$e(i)&&n.push(vo().append(i))}else n.push(vo().append(r));return n}var Zw=ft({$import:(e,n)=>{let r;var s;return ah(n,"ol")?r=bo("number",n.start):r=(s=n).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||s.querySelector(":scope > [aria-checked]")!==null?bo("check"):bo("bullet"),Tn(r,n),[r.splice(0,0,od(Jw(e.$importChildren(n)),n))]},match:gt.tag("ol","ul"),name:"@lexical/list/list"});function f0(e,n){if(n.length!==1)return n;let r=n[0];return wn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function p0(e){let n=(l)=>eT(l)&&!$e(l);if(!e.some(n))return e;let r=[],s=[],i=()=>{s.length>0&&(r.push(s),s=[])};for(let l of e)n(l)?(i(),r.push(Q(l)?l.getChildren():[l])):s.push(l);i();let a=[];for(let l of r)a.length>0&&a.push(fn()),a.push(...l);return a}var Qw=ft({$import:(e,n)=>{let r=n.getAttribute("aria-checked"),s=vo(r==="true"||r!=="false"&&void 0);return eo(s,n),Tn(s,n),[s.splice(0,0,p0(f0(s,e.$importChildren(n))))]},match:gt.tag("li"),name:"@lexical/list/li"});function n0(e,n,r){let s=ah(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!s||s.getAttribute("type")!=="checkbox")return[];let i=vo(s.hasAttribute("checked"));return eo(i,n),Tn(i,n),[i.splice(0,0,p0(f0(i,e.$importChildren(n))))]}var ek={$accepts:(e)=>Le(e)||$e(e),$packageRun:(e)=>[vo().splice(0,0,e)],name:"ListSchema"},m0=[ft({$import:(e,n,r)=>{let s=n.querySelector(':scope > input[type="checkbox"]');return s?n0(e,n,s):r()},match:gt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),ft({$import:(e,n,r)=>{let s=n.querySelector(":scope > .checkbox-wrapper");if(!s)return r();let i=s.querySelector(':scope > input[type="checkbox"]');return i?n0(e,n,i):r()},match:gt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],_0=bn("UPDATE_LIST_START_COMMAND"),x0=bn("INSERT_UNORDERED_LIST_COMMAND"),C0=bn("INSERT_ORDERED_LIST_COMMAND"),y0=bn("REMOVE_LIST_COMMAND");function S0(e,n){return De(e.registerCommand(C0,()=>(Nd("number"),!0),Pe),e.registerCommand(_0,(r)=>{let{listNodeKey:s,newStart:i}=r,a=Rt(s);return!!$e(a)&&(a.getListType()==="number"&&(a.setStart(i),i0(a)),!0)},Pe),e.registerCommand(x0,()=>(Nd("bullet"),!0),Pe),e.registerCommand(y0,()=>(s0(),!0),Pe),e.registerCommand(jr,()=>a0(!!(n&&n.restoreNumbering)),Pe),e.registerCommand(vi,(r)=>{let s=X();if(!j(s)||!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();for(;!Le(a);){if(a.getPreviousSibling()!==null)return!1;let l=a.getParent();if(l===null)return!1;a=l}return!(!Le(a)||!a.collapseAtStart(s))&&(r.preventDefault(),!0)},eu),e.registerNodeTransform(Ys,(r)=>{let s=r.getFirstChild();if(s){if(re(s)){let i=s.getStyle(),a=s.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==a&&r.setTextFormat(a)}}else{let i=X();j(i)&&(i.style!==r.getTextStyle()||i.format!==r.getTextFormat())&&i.isCollapsed()&&r.is(i.anchor.getNode())&&r.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform(Ln,(r)=>{let s=r.getParent();if(Le(s)&&r.is(s.getFirstChild())){let i=r.getStyle(),a=r.getFormat();i===s.getTextStyle()&&a===s.getTextFormat()||s.setTextStyle(i).setTextFormat(a)}}))}function N0(e){let n=(r)=>{let s=r.getParent();if($e(r.getFirstChild())||!$e(s))return;let i=he(r,(a)=>Le(a)&&$e(a.getParent())&&Le(a.getPreviousSibling()));if(i===null&&r.getIndent()>0)r.setIndent(0);else if(Le(i)){let a=i.getPreviousSibling();if(Le(a)){let l=function(d){let f=d,g=f.getFirstChild();for(;$e(g);){let p=g.getLastChild();if(!Le(p))break;f=p,g=f.getFirstChild()}return f}(a),c=l.getParent();if($e(c)){let d=Sd(c);d+1<Sd(s)&&r.setIndent(d)}}}};return e.registerNodeTransform(Qi,(r)=>{let s=[r];for(;s.length>0;){let i=s.shift();if($e(i)){for(let a of i.getChildren())if(Le(a)){n(a);let l=a.getFirstChild();$e(l)&&s.push(l)}}}})}var Th=_e({build:(e,n,r)=>Dt(n),config:We({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[co,sn(qo,{rules:m0})],name:"@lexical/list/List",nodes:()=>[Qi,Ys],register(e,n,r){let s=r.getOutput();return De(Nt(()=>S0(e,{restoreNumbering:s.shouldPreserveNumbering.value})),Nt(()=>s.hasStrictIndent.value?N0(e):void 0))}}),tk=_e({build:(e,n)=>Dt(n),config:We({disableTakeFocusOnClick:!1}),dependencies:[Th],name:"@lexical/list/CheckList",register:(e,n,r)=>u0(e,r.getOutput())}),nk=_e({dependencies:[Th],name:"@lexical/list/Import"});var Et=bh,{$createListItemNode:E0,$createListNode:T0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:vh,$isListNode:Oo,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:b0,INSERT_ORDERED_LIST_COMMAND:v0,INSERT_UNORDERED_LIST_COMMAND:O0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ns,ListNode:Jo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:R0,registerList:Oh,registerListStrictIndentTransform:M0}=Et;var Ah={};Oe(Ah,{ListPlugin:()=>ok});S();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:n=!1}){let[r]=st();return h(()=>{if(!r.hasNodes([Jo,ns]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),h(()=>De(Oh(r,{restoreNumbering:n}),e?M0(r):()=>{}),[r,e,n]),function(s){h(()=>Oh(s),[s])}(r),null}var rk=Ah,D0=rk.ListPlugin;var Rh={};Oe(Rh,{CheckListPlugin:()=>sk});S();function sk({disableTakeFocusOnClick:e=!1}){let[n]=st();return h(()=>R0(n,{disableTakeFocusOnClick:e}),[n,e]),null}var ik=Rh,$0=ik.CheckListPlugin;var Mh={};Oe(Mh,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});S();function ak({maxIndent:e,$canIndent:n}){let[r]=st();return h(()=>Yu(r,e,n),[r,e,n]),null}var w0=Mh,{TabIndentationPlugin:k0,registerTabIndentation:Vz}=w0;var Ih={};Oe(Ih,{$createAutoLinkNode:()=>kh,$createLinkNode:()=>Bl,$isAutoLinkNode:()=>mn,$isLinkNode:()=>Bn,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>Kl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>K0,LinkNode:()=>os,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>H0,formatUrl:()=>Dh,registerAutoLink:()=>X0,registerClickableLink:()=>U0,registerLink:()=>z0});var I0=new Set(["http:","https:","mailto:","sms:","tel:"]);class os extends ct{__url;__target;__rel;__title;$config(){return this.config("link",{extends:ct,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",n={},r){super(r);let{target:s=null,rel:i=null,title:a=null}=n;this.__url=e,this.__target=s,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let n=Xe().createElement("a");return this.updateLinkDOM(null,n,e),et(n,e.theme.link),n}updateLinkDOM(e,n,r){if(wi(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];e&&e[i]===a||(a?n[s]=a:n.removeAttribute(s))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let n=e;e=Dh(e);try{let r=new URL(Dh(e));if(!I0.has(r.protocol))return"about:blank"}catch(r){let s=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(s!=null&&!I0.has(`${s[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!j(n))return!1;let s=n.anchor.getNode(),i=n.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function L0(e){let n=dn(e,"next");return[n,n.getFlipped()]}function F0(e,n){for(let r of n)if(r.origin.isAttached()){let s=kt(r);return void Wo(e,s)}}function lk(e){let n=X(),r=null,s=null;function i(){j(n)&&(F0(n.anchor,r),F0(n.focus,s),Uo(n))}j(n)&&(r=L0(n.anchor),s=L0(n.focus));let a=!1;for(let c of bt(e,"next")){let d=c.origin;if(Q(d)&&!d.isInline()){let f=d.getChildren();if(f.length>0){let g=jt(e);g.append(...f),d.append(g),a=!0}zr(d,Ho(c),{$shouldSplit:()=>!1})}}function l(c,d,f){let[g,p]=c,m=(x)=>No(x)&&x.origin.is(d);if(!m(g)&&!m(p))return c;let _=kt(bt(f,"next"));return[_,_.getFlipped()]}if(e.isAttached()){let c=e.getPreviousSibling();if(Bn(c)&&c.shouldMergeAdjacentLink(e))return r&&(r=l(r,c,e)),s&&(s=l(s,c,e)),c.append(...e.getChildren()),e.remove(),void i();let d=e.getNextSibling();Bn(d)&&e.shouldMergeAdjacentLink(d)&&(r&&(r=l(r,e,d)),s&&(s=l(s,e,d)),e.append(...d.getChildren()),d.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let c=e.getParent();e.remove(),c&&c.isEmpty()&&c.remove()}i()}}function ck(e){let n=null;if(wi(e)){let r=e.textContent;(r!==null&&r!==""||e.children.length>0)&&(n=Bl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:n}}function Bl(e="",n){return un(new os(e,n))}function Bn(e){return e instanceof os}class Kl extends os{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:os})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Xe().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){let r=kh(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function kh(e="",n){return un(new Kl(e,n))}function mn(e){return e instanceof Kl}var bd=bn("TOGGLE_LINK_COMMAND");function P0(e,n){if(e.type==="element"){let r=e.getNode();return Q(r)||function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);throw a.search=l.toString(),Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r.getChildren()[e.offset+n]||null}return null}function Td(e,n={}){let r;if(e&&typeof e=="object"){let{url:g,...p}=e;r=g,n={...p,...n}}else r=e;let{target:s,title:i}=n,a=n.rel===void 0?"noreferrer":n.rel,l=X();if(l===null||!j(l)&&!Ze(l))return;if(Ze(l)){let g=l.getNodes();if(g.length===0)return;return void g.forEach((p)=>{if(r===null){let m=he(p,(_)=>!mn(_)&&Bn(_));m&&(m.insertBefore(p),m.getChildren().length===0&&m.remove())}else{let m=he(p,(_)=>!mn(_)&&Bn(_));if(m)m.setURL(r),s!==void 0&&m.setTarget(s),a!==void 0&&m.setRel(a);else{let _=Bl(r,{rel:a,target:s});p.insertBefore(_),_.append(p)}}})}if(l.isCollapsed()&&r===null)for(let g of l.getNodes()){let p=he(g,(m)=>!mn(m)&&Bn(m));return void(p!==null&&(p.getParentOrThrow().splice(p.getIndexWithinParent(),0,p.getChildren()),p.remove()))}let c=l.extract();if(r===null){let g=new Set;return void c.forEach((p)=>{let m=he(p,(_)=>!mn(_)&&Bn(_));if(m!==null){let _=m.getKey();if(g.has(_))return;(function(x,C){let y=new Set(C.filter((U)=>x.isParentOf(U)).map((U)=>U.getKey())),N=x.getChildren(),T=(U)=>y.has(U.getKey())||Q(U)&&C.some((W)=>x.isParentOf(W)&&U.isParentOf(W)),v=N.filter(T);if(v.length===N.length)return N.forEach((U)=>x.insertBefore(U)),void x.remove();let R=N.findIndex(T),F=N.findLastIndex(T),k=R===0,H=F===N.length-1;if(k)v.forEach((U)=>x.insertBefore(U));else if(H)for(let U=v.length-1;U>=0;U--)x.insertAfter(v[U]);else{for(let W=v.length-1;W>=0;W--)x.insertAfter(v[W]);let U=N.slice(F+1);if(U.length>0){let W=jt(x);v[v.length-1].insertAfter(W),U.forEach((J)=>W.append(J))}}})(m,c),g.add(_)}})}let d=new Set,f=(g)=>{d.has(g.getKey())||(d.add(g.getKey()),g.setURL(r),s!==void 0&&g.setTarget(s),a!==void 0&&g.setRel(a),i!==void 0&&g.setTitle(i))};if(c.length===1){let g=c[0],p=he(g,Bn);if(p!==null)return f(p)}(function(g){let p=X();if(!j(p))return g();let m=Uo(p),_=m.isBackward(),x=P0(m.anchor,_?-1:0),C=P0(m.focus,_?0:-1),y=g();if(x||C){let N=X();if(j(N)){let T=N.clone();if(x){let v=x.getParent();v&&T.anchor.set(v.getKey(),x.getIndexWithinParent()+(_?1:0),"element")}if(C){let v=C.getParent();v&&T.focus.set(v.getKey(),C.getIndexWithinParent()+(_?0:1),"element")}mt(Uo(T))}}})(()=>{let g=null;for(let p of c){if(!p.isAttached())continue;let m=he(p,Bn);if(m){f(m);continue}if(Q(p)){if(!p.isInline())continue;if(Bn(p)){if(!(mn(p)||g!==null&&g.getParentOrThrow().isParentOf(p))){f(p),g=p;continue}for(let x of p.getChildren())p.insertBefore(x);p.remove();continue}}let _=p.getPreviousSibling();Bn(_)&&_.is(g)?_.append(p):(g=Bl(r,{rel:a,target:s,title:i}),p.insertAfter(g),g.append(p))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Dh(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:uk.test(e)?`tel:${e}`:`https://${e}`}var K0=[ft({$import:(e,n)=>{if(!n.textContent&&n.children.length===0)return[];let r=n.getAttribute("href")||"",s={rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")};return qE(e.$importChildren(n),()=>Bl(r,s))},match:gt.tag("a"),name:"@lexical/link/a"})];function z0(e,n){return De(e.registerNodeTransform(os,lk),e.registerCommand(bd,(r)=>{let s=n.validateUrl.peek(),i=n.attributes.peek();if(r===null)return Td(null),!0;if(typeof r=="string")return!(s!==void 0&&!s(r))&&(Td(r,i),!0);{let{url:a,target:l,rel:c,title:d}=r;return Td(a,{...i,rel:c,target:l,title:d}),!0}},Te),Nt(()=>{let r=n.validateUrl.value;if(!r)return;let s=n.attributes.value;return e.registerCommand(Mi,(i)=>{let a=X();if(!j(a)||a.isCollapsed()||!Pn(i,ClipboardEvent))return!1;if(i.clipboardData===null)return!1;let l=i.clipboardData.getData("text");if(!r(l))return!1;return!a.getNodes().some((c)=>Q(c)||re(c)&&!c.isSimpleText())&&(e.dispatchCommand(bd,{...s,url:l}),i.preventDefault(),!0)},Pe)}))}var Od=_e({build:(e,n,r)=>Dt(n),config:{attributes:void 0,validateUrl:void 0},dependencies:[co,sn(qo,{rules:K0})],mergeConfig(e,n){let r=zt(e,n);return e.attributes&&(r.attributes=zt(e.attributes,r.attributes)),r},name:"@lexical/link/Link",nodes:()=>[os],register:(e,n,r)=>z0(e,r.getOutput())}),dk=_e({dependencies:[Od],name:"@lexical/link/Import"});function U0(e,n,r={}){let s=(a)=>{let l=a.target;if(!io(l))return;let c=vu(l);if(c===null)return;let d=null,f=null,g=!1;if(c.update(()=>{let _=vt(l);if(_!==null){let x=he(_,Q);if(!n.disabled.peek())if(Bn(x))g=mn(x)&&x.getIsUnlinked(),d=x.sanitizeUrl(x.getURL()),f=x.getTarget();else{let C=function(y,N){let T=y;for(;T!=null;){if(N(T))return T;T=T.parentNode}return null}(l,wi);C!==null&&(d=C.href,f=C.target)}}}),d===null||d===""||g)return;let p=e.read("latest",X);if(j(p)&&!p.isCollapsed())return void a.preventDefault();let m=a.type==="auxclick"&&a.button===1;window.open(d,n.newTab.peek()||m||a.metaKey||a.ctrlKey||f==="_blank"?"_blank":"_self"),a.preventDefault()},i=(a)=>{a.button===1&&s(a)};return e.registerRootListener((a)=>{if(a)return Jr(a,{click:s,mouseup:i},r)})}var fk=_e({build:(e,n,r)=>Dt(n),config:We({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,n,r)=>U0(e,r.getOutput())});function H0(e,n=(r)=>r){return(r)=>{let s=e.exec(r);return s===null?null:{index:s.index,length:s[0].length,text:s[0],url:n(s[0])}}}var gk=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,pk=(e)=>{let n=gk.exec(e);if(n===null)return null;let r=n[0],s=0;for(let i of r)i==="("?s++:i===")"&&s--;for(;s<0&&r.endsWith(")");)r=r.slice(0,-1),s++;return{index:n.index,length:r.length,text:r,url:r.startsWith("http")?r:`https://${r}`}},hk=H0(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,(e)=>`mailto:${e}`);function $h(e,n){for(let r=0;r<n.length;r++){let s=n[r](e);if(s)return s}return null}var W0=/[.,;\s]/;function vd(e,n){return n.test(e)}function G0(e,n){return vd(e[e.length-1],n)}function wh(e,n){return vd(e[0],n)}function j0(e,n){let r=e.getPreviousSibling();return Q(r)&&(r=r.getLastDescendant()),r===null||Ue(r)||re(r)&&G0(r.getTextContent(),n)}function Y0(e,n){let r=e.getNextSibling();return Q(r)&&(r=r.getFirstDescendant()),r===null||Ue(r)||re(r)&&wh(r.getTextContent(),n)}function mk(e,n,r,s,i){if(!(e>0?vd(s[e-1],r):j0(i[0],r)))return!1;return n<s.length?vd(s[n],r):Y0(i[i.length-1],r)}function _k(e,n,r){let s=[],i=[],a=[],l=0,c=0,d=[...e];for(;d.length>0;){let f=d[0],g=f.getTextContent().length,p=c;c+g<=n?(s.push(f),l+=g):p>=r?a.push(f):i.push(f),c+=g,d.shift()}return[l,s,i,a]}function xk(e,n,r,s){let i=kh(s.url,s.attributes);if(e.length===1){let a,l=e[0];n===0?[a,l]=l.splitText(r):[,a,l]=l.splitText(n,r);let c=yt(s.text);return c.setFormat(a.getFormat()),c.setDetail(a.getDetail()),c.setStyle(a.getStyle()),i.append(c),a.replace(i),l}if(e.length>1){let a=e[0],l,c=a.getTextContent().length;n===0?l=a:[,l]=a.splitText(n);let d=[],f;for(let _=1;_<e.length;_++){let x=e[_],C=x.getTextContent().length,y=c;if(y<r)if(c+C<=r)d.push(x);else{let[N,T]=x.splitText(r-y);d.push(N),f=T}c+=C}let g=X(),p=g?g.getNodes().find(re):void 0,m=yt(l.getTextContent());return m.setFormat(l.getFormat()),m.setDetail(l.getDetail()),m.setStyle(l.getStyle()),i.append(m,...d),p&&p===l&&(j(g)?m.select(g.anchor.offset,g.focus.offset):Ze(g)&&m.select(0,m.getTextContent().length)),l.replace(i),f}}function B0(e,n,r,s){let i=e.getChildren(),a=i.length;for(let f=0;f<a;f++){let g=i[f];if(!re(g)||!g.isSimpleText())return Pl(e),void r(null,e.getURL())}let l=e.getTextContent(),c=$h(l,n);if(c===null||c.text!==l)return Pl(e),void r(null,e.getURL());if(!j0(e,s)||!Y0(e,s))return Pl(e),void r(null,e.getURL());let d=e.getURL();if(d!==c.url&&(e.setURL(c.url),r(c.url,d)),c.attributes){let f=e.getRel();f!==c.attributes.rel&&(e.setRel(c.attributes.rel||null),r(c.attributes.rel||null,f));let g=e.getTarget();g!==c.attributes.target&&(e.setTarget(c.attributes.target||null),r(c.attributes.target||null,g))}}function Pl(e){let n=e.getChildren();for(let r=n.length-1;r>=0;r--)e.insertAfter(n[r]);return e.remove(),n.map((r)=>r.getLatest())}var V0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:W0};function X0(e,n=V0){let{matchers:r,changeHandlers:s,excludeParents:i,separatorRegex:a=W0}=n,l=(c,d)=>{for(let f of s)f(c,d)};return De(e.registerNodeTransform(Ln,(c)=>{let d=c.getParentOrThrow(),f=c.getPreviousSibling();if(mn(d))B0(d,r,l,a);else if(!Bn(d)&&!i.some((g)=>g(d))){if(c.isSimpleText()&&(wh(c.getTextContent(),a)||!mn(f))){let g=function(p){let m=[p],_=p.getNextSibling();for(;_!==null&&re(_)&&_.isSimpleText()&&(m.push(_),!/[\s]/.test(_.getTextContent()));)_=_.getNextSibling();return m}(c);(function(p,m,_,x){for(let R of p){let F=R.getParent();if(mn(F)&&!F.getIsUnlinked())return}let C=[...p],y=C.map((R)=>R.getTextContent()).join(""),N,T=y,v=0;for(;(N=$h(T,m))&&N!==null;){let R=N.index,F=R+N.length;if(mk(v+R,v+F,x,y,C)){let[k,,H,U]=_k(C,v+R,v+F),W=!1;for(let G of H){let ne=G.getParent();if(mn(ne)&&!ne.getIsUnlinked()){W=!0;break}}if(W){v+=F,T=T.substring(F);continue}let J=xk(H,v+R-k,v+F-k,N);C=J?[J,...U]:U,_(N.url,null),v=0}else v+=F;T=T.substring(F)}})(g,r,l,a)}(function(g,p,m,_){let x=g.getParent(),C=g.getPreviousSibling(),y=g.getNextSibling(),N=g.getTextContent();if(!mn(x)||x.getIsUnlinked()){if(mn(C)&&!C.getIsUnlinked()&&C.is(g.getPreviousSibling())&&g.getParent()===C.getParent()){if(!wh(N,_))return Pl(C),void m(null,C.getURL());if(T=N,C.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(T):/^\.[a-zA-Z0-9]{1,}/.test(T)){let v=C.getTextContent()+N,R=$h(v,p);R!==null&&R.text===v&&(C.append(g),B0(C,p,m,_),m(null,C.getURL()))}}var T;!mn(y)||y.getIsUnlinked()||G0(N,_)||y.is(g.getNextSibling())&&g.getParent()===y.getParent()&&(Pl(y),m(null,y.getURL()))}})(c,r,l,a)}}),e.registerCommand(bd,(c)=>{let d=X();if(c!==null||!j(d))return!1;return d.extract().forEach((f)=>{let g=f.getParent();mn(g)&&(g.setIsUnlinked(!g.getIsUnlinked()),g.markDirty())}),!1},Pe))}var Ck=_e({config:V0,dependencies:[Od],mergeConfig(e,n){let r=zt(e,n);for(let s of["matchers","changeHandlers","excludeParents"]){let i=n[s];Array.isArray(i)&&(r[s]=[...e[s],...i])}return r},name:"@lexical/link/AutoLink",nodes:[Kl],register:X0});var Lt=Ih,{$createAutoLinkNode:eU,$createLinkNode:q0,$isAutoLinkNode:J0,$isLinkNode:ea,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:Z0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:ta,TOGGLE_LINK_COMMAND:Lh,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:Q0}=Lt;var Fh={};Oe(Fh,{LinkPlugin:()=>yk});S();function yk({validateUrl:e,attributes:n}){let[r]=st();return h(()=>{if(!r.hasNodes([ta]))throw Error("LinkPlugin: LinkNode not registered on editor")}),h(()=>Q0(r,Dt({attributes:n,validateUrl:e})),[r,e,n]),null}var Sk=Fh,eb=Sk.LinkPlugin;var Ph={};Oe(Ph,{AutoFocusPlugin:()=>Nk});S();function Nk({defaultSelection:e}){let[n]=st();return h(()=>{n.focus(()=>{let r=n.getRootElement(),s=r!==null?Eo(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,n]),null}var Ek=Ph,tb=Ek.AutoFocusPlugin;var Wh={};Oe(Wh,{$createCodeHighlightNode:()=>Uh,$createCodeNode:()=>Ao,$getCodeLineDirection:()=>cb,$getEndOfCodeInLine:()=>db,$getFirstCodeNodeOfLine:()=>rs,$getLastCodeNodeOfLine:()=>Xs,$getStartOfCodeInLine:()=>ub,$isCodeHighlightNode:()=>Ut,$isCodeNode:()=>An,$outdentLeadingSpaces:()=>fb,$plainifyCodeContent:()=>Tk,CodeExtension:()=>Hh,CodeHighlightNode:()=>Wl,CodeImportExtension:()=>kk,CodeImportRules:()=>yb,CodeIndentExtension:()=>Ik,CodeNode:()=>Hl,DEFAULT_CODE_LANGUAGE:()=>gb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>Nb});function Rd(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lb(e,n){let r=e;for(let s=it(e,n);s&&(Ut(s.origin)||Yt(s.origin));s=s.getAdjacentCaret())r=s.origin;return r}function rs(e){return lb(e,"previous")}function Xs(e){return lb(e,"next")}function cb(e){let n=rs(e),r=Xs(e),s=n;for(;s!==null;){if(Ut(s)){let a=yS(s.getTextContent());if(a!==null)return a}if(s===r)break;s=s.getNextSibling()}let i=n.getParent();if(Q(i)){let a=i.getDirection();if(a==="ltr"||a==="rtl")return a}return null}function ub(e,n){let r=null,s=null,i=e,a=n,l=e.getTextContent();for(;;){if(a===0){let f=i.getPreviousSibling();if(f===null){i=null;break}if(Ut(f)||Yt(f)||Ue(f)||Rd(167),i=f,Ue(i)){r={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),l=i.getTextContent()}else a--;let d=l[a];Ut(i)&&d!==" "&&(s={node:i,offset:a})}if(s!==null)return s;let c=null;if(n<e.getTextContentSize())Ut(e)&&(c=e.getTextContent()[n]);else{let d=e.getNextSibling();Ut(d)&&(c=d.getTextContent()[0])}if(c!==null&&c!==" ")return r;{let d=function(f,g){let p=f,m=g,_=f.getTextContent(),x=f.getTextContentSize();for(;;){if(!Ut(p)||m===x){if(p=p.getNextSibling(),p===null||Ue(p))return null;Ut(p)&&(m=0,_=p.getTextContent(),x=p.getTextContentSize())}if(Ut(p)){if(_[m]!==" ")return{node:p,offset:m};m++}}}(e,n);return d!==null?d:r}}function db(e){let n=Xs(e);return Ue(n)&&Rd(168),n}function Tk(e){let n=[];return Li(e,{linebreak:()=>n.push(fn()),tab:()=>n.push(gn()),text:(r)=>n.push(Uh(r))}),n}function fb(e,n,r){if(!Number.isInteger(n)||n<=0)return!1;let s=e.getTextContent(),i=/^ +/.exec(s);if(!i)return!1;let a=Math.min(n,i[0].length),l=e.getKey(),c=r.anchor.key===l&&r.anchor.type==="text"?r.anchor.offset:null,d=r.focus.key===l&&r.focus.type==="text"?r.focus.offset:null;return e.spliceText(0,a,""),c!==null&&r.anchor.set(l,Math.max(0,c-a),"text"),d!==null&&r.focus.set(l,Math.max(0,d-a),"text"),!0}var gb="javascript",bk=()=>gb;function pb(e,n){for(let r of e.childNodes){if(ye(r)&&r.tagName===n)return!0;if(pb(r,n))return!0}return!1}var Ul="data-language",zl="data-highlight-language",Ad="data-theme",vk=()=>{};class Hl extends ct{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:ct,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||pb(e,"BR"))?{conversion:nb,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:nb,priority:0}),table:(e)=>Bh(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Bh(r)?{conversion:ob,priority:3}:null},tr:(e)=>{let n=e.closest("table");return n&&Bh(n)?{conversion:ob,priority:3}:null}}})}constructor(e=void 0,n){super(n),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let n=Xe().createElement("code");et(n,e.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Ul,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(zl,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),n}updateDOM(e,n,r){let s=this.__language,i=e.__language;s?s!==i&&n.setAttribute(Ul,s):i&&n.removeAttribute(Ul);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&s?s!==i&&n.setAttribute(zl,s):n.removeAttribute(zl):a&&s&&n.setAttribute(zl,s);let l=this.__theme,c=e.__theme;l?l!==c&&n.setAttribute(Ad,l):c&&n.removeAttribute(Ad);let d=this.__style,f=e.__style;return d!==f&&fr(n.style,d,f),!1}exportDOM(e){let n=Xe().createElement("pre");et(n,e._config.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Ul,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(zl,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!lo(Ge(),"@lexical/code")){vk();let a=hb(e);if(a)return a}let{anchor:r,focus:s}=e,i=(r.isBefore(s)?r:s).getNode();if(re(i)){let a=rs(i),l=[];for(;;)if(Yt(a))l.push(gn()),a=a.getNextSibling();else{if(!Ut(a))break;{let _=0,x=a.getTextContent(),C=a.getTextContentSize();for(;_<C&&x[_]===" ";)_++;if(_!==0&&l.push(Uh(" ".repeat(_))),_!==C)break;a=a.getNextSibling()}}let c=i.splitText(r.offset)[0],d=r.offset===0?0:1,f=c.getIndexWithinParent()+d,g=i.getParentOrThrow(),p=[fn(),...l];g.splice(f,0,p);let m=l[l.length-1];m?m.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(An(i)){let{offset:a}=e.anchor;i.splice(a,0,[fn()]),i.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}setLanguage(e){let n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}}function Ao(e,n){return jc(Hl).setLanguage(e).setTheme(n)}function An(e){return e instanceof Hl}function nb(e){return{node:Ao(e.getAttribute(Ul))}}function Ok(e){let n=e,r=rb(n);return r||function(s){let i=s.parentElement;for(;i!==null;){if(rb(i))return!0;i=i.parentElement}return!1}(n)?{node:r?Ao():null}:{node:null}}function Ak(){return{node:Ao()}}function ob(){return{node:null}}function rb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){return e.classList.contains("js-file-line-container")}function hb(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type==="element"){let r=n.getNode();if(An(r)){let s=r.getChildrenSize();if(s>=2&&n.offset===s){let i=r.getLastChild();if(Ue(i)&&Ue(i.getPreviousSibling())){let a=Se();return r.splice(s-2,2,[]).insertAfter(a,!1),a.select(),a}}}}return null}class Wl extends Ln{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:Ln})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){let n=super.createDOM(e),r=Kh(e.theme,this.__highlightType);return et(n,r),n}updateDOM(e,n,r){let s=super.updateDOM(e,n,r),i=Kh(r.theme,e.__highlightType),a=Kh(r.theme,this.__highlightType);return i!==a&&(i&&an(n,i),a&&et(n,a)),s}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Ao()}}function Kh(e,n){return n&&e&&e.codeHighlight&&e.codeHighlight[n]}function Uh(e="",n){return un(new Wl(e,n))}function Ut(e){return e instanceof Wl}var mb="data-language";function _b(e){return e.style.fontFamily.match("monospace")!==null}function zh(e){let n=e.parentElement;for(;n!==null;){if(_b(n))return!0;n=n.parentElement}return!1}var Rk=ih([ft({$import:(e,n)=>e.$importChildren(n),match:gt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=ft({$import:(e,n)=>[Ao(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))],match:gt.tag("pre"),name:"@lexical/code/pre"}),Dk=ft({$import:(e,n,r)=>{let s=n.textContent||"";return/\r?\n/.test(s)||n.querySelector("br")!==null?[Ao(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))]:r()},match:gt.tag("code"),name:"@lexical/code/code-multiline"});function na(e){if(!ye(e))return!1;let n=e.style.fontFamily,r=e.style.whiteSpace;return typeof n=="string"&&/monospace/i.test(n)&&typeof r=="string"&&r.startsWith("pre")}function xb(e){let n=!1,r=[],s="",i=!1,a=()=>{i&&(r.push(s),s="",i=!1)};for(let l of Array.from(e.childNodes))if(ye(l))l.tagName==="DIV"?(a(),r.push(l.textContent||""),n=!0):l.tagName==="BR"?(a(),r.push(""),n=!0):(s+=l.textContent||"",i=!0);else if(Fs(l)){let c=l.textContent||"";c.length>0&&(s+=c,i=!0)}return a(),n?r:null}function Cb(e){for(let n of Array.from(e.children)){if(ye(n)&&na(n)){if(xb(n)!==null)return!0;let r=n.nextElementSibling;if(r&&na(r))return!0;continue}if(Cb(n))return!0}return!1}var $k=ih([ft({$import:(e,n,r)=>{if(!na(n)||zh(n))return r();let s=xb(n);return s===null||s.length===0?r():[Ao().splice(0,0,sl(s.join(`
14
+ `);let d=c.length;if(!re(s)||i>=d){let f=s.getParent();s.remove(),f==null||f.getChildrenSize()!==0||So(f)||f.remove(),i-=d+l,s=a}else{let f=s.getKey(),g=e.read("latest",()=>{let _=Rt(f);return re(_)&&_.isSimpleText()?_.getTextContent():null}),p=d-i,m=c.slice(0,p);if(g!==null&&g!==c){let _=En(),x=s;if(s.isSimpleText())s.setTextContent(g);else{let C=yt(g);s.replace(C),x=C}if(j(_)&&_.isCollapsed()){let C=_.anchor.offset;x.select(C,C)}}else if(s.isSimpleText()){let _=n.key===f,x=n.offset;x<i&&(x=d);let C=_?x-i:0,y=_?x:p;if(_&&C===0){let[N]=s.splitText(C,y);N.remove()}else{let[,N]=s.splitText(C,y);N.remove()}}else{let _=yt(m);s.replace(_)}i=0}}}var RM=()=>{};function $u(e,n){(j(e)?e.isCollapsed():re(e)||Q(e))||tp(280);let r=Xr(j(e)?e.style:re(e)?e.getStyle():e.getTextStyle()),s=wS(Object.entries(n).reduce((i,[a,l])=>(typeof l=="function"?i[a]=l(r[a],e):l===null?delete i[a]:i[a]=l,i),{...r}));j(e)||re(e)?e.setStyle(s):e.setTextStyle(s)}function MM(e,n){if(j(e)&&e.isCollapsed()){$u(e,n);let s=e.anchor.getNode();Q(s)&&s.isEmpty()&&$u(s,n)}IS((s)=>{$u(s,n)});let r=e.getNodes();if(r.length>0){let s=new Set;for(let i of r){if(!Q(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let a=i.getKey();s.has(a)||(s.add(a),$u(i,n))}}}function IS(e){let n=X();if(!n)return;let r=new Map,s=(a)=>r.get(a.getKey())||[0,a.getTextContentSize()];if(j(n))for(let a of ur(n).getTextSlices())a&&r.set(a.caret.origin.getKey(),a.getSliceIndices());let i=n.getNodes();for(let a of i){if(!re(a)||!a.canHaveFormat())continue;let[l,c]=s(a);if(c!==l)if(Wg(a)||l===0&&c===a.getTextContentSize())e(a);else e(a.splitText(l,c)[l===0?0:1])}j(n)&&n.anchor.type==="text"&&n.focus.type==="text"&&n.anchor.key===n.focus.key&&LS(n)}function LS(e){if(e.isBackward()){let{anchor:n,focus:r}=e,{key:s,offset:i,type:a}=n;n.set(r.key,r.offset,r.type),r.set(s,i,a)}}function FS(e,n){let r=e.getFormatType(),s=e.getIndent();r!==n.getFormatType()&&n.setFormat(r),s!==n.getIndent()&&n.setIndent(s)}function PS(e,n,r){let s=dn(e,r);if(ll(s))return!1;for(;s;s=s.getParentCaret()){let i=s.getParentAtCaret();if(!i||s.getNodeAtCaret())return!1;if(n.is(i))return!0}return!1}function DM(e,n,r=FS){if(!e)return;let s=e.getStartEndPoints(),i=!1,a=null,l=new Map;if(s){let[c,d]=s,f=he(c.getNode(),gl);a=he(d.getNode(),gl);let g=e.isBackward()?"previous":"next";i=Q(a)&&!a.is(f)&&function(p,m,_){let x=p.getNode();return(!Q(x)||!x.isEmpty())&&PS(p,m,_)}(d,a,pS(g)),Q(f)&&l.set(f.getKey(),f),Q(a)&&!i&&l.set(a.getKey(),a)}for(let c of e.getNodes())if(Q(c)&&gl(c)){if(i&&c.is(a))continue;l.set(c.getKey(),c)}else if(!s){let d=he(c,gl);Q(d)&&l.set(d.getKey(),d)}for(let c of l.values()){let d=n();r(c,d),c.replace(d,!0)}}function $S(e){return e.getNode().isAttached()}function $M(e){let n=e;for(;n!==null&&!Mt(n);){let r=n.getLatest(),s=n.getParent();r.getChildrenSize()===0&&n.remove(!0),n=s}}function wM(e,n,r=null){let s=e.getStartEndPoints(),i=s?s[0]:null,a=e.getNodes(),l=a.length;if(i!==null&&(l===0||l===1&&i.type==="element"&&i.getNode().getChildrenSize()===0)){let f=i.type==="text"?i.getNode().getParentOrThrow():i.getNode(),g=f.getChildren(),p=n();return p.setFormat(f.getFormatType()),p.setIndent(f.getIndent()),g.forEach((m)=>p.append(m)),r&&(p=r.append(p)),void f.replace(p)}let c=null,d=[];for(let f=0;f<l;f++){let g=a[f];Mt(g)?(ep(e,d,d.length,n,r),d=[],c=g):c===null||c!==null&&al(g,c)?d.push(g):(ep(e,d,d.length,n,r),d=[g])}ep(e,d,d.length,n,r)}function ep(e,n,r,s,i=null){if(n.length===0)return;let a=n[0],l=new Map,c=[],d=Q(a)?a:a.getParentOrThrow(),f=d.isInline()?d.getParentOrThrow():d,g=!1;for(;f!==null;){let C=f.getPreviousSibling();if(C!==null){f=C,g=!0;break}if(f=f.getParentOrThrow(),Mt(f))break}let p=new Set;for(let C=0;C<r;C++){let y=n[C];Q(y)&&y.getChildrenSize()===0&&p.add(y.getKey())}let m=new Set;for(let C=0;C<r;C++){let y=n[C],N=y.getParent();if(N!==null&&N.isInline()&&(N=N.getParent()),N!==null&&cl(y)&&!m.has(y.getKey())){let T=N.getKey();if(l.get(T)===void 0){let v=s();v.setFormat(N.getFormatType()),v.setIndent(N.getIndent()),c.push(v),l.set(T,v);let R=N.getChildren();v.splice(v.getChildrenSize(),0,R);for(let F of R)if(m.add(F.getKey()),Q(F))for(let k of F.getChildrenKeys())m.add(k);$M(N)}}else if(p.has(y.getKey())){Q(y)||tp(179);let T=s();T.setFormat(y.getFormatType()),T.setIndent(y.getIndent()),c.push(T),y.remove(!0)}}if(i!==null)for(let C=0;C<c.length;C++){let y=c[C];i.append(y)}let _=null;if(Mt(f))if(g)if(i!==null)f.insertAfter(i);else for(let C=c.length-1;C>=0;C--){let y=c[C];f.insertAfter(y)}else{let C=f,y=C.getFirstChild();if(Q(y)&&(f=y),y===null)if(i)C.append(i);else for(let N=0;N<c.length;N++){let T=c[N];C.append(T),_=T}else if(i!==null)y.insertBefore(i);else for(let N=0;N<c.length;N++){let T=c[N];y.insertBefore(T),_=T}}else if(i)f.insertAfter(i);else for(let C=c.length-1;C>=0;C--){let y=c[C];f.insertAfter(y),_=y}let x=En();j(x)&&$S(x.anchor)&&$S(x.focus)?mt(x.clone()):_!==null?_.selectEnd():e.dirty=!0}function BS(e){let n=KS(e);return n!==null&&n.writingMode==="vertical-rl"}function KS(e){let n=e.anchor.getNode();return Q(n)?np(n):op(n)}function kM(e,n){let r=BS(e)?!n:n;rp(e)&&(r=!r);let s=dn(e.focus,r?"previous":"next");if(ll(s))return!1;if(Hr(s)&&!Yt(s.origin)&&s.origin.isUnmergeable()){let i=s.getNodeAtCaret();if(re(i)&&!Yt(i))return!0}for(let i of bs(s)){if(zo(i))return!i.origin.isInline();if(!Q(i.origin)){if(wt(i.origin))return!0;break}}return!1}function zS(e,n,r,s){e.modify(n?"extend":"move",r,s)}function rp(e){let n=KS(e);return n!==null&&n.direction==="rtl"}function IM(e,n,r){let s=rp(e),i;i=BS(e)||s?!r:r,zS(e,n,i,"character")}function LM(e,n,r){let s=e.getStyle(),i=Xr(s);return i!==null&&i[n]||r}function FM(e,n,r=""){let s=null,i=e.getNodes(),a,l;if(j(e)){if(e.isCollapsed()&&e.style!==""){let x=Xr(e.style);if(x!==null&&n in x)return x[n]}let{anchor:c,focus:d}=e,f=e.isBackward(),g=f?d.getNode():c.getNode(),p=f?c.getNode():d.getNode(),m=f?d.offset:c.offset,_=f?c.offset:d.offset;re(g)&&m===g.getTextContentSize()&&(a=g),_===0&&(l=p)}for(let c=0;c<i.length;c++){let d=i[c];if(re(d)&&!d.is(c===0?a:l)){let f=LM(d,n,r);if(s===null)s=f;else if(s!==f){s="";break}}}return s===null?r:s}var PM=Xr,BM=kS;var ut=sp,{$addNodeStyle:gF,$cloneWithProperties:pF,$copyBlockFormatIndent:hF,$ensureForwardRangeSelection:mF,$forEachSelectedTextNode:_F,$getComputedStyleForElement:xF,$getComputedStyleForParent:CF,$getSelectionStyleValueForProperty:yF,$isAtEdgeOfElement:ip,$isAtNodeEnd:ap,$isParentElementRTL:SF,$isParentRTL:El,$moveCaretSelection:NF,$moveCharacter:lp,$patchStyleText:EF,$selectAll:TF,$setBlocksType:Fi,$shouldOverrideDefaultCharacterSelection:cp,$sliceSelectedTextNodeContent:Ps,$trimTextContentFromAnchor:bF,$wrapNodes:vF,createDOMRange:OF,createRectsFromDOMRange:US,getCSSFromStyleObject:AF,getStyleObjectFromCSS:RF,trimTextContentFromAnchor:MF}=ut;var mp={};Oe(mp,{$descendantsMatching:()=>gD,$dfs:()=>GM,$dfsIterator:()=>XS,$dfsWithSlots:()=>VM,$dfsWithSlotsIterator:()=>qS,$filter:()=>aD,$findMatchingParent:()=>he,$firstToLastIterator:()=>pD,$getAdjacentCaret:()=>jM,$getAdjacentSiblingOrParentSiblingCaret:()=>vs,$getDepth:()=>JS,$getNearestBlockElementAncestorOrThrow:()=>QM,$getNearestNodeOfType:()=>ZM,$getNextRightPreorderNode:()=>qM,$getNextSiblingOrParentSibling:()=>XM,$handleIndentAndOutdent:()=>lD,$insertFirst:()=>cD,$insertNodeIntoLeaf:()=>rD,$insertNodeToNearestRoot:()=>oD,$insertNodeToNearestRootAtCaret:()=>zr,$isAtEndOfNode:()=>rN,$isAtStartOfNode:()=>oN,$isBlockFullySelected:()=>eD,$isEditorIsNestedEditor:()=>dD,$lastToFirstIterator:()=>hp,$onEscapeDown:()=>xD,$onEscapeUp:()=>_D,$restoreEditorState:()=>nD,$reverseDfs:()=>YM,$reverseDfsIterator:()=>ZS,$reverseDfsWithSlots:()=>JM,$reverseDfsWithSlotsIterator:()=>QS,$splitNode:()=>Gy,$unwrapAndFilterDescendants:()=>fD,$unwrapNode:()=>hD,$wrapNodeInElement:()=>sD,CAN_USE_BEFORE_INPUT:()=>fl,CAN_USE_DOM:()=>pn,IS_ANDROID:()=>tS,IS_ANDROID_CHROME:()=>nS,IS_APPLE:()=>pl,IS_APPLE_WEBKIT:()=>du,IS_CHROME:()=>oS,IS_FIREFOX:()=>ws,IS_IOS:()=>ml,IS_SAFARI:()=>fu,addClassNamesToElement:()=>et,calculateZoomLevel:()=>uD,dedupeSelectionRects:()=>GS,eventFiles:()=>iD,getScrollParent:()=>HM,isBlockDomNode:()=>Ls,isHTMLAnchorElement:()=>wi,isHTMLElement:()=>ye,isInlineDomNode:()=>ki,isMimeType:()=>VS,makeStateWrapper:()=>mD,markSelection:()=>YS,mediaFileReader:()=>WM,mergeRegister:()=>De,objectKlassEquals:()=>pp,positionNodeOnRange:()=>jS,registerNestedElementResolver:()=>tD,removeClassNamesFromElement:()=>an,selectionAlwaysOnDisplay:()=>UM});function dp(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function GS(e){let n=(s,i)=>i.left>=s.left-1&&i.top>=s.top-1&&i.right<=s.right+1&&i.bottom<=s.bottom+1,r=[];for(let s of Array.from(e))if(!(s.width<0.5||s.height<0.5||r.some((i)=>n(s,i)))){for(let i=r.length-1;i>=0;i--)n(r[i],s)&&r.splice(i,1);r.push(s)}return r}function Xo(e){return`${e}px`}var KM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function jS(e,n,r){let s=null,i=null,a=null,l=[],c=Is(e.getRootElement()).createElement("div");function d(){s===null&&dp(182),i===null&&dp(183);let{left:p,top:m}=i.getBoundingClientRect(),_=GS(US(e,n));var x,C;c.isConnected||(C=c,(x=i).insertBefore(C,x.firstChild));let y=!1;for(let N=0;N<_.length;N++){let T=_[N],v=l[N]||Is(s).createElement("div"),R=v.style;R.position!=="absolute"&&(R.position="absolute",y=!0);let F=Xo(T.left-p);R.left!==F&&(R.left=F,y=!0);let k=Xo(T.top-m);R.top!==k&&(v.style.top=k,y=!0);let H=Xo(T.width);R.width!==H&&(v.style.width=H,y=!0);let U=Xo(T.height);R.height!==U&&(v.style.height=U,y=!0),v.parentNode!==c&&(c.append(v),y=!0),l[N]=v}for(;l.length>_.length;){let N=l.pop();N!=null&&N.remove()}y&&r(l)}function f(){i=null,s=null,a!==null&&a.disconnect(),a=null,c.remove();for(let p of l)p.remove();l=[]}c.style.position="relative";let g=e.registerRootListener(function p(){let m=e.getRootElement();if(m===null)return f();let _=m.parentElement;if(!ye(_))return f();f(),s=m,i=_,a=new MutationObserver((x)=>{let C=e.getRootElement(),y=C&&C.parentElement;if(C!==s||y!==i)return p();for(let N of x)if(!c.contains(N.target))return d()}),a.observe(_,KM),d()});return()=>{g(),f()}}function HS(e,n,r,s){if(n.type!=="text"&&Q(r)){let i=ky(r,s,e);return[i.element,i.getFirstChildOffset()+n.offset]}return[(re(r)?Iy(r,s,e):xS(s))||s,n.offset]}function zM(e){for(let n of e){let r=n.style;r.background!=="Highlight"&&(r.background="Highlight"),r.color!=="HighlightText"&&(r.color="HighlightText"),r.marginTop!==Xo(-1.5)&&(r.marginTop=Xo(-1.5)),r.paddingTop!==Xo(4)&&(r.paddingTop=Xo(4)),r.paddingBottom!==Xo(0)&&(r.paddingBottom=Xo(0))}}function YS(e,n=zM){let r=null,s=null,i=null,a=null,l=null,c=null,d=()=>{};function f(g){g.read(()=>{let p=X();if(!j(p))return r=null,i=null,a=null,c=null,d(),void(d=()=>{});let[m,_]=function(U){let W=U.getStartEndPoints();return U.isBackward()?[W[1],W[0]]:W}(p),x=m.getNode(),C=x.getKey(),y=m.offset,N=_.getNode(),T=N.getKey(),v=_.offset,R=e.getElementByKey(C),F=e.getElementByKey(T),k=r===null||R!==s||y!==i||C!==r.getKey(),H=a===null||F!==l||v!==c||T!==a.getKey();if((k||H)&&R!==null&&F!==null){let U=function(W,J,G,ne,ee,se,V){let fe=(W._window?W._window.document:document).createRange();return fe.setStart(...HS(W,J,G,ne)),fe.setEnd(...HS(W,ee,se,V)),fe}(e,m,x,R,_,N,F);d(),d=jS(e,U,n)}r=x,s=R,i=y,a=N,l=F,c=v},{editor:e})}return f(e.getEditorState()),De(e.registerUpdateListener(({editorState:g})=>f(g)),()=>{d()})}function UM(e,n){let r=null,s=()=>{let i=e.getRootElement(),a=i!==null?i.ownerDocument.defaultView:null,l=a!==null?a.getSelection():null,c=l!==null?ks(l,i).anchorNode:null;c!==null&&i!==null&&i.contains(c)?r!==null&&(r(),r=null):r===null&&(r=YS(e,n))};return e.registerRootListener((i)=>{if(i){let a=i.ownerDocument,l=De(ao(a,"selectionchange",s),()=>{r!==null&&r()});return s(),l}})}function HM(e,n){let r=e.ownerDocument,s=r.defaultView||window,i=s.getComputedStyle(e),a=i.position==="absolute",l=n?/(auto|scroll|hidden)/:/(auto|scroll)/;if(i.position==="fixed")return r.body;for(let c=e;c=Nl(c);)if(i=s.getComputedStyle(c),(!a||i.position!=="static")&&l.test(i.overflow+i.overflowY+i.overflowX))return c;return r.body}function VS(e,n){for(let r of n)if(e.type.startsWith(r))return!0;return!1}function WM(e,n){let r=e[Symbol.iterator]();return new Promise((s,i)=>{let a=[],l=()=>{let{done:c,value:d}=r.next();if(c)return s(a);let f=new FileReader;f.addEventListener("error",i),f.addEventListener("load",()=>{let g=f.result;typeof g=="string"&&a.push({file:d,result:g}),l()}),VS(d,n)?f.readAsDataURL(d):l()};l()})}function GM(e,n){return Array.from(XS(e,n))}function jM(e){return e?e.getAdjacentCaret():null}function YM(e,n){return Array.from(ZS(e,n))}function XS(e,n){return wu("next",e,n)}function VM(e,n){return Array.from(qS(e,n))}function*qS(e,n){for(let r of wu("next",e,n)){yield r;let{node:s,depth:i}=r;if(ul(s)&&!s.is(n))for(let a of As(s)){let l=Ci(s,a);l!==null&&(yield*fp(l,i+1))}}}function*fp(e,n){yield{depth:n,node:e};let r=n+1;if(ul(e))for(let s of As(e)){let i=Ci(e,s);i!==null&&(yield*fp(i,r))}if(Q(e))for(let s of e.getChildren())yield*fp(s,r)}function WS(e,n){let r=vs(it(e,n));return r&&r[0]}function wu(e,n,r){let s=Je(),i=n||s,a=Q(i)?bt(i,e):it(i,e),l=JS(i),c=r?il(Kg(it(r,e)))||WS(r,e):WS(i,e),d=l;return Xg({hasNext:(f)=>f!==null,initial:a,map:(f)=>({depth:d,node:f.origin}),step:(f)=>{if(f.isSameNodeCaret(c))return null;zo(f)&&d++;let g=vs(f);return!g||g[0].isSameNodeCaret(c)?null:(d+=g[1],g[0])}})}function XM(e){let n=vs(it(e,"next"));return n&&[n[0].origin,n[1]]}function JS(e){let n=-1;for(let r=e;r!==null;r=r.getParent()??Vc(r))n++;return n}function qM(e){let n=Kg(it(e,"previous")),r=vs(n,"root");return r&&r[0].origin}function ZS(e,n){return wu("previous",e,n)}function JM(e,n){return Array.from(QS(e,n))}function*QS(e,n){let r=[];for(let s of wu("previous",e,n)){for(;r.length>0&&s.depth<=r[r.length-1].depth;){let l=r.pop();yield*gp(l.node,l.depth+1)}yield s;let{node:i,depth:a}=s;ul(i)&&As(i).length>0&&!i.is(n)&&r.push({depth:a,node:i})}for(;r.length>0;){let s=r.pop();yield*gp(s.node,s.depth+1)}}function*gp(e,n){let r=As(e);for(let s=r.length-1;s>=0;s--){let i=Ci(e,r[s]);i!==null&&(yield*eN(i,n))}}function*eN(e,n){yield{depth:n,node:e};let r=n+1;if(Q(e)){let s=e.getChildren();for(let i=s.length-1;i>=0;i--)yield*eN(s[i],r)}ul(e)&&(yield*gp(e,r))}function ZM(e,n){let r=e;for(;r!=null;){if(r instanceof n)return r;r=r.getParent()}return null}function QM(e){let n=he(e,(r)=>Q(r)&&!r.isInline());return Q(n)||dp(4,e.__key),n}function eD(e,n){let r=dr(j(n)?ur(n):n,"next"),s=Qn(r.anchor.origin),i=Qn(e.getLatest());if(s===null?i!==null:!s.is(i))return!1;let a=kt(bt(e,"next")),l=$y(kt(bt(e,"previous")),"next");return Br(r.anchor,a)<=0&&Br(r.focus,l)>=0}function tD(e,n,r,s){let i=(a)=>a instanceof n;return e.registerNodeTransform(n,(a)=>{let l=((c)=>{let d=c.getChildren();for(let p=0;p<d.length;p++){let m=d[p];if(i(m))return null}let f=c,g=c;for(;f!==null;)if(g=f,f=f.getParent(),i(f))return{child:g,parent:f};return null})(a);if(l!==null){let{child:c,parent:d}=l;if(c.is(a)){s(d,a);let f=c.getNextSiblings(),g=f.length;if(d.insertAfter(c),g!==0){let p=r(d);c.insertAfter(p);for(let m=0;m<g;m++)p.append(f[m])}d.canBeEmpty()||d.getChildrenSize()!==0||d.remove()}}})}function nD(e,n){let r=new Map,s=e._pendingEditorState;for(let[a,l]of n._nodeMap)r.set(a,Gc(l));s&&(s._nodeMap=r),xi();let i=n._selection;mt(i===null?null:i.clone())}function oD(e){let n=X()||En(),r;if(j(n))r=dn(n.focus,"next");else{if(n!=null){let l=n.getNodes(),c=l[l.length-1];c&&(r=it(c,"next"))}r=r||bt(Je(),"previous").getFlipped().insert(Se())}let s=zr(e,r),i=il(s),a=zo(i)?kt(i):s;return kn(Os(a)),e.getLatest()}function rD(e){let n=X();if(!j(n))return void(n&&n.insertNodes([e]));let r=ur(n),s=dr(Hy(r),"next").anchor;if(Hr(s)){let a=Zc(s);if(!a)return;s=a}let i=s.getFlipped();i.insert(e),kn(Zn(i,i))}function sD(e,n){let r=n();return e.replace(r),r.append(e),r}function pp(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function iD(e){let n=null;if(pp(e,DragEvent)?n=e.dataTransfer:pp(e,ClipboardEvent)&&(n=e.clipboardData),n===null)return[!1,[],!1];let r=n.types,s=r.includes("Files"),i=r.includes("text/html")||r.includes("text/plain");return[s,Array.from(n.files),i]}function aD(e,n){let r=[];for(let s=0;s<e.length;s++){let i=n(e[s]);i!==null&&r.push(i)}return r}function lD(e){let n=X();if(!j(n))return!1;let r=new Set,s=n.getNodes();for(let i=0;i<s.length;i++){let a=s[i],l=a.getKey();if(r.has(l))continue;let c=he(a,(f)=>Q(f)&&!f.isInline());if(c===null)continue;let d=c.getKey();c.canIndent()&&!r.has(d)&&(r.add(d),e(c))}return r.size>0}function cD(e,n){bt(e,"next").insert(n)}var up=!(ws||!pn)&&void 0;function uD(e,n=!1){let r=1;if(function(){if(up===void 0){let s=document.createElement("div");s.style.position="absolute",s.style.opacity="0",s.style.width="100px",s.style.left="-1000px",document.body.appendChild(s);let i=s.getBoundingClientRect();s.style.setProperty("zoom","2"),up=s.getBoundingClientRect().width===i.width,document.body.removeChild(s)}return up}()||n){let s=e&&e.ownerDocument.defaultView||window;for(;e;)r*=Number(s.getComputedStyle(e).getPropertyValue("zoom")),e=Nl(e)}return r}function dD(e){return e._parentEditor!==null}function fD(e,n){return tN(e,n,null)}function tN(e,n,r){let s=!1;for(let i of hp(e))n(i)?r!==null&&r(i):(s=!0,Q(i)&&tN(i,n,r||((a)=>i.insertAfter(a))),i.remove());return s}function gD(e,n){let r=[],s=Array.from(e).reverse();for(let i=s.pop();i!==void 0;i=s.pop())if(n(i))r.push(i);else if(Q(i))for(let a of hp(i))s.push(a);return r}function pD(e){return nN(bt(e,"next"))}function hp(e){return nN(bt(e,"previous"))}function nN(e){return Xg({hasNext:No,initial:e.getAdjacentCaret(),map:(n)=>n.origin.getLatest(),step:(n)=>n.getAdjacentCaret()})}function hD(e){Ho(it(e,"next")).splice(1,e.getChildren())}function mD(e){let n=(s)=>Ko(s,e),r=(s,i)=>to(s,e,i);return{$get:n,$set:r,accessors:[n,r],makeGetterMethod:()=>function(){return n(this)},makeSetterMethod:()=>function(s){return r(this,s)},stateConfig:e}}function _D(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getFirstChild()===s&&oN(r.anchor,s))return s.insertBefore(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function xD(e,n){let r=X();if(j(r)&&r.isCollapsed()){let s=he(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getLastChild()===s&&rN(r.anchor,s))return s.insertAfter(Se()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function oN(e,n){return ip(e,n,"previous")}function rN(e,n){return ip(e,n,"next")}var de=mp,{$descendantsMatching:Tl,$dfs:sN,$dfsIterator:IF,$dfsWithSlots:LF,$dfsWithSlotsIterator:FF,$filter:PF,$findMatchingParent:BF,$firstToLastIterator:KF,$getAdjacentCaret:zF,$getAdjacentSiblingOrParentSiblingCaret:UF,$getDepth:HF,$getNearestBlockElementAncestorOrThrow:ku,$getNearestNodeOfType:Iu,$getNextRightPreorderNode:WF,$getNextSiblingOrParentSibling:GF,$handleIndentAndOutdent:bl,$insertFirst:iN,$insertNodeIntoLeaf:jF,$insertNodeToNearestRoot:Lu,$insertNodeToNearestRootAtCaret:YF,$isAtEndOfNode:VF,$isAtStartOfNode:XF,$isBlockFullySelected:vl,$isEditorIsNestedEditor:qF,$lastToFirstIterator:JF,$onEscapeDown:_p,$onEscapeUp:Cp,$restoreEditorState:ZF,$reverseDfs:QF,$reverseDfsIterator:eP,$reverseDfsWithSlots:tP,$reverseDfsWithSlotsIterator:nP,$splitNode:oP,$unwrapAndFilterDescendants:yp,$unwrapNode:rP,$wrapNodeInElement:sP,CAN_USE_BEFORE_INPUT:iP,CAN_USE_DOM:aP,IS_ANDROID:lP,IS_ANDROID_CHROME:cP,IS_APPLE:uP,IS_APPLE_WEBKIT:dP,IS_CHROME:fP,IS_FIREFOX:gP,IS_IOS:pP,IS_SAFARI:hP,addClassNamesToElement:mP,calculateZoomLevel:aN,dedupeSelectionRects:_P,eventFiles:Bs,getScrollParent:xP,isBlockDomNode:CP,isHTMLAnchorElement:yP,isHTMLElement:SP,isInlineDomNode:NP,isMimeType:EP,makeStateWrapper:TP,markSelection:bP,mediaFileReader:vP,mergeRegister:OP,objectKlassEquals:Pn,positionNodeOnRange:AP,registerNestedElementResolver:RP,removeClassNamesFromElement:MP,selectionAlwaysOnDisplay:lN}=de;var Ip={};Oe(Ip,{$applyFormatToDom:()=>OD,$createHorizontalRuleNode:()=>kp,$defaultShouldInsertAfter:()=>EN,$getExtensionDependency:()=>kN,$getExtensionOutput:()=>BD,$getPeerDependency:()=>KD,$isDecoratorTextNode:()=>bD,$isHorizontalRuleNode:()=>LN,AutoFocusExtension:()=>ND,ClearEditorExtension:()=>ED,ClickAfterLastBlockExtension:()=>TD,DecoratorTextExtension:()=>MD,DecoratorTextNode:()=>Wu,EditorStateExtension:()=>Uu,HorizontalRuleExtension:()=>HD,HorizontalRuleNode:()=>zi,IMEExtension:()=>WD,INSERT_HORIZONTAL_RULE_COMMAND:()=>IN,InitialStateExtension:()=>$N,LexicalBuilder:()=>hr,NestedEditorExtension:()=>GD,NodeSelectionDataSelectedExtension:()=>jD,NodeSelectionExtension:()=>Rp,NormalizeInlineElementsExtension:()=>YD,NormalizeTripleClickSelectionExtension:()=>XD,PreventSelectAllExtension:()=>Mp,RootElementExtension:()=>JD,SelectBlockExtension:()=>ZD,SelectionAlwaysOnDisplayExtension:()=>QD,TabIndentationExtension:()=>e$,WatchEditableExtension:()=>t$,applyFormatFromStyle:()=>vD,applyFormatToDom:()=>vN,batch:()=>mN,buildEditorFromExtensions:()=>LD,computed:()=>CN,configExtension:()=>sn,declarePeerDependency:()=>fS,defineExtension:()=>_e,effect:()=>Zt,getExtensionDependencyFromEditor:()=>wN,getKnownTypesAndNodes:()=>TN,getPeerDependencyFromEditor:()=>wp,getPeerDependencyFromEditorOrThrow:()=>PD,namedSignals:()=>To,registerClearEditor:()=>NN,registerTabIndentation:()=>PN,safeCast:()=>We,shallowMergeConfig:()=>zt,signal:()=>Qr,untracked:()=>vp,watchedSignal:()=>Rl});var CD=Symbol.for("preact-signals");function Hu(){if(pr>1)return void pr--;let e,n=!1;for(!function(){let r=Ku;for(Ku=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o}();Al!==void 0;){let r=Al;for(Al=void 0,zu++;r!==void 0;){let s=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&_N(r))try{r.c()}catch(i){n||(e=i,n=!0)}r=s}}if(zu=0,pr--,n)throw e}function mN(e){if(pr>0)return e();Op=++yD,pr++;try{return e()}finally{Hu()}}var nt,Al;function vp(e){let n=nt;nt=void 0;try{return e()}finally{nt=n}}var Ku,pr=0,zu=0,yD=0,Op=0,Bu=0;function cN(e){if(nt===void 0)return;let n=e.n;return n===void 0||n.t!==nt?(n={i:0,S:e,p:nt.s,n:void 0,t:nt,e:void 0,x:void 0,r:n},nt.s!==void 0&&(nt.s.n=n),nt.s=n,e.n=n,32&nt.f&&e.S(n),n):n.i===-1?(n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=nt.s,n.n=void 0,nt.s.n=n,nt.s=n),n):void 0}function hn(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function Qr(e,n){return new hn(e,n)}function _N(e){for(let n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function uN(e){for(let n=e.s;n!==void 0;n=n.n){let r=n.S.n;if(r!==void 0&&(n.r=r),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function xN(e){let n,r=e.s;for(;r!==void 0;){let s=r.p;r.i===-1?(r.S.U(r),s!==void 0&&(s.n=r.n),r.n!==void 0&&(r.n.p=s)):n=r,r.S.n=r.r,r.r!==void 0&&(r.r=void 0),r=s}e.s=n}function Ks(e,n){hn.call(this,void 0),this.x=e,this.s=void 0,this.g=Bu-1,this.f=4,this.W=n==null?void 0:n.watched,this.Z=n==null?void 0:n.unwatched,this.name=n==null?void 0:n.name}function CN(e,n){return new Ks(e,n)}function yN(e){let n=e.m;if(e.m=void 0,typeof n=="function"){pr++;let r=nt;nt=void 0;try{n()}catch(s){throw e.f&=-2,e.f|=8,Dp(e),s}finally{nt=r,Hu()}}}function Dp(e){for(let n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,yN(e)}function SD(e){if(nt!==this)throw Error("Out-of-order effect");xN(this),nt=e,this.f&=-2,8&this.f&&Dp(this),Hu()}function Ki(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n==null?void 0:n.name}function Zt(e,n){let r=new Ki(e,n);try{r.c()}catch(i){throw r.d(),i}let s=r.d.bind(r);return s[Symbol.dispose]=s,s}function To(e,n={}){let r={};for(let s in e){let i=n[s],a=Qr(i===void 0?e[s]:i);r[s]=a}return r}hn.prototype.brand=CD,hn.prototype.h=function(){return!0},hn.prototype.S=function(e){let n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:vp(()=>{var r;(r=this.W)==null||r.call(this)}))},hn.prototype.U=function(e){if(this.t!==void 0){let{e:n,x:r}=e;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&vp(()=>{var s;(s=this.Z)==null||s.call(this)}))}},hn.prototype.subscribe=function(e){return Zt(()=>{let n=this.value,r=nt;nt=void 0;try{e(n)}finally{nt=r}},{name:"sub"})},hn.prototype.valueOf=function(){return this.value},hn.prototype.toString=function(){return this.value+""},hn.prototype.toJSON=function(){return this.value},hn.prototype.peek=function(){let e=nt;nt=void 0;try{return this.value}finally{nt=e}},Object.defineProperty(hn.prototype,"value",{get(){let e=cN(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(zu>100)throw Error("Cycle detected");(function(n){pr!==0&&zu===0&&n.l!==Op&&(n.l=Op,Ku={S:n,v:n.v,i:n.i,o:Ku})})(this),this.v=e,this.i++,Bu++,pr++;try{for(let n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Hu()}}}}),Ks.prototype=new hn,Ks.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===Bu)return!0;if(this.g=Bu,this.f|=1,this.i>0&&!_N(this))return this.f&=-2,!0;let e=nt;try{uN(this),nt=this;let n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return nt=e,xN(this),this.f&=-2,!0},Ks.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let n=this.s;n!==void 0;n=n.n)n.S.S(n)}hn.prototype.S.call(this,e)},Ks.prototype.U=function(e){if(this.t!==void 0&&(hn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let n=this.s;n!==void 0;n=n.n)n.S.U(n)}},Ks.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ks.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=cN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ki.prototype.c=function(){let e=this.S();try{if(8&this.f)return;if(this.x===void 0)return;let n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}},Ki.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,yN(this),uN(this),pr++;let e=nt;return nt=this,SD.bind(this,e)},Ki.prototype.N=function(){2&this.f||(this.f|=2,this.u=Al,Al=this)},Ki.prototype.d=function(){this.f|=8,1&this.f||Dp(this)},Ki.prototype.dispose=function(){this.d()};var ND=_e({build:(e,n,r)=>To(n),config:We({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,n,r){let s=r.getOutput();return Zt(()=>s.disabled.value?void 0:e.registerRootListener((i)=>{e.focus(()=>{let a=i!==null?Eo(i):null;i===null||a!==null&&i.contains(a)||i.focus({preventScroll:!0})},{defaultSelection:s.defaultSelection.peek()})}))}});function SN(){let e=Je(),n=X(),r=Se();e.clear(),e.append(r),n!==null&&r.select(),j(n)&&(n.format=0)}function NN(e,n=SN){return e.registerCommand(Qc,()=>(n(),!0),Te)}var ED=_e({build:(e,n,r)=>To(n),config:We({$onClear:SN}),name:"@lexical/extension/ClearEditor",register(e,n,r){let{$onClear:s}=r.getOutput();return Zt(()=>NN(e,s.value))}});function EN(e){return!!wt(e)||!(!Q(e)||!e.isShadowRoot())}function dN(e,n,r,s){return!!e.isEditable()&&(r.target===n&&e.read("latest",()=>{let i=Je().getLastChild();if(i===null)return!1;let a=e.getElementByKey(i.getKey());return a!==null&&(!(r.clientY<=a.getBoundingClientRect().bottom)&&s(i))}))}var TD=_e({build:(e,n)=>To(n),config:We({$shouldInsertAfter:EN,disabled:!1}),name:"@lexical/ClickAfterLastBlock",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(i===null)return;return Jr(i,{click:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&(a.preventDefault(),qg(a),e.update(()=>{let l=Je().getLastChild();if(l===null)return;if(!s.$shouldInsertAfter.peek()(l))return;let c=Se();l.insertAfter(c),c.select()}))},mousedown:(a)=>{dN(e,i,a,s.$shouldInsertAfter.peek())&&a.preventDefault()}},!0)})})});function TN(e){let n=new Set,r=new Set;for(let s of bN(e)){let i=typeof s=="function"?s:s.replace;CS(i),n.add(i.getType()),r.add(i)}return{nodes:r,types:n}}function bN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Sp=Vo("format",{parse:(e)=>typeof e=="number"?e:0});class Wu extends lu{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:lu,stateConfigs:[{flat:!0,stateConfig:Sp}]})}getFormat(e){return Ko(this,Sp,e)}getFormatFlags(e,n){return Jg(this.getFormat(),e,n)}hasFormat(e){let n=$i[e];return(this.getFormat()&n)!==0}setFormat(e){return to(this,Sp,e)}toggleFormat(e){let n=this.getFormat(),r=Jg(n,e,null);return this.setFormat(r)}isInline(){return!0}createDOM(e,n){return Xe().createElement("span")}}function bD(e){return e instanceof Wu}function vD(e,n,r){let s=n.fontWeight,i=n.textDecoration.split(" "),a=s==="700"||s==="bold",l=i.includes("line-through"),c=n.fontStyle==="italic",d=i.includes("underline"),f=n.verticalAlign;return a&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),c&&!e.hasFormat("italic")&&e.toggleFormat("italic"),d&&!e.hasFormat("underline")&&e.toggleFormat("underline"),f!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),f!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),r&&!e.hasFormat(r)&&e.toggleFormat(r),e}function vN(e,n,r=RD){let s=n;for(let[i,a]of Object.entries(r))e.hasFormat(a)&&(s=AD(s,i));return s}var OD=vN;function AD(e,n){let r=e.ownerDocument.createElement(n);return r.appendChild(e),r}var RD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},MD=_e({name:"@lexical/extension/DecoratorText",nodes:()=>[Wu]});function Rl(e,n){let r;return Qr(e(),{unwatched(){r&&(r(),r=void 0)},watched(){this.value=e(),r=n(this)}})}var Uu=_e({build:(e)=>Rl(()=>e.getEditorState(),(n)=>e.registerUpdateListener((r)=>{n.value=r.editorState})),name:"@lexical/extension/EditorState"});function tt(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ON;try{ON="0.49.0+prod.esm"}catch(e){}var DD=ON??'"<unknown>+source"',$D=new Set(["__proto__","constructor","prototype"]);function AN(e,n){if(e&&n&&!Array.isArray(n)&&typeof e=="object"&&typeof n=="object"){let r=e,s=n;for(let i in s)!$D.has(i)&&Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=AN(r[i],s[i]));return e}return n}var $p=0,Ap=1,RN=2,Np=3,Fu=4,Pi=5,Ep=6,Ol=7;function Tp(e){return e.id===$p}function MN(e){return e.id===RN}function wD(e){return function(n){return n.id===Ap}(e)||tt(305,String(e.id),String(Ap)),Object.assign(e,{id:RN})}var kD=new Set;class DN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:$p}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):zt;for(let r of this.configs)e=n(e,r);return e}init(e){let n=this.state;MN(n)||tt(306,String(n.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(l,c,d){return Object.assign(l,{config:c,id:Np,registerState:d})}(n,this.mergeConfigs(),r),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,r)),this.state=function(l,c,d){return Object.assign(l,{id:Fu,initResult:c,registerState:d})}(i,a,s)}build(e){let n=this.state,r;n.id!==Fu&&tt(307,String(n.id),String(Pi)),this.extension.build&&(r=this.extension.build(e,n.config,n.registerState));let s={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=function(i,a,l){return Object.assign(i,{id:Pi,output:a,registerState:l})}(n,r,s)}register(e,n){this._signal=n;let r=this.state;r.id!==Pi&&tt(308,String(r.id),String(Pi));let s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(i){return Object.assign(i,{id:Ep})}(r),()=>{let i=this.state;i.id!==Ol&&tt(309,String(r.id),String(Ol)),this.state=function(a){return Object.assign(a,{id:Pi})}(i),s&&s()}}afterRegistration(e){let n=this.state,r;return n.id!==Ep&&tt(310,String(n.id),String(Ep)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=function(s){return Object.assign(s,{id:Ol})}(n),r}getSignal(){return this._signal===void 0&&tt(311),this._signal}getInitResult(){this.extension.init===void 0&&tt(312,this.extension.name);let e=this.state;return function(n){return n.id>=Fu}(e)||tt(313,String(e.id),String(Fu)),e.initResult}getInitPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(n){return n.id>=Np}(e)||tt(314,String(e.id),String(Np)),{config:e.config}}getPeer(e){let n=this.builder.extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}getInitDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionInitDependency()}getDependency(e){let n=this.builder.getExtensionRep(e);return n===void 0&&tt(315,this.extension.name,e.name),n.getExtensionDependency()}getState(){let e=this.state;return function(n){return n.id>=Ol}(e)||tt(316,String(e.id),String(Ol)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||kD}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(n){return n.id>=Pi})(e)||tt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var fN={tag:Gr};function ID(){let e=Je();e.isEmpty()&&e.append(Se())}var $N=_e({config:We({setOptions:fN,updateOptions:fN}),init:({$initialEditorState:e=ID})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},s){let i=s.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:a}=i;if(Py(a))e.setEditorState(a,r);else if(typeof a=="function")e.update(()=>{a(e)},n);else if(a&&(typeof a=="string"||typeof a=="object")){let l=e.parseEditorState(a);e.setEditorState(l,r)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cu,Ln,iS,Nu,aS]}),gN=Symbol.for("@lexical/extension/LexicalBuilder");function LD(...e){return hr.fromExtensions(e).buildEditor()}function pN(){}function FD(e){throw e}function Pu(e){return Array.isArray(e)?e:[e]}var bp=DD;class hr{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=bp,this.roots=e;for(let n of e)this.addExtension(n)}static fromExtensions(e){let n=[Pu($N)];for(let r of e)n.push(Pu(r));return new hr(n)}static maybeFromEditor(e){let n=e[gN];return n&&(n.PACKAGE_VERSION!==bp&&tt(292,n.PACKAGE_VERSION,bp),n instanceof hr||tt(293)),n}static fromEditor(e){let n=hr.maybeFromEditor(e);return n===void 0&&tt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,onWarn:r,...s}=this.buildCreateEditorArgs(),i=Object.assign(Tu({...s,...n?{onError:(a)=>{n(a,i)}}:{},...r?{onWarn:(a)=>{r(a,i)}}:{}}),{[gN]:this});for(let a of this.sortedExtensionReps())a.build(i);return i}buildEditor(){let e=pN;function n(){try{e()}finally{e=pN}}let r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=De(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let n=this.extensionNameMap.get(e.name);if(n)return n.extension!==e&&tt(295,e.name),n}addEdge(e,n,r){let s=this.outgoingConfigEdges.get(e);s?s.set(n,r):this.outgoingConfigEdges.set(e,new Map([[n,r]]));let i=this.incomingEdges.get(n);i?i.add(e):this.incomingEdges.set(n,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&tt(296);let n=Pu(e),[r]=n;typeof r.name!="string"&&tt(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&tt(298,r.name),!s){s=new DN(this,r),this.extensionNameMap.set(r.name,s);let i=this.conflicts.get(r.name);typeof i=="string"&&tt(299,r.name,i);for(let a of r.conflictsWith||[])this.extensionNameMap.has(a)&&tt(299,r.name,a),this.conflicts.set(a,r.name);for(let a of r.dependencies||[]){let l=Pu(a);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(let[a,l]of r.peerDependencies||[])this.addEdge(r.name,a,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],n=(r,s)=>{let i=r.state;if(MN(i))return;let a=r.extension.name;var l;Tp(i)||tt(300,a,s||"[unknown]"),Tp(l=i)||tt(304,String(l.id),String($p)),i=Object.assign(l,{id:Ap}),r.state=i;let c=this.outgoingConfigEdges.get(a);if(c)for(let d of c.keys()){let f=this.extensionNameMap.get(d);f&&n(f,a)}i=wD(i),r.state=i,e.push(r)};for(let r of this.extensionNameMap.values())Tp(r.state)&&n(r);for(let r of e)for(let[s,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){let a=this.extensionNameMap.get(s);if(a)for(let l of i)a.configs.add(l)}for(let[r,...s]of this.roots)if(s.length>0){let i=this.extensionNameMap.get(r.name);i===void 0&&tt(301,r.name);for(let a of s)i.configs.add(a)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let n=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],i=r.signal;for(let a of n){let l=a.register(e,i);l&&s.push(l)}for(let a of n){let l=a.afterRegistration(e);l&&s.push(l)}return De(...s)}buildCreateEditorArgs(){let e={},n=new Set,r=new Map,s=new Map,i={},a={},l=this.sortedExtensionReps();for(let f of l){let{extension:g}=f;if(g.onError!==void 0&&(e.onError=g.onError),g.onWarn!==void 0&&(e.onWarn=g.onWarn),g.disableEvents!==void 0&&(e.disableEvents=g.disableEvents),g.parentEditor!==void 0&&(e.parentEditor=g.parentEditor),g.editable!==void 0&&(e.editable=g.editable),g.namespace!==void 0&&(e.namespace=g.namespace),g.$initialEditorState!==void 0&&(e.$initialEditorState=g.$initialEditorState),g.nodes)for(let p of bN(g)){if(typeof p!="function"){let m=r.get(p.replace);m&&tt(302,g.name,p.replace.name,m.extension.name),r.set(p.replace,f)}n.add(p)}if(g.html){if(g.html.export)for(let[p,m]of g.html.export.entries())s.set(p,m);g.html.import&&Object.assign(i,g.html.import)}g.theme&&AN(a,g.theme)}Object.keys(a).length>0&&(e.theme=a),n.size&&(e.nodes=[...n]);let c=Object.keys(i).length>0,d=s.size>0;(c||d)&&(e.html={},c&&(e.html.import=i),d&&(e.html.export=s));for(let f of l)f.init(e);return e.onError||(e.onError=FD),e}}function wN(e,n){let r=hr.fromEditor(e).getExtensionRep(n);return r===void 0&&tt(303,n.name),r.getExtensionDependency()}function wp(e,n){let r=hr.maybeFromEditor(e);if(!r)return;let s=r.extensionNameMap.get(n);return s?s.getExtensionDependency():void 0}function PD(e,n){let r=wp(e,n);return r===void 0&&tt(291,n),r}function kN(e){return wN(Ge(),e)}function BD(e){return kN(e).output}function KD(e){return wp(Ge(),e)}var zD=new Set,Rp=_e({build(e,n,r){let s=r.getDependency(Uu).output,i=Qr({watchedNodeKeys:new Map}),a=Rl(()=>{},()=>Zt(()=>{let l=a.peek(),{watchedNodeKeys:c}=i.value,d,f=!1;s.value.read(()=>{if(X())for(let[g,p]of c.entries()){if(p.size===0){c.delete(g);continue}let m=Rt(g),_=m&&m.isSelected()||!1;f=f||_!==(!!l&&l.has(g)),_&&(d=d||new Set,d.add(g))}}),!f&&d&&l&&d.size===l.size||(a.value=d)}));return{watchNodeKey:function(l){let c=CN(()=>(a.value||zD).has(l)),{watchedNodeKeys:d}=i.peek(),f=d.get(l),g=f!==void 0;return f=f||new Set,f.add(c),g||(d.set(l,f),i.value={watchedNodeKeys:d}),c}}},dependencies:[Uu],name:"@lexical/extension/NodeSelection"}),IN=bn("INSERT_HORIZONTAL_RULE_COMMAND");class zi extends lu{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:UD,priority:0})}})}exportDOM(){return{element:Xe().createElement("hr")}}createDOM(e){let n=Xe().createElement("hr");return et(n,e.theme.hr),n}getTextContent(){return`
15
+ `}isInline(){return!1}updateDOM(){return!1}}function UD(){return{node:kp()}}function kp(){return jc(zi)}function LN(e){return e instanceof zi}var HD=_e({dependencies:[Uu,Rp],name:"@lexical/extension/HorizontalRule",nodes:()=>[zi],register(e,n,r){let{watchNodeKey:s}=r.getDependency(Rp).output,i=Qr({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return De(e.registerCommand(IN,(l)=>{let c=X();if(!j(c))return!1;if(c.focus.getNode()!==null){let d=kp();Lu(d)}return!0},Te),e.registerCommand(yi,(l)=>{if(io(l.target)){let c=Fy(l.target);if(LN(c))return function(d,f=!1){let g=X(),p=d.isSelected(),m=d.getKey(),_;f&&Ze(g)?_=g:(_=Yc(),mt(_)),p?_.delete(m):_.add(m)}(c,l.shiftKey),!0}return!1},Pe),e.registerMutationListener(zi,(l,c)=>{mN(()=>{let d=!1,{nodeSelections:f}=i.peek();for(let[g,p]of l.entries())if(p==="destroyed")f.delete(g),d=!0;else{let m=f.get(g),_=e.getElementByKey(g);m?m.domNode.value=_:(d=!0,f.set(g,{domNode:Qr(_),selectedSignal:s(g)}))}d&&(i.value={nodeSelections:f})})}),Zt(()=>{let l=[];for(let{domNode:c,selectedSignal:d}of i.value.nodeSelections.values())l.push(Zt(()=>{let f=c.value;if(f)d.value?et(f,a):an(f,a)}));return De(...l)}))}}),WD=_e({build:(e)=>({composingTextNode:Qr(null),compositionKey:Qr(null)}),name:"@lexical/extension/IME",register(e,n,r){let{compositionKey:s,composingTextNode:i}=r.getOutput(),a=e.registerCommand(qy,()=>{let f=X();return j(f)&&(s.value=f.anchor.key),!1},eu),l=Zt(()=>{let f=s.value;i.value=f!==null?e.read("latest",()=>{let g=Rt(f);return re(g)?g:null}):null}),c=e.registerUpdateListener(({tags:f,editorState:g})=>{f.has(nu)&&g.read(()=>{let p=X();if(!j(p))return;let m=p.anchor.getNode();re(m)&&(i.value=m)})}),d=e.registerRootListener((f)=>{if(f===null)return void(s.value=null);return ao(f,"compositionend",()=>{s.value=null})});return De(a,l,c,d)}}),GD=_e({build:(e,n)=>To({inheritEditableFromParent:n.inheritEditableFromParent}),config:We({$getParentEditor:function(){let e=Ge();return hr.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,n,r)=>{let s=n.$getParentEditor();e.parentEditor=s,e.theme=e.theme||s._config.theme},name:"@lexical/extension/NestedEditor",register:(e,n,r)=>Zt(()=>{let s=e._parentEditor;if(s&&r.getOutput().inheritEditableFromParent.value)return e.setEditable(s.isEditable()),s.registerEditableListener(e.setEditable.bind(e))})}),jD=_e({config:We({attribute:"data-selected",nodes:[]}),init(e,n){let r=new Set,s=Ou(TN(e).nodes);for(let i of n.nodes){let a=i.getType(),l=s.get(a);l===void 0&&tt(339,i.name,a),r.add(a);for(let c of l)r.add(c)}return{matchTypes:r}},mergeConfig:(e,n)=>zt(e,{...n,...n.nodes&&{nodes:[...e.nodes,...n.nodes]}}),name:"@lexical/extension/NodeSelectionDataSelected",register(e,n,r){let{attribute:s}=n,{matchTypes:i}=r.getInitResult(),a=new Map,l=(d)=>{let f=new Set;d.read(()=>{let g=X();if(Ze(g))for(let p of g.getNodes())i.has(p.getType())&&f.add(p.getKey())});for(let[g,p]of a)f.has(g)||(p.removeAttribute(s),a.delete(g));for(let g of f){let p=e.getElementByKey(g);p!==null&&(p.setAttribute(s,"true"),a.set(g,p))}};l(e.getEditorState());let c=e.registerUpdateListener(({editorState:d})=>l(d));return()=>{c();for(let d of a.values())d.removeAttribute(s);a.clear()}}});function hN(e){Q(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var YD=_e({build:(e,n,r)=>To(n),config:We({disabled:!1}),name:"@lexical/NormalizeInlineElements",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value){let i=[];for(let{klass:a,transforms:l}of e._nodes.values())a.prototype instanceof ct&&a.prototype.isInline!==ct.prototype.isInline&&(l.add(hN),i.push(()=>l.delete(hN)));return()=>i.forEach((a)=>a())}})}}),VD=new Set([Su,dS]),XD=_e({build:(e,n,r)=>To(n),config:We({$fixFocusOverselection:function(){let e=X();if(j(e)&&!e.isCollapsed()){let n=dr(ur(e),"next"),r=n.focus;for(Hr(r)&&n.anchor.origin!==r.origin&&r.offset===0&&(r=Ho(r.getSiblingCaret())),No(r)&&n.anchor.origin!==r.origin&&Ue(r.origin)&&(r=Ho(r));zo(r)&&n.anchor.origin!==r.origin;)r=Ho(it(r.origin,"next"));if(No(r)&&Q(r.origin)&&(r=kt(bt(r.origin,"previous")).getFlipped()),r=kt(r),!r.isSamePointCaret(n.focus)){let s=kn(Zn(n.anchor,r)),i=Ge().getRootElement(),a=i&&Fn(i.ownerDocument.defaultView);a&&jy(En(),s,Ge(),a,VD,i)}}},dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:(e,n,r)=>Zt(()=>{let s=r.getOutput();if(!s.disabled.value)return e.registerRootListener((i)=>{if(!i)return;let a=0,l=(c)=>{if(c?c.detail===3:a>0){let d=s.dateNow.peek()();a=c&&c.type==="mousedown"||d-a<=s.thresholdMsec.peek()?d:0}return a};return De(e.registerCommand(ro,()=>(l(null)&&(a=0,s.$fixFocusOverselection.peek()()),!1),Xy),Jr(i,{mousedown:l,mouseup:l},!0))})})});function qD(e){let n=e.target;NS(e,"a",{ctrlKey:!pl,metaKey:pl})&&ye(n)&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.addEventListener("keydown",qg,{once:!0})}var Mp=_e({build:(e,n,r)=>To(n),config:We({disabled:!1}),name:"@lexical/extension/PreventSelectAll",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return e.registerRootListener((i)=>{if(i)return ao(i,"keydown",qD,!0)})})}}),JD=_e({build:(e)=>Rl(()=>e.getRootElement(),(n)=>e.registerRootListener((r)=>{n.value=r})),name:"@lexical/extension/RootElement"}),ZD=_e({build:(e,n,r)=>To(n),config:We({cascadeSelection:!1,disabled:!1}),dependencies:[Mp],name:"@lexical/extension/SelectBlock",register:(e,n,r)=>{let s=r.getOutput(),i=r.getDependency(Mp).output;return De(Zt(()=>{i.disabled.value=s.disabled.value}),Zt(()=>{if(!s.disabled.value)return e.registerCommand(Di,(a,l)=>{if(l!==e){if(!s.cascadeSelection.peek())return!1;return!!l.read("pending",()=>{let m=X();return j(m)&&vl(Je(),m)})&&(Wr(),!0)}let c=X();if(Ze(c)){let m=c.getNodes(),_=m[0];if(!_)return!1;let x=_.getTopLevelElement();return!x||So(x)||x.is(_)||m.length>1&&(d=x,!m.every((C)=>d.is(C.getTopLevelElement())))?Wr():Q(x)&&x.select(0,x.getChildrenSize()),!0}var d;if(!j(c))return!1;let f=c.anchor.getNode(),g=f.getTopLevelElement();if(g&&g.is(c.focus.getNode().getTopLevelElement())&&!vl(g,c))return g.select(0,g.getChildrenSize()),!0;let p=Qn(f);for(;p!==null;){if(Q(p)&&!vl(p,c))return p.select(0,p.getChildrenSize()),!0;let m=Vc(p);p=m===null?null:Qn(m)}return vl(Je(),c)||Wr(),!0},Pe)}))}}),QD=_e({build:(e,n,r)=>To(n),config:We({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,n,r)=>{let s=r.getOutput();return Zt(()=>{if(!s.disabled.value)return lN(e,s.onReposition.value)})}});function FN(e){return e.canIndent()}function PN(e,n,r=FN){return De(e.registerCommand(Vr,(s)=>{let i=X();if(!j(i))return!1;s.preventDefault();let a=function(l){if(l.getNodes().filter((m)=>Ur(m)&&m.canIndent()).length>0)return!0;let{anchor:c,focus:d}=l,f=d.isBefore(c)?d:c,g=f.getNode(),p=ku(g);if(p.canIndent()){let m=p.getKey(),_=Kr();if(_.anchor.set(m,0,"element"),_.focus.set(m,0,"element"),_=Uo(_),_.anchor.is(f))return!0}return!1}(i)?s.shiftKey?Yo:no:$s;return e.dispatchCommand(a)},Te),e.registerCommand(no,()=>{let s=typeof n=="number"?n:n?n.peek():null,i=X();if(!j(i))return!1;let a=typeof r=="function"?r:r.peek();return bl((l)=>{if(a(l)){let c=l.getIndent()+1;(!s||c<s)&&l.setIndent(c)}})},Si))}var e$=_e({build:(e,n,r)=>To(n),config:We({$canIndent:FN,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,n,r){let{disabled:s,maxIndent:i,$canIndent:a}=r.getOutput();return Zt(()=>{if(!s.value)return PN(e,i,a)})}}),t$=_e({build:(e)=>Rl(()=>e.isEditable(),(n)=>e.registerEditableListener((r)=>{n.value=r})),name:"@lexical/extension/WatchEditable"});var Ne=Ip,{$applyFormatToDom:IP,$createHorizontalRuleNode:Gu,$defaultShouldInsertAfter:LP,$getExtensionDependency:FP,$getExtensionOutput:BN,$getPeerDependency:KN,$isDecoratorTextNode:PP,$isHorizontalRuleNode:zN,AutoFocusExtension:BP,ClearEditorExtension:KP,ClickAfterLastBlockExtension:zP,DecoratorTextExtension:UP,DecoratorTextNode:HP,EditorStateExtension:WP,HorizontalRuleExtension:UN,HorizontalRuleNode:ju,IMEExtension:GP,INSERT_HORIZONTAL_RULE_COMMAND:jP,InitialStateExtension:YP,LexicalBuilder:HN,NestedEditorExtension:VP,NodeSelectionDataSelectedExtension:XP,NodeSelectionExtension:qP,NormalizeInlineElementsExtension:WN,NormalizeTripleClickSelectionExtension:GN,PreventSelectAllExtension:JP,RootElementExtension:ZP,SelectBlockExtension:QP,SelectionAlwaysOnDisplayExtension:eB,TabIndentationExtension:tB,WatchEditableExtension:nB,applyFormatFromStyle:oB,applyFormatToDom:rB,batch:Lp,buildEditorFromExtensions:sB,computed:iB,configExtension:jN,declarePeerDependency:aB,defineExtension:lB,effect:Nt,getExtensionDependencyFromEditor:cB,getKnownTypesAndNodes:YN,getPeerDependencyFromEditor:lo,getPeerDependencyFromEditorOrThrow:uB,namedSignals:Dt,registerClearEditor:dB,registerTabIndentation:Yu,safeCast:fB,shallowMergeConfig:gB,signal:zs,untracked:pB,watchedSignal:VN}=Ne;var Fp={};Oe(Fp,{ReactProviderExtension:()=>n$});var n$=_e({name:"@lexical/react/ReactProvider"});var o$=Fp,XN=o$.ReactProviderExtension;var Bp={};Oe(Bp,{$canShowPlaceholder:()=>JN,$canShowPlaceholderCurry:()=>s$,$findTextIntersectionFromCharacters:()=>i$,$isRootTextContentEmpty:()=>Pp,$isRootTextContentEmptyCurry:()=>r$,$rootTextContent:()=>qN,registerLexicalTextEntity:()=>l$});function qN(){return Je().getTextContent()}function Pp(e,n=!0){if(e)return!1;let r=qN();return n&&(r=r.trim()),r===""}function r$(e,n){return()=>Pp(e,n)}function JN(e){if(!Pp(e,!1))return!1;let n=Je().getChildren(),r=n.length;if(r>1)return!1;for(let s=0;s<r;s++){let i=n[s];if(wt(i))return!1;if(Q(i)){if(!wn(i))return!1;if(i.__indent!==0)return!1;let a=i.getChildren(),l=a.length;for(let c=0;c<l;c++){let d=a[s];if(!re(d))return!1}}}return!0}function s$(e){return()=>JN(e)}function i$(e,n){let r=e.getFirstChild(),s=0;e:for(;r!==null;){if(Q(r)){let l=r.getFirstChild();if(l!==null){r=l;continue}}else if(re(r)){let l=r.getTextContentSize();if(s+l>n)return{node:r,offset:n-s};s+=l}let i=r.getNextSibling();if(i!==null){r=i;continue}let a=r.getParent();for(;a!==null;){let l=a.getNextSibling();if(l!==null){r=l;continue e}a=a.getParent()}break}return null}function a$(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l$(e,n,r,s){let i=(l)=>l instanceof r,a=(l)=>{let c=yt(l.getTextContent());c.setFormat(l.getFormat()),l.replace(c)};return[e.registerNodeTransform(Ln,(l)=>{if(!l.isSimpleText())return;let c,d=l.getPreviousSibling(),f=l.getTextContent(),g=l;if(re(d)){let m=d.getTextContent(),_=n(m+f);if(i(d)){if(_===null||((x)=>x.getLatest().__mode)(d)!==0)return void a(d);{let x=_.end-m.length;if(x>0){let C=m+f.slice(0,x);if(d.select(),d.setTextContent(C),x===f.length)l.remove();else{let y=f.slice(x);l.setTextContent(y)}return}}}else if(_===null||_.start<m.length)return}let p=0;for(;;){c=n(f);let m,_=c===null?"":f.slice(c.end);if(f=_,_===""){let C=g.getNextSibling();if(re(C)){_=g.getTextContent()+C.getTextContent();let y=n(_);if(y===null)return void(i(C)?a(C):C.markDirty());if(y.start!==0)return}}if(c===null)return;if(c.start===0&&re(d)&&d.isTextEntity()){p+=c.end;continue}c.start===0?[m,g]=g.splitText(c.end):[,m,g]=g.splitText(c.start+p,c.end+p),m===void 0&&a$(165,"nodeToReplace");let x=s(m);if(x.setFormat(m.getFormat()),m.replace(x),g==null)return;p=0,d=x}}),e.registerNodeTransform(r,(l)=>{let c=l.getTextContent(),d=n(c);if(d===null||d.start!==0)return void a(l);if(c.length>d.end)return void l.splitText(d.end);let f=l.getPreviousSibling();re(f)&&f.isTextEntity()&&(a(f),a(l));let g=l.getNextSibling();re(g)&&g.isTextEntity()&&(a(g),i(l)&&a(l))})]}var Us=Bp,{$canShowPlaceholder:CB,$canShowPlaceholderCurry:Vu,$findTextIntersectionFromCharacters:yB,$isRootTextContentEmpty:SB,$isRootTextContentEmptyCurry:NB,$rootTextContent:EB,registerLexicalTextEntity:TB}=Us;var Kp={};Oe(Kp,{DragonExtension:()=>g$,installDragonSupport:()=>u$,registerDragonSupport:()=>eE});var c$={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Xu=Symbol.for("@lexical/dragon/WindowState");function u$(e=function(){return typeof window<"u"?window:void 0}()){return e?QN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function QN(e,n,r){let s=function(i){let a=i[Xu];return a===void 0&&(a={dispose:()=>{},editors:new Map,installs:new Set},i[Xu]=a),a}(e);if(s.installs.size===0){let i=f$.bind(e);e.addEventListener("message",i,!0),s.dispose=()=>{e.removeEventListener("message",i,!0)}}if(s.installs.add(n),r){let i=s.editors.get(r)||new Set;i.add(n),s.editors.set(r,i)}return d$.bind(null,e,s,n,r)}function d$(e,n,r,s){if(s){let i=n.editors.get(s);i&&i.delete(r)&&i.size===0&&n.editors.delete(s)}n.installs.delete(r)&&n.installs.size===0&&(n.dispose(),delete e[Xu])}function ZN(e){return e&&e.ownerDocument.defaultView}function eE(e){let n=VN(()=>ZN(e.getRootElement()),(r)=>e.registerRootListener((s)=>{r.value=ZN(s)}));return Nt(()=>{let r=n.value;if(r)return QN(r,Symbol("@lexical/dragon/editorInstall"),e)})}function f$(e){if(e.origin!==this.location.origin)return;let n=function(s){let i=s[Xu];if(i===void 0)return null;let a=bu(hS(s.document));return Ru(a)&&i.editors.has(a)?a:null}(this);if(n===null)return;let r=e.data;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch(i){return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){let i=s.payload;if(i&&i.functionId==="makeChanges"){let a=i.args;if(Array.isArray(a)){let[l,c,d,f,g,p]=a;if(![l,c,f,g].every(Number.isFinite)||typeof d!="string"&&d!==-1)return;n.update(()=>{let m=X();if(j(m)){let _=m.anchor,x=_.getNode(),C=0,y=0;if(re(x)&&l>=0&&c>=0&&(C=l,y=l+c,m.setTextNodeRange(x,C,x,y)),typeof d!="string"||C===y&&d===""||(m.insertRawText(d),x=_.getNode()),re(x)){let N=x.getTextContentSize();C=Math.min(Math.max(f,0),N),y=f<0||g<0?C:Math.min(f+g,N),m.setTextNodeRange(x,C,x,y)}if(typeof p=="string"&&g>0&&!m.isCollapsed()){let N=c$[p];N!==void 0&&m.formatText(N)}e.stopImmediatePropagation()}})}}}}}var g$=_e({build:(e,n,r)=>Dt(n),config:We({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,n,r)=>Nt(()=>r.getOutput().disabled.value?void 0:eE(e))});var zp=Kp,{DragonExtension:tE,installDragonSupport:AB,registerDragonSupport:nE}=zp;var oh={};Oe(oh,{$appendNodeToHTML:()=>pw,$distributeInlineWrapper:()=>LE,$generateDOMFromNodes:()=>VE,$generateDOMFromRoot:()=>fw,$generateHtmlFromNodes:()=>gw,$generateNodesFromDOM:()=>dw,$generateNodesFromDOMViaExtension:()=>aw,$getImportContextValue:()=>IE,$getRenderContextValue:()=>x$,$getSessionDOMRenderConfig:()=>ed,$inlineStylesFromStyleSheets:()=>mE,$isBlockLevel:()=>Wi,$propagateTextAlignToBlockChildren:()=>FE,$setRenderContextValue:()=>C$,$updateRenderContextValue:()=>y$,$withImportContext:()=>Qp,$withRenderContext:()=>Zp,BlockSchema:()=>BE,CoreImportExtension:()=>jE,CoreImportRules:()=>UE,DOMImportExtension:()=>nh,DOMRenderExtension:()=>k$,HorizontalRuleImportExtension:()=>cw,HorizontalRuleImportRules:()=>lw,ImportOverlays:()=>$E,ImportSource:()=>z$,ImportSourceDataTransfer:()=>U$,ImportTextFormat:()=>Ju,ImportTextStyle:()=>AE,ImportWhitespaceConfig:()=>DE,InlineSchema:()=>H$,NestedBlockSchema:()=>W$,RenderContextExport:()=>qp,RenderContextRoot:()=>CE,RootSchema:()=>KE,contextUpdater:()=>m$,contextValue:()=>Ml,createImportState:()=>Ws,createRenderState:()=>Xp,defaultIsInline:()=>ME,defaultPreservesWhitespace:()=>RE,defineImportRule:()=>_r,defineOverlayRules:()=>ow,domOverride:()=>S$,isElementOfTag:()=>B$,parseSelector:()=>OE,sel:()=>uw});function Hs(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hi;function es(e,n){let{key:r}=n;return e&&r in e?e[r]:n.defaultValue}function Yp(e){return Hi&&Hi.editor===e?Hi:void 0}function Zu(e,n){let r=Yp(n);return r&&r[e]}function p$(e,n){if("cfg"in n){let{cfg:r,updater:s}=n;return[r,s(es(e,r))]}return n}function qu(e,n){let r=n;for(let s of e){let[i,a]=p$(r,s),l=i.key;if(r===n&&es(r,i)===a)continue;let c=r===n||r===void 0?h$(n):r;c[l]=a,r=c}return r}function h$(e){return Object.create(e||null)}function Ml(e,n){return[e,n]}function m$(e,n){return{cfg:e,updater:n}}function gE(e,n,r,s=Ge()){let i=Hi,a=Yp(s);try{return Hi={...a,editor:s,[e]:n},r()}finally{Hi=i}}function pE(e,n=()=>{}){return(r,s=Ge())=>(i)=>{let a=Yp(s),l=a&&a[e],c=qu(r,l||n(s));return c&&c!==l?gE(e,c,i,s):i()}}function hE(e,n,r,s){return Object.assign(Vo(Symbol(n),{isEqual:s,parse:r}),{[e]:!0})}var mE=(e,n,r)=>{_E(e),r()};function _E(e){if(!qr(e))return;let n=e;if(n.querySelector("style")===null)return;let r=new Map;function s(i){let a=r.get(i);if(a===void 0){a=new Set;for(let l=0;l<i.style.length;l++)a.add(i.style[l]);r.set(i,a)}return a}try{for(let i of Array.from(n.styleSheets)){let a;try{a=i.cssRules}catch(l){continue}for(let l of Array.from(a)){if(!Pn(l,CSSStyleRule))continue;let c;try{c=n.querySelectorAll(l.selectorText)}catch(d){continue}for(let d of Array.from(c)){if(!ye(d))continue;let f=s(d);for(let g=0;g<l.style.length;g++){let p=l.style[g];f.has(p)||d.style.setProperty(p,l.style.getPropertyValue(p),l.style.getPropertyPriority(p))}}}}}catch(i){}}var Vp="@lexical/html/DOM",Qu=Symbol.for("@lexical/html/DOMExportContext"),xE="@lexical/html/DOMImport",Dl=Symbol.for("@lexical/html/DOMImportContext"),_$=()=>!0;function Xp(e,n,r){return hE(Qu,e,n,r)}var CE=Xp("root",Boolean),qp=Xp("isExport",Boolean);function yE(e){let n=lo(e,Vp);return n?n.output.defaults:void 0}function x$(e,n=Ge()){return es(function(r){return Zu(Qu,r)||yE(r)}(n),e)}function Jp(e){let n=lo(e,Vp);return n?n.output.runtime:void 0}function C$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n)}function y$(e,n,r=Ge()){let s=Jp(r);s&&s.setContextValue(e,n(es(s.editorContext,e)))}function ed(e=Ge()){let n=Jp(e);return n?n.getSessionConfig():zg(e)}var Zp=pE(Qu,yE);function S$(e,n,r){return{...n,...r,nodes:e}}function N$(e){return(n)=>n instanceof e}function E$(e,{nodes:n}){if(n==="*")return _$;let r={},s=[];for(let i of n)if("getType"in i){let a=i.getType();if(r){let l=e.get(a);l===void 0&&Hs(339,i.name,a);for(let c of l)r[c]=!0}s.push(N$(i))}else r=void 0,s.push(i);return r||(s.length===1?s[0]:(i)=>{for(let a of s)if(a(i))return!0;return!1})}function oE(e){return(n,r,s)=>e(n,s)}function Up(e){return(n,r,s,i)=>e(n,r,i)}function rE(e){return(n,r,s,i,a)=>e(n,r,s,a)}function T$(e){return(n,r,s,i,a,l)=>e(n,r,s,i,l)}function sE(e,n){return(r,s)=>{let i=()=>e(r,s),a=n(r);return a?a(r,i,s):i()}}function Hp(e,n){return(r,s,i)=>{let a=()=>e(r,s,i),l=n(r);return l?l(r,s,a,i):a()}}var b$=Hp,v$=Up;function iE(e,n){return(r,s,i,a)=>{let l=()=>e(r,s,i,a),c=n(r);return c?c(r,s,i,l,a):l()}}function O$(e,n){return(r,s,i,a,l)=>{let c=()=>e(r,s,i,a,l),d=n(r);return d?d(r,s,i,a,c,l):c()}}function A$(e,n){return(r,s,i,a)=>{e(r,s,i,a);let l=n(r);l&&l(r,s,i,a)}}function mr(e,n,r,s,i){let a=r[n];for(let l of e[n])if(typeof l[0]=="function"){let[c,d]=l;a=s(a,(f)=>c(f)&&d||void 0)}else{let c=l[1],d={};for(let f in c){let g=c[f];g&&(d[f]=g.reduce((p,m)=>s(p,()=>m),a))}a=s(a,(f)=>{let g=d[f.getType()];return g&&i(g)})}r[n]=a}function R$(e,n,r,s){if(!s)return;let i=e[n];if(typeof r=="function")i.push([r,s]);else{let a=i[i.length-1],l;a&&a[0]==="types"?l=a[1]:(l={},i.push(["types",l]));for(let c in r){let d=l[c]||[];l[c]=d,d.push(s)}}}function M$(e){return e.nodes==="*"}function D$(e,n){let r=Ou(YN(e).nodes),s={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let i of function(a){let l=[],c=[],d=[];for(let p of a)if(M$(p))l.push(p);else if(Array.isArray(p.nodes))for(let m of p.nodes)Hg(m.prototype)?d.push(p.nodes.length===1?p:{...p,nodes:[m]}):c.push(p.nodes.length===1?p:{...p,nodes:[m]});let f=new Map,g=(p)=>{let m=f.get(p);if(m===void 0){m=-1;for(let _ of OS(p))m++;f.set(p,m)}return m};return d.sort((p,m)=>g(p.nodes[0])-g(m.nodes[0])),[...d,...c,...l]}(n)){let a=E$(r,i);for(let l in s)R$(s,l,a,i[l])}return s}function $$(e){return e}function Wp(e,{overrides:n}){let r=D$(e,n),s={...Gg,...e.dom};return mr(r,"$createDOM",s,sE,oE),mr(r,"$exportDOM",s,sE,oE),mr(r,"$extractWithChild",s,O$,T$),mr(r,"$getDOMSlot",s,b$,v$),mr(r,"$shouldExclude",s,Hp,Up),mr(r,"$shouldInclude",s,Hp,Up),mr(r,"$getSlotTargetElement",s,iE,rE),mr(r,"$updateDOM",s,iE,rE),mr(r,"$decorateDOM",s,A$,$$),s}function SE(e){return{get:(n)=>es(e,n)}}function aE(e){let n=Object.create(null);return qu(e,n)||n}function Gp(e,n){let r=SE(n);return e.filter((s)=>!(s.disabledForEditor&&s.disabledForEditor(r)))}function w$(e){if(e.nodes==="*")return()=>!0;let n=e.nodes.map((r)=>{let s=r;return Hg(s.prototype)?(i)=>i instanceof s:r});return(r)=>n.some((s)=>s(r))}class NE{editor;initialEditorConfig;overrides;editorContext;hasSessionGates;installed;sessionCache=new Map;constructor(e,n,r,s){this.editor=e,this.initialEditorConfig=n,this.overrides=r,this.editorContext=s,this.installed=Gp(r,s),this.hasSessionGates=r.some((i)=>i.disabledForSession)}setContextValue(e,n){let r=this.installed;this.editorContext[e.key]=n;let s=Gp(this.overrides,this.editorContext);if(function(d,f){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(d[g]!==f[g])return!1;return!0}(r,s))return;let i=function(d,f){let g=new Set(d),p=new Set(f),m=[];for(let _ of d)p.has(_)||m.push(_);for(let _ of f)g.has(_)||m.push(_);return m}(r,s);this.installed=s,this.sessionCache.clear();let a=Wp(this.initialEditorConfig,{overrides:s});this.editor._config.dom=a;let l=function(d){let f=[];for(let g of d)(g.$createDOM||g.$getDOMSlot||g.$decorateDOM)&&f.push(w$(g));return f.length===0?null:(g)=>f.some((p)=>p(g))}(i);if(!l)return;let c=a.$updateDOM;a.$updateDOM=(d,f,g,p)=>!!l(d)||c(d,f,g,p),this.editor.update(xi,{discrete:!0}),a.$updateDOM=c}getSessionConfig(){let e=this.editor._config.dom||Gg;if(!this.hasSessionGates)return e;let n=SE(Zu(Qu,this.editor)||this.editorContext),r=[],s=[];if(this.installed.forEach((l,c)=>{l.disabledForSession&&l.disabledForSession(n)?r.push(String(c)):s.push(l)}),r.length===0)return e;let i=r.join(","),a=this.sessionCache.get(i);return a||(a=Wp(this.initialEditorConfig,{overrides:s}),this.sessionCache.set(i,a)),a}}var k$=_e({build(e,n,r){let{initialEditorConfig:s}=r.getInitResult(),i=aE(n.contextDefaults);return{defaults:i,runtime:new NE(e,s,n.overrides,i)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Cu,()=>{let e=Xe().createElement("div");return e.role="textbox",{element:e}}]])},init(e,n){let r={dom:e.dom,nodes:e.nodes},s=aE(n.contextDefaults),i=Gp(n.overrides,s);return e.dom=Wp(e,{overrides:i}),{initialEditorConfig:r}},mergeConfig(e,n){let r=zt(e,n);for(let s of["overrides","contextDefaults"])n[s]&&(r[s]=[...e[s],...n[s]]);return r},name:Vp}),td=Symbol.for("@lexical/html/SelectorImpl");function $l(e,n){let r={kind:"element",predicate:(s=n,s.length===0?ye:s.length===1?s[0]:(a,l)=>{for(let c of s)if(!c(a,l))return!1;return!0}),tags:e};var s;let i=(a)=>$l(e,[...n,a]);return{[td]:r,attr:(a,l,c)=>i(jp(a,l,c)),classAll:(...a)=>i(TE(a)),classAny:(...a)=>i(function(l){let c=EE(l);if(c.length===0)return()=>!1;return(d)=>{if(!ye(d))return!1;let f=d.classList;for(let g of c)if(f.contains(g))return!0;return!1}}(a)),styleAny:(a,l,c)=>i(function(d,f,g){if(typeof f=="string")return(p)=>ye(p)&&p.style.getPropertyValue(d)===f;if(f instanceof RegExp){let p=g&&g.capture,m=f;return(_,x)=>{if(!ye(_))return!1;let C=_.style.getPropertyValue(d);if(!C)return!1;let y=C.match(m);return y!==null&&(p!==void 0&&(x[p]=y),!0)}}Hs(362,JSON.stringify(d))}(a,l,c))}}function EE(e){let n=[];for(let r of e)r&&n.push(r);return n}function TE(e){let n=EE(e);return n.length===0?()=>!0:(r)=>{if(!ye(r))return!1;let s=r.classList;for(let i of n)if(!s.contains(i))return!1;return!0}}function jp(e,n,r){if(n===!0)return(s)=>ye(s)&&s.hasAttribute(e);if(typeof n=="string")return(s)=>ye(s)&&s.getAttribute(e)===n;if(n instanceof RegExp){let s=r&&r.capture,i=n;return(a,l)=>{if(!ye(a))return!1;let c=a.getAttribute(e);if(c==null)return!1;let d=c.match(i);return d!==null&&(s!==void 0&&(l[s]=d),!0)}}Hs(361,JSON.stringify(e))}var I$={kind:"text",predicate:Fs,tags:new Set},L$={[td]:I$},F$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},P$={[td]:F$},Ui={any:()=>$l(new Set,[]),comment:()=>P$,tag(...e){e.length>0||Hs(363);let n=new Set;for(let r of e)n.add(r.toUpperCase());return $l(n,[])},text:()=>L$};function B$(e,n){return ye(e)&&e.nodeName===n.toUpperCase()}var bE=/[A-Za-z0-9_-]/;class vE{constructor(e,n){this.source=e,this.pos=n}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&bE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e==='"'||e==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let r=this.source.slice(n,this.pos);return this.pos++,r.replace(/\\(.)/g,"$1")}assert(e,n){e||Hs(364,String(this.pos+1),n,this.source)}}function K$(e){let n=new Set,r=[],s=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(bE.test(e.peek())){let i=e.readIdent();i&&n.add(i.toUpperCase())}for(;!e.eof();){let i=e.peek();if(i==="."){e.consume();let a=e.readIdent();e.assert(a!=="",'expected class name after "."'),s.push(a)}else if(i==="#"){e.consume();let a=e.readIdent();e.assert(a!=="",'expected id after "#"'),r.push(jp("id",a))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();let a=e.readIdent();e.assert(a!=="",'expected attribute name after "["'),e.skipWhitespace();let l=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let c=e.peek();c==='"'||c==="'"?l=e.readQuoted():(l=e.readIdent(),e.assert(l!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),r.push(jp(a,l))}}}return s.length>0&&r.push(TE(s)),{predicates:r,tags:n}}function OE(e){let n=new vE(e,0),r=[];for(;;){let i=K$(n);if(r.push(i),n.skipWhitespace(),n.eof())break;n.assert(n.peek()===",",'expected "," (selector lists are the only supported combinator)'),n.consume(),n.skipWhitespace()}if(r.length===1)return $l(r[0].tags,r[0].predicates);let s=new Set;if(r.every((i)=>i.tags.size>0))for(let i of r)for(let a of i.tags)s.add(a);return $l(s,[(i,a)=>{for(let l of r){let c=i.nodeName;if(l.tags.size>0&&!l.tags.has(c))continue;let d=!0;for(let f of l.predicates)if(!f(i,a)){d=!1;break}if(d)return!0}return!1}])}function _r(e){return e}function Ws(e,n,r){return hE(Dl,e,n,r)}var z$=Ws("importSource",()=>"unknown"),U$=Ws("importSourceDataTransfer",()=>null),Ju=Ws("textFormat",()=>0),AE=Ws("textStyle",()=>({}));function RE(e){if(!ye(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function ME(e){if(Fs(e))return!0;if(!ye(e))return!1;let n=e.style.display;return n?n.startsWith("inline"):!Ls(e)&&ki(e)}var DE=Ws("whitespaceConfig",()=>({isInline:ME,preservesWhitespace:RE})),$E=Ws("importOverlays",()=>[]);class wE{constructor(e){this.record=e}get(e){return es(this.record,e)}set(e,n){this.record[e.key]=n}update(e,n){this.record[e.key]=n(es(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function kE(e){let n=lo(e,xE);return n?n.output.defaults:void 0}function IE(e,n=Ge()){return es(function(r){return Zu(Dl,r)||kE(r)}(n),e)}var Qp=pE(Dl,kE);function Wi(e){return Ur(e)||wt(e)&&!e.isInline()}function LE(e,n){let r=[],s=[],i=()=>{s.length!==0&&(r.push(n().splice(0,0,s)),s=[])};for(let a of e)if(Wi(a)){if(i(),Q(a)){let l=LE(a.getChildren(),n);a.splice(0,a.getChildrenSize(),l)}r.push(a)}else s.push(a);return i(),r}function FE(e,n){if(!ye(n))return e;let r=n.style.textAlign;if(!eh(r))return e;for(let s of e)Ur(s)&&s.getFormatType()===""&&s.setFormat(r);return e}function PE(e,n,r){e.length===1&&Ue(e[0])&&(e=[]);let s=Se();if(ye(r)){let i=r.style.textAlign;eh(i)&&s.setFormat(i)}return[s.splice(0,0,e)]}var BE={$accepts:Wi,$packageRun:PE,name:"BlockSchema"},H$={$accepts:(e)=>!Wi(e),name:"InlineSchema"},W$={$accepts:Wi,$packageRun:(e)=>e,name:"NestedBlockSchema"},KE={$accepts:Wi,$packageRun:PE,name:"RootSchema"},Gs=Ui,G$=new Set(["center","end","justify","left","right","start"]);function eh(e){return G$.has(e)}var j$={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Y$={CODE:rS,MARK:sS},V$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),X$=_r({$import:(e,n)=>{let r=e.get(Ju),s=j$[n.nodeName],i=function(m){return{fontStyle:m.style.fontStyle,fontWeight:m.style.fontWeight,textDecoration:m.style.textDecoration,verticalAlign:m.style.verticalAlign}}(n),a=s?(l=s,{fontStyle:(c=i).fontStyle||l.fontStyle,fontWeight:c.fontWeight||l.fontWeight,textDecoration:c.textDecoration||l.textDecoration,verticalAlign:c.verticalAlign||l.verticalAlign}):i;var l,c;let d=(f=r,g=function(m){let _=0,x=0,{fontWeight:C,fontStyle:y,textDecoration:N,verticalAlign:T}=m;if(C==="700"||C==="bold"?_|=hl:C!=="normal"&&C!=="400"||(x|=hl),y==="italic"?_|=_l:y==="normal"&&(x|=_l),N){let v=N.split(" ");v.includes("underline")&&(_|=Cl),v.includes("line-through")&&(_|=xl),v.includes("none")&&(x|=Cl|xl)}return T==="sub"?(_|=gu,x|=pu):T==="super"?(_|=pu,x|=gu):T==="baseline"&&(x|=gu|pu),{clear:x,set:_}}(a),f&~g.clear|g.set);var f,g;let p=Y$[n.nodeName];return p&&(d|=p),d===r?e.$importChildren(n):e.$importChildren(n,{context:[Ml(Ju,d)]})},match:Gs.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function lE(e,n,r){let s=e;for(;;){let i=null;for(;(i=n?s.nextSibling:s.previousSibling)===null;){let l=s.parentNode;if(l===null)return null;s=l}if(s=i,!r.isInline(s))return null;let a=s;for(;(a=n?s.firstChild:s.lastChild)!==null;)s=a;if(Fs(s))return s;if(s.nodeName==="BR")return null}}function cE(e,n){return n!==0&&re(e)?e.setFormat(n):e}function uE(e,n){if(re(e)){let r=function(s){let i="";for(let a in s)V$.has(a)||(i+=`${a}: ${s[a]}; `);return i.trimEnd()}(n);r!==""&&e.setStyle(r)}return e}var q$=_r({$import:(e,n)=>{let r=e.get(Ju),s=e.get(AE),i=e.get(DE);if(function(c,d){let f=c.parentNode;for(;f!==null;){if(d.preservesWhitespace(f))return!0;f=f.parentNode}return!1}(n,i)){let c=sl(n.textContent||"");for(let d of c)cE(d,r),uE(d,s);return c}let a=function(c,d){let f=(c.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(f.length===0)return"";if(f[0]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!1,d))!==null;){let m=g.textContent||"";if(m.length>0){/[ \t\n]$/.test(m)&&(f=f.slice(1)),p=!1;break}}p&&(f=f.slice(1))}if(f.length>0&&f[f.length-1]===" "){let g=c,p=!0;for(;g!==null&&(g=lE(g,!0,d))!==null;)if((g.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){p=!1;break}p&&(f=f.slice(0,-1))}return f}(n,i);if(a==="")return[];let l=yt(a);return cE(l,r),uE(l,s),[l]},match:Gs.text(),name:"@lexical/html/#text"}),J$=_r({$import:()=>[],match:Gs.tag("script","style"),name:"@lexical/html/script-style-ignore"}),Z$=_r({$import:(e,n)=>bS(n)||TS(n)?[]:[fn()],match:Gs.tag("br"),name:"@lexical/html/br"}),Q$=_r({$import:(e,n)=>{let r=Se();if(eo(r,n),Zr(n,r),r.getFormatType()===""){let s=n.getAttribute("align");s&&eh(s)&&r.setFormat(s)}return Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:Gs.tag("p"),name:"@lexical/html/p"}),zE=_r({$import:(e,n,r)=>Ge().hasNode(ju)?[Gu()]:r(),match:Gs.tag("hr"),name:"@lexical/html/hr"}),UE=[J$,Q$,zE,_r({$import:(e,n,r)=>Ls(n)?FE(e.$importChildren(n,{schema:BE}),n):r(),match:Gs.any(),name:"@lexical/html/transparent-block"}),q$,Z$,X$];function ew(e,n){let r=[],s=0,i=0;for(;s<e.length&&i<n.length;)e[s]<=n[i]?r.push(e[s++]):r.push(n[i++]);for(;s<e.length;)r.push(e[s++]);for(;i<n.length;)r.push(n[i++]);return r}function HE(e){let n=[],r=new Map,s=[],i=[],a=[],l=new Set;e.forEach((d,f)=>{let g=function(m){let _=m[td];return _===void 0&&Hs(360),_}(d.match),p=d.name||function(m,_){if(m.kind==="text")return`#text@${_}`;if(m.kind==="comment")return`#comment@${_}`;if(m.tags.size===0)return`*@${_}`;return`${Array.from(m.tags).join(",").toLowerCase()}@${_}`}(g,f);if(d.name&&l.add(d.name),n.push({$import:d.$import,name:p,predicate:g.predicate}),g.kind==="text")i.push(f);else if(g.kind==="comment")a.push(f);else if(g.tags.size===0)s.push(f);else for(let m of g.tags){let _=r.get(m);_||(_=[],r.set(m,_)),_.push(f)}});let c=new Map;if(s.length===0)for(let[d,f]of r)c.set(d,f);else for(let[d,f]of r)c.set(d,ew(f,s));return{byTag:c,commentIndices:a,rules:n,textIndices:i,wildcardIndices:s}}function dE(e,n){return Fs(n)?e.textIndices:n.nodeType===8?e.commentIndices:ye(n)?e.byTag.get(n.nodeName)||e.wildcardIndices:tw}var tw=Object.freeze([]);function WE(e){let n=[];for(let r of e)if(nw(r))for(let s of r.rules)n.push(s);else n.push(r);return n}function nw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function ow(e){let n=WE(e);return{__type:"CompiledOverlayRules",dispatch:HE(n),rules:n}}var rw=Object.freeze({});function sw(e,n){return{$importChildren:(s,i)=>function(a,l,c){let d=c&&c.rules?c.rules.dispatch:void 0;d&&a.overlays.push(d);try{let f=()=>GE(a,l,c);return c&&c.context?Qp(c.context,a.editor)(f):f()}finally{d&&a.overlays.pop()}}(e,s,i),$importOne:(s,i)=>th(e,s,i),captures:n,get:(s)=>IE(s,e.editor),session:e.session}}function GE(e,n,r){let s=r&&r.$onChild,i=[];for(let c of Array.from(n.childNodes)){let d=th(e,c,void 0);for(let f of d){let g=s?s(f):f;g!=null&&i.push(g)}}let a=r&&r.$after?r.$after(i):i,l=r&&r.schema;return l?function(c,d,f,g){let p=[],m=null,_=()=>{if(m===null)return;let x=m;if(m=null,c.$packageRun){let C=c.$packageRun(x,f,g);if(C.length>0){for(let y of C)p.push(y);return}}if(c.onReject==="hoist")for(let C of x)p.push(C)};for(let x of d)c.$accepts(x,f)?(_(),p.push(x)):(m===null&&(m=[]),m.push(x));return _(),c.$finalize?c.$finalize(p,f):p}(l,a,null,n):a}function th(e,n,r){let s=()=>function(i,a){let l=function(g,p){let m=[];for(let x=g.overlays.length-1;x>=0;x--){let C=g.overlays[x],y=dE(C,p);y.length>0&&m.push({dispatch:C,indices:y})}let _=dE(g.dispatch,p);return _.length>0&&m.push({dispatch:g.dispatch,indices:_}),m}(i,a);if(l.length===0)return fE(i,a);let c=0,d=0,f=()=>{for(;c<l.length;){let{dispatch:g,indices:p}=l[c];for(;d<p.length;){let m=p[d++],_=g.rules[m],x={};if(_.predicate(a,x)){let C=sw(i,Object.keys(x).length===0?rw:x);try{return _.$import(C,a,f)}catch(y){throw y}}}c++,d=0}return fE(i,a)};return f()}(e,n);return r&&r.context?Qp(r.context,e.editor)(s):s()}function fE(e,n){if(n.childNodes.length===0)return[];let r=[];for(let s of Array.from(n.childNodes)){let i=th(e,s,void 0);for(let a of i)r.push(a)}return r}var iw=_r({$import:(e,n)=>e.$importChildren(n),match:Ui.any(),name:"@lexical/html/default-hoist"}),nh=_e({build(e,n){let r=HE(WE(n.rules)),s=qu(n.contextDefaults,void 0),i=n.preprocess;return{$generateNodesFromDOM:(a,l)=>{let c=Zu(Dl,e)||s,d=l&&l.context?qu(l.context,c):c,f=d!==void 0&&d!==c?d:Object.create(c||null),g=new wE(f),p={session:g};return function(m,_,x){let C=m.length-1,y=()=>{for(;C>=0;)return void(0,m[C--])(_,x,y)};y()}(l&&l.preprocess?[...i,...l.preprocess]:i,a,p),gE(Dl,f,()=>function(m,_,x,C){return GE({dispatch:m,editor:_,overlays:C.get($E).map((y)=>y.dispatch),session:C},qr(x)?x.body:x,{schema:KE})}(r,e,a,g),e)},defaults:s}},config:{contextDefaults:[],preprocess:[mE],rules:[iw]},mergeConfig:(e,n)=>zt(e,{...n,...n.contextDefaults&&{contextDefaults:[...e.contextDefaults,...n.contextDefaults]},...n.preprocess&&{preprocess:[...e.preprocess,...n.preprocess]},...n.rules&&{rules:[...n.rules,...e.rules]}}),name:xE});function aw(e,n){return BN(nh).$generateNodesFromDOM(e,n)}var jE=_e({dependencies:[sn(nh,{rules:UE})],name:"@lexical/html/CoreImport"}),lw=[zE],cw=_e({dependencies:[UN,jE],name:"@lexical/html/HorizontalRuleImport"}),uw={any:Ui.any,comment:Ui.comment,css:OE,tag:Ui.tag,text:Ui.text},YE=new Set(["STYLE","SCRIPT"]);function dw(e,n){_E(n);let r=qr(n)?n.body.childNodes:n.childNodes,s=[],i=[];for(let a of r)if(!YE.has(a.nodeName)){let l=XE(a,e,i,!1);if(l!==null)for(let c of l)s.push(c)}return function(a){for(let l of a)l.getParent()&&l.getNextSibling()instanceof dl&&l.insertAfter(fn());for(let l of a){let c=l.getParent();c&&c.splice(l.getIndexWithinParent(),1,l.getChildren())}}(i),s}function VE(e,n=null,r=Ge()){return Zp([Ml(qp,!0)],r)(()=>{let s=Je(),i=ed(r),a=j(n)?Qn(n.anchor.getNode()):null,l=e.append.bind(e);for(let c of(Q(a)?a:s).getChildren())nd(r,c,l,n,i);return e})}function fw(e,n=Je()){let r=Ge();return Zp([Ml(qp,!0),Ml(CE,!0)],r)(()=>{let s=ed(r),i=e.append.bind(e);return nd(r,n,i,null,s),e})}function gw(e,n=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hs(338),Ay(e),VE(Xe().createElement("div"),n,e).innerHTML}function nd(e,n,r,s=null,i=zg(e)){let a=i.$shouldInclude(n,s,e),l=i.$shouldExclude(n,s,e),c=n;s!==null&&re(n)&&(c=Ps(s,n,"clone"));let d=i.$exportDOM(c,e),{element:f,after:g,append:p,$getChildNodes:m}=d;if(!f)return!1;let _=Xe().createDocumentFragment(),x=m?m():Q(c)?c.getChildren():[],C=a&&Ze(s)&&Q(n)?null:s,y=_.append.bind(_);for(let N of x){let T=nd(e,N,y,C,i);!a&&T&&i.$extractWithChild(n,N,s,"html",e)&&(a=!0)}if(a&&!l){if((ye(f)||Vg(f))&&(p?p(_):f.append(_)),r(f),g){let N=g.call(c,f);N&&(Vg(f)?f.replaceChildren(N):f.replaceWith(N))}}else r(_);return a}function pw(e,n,r,s=null){return nd(e,n,r.append.bind(r),s,ed(e))}function XE(e,n,r,s,i=new Map,a){let l=[];if(YE.has(e.nodeName))return l;let c=null,d=function(x,C){let{nodeName:y}=x,N=C._htmlConversions.get(y.toLowerCase()),T=null;if(N!==void 0)for(let v of N){let R=v(x);R!==null&&(T===null||(T.priority||0)<=(R.priority||0))&&(T=R)}return T!==null?T.conversion:null}(e,n),f=d?d(e):null,g=null;if(f!==null){g=f.after;let x=f.node;if(c=Array.isArray(x)?x[x.length-1]:x,c!==null){for(let[,C]of i)if(c=C(c,a),!c)break;c&&l.push(...Array.isArray(x)?x:[c])}f.forChild!=null&&i.set(e.nodeName,f.forChild)}let p=e.childNodes,m=[],_=(c==null||!Mt(c))&&(c!=null&&Ur(c)||s);for(let x=0;x<p.length;x++)m.push(...XE(p[x],n,r,_,new Map(i),c));if(g!=null&&(m=g(m)),Ls(e)&&(m=hw(e,m,_?()=>{let x=new dl;return r.push(x),x}:Se)),c==null)if(m.length>0)for(let x of m)l.push(x);else Ls(e)&&function(x){if(x.nextSibling==null||x.previousSibling==null)return!1;return ki(x.nextSibling)&&ki(x.previousSibling)}(e)&&l.push(fn());else Q(c)&&c.append(...m);return l}function hw(e,n,r){let s=e.style.textAlign,i=[],a=[];for(let l=0;l<n.length;l++){let c=n[l];if(Ur(c))s&&!c.getFormat()&&c.setFormat(s),i.push(c);else if(a.push(c),l===n.length-1||l<n.length-1&&Ur(n[l+1])){let d=r();d.setFormat(s),d.append(...a),i.push(d),a=[]}}return i}var be=oh,{$appendNodeToHTML:kB,$distributeInlineWrapper:qE,$generateDOMFromNodes:IB,$generateDOMFromRoot:LB,$generateHtmlFromNodes:JE,$generateNodesFromDOM:ZE,$generateNodesFromDOMViaExtension:QE,$getImportContextValue:FB,$getRenderContextValue:PB,$getSessionDOMRenderConfig:BB,$inlineStylesFromStyleSheets:KB,$isBlockLevel:eT,$propagateTextAlignToBlockChildren:od,$setRenderContextValue:zB,$updateRenderContextValue:UB,$withImportContext:HB,$withRenderContext:WB,BlockSchema:tT,CoreImportExtension:co,CoreImportRules:GB,DOMImportExtension:qo,DOMRenderExtension:jB,HorizontalRuleImportExtension:YB,HorizontalRuleImportRules:VB,ImportOverlays:nT,ImportSource:oT,ImportSourceDataTransfer:rT,ImportTextFormat:rh,ImportTextStyle:sh,ImportWhitespaceConfig:XB,InlineSchema:qB,NestedBlockSchema:JB,RenderContextExport:ZB,RenderContextRoot:QB,RootSchema:eK,contextUpdater:tK,contextValue:Gi,createImportState:nK,createRenderState:oK,defaultIsInline:rK,defaultPreservesWhitespace:sK,defineImportRule:ft,defineOverlayRules:ih,domOverride:iK,isElementOfTag:ah,parseSelector:aK,sel:gt}=be;var fh={};Oe(fh,{$exportMimeTypeFromSelection:()=>Tw,$generateJSONFromSelectedNodes:()=>pT,$generateNodesFromSerializedNodes:()=>hT,$getClipboardDataFromSelection:()=>mT,$getHtmlContent:()=>uh,$getLexicalContent:()=>dh,$handlePlainTextDrop:()=>Sw,$handleRichTextDrop:()=>yw,$insertDataTransferForPlainText:()=>uT,$insertDataTransferForRichText:()=>dT,$insertGeneratedNodes:()=>id,$writeDragSourceToDataTransfer:()=>Cw,ClipboardDOMImportExtension:()=>xw,ClipboardImportExtension:()=>ch,DEFAULT_IMPORT_MIME_TYPE:()=>sd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>rd,GetClipboardDataExtension:()=>ST,caretFromPoint:()=>aT,copyToClipboard:()=>Nw,setLexicalClipboardDataTransfer:()=>_T});function aT(e,n,r=null){let s=Is(r),i=r?_S(r):[],a=r!==null&&i.length>0;if(a&&typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n,{shadowRoots:i});if(l!==null&&function(c,d){for(let f=c;f!==null;){if(f===d)return!0;f=Nl(f)}return!1}(l.offsetNode,r))return{node:l.offsetNode,offset:l.offset}}if(a){let l=r.getRootNode();if(Au(l)){let c=l.elementFromPoint(e,n);if(c!==null&&r.contains(c)){let d=function(f,g,p,m){let _=m.createRange(),x=(H)=>g<H.top?H.top-g:g>H.bottom?g-H.bottom:0,C=(H)=>f<H.left?H.left-f:f>H.right?f-H.right:0,y=m.createTreeWalker(p,NodeFilter.SHOW_TEXT),N=null,T=1/0,v=1/0;for(let H=y.nextNode();H;H=y.nextNode()){_.selectNodeContents(H);for(let U of _.getClientRects()){let W=x(U),J=C(U);(W<T||W===T&&J<v)&&(T=W,v=J,N=H)}}if(N===null)return null;let R=0,F=1/0,k=1/0;for(let H=0;H<=N.length;H++){_.setStart(N,H),_.collapse(!0);let U=_.getBoundingClientRect(),W=x(U),J=Math.abs(f-U.left);(W<F||W===F&&J<k)&&(F=W,k=J,R=H)}return{node:N,offset:R}}(e,n,c,s);if(d!==null)return d}}}if(typeof s.caretRangeFromPoint=="function"){let l=s.caretRangeFromPoint(e,n);return l===null?null:{node:l.startContainer,offset:l.startOffset}}if(typeof s.caretPositionFromPoint=="function"){let l=s.caretPositionFromPoint(e,n);return l===null?null:{node:l.offsetNode,offset:l.offset}}return null}function Yi(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var rd={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function lT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(n)=>n}).createHTML(e);return e}var sT=(e,n)=>{if(!j(n))return n.insertRawText(e),!0;let r=(s)=>{let i=X();j(i)&&s(i)};return Li(e,{linebreak:()=>r((s)=>s.insertParagraph()),tab:()=>r((s)=>s.insertNodes([gn()])),text:(s)=>r((i)=>i.insertText(s))}),!0},sd={"application/x-lexical-editor":[(e,n,r)=>{try{let s=Ge(),i=JSON.parse(e);if(i&&i.namespace===s._config.namespace&&Array.isArray(i.nodes))return id(s,hT(i.nodes),n),!0}catch(s){console.error(s)}return r()}],"text/html":[(e,n,r)=>{try{let s=Ge(),i=new DOMParser().parseFromString(lT(e),"text/html");return id(s,ZE(s,i),n),!0}catch(s){return console.error(s),r()}}],"text/plain":[sT],"text/uri-list":[sT]};function mw(e,n,r,s){if(!e)return!1;let i=(a)=>!!e[a]&&e[a](n,r,i.bind(null,a-1),s);return i(e.length-1)}function cT(e,n,r){let s=n.getData("text/plain");for(let i of function(a){return Object.keys(a.$importMimeType).filter((l)=>a.$importMimeType[l]!==void 0).sort((l,c)=>{let d=a.priority[l],f=a.priority[c];return d===void 0&&f===void 0?l<c?-1:l>c?1:0:d===void 0?1:f===void 0?-1:d-f})}(e)){let a=n.getData(i);if(a&&((i!=="text/html"||a!==s)&&mw(e.$importMimeType[i],a,r,n)))return!0}return!1}var _w={$importMimeType:sd,$insertDataTransfer:(e,n)=>cT({$importMimeType:sd,priority:rd},e,n),priority:rd},ch=_e({build:(e,n)=>({$importMimeType:n.$importMimeType,$insertDataTransfer:(r,s)=>cT(n,r,s),priority:n.priority}),config:We({$importMimeType:sd,priority:rd}),mergeConfig(e,n){let r=zt(e,n);if(n.$importMimeType){let s={...e.$importMimeType};for(let[i,a]of Object.entries(n.$importMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$importMimeType=s}return n.priority&&(r.priority={...e.priority,...n.priority}),r},name:"@lexical/clipboard/Import"}),xw=_e({dependencies:[co,jN(ch,{$importMimeType:{"text/html":[(e,n,r,s)=>{let i=new DOMParser().parseFromString(lT(e),"text/html"),a=QE(i,{context:[Gi(oT,"paste"),Gi(rT,s)]});return id(Ge(),a,n),!0}]}})],name:"@lexical/clipboard/DOMImport"});function uh(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?"":JE(e,n)}function dh(e,n=X()){return n==null&&Yi(166),j(n)&&n.isCollapsed()||n.getNodes().length===0?null:JSON.stringify(pT(e,n))}function uT(e,n){let r=e.getData("text/plain")||e.getData("text/uri-list");r!=null&&n.insertRawText(r)}function dT(e,n,r){(function(){let s=KN(ch.name);return s?s.output:_w})().$insertDataTransfer(e,n)}var fT="application/x-lexical-drag";function Cw(e,n){let r={editorKey:n.getKey()};e.setData(fT,JSON.stringify(r))}function gT(e,n,r){let s=e.dataTransfer;if(s===null)return!1;let i=function(f){let g=f.getData(fT);if(!g)return null;let p;try{p=JSON.parse(g)}catch(_){return null}return(m=p)!==null&&typeof m=="object"&&"editorKey"in m&&typeof m.editorKey=="string"?p:null;var m}(s);if(i===null)return!1;let a=function(f,g){let p=aT(f.clientX,f.clientY,g.getRootElement());if(p===null)return null;let m=vt(p.node);if(m===null)return null;if(re(m))return Xc(m,"next",p.offset);if(Q(m))return Bg(m,p.offset,"next");let _=m.getParent();return _===null?null:Bg(_,m.getIndexWithinParent()+1,"next")}(e,n);if(a===null)return!1;let l=Zc(a);if(l===null)return!1;let c=i.editorKey===n.getKey(),d=X();if(c){if(!j(d)||d.isCollapsed())return!1;if(function(f,g){let{anchor:p,focus:m}=dr(ur(g),"next");return Br(p,f)<0&&Br(f,m)<0}(a,d))return e.preventDefault(),!0;d.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(r(s,kn(Os(l)),n),!c){let f=n.getRootElement(),g=f?f.ownerDocument:null,p=g?function(m,_){for(let x of gS(_)){let C=bu(x);if(Ru(C)&&C.getKey()===m&&ye(x))return x}return null}(i.editorKey,g):null;p!==null&&p.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function yw(e,n){return gT(e,n,dT)}function Sw(e,n){return gT(e,n,(r,s)=>uT(r,s))}function id(e,n,r){e.dispatchCommand(yu,{nodes:n,selection:r})||(r.insertNodes(n),function(s){if(j(s)&&s.isCollapsed()){let i=s.anchor,a=null,l=dn(i,"previous");if(l)if(Hr(l))a=l.origin;else{let c=Zn(l,bt(Je(),"next").getFlipped());for(let d of c){if(re(d.origin)){a=d.origin;break}if(Q(d.origin)&&!d.origin.isInline())break}}if(a&&re(a)){let c=a.getFormat(),d=a.getStyle();s.format===c&&s.style===d||(s.format=c,s.style=d,s.dirty=!0)}}}(r))}function lh(e,n,r,s=[]){let i=n===null||r.isSelected(n),a=Q(r)&&r.excludeFromCopy("html"),l=r;n!==null&&re(l)&&(l=Ps(n,l,"clone"));let c=Q(l)?l.getChildren():[],d=function(g){let p=g.exportJSON(),m=g.constructor;if(p.type!==m.getType()&&Yi(58,m.name),Q(g)){let _=p.children;Array.isArray(_)||Yi(59,m.name)}return p}(l);re(l)&&l.getTextContentSize()===0&&(i=!1);let f=i&&Ze(n)&&Q(r)?null:n;for(let g=0;g<c.length;g++){let p=c[g],m=lh(e,f,p,d.children);!i&&Q(r)&&m&&r.extractWithChild(p,n,"clone")&&(i=!0)}if(i&&!a){let g=As(l);if(g.length>0){let p={};for(let m of g){let _=Ci(l,m);_===null&&Yi(366,l.constructor.name,m);let x=[];lh(e,null,_,x),x.length===1&&x[0].type===_.getType()||Yi(385,m,l.constructor.name,String(x.length),String(x.length>0?x[0].type:"none")),p[m]=x[0]}d.$slots=p}}if(i&&!a)s.push(d);else if(Array.isArray(d.children))for(let g=0;g<d.children.length;g++){let p=d.children[g];s.push(p)}return i}function pT(e,n){let r=[],s=Je(),i=j(n)?n.anchor.getNode():Ze(n)?n.getNodes()[0]??null:null,a=i!==null?Qn(i):null,l=(Q(a)?a:s).getChildren();for(let c=0;c<l.length;c++)lh(e,n,l[c],r);return{namespace:e._config.namespace,nodes:r}}function hT(e){let n=[];for(let r of e)n.push(Uy(r));return n}var ji=null;async function Nw(e,n,r){if(ji!==null)return!1;if(n!==null)return new Promise((f,g)=>{e.update(()=>{f(iT(e,n,r))})});let s=e.getRootElement(),i=e._window||window,a=i.document,l=Fn(i);if(s===null||l===null)return!1;let c=a.createElement("span");c.style.position="fixed",c.style.top="-1000px",c.append(a.createTextNode("#")),s.append(c);let d=a.createRange();return d.setStart(c,0),d.setEnd(c,1),l.removeAllRanges(),l.addRange(d),new Promise((f,g)=>{let p=e.registerCommand(Ni,(m)=>(Pn(m,ClipboardEvent)&&(p(),ji!==null&&(i.clearTimeout(ji),ji=null),f(iT(e,m,r))),!0),Si);ji=i.setTimeout(()=>{p(),ji=null,f(!1)},50),a.execCommand("copy"),c.remove()})}function iT(e,n,r){if(r===void 0){let i=Fn(e._window),a=X();if(!a||a.isCollapsed())return!1;if(!i)return!1;let l=ks(i,e.getRootElement()),{anchorNode:c,focusNode:d}=l;if(c!==null&&d!==null&&!vS(e,c,d))return!1;r=mT(a)}n.preventDefault();let s=n.clipboardData;return s!==null&&(_T(s,r),!0)}var Ew=[["text/html",uh],["application/x-lexical-editor",dh]];function mT(e=X()){return function(n,r){let s={"text/plain":""};for(let[i,a]of Object.entries(n))if(a){let l=yT(a,r);l!==null&&(s[i]=l)}return s}(xT(),e)}function _T(e,n){for(let[r]of Ew)n[r]===void 0&&e.setData(r,"");for(let r in n){let s=n[r];s!==void 0&&e.setData(r,s)}}function xT(e=Ge()){let n=lo(e,ST.name);return n?n.output:CT}var CT={"application/x-lexical-editor":[(e,n)=>e?dh(Ge(),e):n()],"text/html":[(e,n)=>e?uh(Ge(),e):n()],"text/plain":[(e,n)=>e?e.getTextContent():n()]};function yT(e,n){let r=(s)=>e[s]?e[s](n,r.bind(null,s-1)):null;return r(e.length-1)}function Tw(e,n=X()){return yT(xT()[e]||[],n)}var ST=_e({build:(e,n,r)=>n.$exportMimeType,config:We({$exportMimeType:CT}),mergeConfig(e,n){let r=zt(e,n);if(n.$exportMimeType){let s={...e.$exportMimeType};for(let[i,a]of Object.entries(n.$exportMimeType))if(a){let l=s[i];s[i]=l?[...l,...a]:a}r.$exportMimeType=s}return r},name:"@lexical/clipboard/GetClipboardData"});var It=fh,{$exportMimeTypeFromSelection:pK,$generateJSONFromSelectedNodes:hK,$generateNodesFromSerializedNodes:mK,$getClipboardDataFromSelection:ad,$getHtmlContent:_K,$getLexicalContent:xK,$handlePlainTextDrop:CK,$handleRichTextDrop:NT,$insertDataTransferForPlainText:yK,$insertDataTransferForRichText:gh,$insertGeneratedNodes:SK,$writeDragSourceToDataTransfer:ET,ClipboardDOMImportExtension:NK,ClipboardImportExtension:EK,DEFAULT_IMPORT_MIME_TYPE:TK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:bK,GetClipboardDataExtension:vK,caretFromPoint:ld,copyToClipboard:wl,setLexicalClipboardDataTransfer:TT}=It;var hh={};Oe(hh,{$createHeadingNode:()=>Ji,$createQuoteNode:()=>Il,$isHeadingNode:()=>$w,$isQuoteNode:()=>Mw,DRAG_DROP_PASTE:()=>ph,HeadingNode:()=>Ll,QuoteNode:()=>kl,RichTextExtension:()=>wT,RichTextImportExtension:()=>Rw,RichTextImportRules:()=>$T,ShadowRootQuoteRule:()=>Ow,eventFiles:()=>Bs,quoteShadowRootState:()=>fd,registerRichText:()=>kT});var bw=ft({$import:(e,n)=>{let r=Ji(n.nodeName.toLowerCase());return Zr(n,r),eo(r,n),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:gt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),vw=ft({$import:(e,n)=>{let r=Il();return eo(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:gt.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),Ow=ft({$import:(e,n)=>{let r=Il({shadowRoot:!0});return eo(r,n),Zr(n,r),Tn(r,n),[r.splice(0,0,e.$importChildren(n,{schema:tT}))]},match:gt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),$T=[bw,vw,ft({$import:(e,n,r)=>{let s=n.firstChild;return s&&(ye(i=s)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt")?e.$importChildren(n):r();var i},match:gt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),ft({$import:(e,n,r)=>n.style.fontSize!=="26pt"?r():[Ji("h1").splice(0,0,e.$importChildren(n))],match:gt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Aw(e,n){return e&&n!==null?zt(e,n):n}var wT=_e({build:(e,n)=>Dt(n),config:We({escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}}}),conflictsWith:["@lexical/plain-text"],dependencies:[tE,WN,GN,co,sn(qo,{rules:$T})],mergeConfig:function(e,n){let r=zt(e,n);return n.escapeFormatTriggers&&(r.escapeFormatTriggers=function(s,i){let a=zt(s,i);for(let l of Object.keys(i))a[l]=Aw(s[l],i[l]);return a}(e.escapeFormatTriggers,n.escapeFormatTriggers)),r},name:"@lexical/rich-text",nodes:()=>[Ll,kl],register:(e,n,r)=>Nt(()=>kT(e,r.getOutput().escapeFormatTriggers))}),Rw=_e({dependencies:[wT],name:"@lexical/rich-text/Import"}),ph=bn("DRAG_DROP_PASTE_FILE"),fd=Vo("shadowRoot",{parse:Boolean});class kl extends ct{$config(){return this.config("quote",{extends:ct,importDOM:{blockquote:()=>({conversion:Dw,priority:0})},stateConfigs:[{flat:!0,stateConfig:fd}]})}isShadowRoot(){return Ko(this,fd)}setIsShadowRoot(e){return to(this,fd,e)}createDOM(e){let n=Xe().createElement("blockquote");return et(n,e.theme.quote),n}updateDOM(e,n,r){return!1}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}exportJSON(){return super.exportJSON()}static importJSON(e){return Il().updateFromJSON(e)}insertNewAfter(e,n){let r=Se(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Il(e){let n=un(new kl);return e&&e.shadowRoot?n.setIsShadowRoot(!0):n}function Mw(e){return e instanceof kl}class Ll extends ct{__tag;$config(){return this.config("heading",{extends:ct,importDOM:{h1:()=>({conversion:Vi,priority:0}),h2:()=>({conversion:Vi,priority:0}),h3:()=>({conversion:Vi,priority:0}),h4:()=>({conversion:Vi,priority:0}),h5:()=>({conversion:Vi,priority:0}),h6:()=>({conversion:Vi,priority:0}),p:(e)=>{let n=e.firstChild;return n!==null&&bT(n)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>bT(e)?{conversion:()=>({node:Ji("h1")}),priority:3}:null}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",n){super(n),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let n=this.getWritable();return n.__tag=e,n}createDOM(e){let n=this.__tag,r=Xe().createElement(n),s=e.theme.heading;if(s!==void 0){let i=s[n];et(r,i)}return r}updateDOM(e,n,r){return e.__tag!==this.__tag}exportDOM(e){let{element:n}=super.exportDOM(e);if(ye(n)){this.isEmpty()&&n.append(Xe().createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();s&&(n.dir=s)}return{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,n=!0){let r=e?e.anchor.offset:0,s=this.getLastDescendant(),i=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Se():Ji(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let l=Se();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Se();this.getChildren().forEach((n)=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}}function bT(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Vi(e){let n=e.nodeName.toLowerCase(),r=null;return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6"||(r=Ji(n),Zr(e,r),eo(r,e),Tn(r,e)),{node:r}}function Dw(e){let n=Il();return eo(n,e),Zr(e,n),Tn(n,e),{node:n}}function Ji(e="h1"){return un(new Ll(e))}function $w(e){return e instanceof Ll}function vT(e){let n=vt(e);return wt(n)}function Xi(e,n,r,s){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type==="text"){let c=e.anchor.getNode();if(re(c)){a=c;let d=e.anchor.offset,f=d===c.getTextContentSize()&&c.getNextSibling()===null,g=d===0&&c.getPreviousSibling()===null;i=r==="end"&&f||r==="start"&&g||r==="both"&&(f||g)}}let l=!1;for(let[c,d]of Object.entries(s)){if(d==null||!d[n])continue;let f=c;if(d.onlyAtBoundary){if(!(i&&a&&re(a)&&a.hasFormat(f)))continue;l=!0}e.hasFormat(f)&&e.toggleFormat(f)}l&&e.setStyle("")}var ww={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function cd(e,n){return function(r,s){if(!r.isCollapsed())return!1;let i=dn(r.focus,s),a=he(i.origin,Jc);if(!a)return!1;let l=r.focus.getNode();if(!a.is(l)&&!al(l,a))return!1;let c=Zn(i,it(a,s));if(c.getTextSlices().some((p)=>p&&p.getTextContentSize()>0))return!1;let d=Zn(c.anchor.getSiblingCaret(),c.focus),f=d.anchor.origin;for(let p of d){if(!No(p)||!p.origin.is(f.getParent()))return!1;f=p.origin}let g=a;for(let p of bs(it(a,s))){if(!p.origin.is(g.getParent())){if(Ky(p.origin)){let m=it(g,s);return kn(Zn(m,m)),!0}break}if(!Jc(p.origin))break;g=p.origin}return!1}(e,n)||function(r,s){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;let i=dn(r.anchor,s).getNodeAtCaret();return!(!Jc(i)||i.isInline()||(kn(Os(kt(bt(i,s)))),0))}(e,n)}function OT(e){return wt(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function ud(e){let n=Yc();n.add(e),mt(n)}function AT(e,n){if(!e.isCollapsed())return!1;let r=e.focus,s=r.getNode(),i=n?"previous":"next",a=dn(r,i);if(r.type==="element"&&Q(s)&&Mt(s)){let N=a.getNodeAtCaret();return!(N===null||!OT(N))&&(ud(N.__key),!0)}let l=he(Q(s)?s:s.getParentOrThrow(),(N)=>Q(N)&&!N.isInline()&&Mt(N.getParent()));if(l===null)return!1;let c=it(l,i).getNodeAtCaret();if(c===null||!OT(c))return!1;if(l.getTextContentSize()===0)return ud(c.__key),!0;let d=Ge().getRootElement();if(d===null)return!1;let f=Fn(d.ownerDocument.defaultView);if(f===null||f.rangeCount===0)return!1;let{anchorNode:g,anchorOffset:p,focusNode:m,focusOffset:_}=f;f.modify("move",n?"backward":"forward","line");let{anchorNode:x,anchorOffset:C}=f;if(x===null)return RT(f,g,p,m,_),!1;let y=vt(x);if(RT(f,g,p,m,_),y===null)return!1;if(x===g&&C===p)return ud(c.__key),!0;return!y.is(l)&&!al(y,l)&&(ud(c.__key),!0)}function RT(e,n,r,s,i){n!==null&&s!==null&&e.setBaseAndExtent(n,r,s,i)}function MT(e,n){if(!e.isCollapsed())return!1;let r=e.focus.getNode(),s=he(Q(r)?r:r.getParentOrThrow(),(y)=>Q(y)&&!y.isInline());if(s===null)return!1;let i=Ge(),a=i.getRootElement();if(a===null)return!1;let l=a.ownerDocument.defaultView;if(l===null)return!1;let c=!1;for(let y of s.getChildren())if(Q(y)&&y.isInline()){let N=i.getElementByKey(y.getKey());if(N!==null){let T=l.getComputedStyle(N).display;if(T==="inline-grid"||T==="inline-flex"){c=!0;break}}}if(!c)return!1;let d=it(s,n?"previous":"next").getNodeAtCaret();if(d===null||!Q(d)){if(n){let y=s.getFirstDescendant();re(y)?y.select(0,0):s.select(0,0)}else{let y=s.getLastDescendant();if(re(y)){let N=y.getTextContentSize();y.select(N,N)}else{let N=s.getChildrenSize();s.select(N,N)}}return!0}let f=i.getElementByKey(d.getKey());if(f===null)return!1;let g=Fn(l);if(g===null||g.rangeCount===0)return!1;let p=g.getRangeAt(0).cloneRange();p.collapse(!0);let m=p.getBoundingClientRect(),_=f.getBoundingClientRect(),x=_.top+_.height/2;if(m.height>0){let y=ld(m.left,x,a);if(y!==null&&f.contains(y.node)){let N=a.ownerDocument.createRange();return N.setStart(y.node,y.offset),N.collapse(!0),e.applyDOMRange(N),e.dirty=!0,!0}}let C=n?d.getLastDescendant():d.getFirstDescendant();if(re(C)){let y=n?C.getTextContentSize():0;C.select(y,y)}else{let y=d.getChildrenSize();d.select(n?y:0,n?y:0)}return!0}function dd(e,n){let r=it(e,n),s=r.getAdjacentCaret();s!==null&&Q(s.origin)&&!s.origin.isInline()&&s.origin.isShadowRoot()?kn(Os(r)):n==="next"?e.selectNext(0,0):e.selectPrevious()}function DT(e,n,r){r.preventDefault(),r.stopPropagation();let s=e.getNodes();if(s.length===0)return!0;let i=s.map((d)=>it(d,"next")).sort(Br),a=(n?i[0]:i[i.length-1]).origin,l=he(a,(d)=>d!==a&&Q(d)&&!d.isInline())??Je(),c=n?0:l.getChildrenSize();return l.select(c,c),!0}function kT(e,n=zs(ww)){return De(e.registerCommand(yi,()=>{let r=X();return Ze(r)?(r.clear(),!0):(j(r)&&Xi(r,"click","both",n.peek()),!1)},Te),e.registerCommand(Ei,(r)=>{let s=X();return j(s)?(s.deleteCharacter(r),!0):!!Ze(s)&&(s.deleteNodes(),!0)},Te),e.registerCommand(au,(r)=>{let s=X();return!!j(s)&&(s.deleteWord(r),!0)},Te),e.registerCommand(iu,(r)=>{let s=X();return!!j(s)&&(s.deleteLine(r),!0)},Te),e.registerCommand(ou,(r)=>{let s=X();if(typeof r=="string")s!==null&&s.insertText(r);else{if(s===null)return!1;let i=r.dataTransfer;if(i!=null)gh(i,s,e);else if(j(s)){let a=r.data;return a&&s.insertText(a),!0}}return!0},Te),e.registerCommand(lS,()=>{let r=X();return!!j(r)&&(r.removeText(),!0)},Te),e.registerCommand(Go,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(Dy(s,r),!0)},Te),e.registerCommand(cS,(r)=>{let s=X();return!(!j(s)&&!Ze(s))&&(Wy(s,r),!0)},Te),e.registerCommand(cu,(r)=>{let s=X();if(!j(s)&&!Ze(s))return!1;let i=s.getNodes();for(let a of i){let l=he(a,(c)=>Q(c)&&!c.isInline());l!==null&&l.setFormat(r)}return!0},Te),e.registerCommand(jg,(r)=>{let s=X();return!!j(s)&&(s.insertLineBreak(r),!0)},Te),e.registerCommand(jr,()=>{let r=X();return!!j(r)&&(r.insertParagraph(),!0)},Te),e.registerCommand($s,()=>{let r=gn(),s=X();return j(s)&&(r.setFormat(s.format),r.setStyle(s.style)),qc([r]),!0},Te),e.registerCommand(no,()=>bl((r)=>{let s=r.getIndent();r.setIndent(s+1)}),Te),e.registerCommand(Yo,()=>bl((r)=>{let s=r.getIndent();s>0&&r.setIndent(Math.max(0,s-1))}),Te),e.registerCommand(oo,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"previous"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===0}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"previous"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!0))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!0))return r.preventDefault(),!0}return!1},Te),e.registerCommand(jo,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],"next"),!0}else if(j(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===Je().getChildrenSize()}(s))return r.preventDefault(),!0;if(!r.shiftKey&&cd(s,"next"))return r.preventDefault(),!0;if(!r.shiftKey&&AT(s,!1))return r.preventDefault(),!0;if(!r.shiftKey&&MT(s,!1))return r.preventDefault(),!0}return!1},Te),e.registerCommand(Yr,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],El(i[0])?"next":"previous"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,El(s.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","start",n.peek()),cp(s,!0)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!0),!0}return!1},Te),e.registerCommand(bi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),dd(i[0],El(i[0])?"previous":"next"),!0}if(!j(s))return!1;if(!r.shiftKey&&cd(s,El(s.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Xi(s,"arrow","end",n.peek()),cp(s,!1)){let i=r.shiftKey;return r.preventDefault(),lp(s,i,!1),!0}return!1},Te),e.registerCommand(vi,(r)=>{let s=X();if(!Ze(s)&&vT(r.target))return!1;if(j(s)){if(function(i){if(!i.isCollapsed())return!1;let{anchor:a}=i;if(a.offset!==0)return!1;let l=a.getNode();if(So(l))return!1;let c=ku(l);return c.getIndent()>0&&(c.is(l)||l.is(c.getFirstDescendant()))}(s))return r.preventDefault(),e.dispatchCommand(Yo);if(ml&&fl)return!1}else if(!Ze(s))return!1;return r.preventDefault(),e.dispatchCommand(Ei,!0)},Te),e.registerCommand(hu,(r)=>{let s=X();return!(!Ze(s)&&vT(r.target))&&(!(!j(s)&&!Ze(s))&&(r.preventDefault(),e.dispatchCommand(Ei,!1)))},Te),e.registerCommand(Oi,(r)=>{let s=X();if(Ze(s)){let i=s.getNodes();i.length===1&&wt(i[0])&&!i[0].isInline()&&(s=i[0].selectNext())}if(!j(s))return!1;if(Xi(s,"enter","both",n.peek()),r!==null){if((ml||fu||du)&&fl)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(jg,!1)}return e.dispatchCommand(jr)},Te),e.registerCommand(Ai,()=>{let r=X();return!!j(r)&&(e.blur(),!0)},Te),e.registerCommand(Qy,(r)=>{let[,s]=Bs(r);if(s.length>0){let{clientX:i,clientY:a}=r,l=ld(i,a,e.getRootElement());if(l!==null){let{offset:c,node:d}=l,f=vt(d);if(f!==null){let g=Kr();if(re(f))g.anchor.set(f.getKey(),c,"text"),g.focus.set(f.getKey(),c,"text");else{let m=f.getParentOrThrow().getKey(),_=f.getIndexWithinParent()+1;g.anchor.set(m,_,"element"),g.focus.set(m,_,"element")}let p=Uo(g);mt(p)}e.dispatchCommand(ph,s)}return r.preventDefault(),!0}return NT(r,e)},Te),e.registerCommand(Zy,(r)=>{let[s]=Bs(r),i=X();return!(s&&!j(i))&&(j(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(TT(r.dataTransfer,ad(i)),ET(r.dataTransfer,e)),!0)},Te),e.registerCommand(Jy,(r)=>{let[s]=Bs(r),i=X();if(s&&!j(i))return!1;let{clientX:a,clientY:l}=r,c=ld(a,l,e.getRootElement());if(c!==null){let d=vt(c.node);wt(d)&&r.preventDefault()}return!0},Te),e.registerCommand(Di,()=>{let r=X();return Wr(j(r)&&Qn(r.anchor.getNode())!==null?r:null),!0},Te),e.registerCommand(Ni,(r)=>(wl(e,Pn(r,ClipboardEvent)?r:null),!0),Te),e.registerCommand(ru,(r)=>(async function(s,i){await wl(i,Pn(s,ClipboardEvent)?s:null),i.update(()=>{let a=X();j(a)?a.removeText():Ze(a)&&a.getNodes().forEach((l)=>l.remove())},{tag:su})}(r,e),!0),Te),e.registerCommand(Mi,(r)=>{let[,s,i]=Bs(r);if(s.length>0&&!i)return e.dispatchCommand(ph,s),!0;if(io(r.target)&&By(r.target))return!1;return X()!==null&&(function(a,l){a.preventDefault(),l.update(()=>{let c=X(),d=Pn(a,InputEvent)||Pn(a,KeyboardEvent)?null:a.clipboardData;d!=null&&c!==null&&gh(d,c,l)},{tag:_u})}(r,e),!0)},Te),e.registerCommand(mu,()=>{let r=X();return j(r)&&Xi(r,"space","both",n.peek()),!1},Te),e.registerCommand(Vr,()=>{let r=X();return j(r)&&Xi(r,"tab","both",n.peek()),!1},Te),e.registerCommand(yl,(r)=>{let s=X();if(Ze(s))return DT(s,!1,r);if(!j(s))return!1;let{anchor:i}=s;if(i.type!=="element"||i.offset!==0)return!1;let a=i.getNode();if(!Q(a))return!1;let l=a.getFirstChild();if(!wt(l)||!l.isInline())return!1;let c=a.getKey(),d=a.selectEnd();return r.shiftKey&&d.anchor.set(c,0,"element"),r.preventDefault(),r.stopPropagation(),!0},Te),e.registerCommand(Ri,(r)=>{let s=X();if(Ze(s))return DT(s,!0,r);if(!j(s))return!1;let{anchor:i,focus:a}=s,l=he(a.getNode(),(f)=>Q(f)&&!f.isInline());if(l===null)return!1;let c=l.getFirstChild();if(!wt(c)||!c.isInline())return!1;if(he(i.getNode(),(f)=>Q(f)&&!f.isInline())!==l)return!1;let d=l.getKey();return(a.type!=="element"||a.key!==d||a.offset!==0)&&(s.focus.set(d,0,"element"),r.shiftKey||s.anchor.set(d,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},Te))}var On=hh,{$createHeadingNode:gd,$createQuoteNode:pd,$isHeadingNode:Fl,$isQuoteNode:hd,DRAG_DROP_PASTE:LK,HeadingNode:md,QuoteNode:_d,RichTextExtension:FK,RichTextImportExtension:PK,RichTextImportRules:BK,ShadowRootQuoteRule:KK,eventFiles:zK,quoteShadowRootState:UK,registerRichText:IT}=On;var _h={};Oe(_h,{RichTextPlugin:()=>Fw});S();function kw(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var mh=pn?He:h;function Iw({editor:e,ErrorBoundary:n}){return function(r,s){let[i,a]=u(()=>r.getDecorators());return mh(()=>r.registerDecoratorListener((l)=>{tn(()=>{a(l)})}),[r]),h(()=>{a(r.getDecorators())},[r]),D(()=>{let l=[],c=Object.keys(i);for(let d=0;d<c.length;d++){let f=c[d],g=t(s,{onError:(m)=>r._onError(m),children:t(ia,{fallback:null,children:i[f]})}),p=r.getElementByKey(f);p!==null&&l.push(Qa(g,p,f))}return l},[s,i,r])}(e,n)}function Lw({editor:e,ErrorBoundary:n}){return function(r){let s=HN.maybeFromEditor(r);if(s&&s.hasExtensionByName(XN.name)){for(let i of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(i)&&kw(320,i);return!0}return!1}(e)?null:t(Iw,{editor:e,ErrorBoundary:n})}function LT(e){return e.read("latest",Vu(e.isComposing()))}function Fw({contentEditable:e,placeholder:n=null,ErrorBoundary:r}){let[s]=st();return function(i){mh(()=>De(IT(i),nE(i)),[i])}(s),o(L,{children:[e,t(Pw,{content:n}),t(Lw,{editor:s,ErrorBoundary:r})]})}function Pw({content:e}){let[n]=st(),r=function(i){let[a,l]=u(()=>LT(i));return mh(()=>{function c(){let d=LT(i);l(d)}return c(),De(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a}(n),s=RS();return r?typeof e=="function"?e(s):e:null}var Bw=_h,FT=Bw.RichTextPlugin;var xh={};Oe(xh,{ContentEditable:()=>zw,ContentEditableElement:()=>KT});S();var BT=pn?He:h;function Kw({editor:e,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:s,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:l,ariaInvalid:c,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:g,ariaOwns:p,ariaRequired:m,autoCapitalize:_,className:x,id:C,role:y="textbox",spellCheck:N=!0,style:T,tabIndex:v,"data-testid":R,...F},k){let[H,U]=u(e.isEditable()),W=P((G)=>{G&&G.ownerDocument&&G.ownerDocument.defaultView?e.setRootElement(G):e.setRootElement(null)},[e]),J=D(()=>function(...G){return(ne)=>{for(let ee of G)typeof ee=="function"?ee(ne):ee!=null&&(ee.current=ne)}}(k,W),[W,k]);return BT(()=>(U(e.isEditable()),e.registerEditableListener((G)=>{U(G)})),[e]),t("div",{"aria-activedescendant":H?n:void 0,"aria-autocomplete":H?r:"none","aria-controls":H?s:void 0,"aria-describedby":i,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":H&&y==="combobox"?!!l:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":g,"aria-owns":H?p:void 0,"aria-readonly":!H||void 0,"aria-required":m,autoCapitalize:_,className:x,contentEditable:H,"data-testid":R,id:C,ref:J,role:y,spellCheck:N,style:T,tabIndex:v??(H?void 0:-1),...F})}var KT=O(Kw);function PT(e){return e.read("latest",Vu(e.isComposing()))}var zw=O(Uw);function Uw(e,n){let{placeholder:r,...s}=e,[i]=st();return o(L,{children:[t(KT,{editor:i,...s,ref:n}),r!=null&&t(Hw,{editor:i,content:r})]})}function Hw({content:e,editor:n}){let r=function(l){let[c,d]=u(()=>PT(l));return BT(()=>{function f(){let g=PT(l);d(g)}return f(),De(l.registerUpdateListener(()=>{f()}),l.registerEditableListener(()=>{f()}))},[l]),c}(n),[s,i]=u(n.isEditable());if(He(()=>(i(n.isEditable()),n.registerEditableListener((l)=>{i(l)})),[n]),!r)return null;let a=null;return typeof e=="function"?a=e(s):e!==null&&(a=e),a===null?null:t("div",{"aria-hidden":!0,children:a})}var zT=xh,{ContentEditable:UT,ContentEditableElement:az}=zT;var Ch={};Oe(Ch,{HistoryExtension:()=>xd,SharedHistoryExtension:()=>jw,createEmptyHistoryState:()=>GT,registerHistory:()=>WT});function Ww(e,n,r,s,i){if(e===null||r.size===0&&s.size===0&&!i)return 0;let a=n._selection,l=e._selection;if(i)return 1;if(!(j(a)&&j(l)&&l.isCollapsed()&&a.isCollapsed()))return 0;let c=function(N,T,v){let R=N._nodeMap,F=[];for(let k of T){let H=R.get(k);H!==void 0&&F.push(H)}for(let[k,H]of v){if(!H)continue;let U=R.get(k);U===void 0||So(U)||F.push(U)}return F}(n,r,s);if(c.length===0)return 0;if(c.length>1){let N=n._nodeMap,T=N.get(a.anchor.key),v=N.get(l.anchor.key);return T&&v&&!e._nodeMap.has(T.__key)&&re(T)&&T.__text.length===1&&a.anchor.offset===1?2:0}let d=c[0],f=e._nodeMap.get(d.__key);if(!re(f)||!re(d)||f.__mode!==d.__mode)return 0;let g=f.__text,p=d.__text;if(g===p)return 0;let m=a.anchor,_=l.anchor;if(m.key!==_.key||m.type!=="text")return 0;let x=m.offset,C=_.offset,y=p.length-g.length;return y===1&&C===x-1?2:y===-1&&C===x+1?3:y===-1&&C===x?4:0}function Gw(e,n,r){let s=r(),i=0,a=s,l=0,c=null;return(d,f,g,p,m,_)=>{let x=r();if(_.has(nu)&&(a=s,l=i,c=d),_.has(Ti))return i=0,s=x,2;_.has(tu)&&c&&(s=a,i=l,d=c);let C=_.has(_u)||_.has(su)?0:Ww(d,f,p,m,e.isComposing()),y=(()=>{let N=g===null||g.editor===e,T=_.has(uu);if(!T&&N&&_.has(Gr))return 0;if(C===1)return 2;if(d===null)return 1;let v=f._selection;if(!(p.size>0||m.size>0))return v!==null?0:2;let R=typeof n=="number"?n:n.peek();if(T===!1&&C!==0&&C===i&&x<s+R&&N)return 0;if(p.size===1){if(function(F,k,H){let U=k._nodeMap.get(F),W=H._nodeMap.get(F),J=k._selection,G=H._selection;return!(j(J)&&j(G)&&J.anchor.type==="element"&&J.focus.type==="element"&&G.anchor.type==="text"&&G.focus.type==="text"||!re(U)||!re(W)||U.__parent!==W.__parent)&&JSON.stringify(k.read(()=>U.exportJSON()))===JSON.stringify(H.read(()=>W.exportJSON()))}(Array.from(p)[0],d,f))return 0}return 1})();return s=x,i=C,y}}function HT(e,n){e.undoStack=[],e.redoStack=[],e.current=null,n&&n(e)}function WT(e,n,r,s=Date.now,i,a=null){let l=Gw(e,r,s),c=()=>{i&&i(n)};return c(),De(e.registerCommand(Eu,()=>(function(d,f,g){let{redoStack:p,undoStack:m}=f;if(m.length!==0){let _=f.current,x=m.pop();_!==null&&(p.push(_),d.dispatchCommand(Ms,!0)),m.length===0&&d.dispatchCommand(Ds,!1),f.current=x||null,g&&g(f),x&&x.editor.setEditorState(x.editorState,{tag:Ti})}}(e,n,i),!0),Te),e.registerCommand(xu,()=>(function(d,f,g){let{redoStack:p,undoStack:m}=f;if(p.length!==0){let _=f.current;_!==null&&(m.push(_),d.dispatchCommand(Ds,!0));let x=p.pop();p.length===0&&d.dispatchCommand(Ms,!1),f.current=x||null,g&&g(f),x&&x.editor.setEditorState(x.editorState,{tag:Ti})}}(e,n,i),!0),Te),e.registerCommand(Qc,()=>(HT(n,i),!1),Te),e.registerCommand(Yy,()=>(HT(n,i),e.dispatchCommand(Ms,!1),e.dispatchCommand(Ds,!1),!0),Te),e.registerUpdateListener(({editorState:d,prevEditorState:f,dirtyLeaves:g,dirtyElements:p,tags:m})=>{let{current:_,redoStack:x,undoStack:C}=n,y=_===null?null:_.editorState;if(_!==null&&d===y)return;let N=l(f,d,_,g,p,m);if(N===1){if(x.length!==0&&(n.redoStack=[],e.dispatchCommand(Ms,!1)),_!==null){C.push({..._});let T=typeof a=="number"||a===null?a:a.peek();T!==null&&C.length>T&&C.splice(0,C.length-T),e.dispatchCommand(Ds,!0)}}else if(N===2)return;n.current={editor:e,editorState:d},c()}))}function GT(){return{current:null,redoStack:[],undoStack:[]}}var xd=_e({build:(e,{delay:n,createInitialHistoryState:r,disabled:s,maxDepth:i,now:a},l)=>({...Dt({delay:n,disabled:s,historyState:r(e),maxDepth:i,now:a}),...l.getInitResult()}),config:We({createInitialHistoryState:GT,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:()=>({canRedo:zs(!1),canUndo:zs(!1)}),name:"@lexical/history/History",register:(e,n,r)=>{let{canUndo:s,canRedo:i}=r.getInitResult(),a=r.getOutput(),l=(c)=>Lp(()=>{s.value=c!=null&&c.undoStack.length>0,i.value=c!=null&&c.redoStack.length>0});return Nt(()=>{if(!a.disabled.value)return WT(e,a.historyState.value,a.delay,()=>a.now.peek()(),l,a.maxDepth);l(null)})}}),jw=_e({build:(e,{disabled:n,parentEditor:r})=>Dt({disabled:n,parentEditor:r||e._parentEditor}),config:We({disabled:!1,parentEditor:null}),dependencies:[sn(xd,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,n,r)=>Nt(()=>{let{disabled:s,parentEditor:i}=r.getOutput();if(!s.value){let{output:a}=r.getDependency(xd),l=function(d){return d?lo(d,xd.name):null}(i.value);if(!l)return;let c=l.output;Lp(()=>{a.delay.value=c.delay.value,a.historyState.value=c.historyState.value,a.now.value=c.now.value,a.disabled.value=c.disabled.value})}})});var Cd=Ch,{HistoryExtension:dz,SharedHistoryExtension:fz,createEmptyHistoryState:yd,registerHistory:jT}=Cd;var yh={};Oe(yh,{HistoryPlugin:()=>Yw,createEmptyHistoryState:()=>yd});S();function Yw({delay:e,externalHistoryState:n}){let[r]=st();return function(s,i,a=1000){let l=D(()=>i||yd(),[i]);h(()=>jT(s,l,a),[a,s,l])}(r,n,e),null}var YT=yh,{HistoryPlugin:VT,createEmptyHistoryState:xz}=YT;var bh={};Oe(bh,{$createListItemNode:()=>vo,$createListNode:()=>bo,$getListDepth:()=>Sd,$handleListInsertParagraph:()=>a0,$insertList:()=>Nd,$isListItemNode:()=>Le,$isListNode:()=>$e,$removeList:()=>s0,CheckListExtension:()=>tk,INSERT_CHECK_LIST_COMMAND:()=>c0,INSERT_ORDERED_LIST_COMMAND:()=>_0,INSERT_UNORDERED_LIST_COMMAND:()=>m0,ListExtension:()=>Th,ListImportExtension:()=>nk,ListImportRules:()=>p0,ListItemNode:()=>Ys,ListNode:()=>Qi,ListSchema:()=>ek,REMOVE_LIST_COMMAND:()=>x0,UPDATE_LIST_START_COMMAND:()=>h0,registerCheckList:()=>u0,registerList:()=>C0,registerListStrictIndentTransform:()=>y0});function ts(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sd(e){let n=1,r=e.getParent();for(;r!=null;){if(Le(r)){let s=r.getParent();if($e(s)){n++,r=s.getParent();continue}ts(40)}return n}return n}function Sh(e){let n=e.getParent();$e(n)||ts(40);let r=n,s=n;for(;s!==null;)s=s.getParent(),$e(s)&&(r=s);return r}function o0(e){let n=[],r=e.getChildren().filter(Le);for(let s=0;s<r.length;s++){let i=r[s],a=i.getFirstChild();$e(a)?n=n.concat(o0(a)):n.push(i)}return n}function uo(e){return Le(e)&&$e(e.getFirstChild())}function r0(e,n){return Le(e)&&(n.length===0||n.length===1&&e.is(n[0])&&e.getChildrenSize()===0)}function Nd(e){let n=X();if(n!==null){let r=n.getNodes();if(j(n)){let[i]=n.getStartEndPoints(),a=i.getNode(),l=a.getParent();if(Mt(a)){let c=a.getFirstChild();if(c)r=c.selectStart().getNodes();else{let d=Se();a.append(d),r=d.select().getNodes()}}else if(r0(a,r)){let c=bo(e);if(Mt(l)){a.replace(c);let d=vo();Q(a)&&(d.setFormat(a.getFormatType()),d.setIndent(a.getIndent())),c.append(d)}else if(Le(a)){let d=a.getParentOrThrow();js(c,d.getChildren()),d.replace(c)}return}}let s=new Set;for(let i=0;i<r.length;i++){let a=r[i];if(Q(a)&&a.isEmpty()&&!Le(a)&&!s.has(a.getKey())){XT(a,e);continue}let l=cl(a)?a.getParent():Le(a)&&a.isEmpty()?a:null;for(;l!=null;){let c=l.getKey();if($e(l)){if(!s.has(c)){let d=bo(e);js(d,l.getChildren()),l.replace(d),s.add(c)}break}{let d=l.getParent();if(Mt(d)&&!s.has(c)){s.add(c),XT(l,e);break}l=d}}}}}function js(e,n){e.splice(e.getChildrenSize(),0,n)}function XT(e,n){if($e(e))return e;let r=e.getPreviousSibling(),s=e.getNextSibling(),i=vo(),a;if(js(i,e.getChildren()),$e(r)&&n===r.getListType())r.append(i),$e(s)&&n===s.getListType()&&(js(r,s.getChildren()),s.remove()),a=r;else if($e(s)&&n===s.getListType())s.getFirstChildOrThrow().insertBefore(i),a=s;else{let c=bo(n);c.append(i),e.replace(c),a=c}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let l=X();return j(l)&&(a.getKey()===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,"element"),a.getKey()===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,"element")),e.remove(),a}function Eh(e,n){let r=e.getLastChild(),s=n.getFirstChild();r&&s&&uo(r)&&uo(s)&&(Eh(r.getFirstChild(),s.getFirstChild()),s.remove());let i=n.getChildren();i.length>0&&e.append(...i),n.remove()}function s0(){let e=X();if(j(e)){let n=new Set,r=e.getNodes(),s=e.anchor.getNode();if(r0(s,r))n.add(Sh(s));else for(let i=0;i<r.length;i++){let a=r[i];if(cl(a)){let l=Iu(a,Ys);l!=null&&n.add(Sh(l))}}for(let i of n){let a=i,l=o0(i);for(let c of l){let d=Se().setTextStyle(e.style).setTextFormat(e.format);js(d,c.getChildren()),a.insertAfter(d),a=d,c.__key===e.anchor.key&&Wo(e.anchor,kt(bt(d,"next"))),c.__key===e.focus.key&&Wo(e.focus,kt(bt(d,"next"))),c.remove()}i.remove()}}}function i0(e){let n=e.getListType()!=="check",r=e.getStart();for(let s of e.getChildren())Le(s)&&(s.getValue()!==r&&s.setValue(r),n&&s.getLatest().__checked!=null&&s.setChecked(void 0),$e(s.getFirstChild())||r++)}function Vw(e){let n=new Set;if(uo(e)||n.has(e.getKey()))return;let r=e.getParent(),s=e.getNextSibling(),i=e.getPreviousSibling();if(uo(s)&&uo(i)){let a=i.getFirstChild();if($e(a)){a.append(e);let l=s.getFirstChild();if($e(l))js(a,l.getChildren()),s.remove(),n.add(s.getKey())}}else if(uo(s)){let a=s.getFirstChild();if($e(a)){let l=a.getFirstChild();l!==null&&l.insertBefore(e)}}else if(uo(i)){let a=i.getFirstChild();$e(a)&&a.append(e)}else if($e(r)){let a=jt(e),l=jt(r);a.append(l),l.append(e),i?i.insertAfter(a):s?s.insertBefore(a):r.append(a)}}function qT(e){if(uo(e))return;let n=e.getParent(),r=n?n.getParent():void 0;if($e(r?r.getParent():void 0)&&Le(r)&&$e(n)){let s=n?n.getFirstChild():void 0,i=n?n.getLastChild():void 0;if(e.is(s))r.insertBefore(e),n.isEmpty()&&r.remove();else if(e.is(i))r.insertAfter(e),n.isEmpty()&&r.remove();else{let a=jt(e),l=jt(n);a.append(l),e.getPreviousSiblings().forEach((f)=>l.append(f));let c=jt(e),d=jt(n);c.append(d),js(d,e.getNextSiblings()),r.insertBefore(a),r.insertAfter(c),r.replace(e)}}}function a0(e=!1){let n=X();if(!j(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),s=null;if(Le(r)&&r.getChildrenSize()===0)s=r;else if(re(r)){let f=r.getParent();Le(f)&&f.getChildren().every((g)=>re(g)&&g.getTextContent().trim()==="")&&(s=f)}if(s===null)return!1;let i=Sh(s),a=s.getParent();$e(a)||ts(40);let l=a.getParent(),c;if(Mt(l))c=Se(),i.insertAfter(c);else{if(!Le(l))return!1;c=jt(l),l.insertAfter(c)}c.setTextStyle(n.style).setTextFormat(n.format).select();let d=s.getNextSiblings();if(d.length>0){let f=e?function(p,m){return p.getStart()+m.getIndexWithinParent()}(a,s):1,g=jt(a).setStart(f);if(Le(c)){let p=jt(c);p.append(g),c.insertAfter(p)}else c.insertAfter(g);g.append(...d)}return function(f){let g=f;for(;g.getNextSibling()==null&&g.getPreviousSibling()==null;){let p=g.getParent();if(p==null||!Le(p)&&!$e(p))break;g=p}g.remove()}(s),!0}class Ys extends ct{__value;__checked;$config(){return this.config("listitem",{$transform:(e)=>{let n=e.getParent();if($e(n))n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(n){let r=e.createParentElementNode();$e(r)||ts(340);let s=[e];for(let i of["previous","next"]){s.reverse();for(let{origin:a}of it(e,i)){if(!Le(a))break;s.push(a)}}e.insertBefore(r),r.splice(0,0,s),Mt(n)||(zr(r,Ho(it(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:ct,importDOM:Yg({li:()=>({conversion:Xw,priority:0})})})}constructor(e=1,n=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let n=Xe().createElement("li");return this.updateListItemDOM(null,n,e),n}updateListItemDOM(e,n,r){(function(a,l){let c=l.getParent();!$e(c)||c.getListType()!=="check"||$e(l.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),a.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(n,this),n.value=this.__value,function(a,l,c){let d=l.list;if(!d)return;let f=d.listitem,g=d.nested&&d.nested.listitem,p=c.getParent(),m=$e(p)&&p.getListType()==="check",_=c.getChecked(),x=c.getChildren().some((N)=>$e(N)),C=[];d.listitemChecked!==void 0&&C.push(d.listitemChecked),d.listitemUnchecked!==void 0&&C.push(d.listitemUnchecked),g!==void 0&&C.push(...Ii(g)),C.length>0&&an(a,...C);let y=[];if(f!==void 0&&y.push(...Ii(f)),m){let N=_?d.listitemChecked:d.listitemUnchecked;N!==void 0&&y.push(N)}g!==void 0&&x&&y.push(...Ii(g)),y.length>0&&et(a,...y)}(n,r.theme,this);let s=e?e.__style:"",i=this.__style;s!==i&&fr(n.style,i,s),function(a,l,c){let d=l.__textStyle,f=c?c.__textStyle:"";if(c!==null&&f===d)return;let g=Xr(d);for(let p in g)a.style.setProperty(`--listitem-marker-${p}`,g[p]);if(f!=="")for(let p in Xr(f))p in g||a.style.removeProperty(`--listitem-marker-${p}`)}(n,this,e)}updateDOM(e,n,r){let s=n;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let n=this.createDOM(e._config),r=this.getFormatType();r&&(n.style.textAlign=r);let s=this.getDirection();return s&&(n.dir=s),uo(this)?{after(i){if(ye(i)){let a=i.previousElementSibling;if(ye(a)&&a.nodeName==="LI"){for(;i.firstChild;)a.append(i.firstChild);i.remove()}}return i},element:n}:{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(Q(r)&&this.canMergeWith(r)){let s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,n){if(Le(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!$e(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let a=jt(r),l=this.getNextSibling();for(;l;){let c=l;l=l.getNextSibling(),a.append(c)}r.insertAfter(e),e.insertAfter(a)}let s=this.__key,i=0;if(n&&(Q(e)||ts(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&Q(e)){let a=X();if(j(a))for(let l of a.getStartEndPoints())l.key===s&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){let r=this.getParentOrThrow();if($e(r)||ts(39),Le(e))return super.insertAfter(e,n);let s=this.getNextSiblings();if(r.insertAfter(e,n),s.length!==0){let i=jt(r);s.forEach((a)=>i.append(a)),e.insertAfter(i,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&uo(n)&&uo(r)&&(Eh(n.getFirstChild(),r.getFirstChild()),r.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}collapseAtStart(e){if(uo(this))return!1;let n=this.getParentOrThrow();if(Le(n.getParentOrThrow()))return qT(this),!0;let r=Se().append(...this.getChildren()),s=this.getNextSiblings();if(s.length>0){let i=jt(n);i.append(...s),n.insertAfter(i)}return n.insertAfter(r),this.remove(),n.getChildrenSize()===0&&n.remove(),r.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let n=this.getWritable();return n.__value=e,n}getChecked(){let e=this.getLatest(),n,r=this.getParent();return $e(r)&&(n=r.getListType()),n==="check"?Boolean(e.__checked):void 0}setChecked(e){let n=this.getWritable();return n.__checked=e,n}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let n=e.getParentOrThrow(),r=0;for(;Le(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&ts(117),(e=Math.floor(e))>=0||ts(199);let n=this.getIndent();for(;n!==e;)n<e?(Vw(this),n++):(qT(this),n--);return this}canInsertAfter(e){return Le(e)}canReplaceWith(e){return Le(e)}canMergeWith(e){return Le(e)||wn(e)}extractWithChild(e,n){if(!j(n))return!1;let r=n.anchor.getNode(),s=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return bo("bullet")}canMergeWhenEmpty(){return!0}}function Xw(e){if(e.classList.contains("task-list-item")){for(let s of e.children)if(s.tagName==="INPUT")return JT(s)}if(e.classList.contains("joplin-checkbox")){for(let s of e.children)if(s.classList.contains("checkbox-wrapper")&&s.children.length>0&&s.children[0].tagName==="INPUT")return JT(s.children[0])}let n=e.getAttribute("aria-checked"),r=vo(n==="true"||n!=="false"&&void 0);return eo(r,e),{after:l0.bind(null,r),node:Tn(r,e)}}function JT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let n=vo(e.hasAttribute("checked"));return{after:l0.bind(null,n),node:n}}function l0(e,n){let r=n[0];return n.length===1&&wn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function vo(e){return un(new Ys(void 0,e))}function Le(e){return e instanceof Ys}class Qi extends ct{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(n){let r=n.getNextSibling();$e(r)&&n.getListType()===r.getListType()&&Eh(n,r)})(e),i0(e)},extends:ct,importDOM:Yg({ol:()=>({conversion:QT,priority:0}),ul:()=>({conversion:QT,priority:0})})})}constructor(e="number",n=1,r){super(r);let s=qw[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=n}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let n=this.getWritable();return n.__listType=e,n.__tag=e==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let n=this.getWritable();return n.__start=e,n}createDOM(e,n){let r=this.__tag,s=Xe().createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,ZT(s,e.theme,this),s}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(ZT(n,r.theme,this),e.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let n=this.createDOM(e._config,e);return ye(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,n,r){let s=r;for(let i=0;i<r.length;i++){let a=r[i];Le(a)||(s===r&&(s=[...r]),s[i]=this.createListItemNode().append(!Q(a)||$e(a)||a.isInline()?a:yt(a.getTextContent())))}return super.splice(e,n,s)}extractWithChild(e){return Le(e)}createListItemNode(){return vo()}}function ZT(e,n,r){let s=[],i=[],a=n.list;if(a!==void 0){let l=a[`${r.__tag}Depth`]||[],c=Sd(r)-1,d=c%l.length,f=l[d],g=a[r.__tag],p,{nested:m,checklist:_}=a;if(m!==void 0&&m.list&&(p=m.list),g!==void 0&&s.push(g),_!==void 0&&r.__listType==="check"&&s.push(_),f!==void 0){s.push(...Ii(f));for(let x=0;x<l.length;x++)x!==d&&i.push(r.__tag+x)}if(p!==void 0){let x=Ii(p);c>1?s.push(...x):i.push(...x)}}i.length>0&&an(e,...i),s.length>0&&et(e,...s)}function QT(e){let n;if(function(r){return ye(r)&&r.nodeName.toLowerCase()==="ol"}(e)){let r=e.start;n=bo("number",r)}else n=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(let s of r.childNodes)if(ye(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(e)?bo("check"):bo("bullet");return Tn(n,e),{after:(r)=>function(s,i){let a=i.createListItemNode.bind(i),l=[];for(let c=0;c<s.length;c++){let d=s[c];if(Le(d)){l.push(d);let f=d.getChildren();f.length>1&&f.forEach((g)=>{$e(g)&&l.push(a().append(g))})}else l.push(a().append(d))}return l}(r,n),node:n}}var qw={ol:"number",ul:"bullet"};function bo(e="number",n=1){return un(new Qi(e,n))}function $e(e){return e instanceof Qi}var c0=bn("INSERT_CHECK_LIST_COMMAND");function u0(e,n){let r=n&&n.disableTakeFocusOnClick||!1,s=typeof r=="boolean"?()=>r:r.peek.bind(r),i=(f)=>{let g=f.target;if(!ye(g))return!1;let p=g.__lexicalCheckListLastHandled;return p!==void 0&&f.timeStamp-p<500},a=(f)=>{let g=f.target;ye(g)&&(g.__lexicalCheckListLastHandled=f.timeStamp)},l=(f)=>{i(f)||(a(f),e0(f,s()))},c=(f)=>{f.pointerType==="touch"&&(i(f)||(a(f),e0(f,s())))},d=(f)=>{(function(g,p){d0(g,()=>{g.preventDefault(),p&&g.stopPropagation()})})(f,s())};return De(e.registerCommand(c0,()=>(Nd("check"),!0),Pe),e.registerCommand(jo,(f)=>t0(f,e,!1),Pe),e.registerCommand(oo,(f)=>t0(f,e,!0),Pe),e.registerCommand(Ai,()=>{if(Nh(e)!=null){let f=e.getRootElement();return f!=null&&f.focus(),!0}return!1},Pe),e.registerCommand(mu,(f)=>{let g=Nh(e);return!(g==null||!e.isEditable())&&(e.update(()=>{let p=vt(g);Le(p)&&(f.preventDefault(),p.toggleChecked())}),!0)},Pe),e.registerCommand(Yr,(f)=>e.read("latest",()=>{let g=X();if(j(g)&&g.isCollapsed()){let{anchor:p}=g,m=p.type==="element";if(m||p.offset===0){let _=p.getNode(),x=he(_,(C)=>Q(C)&&!C.isInline());if(Le(x)){let C=x.getParent();if($e(C)&&C.getListType()==="check"&&(m||x.getFirstDescendant()===_)){let y=e.getElementByKey(x.__key);if(y!=null&&Eo(y)!==y)return y.focus(),f.preventDefault(),!0}}}}return!1}),Pe),e.registerRootListener((f)=>{if(f!==null)return De(Jr(f,{click:l,pointerup:c}),Jr(f,{mousedown:d,pointerdown:d},{capture:!0}),ao(f,"touchstart",d,{capture:!0,passive:!1}))}))}function d0(e,n){let r=e.target;if(!ye(r))return;let s=r.firstChild;if(ye(s)&&(s.tagName==="UL"||s.tagName==="OL"))return;let i=r.parentNode;if(!i||i.__lexicalListType!=="check")return;let a=null,l=null;if("clientX"in e)a=e.clientX;else if("touches"in e){let _=e.touches;_.length>0&&(a=_[0].clientX,l="touch")}if(a==null)return;let c=r.getBoundingClientRect(),d=a/aN(r),f=r.ownerDocument.defaultView,g=f?f.getComputedStyle(r,"::before"):{width:"0px"},p=parseFloat(g.width),m=l==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(r.dir==="rtl"?d<c.right+m&&d>c.right-p-m:d>c.left-m&&d<c.left+p+m)&&n()}function e0(e,n){d0(e,()=>{if(ye(e.target)){let r=e.target,s=vu(r);s!=null&&s.isEditable()&&s.update(()=>{let i=vt(r);Le(i)&&(n?(rl(Su),rl(uS)):r.focus(),i.toggleChecked())})}})}function Nh(e){let n=e.getRootElement(),r=n?Eo(n):null;return ye(r)&&r.tagName==="LI"&&r.parentNode!=null&&r.parentNode.__lexicalListType==="check"?r:null}function t0(e,n,r){let s=Nh(n);return s!=null&&n.update(()=>{let i=vt(s);if(!Le(i))return;let a=function(l,c){let d=c?l.getPreviousSibling():l.getNextSibling(),f=l;for(;d==null&&Le(f);)f=f.getParentOrThrow().getParent(),f!=null&&(d=c?f.getPreviousSibling():f.getNextSibling());for(;Le(d);){let g=c?d.getLastChild():d.getFirstChild();if(!$e(g))return d;d=c?g.getLastChild():g.getFirstChild()}return null}(i,r);if(a!=null){a.selectStart();let l=n.getElementByKey(a.__key);l!=null&&(e.preventDefault(),setTimeout(()=>{l.focus()},0))}}),!1}function Jw(e){let n=[];for(let r of e)if(Le(r)){n.push(r);let s=r.getChildren();if(s.length>1)for(let i of s)$e(i)&&n.push(vo().append(i))}else n.push(vo().append(r));return n}var Zw=ft({$import:(e,n)=>{let r;var s;return ah(n,"ol")?r=bo("number",n.start):r=(s=n).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||s.querySelector(":scope > [aria-checked]")!==null?bo("check"):bo("bullet"),Tn(r,n),[r.splice(0,0,od(Jw(e.$importChildren(n)),n))]},match:gt.tag("ol","ul"),name:"@lexical/list/list"});function f0(e,n){if(n.length!==1)return n;let r=n[0];return wn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function g0(e){let n=(l)=>eT(l)&&!$e(l);if(!e.some(n))return e;let r=[],s=[],i=()=>{s.length>0&&(r.push(s),s=[])};for(let l of e)n(l)?(i(),r.push(Q(l)?l.getChildren():[l])):s.push(l);i();let a=[];for(let l of r)a.length>0&&a.push(fn()),a.push(...l);return a}var Qw=ft({$import:(e,n)=>{let r=n.getAttribute("aria-checked"),s=vo(r==="true"||r!=="false"&&void 0);return eo(s,n),Tn(s,n),[s.splice(0,0,g0(f0(s,e.$importChildren(n))))]},match:gt.tag("li"),name:"@lexical/list/li"});function n0(e,n,r){let s=ah(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!s||s.getAttribute("type")!=="checkbox")return[];let i=vo(s.hasAttribute("checked"));return eo(i,n),Tn(i,n),[i.splice(0,0,g0(f0(i,e.$importChildren(n))))]}var ek={$accepts:(e)=>Le(e)||$e(e),$packageRun:(e)=>[vo().splice(0,0,e)],name:"ListSchema"},p0=[ft({$import:(e,n,r)=>{let s=n.querySelector(':scope > input[type="checkbox"]');return s?n0(e,n,s):r()},match:gt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),ft({$import:(e,n,r)=>{let s=n.querySelector(":scope > .checkbox-wrapper");if(!s)return r();let i=s.querySelector(':scope > input[type="checkbox"]');return i?n0(e,n,i):r()},match:gt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Zw,Qw],h0=bn("UPDATE_LIST_START_COMMAND"),m0=bn("INSERT_UNORDERED_LIST_COMMAND"),_0=bn("INSERT_ORDERED_LIST_COMMAND"),x0=bn("REMOVE_LIST_COMMAND");function C0(e,n){return De(e.registerCommand(_0,()=>(Nd("number"),!0),Pe),e.registerCommand(h0,(r)=>{let{listNodeKey:s,newStart:i}=r,a=Rt(s);return!!$e(a)&&(a.getListType()==="number"&&(a.setStart(i),i0(a)),!0)},Pe),e.registerCommand(m0,()=>(Nd("bullet"),!0),Pe),e.registerCommand(x0,()=>(s0(),!0),Pe),e.registerCommand(jr,()=>a0(!!(n&&n.restoreNumbering)),Pe),e.registerCommand(vi,(r)=>{let s=X();if(!j(s)||!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();for(;!Le(a);){if(a.getPreviousSibling()!==null)return!1;let l=a.getParent();if(l===null)return!1;a=l}return!(!Le(a)||!a.collapseAtStart(s))&&(r.preventDefault(),!0)},eu),e.registerNodeTransform(Ys,(r)=>{let s=r.getFirstChild();if(s){if(re(s)){let i=s.getStyle(),a=s.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==a&&r.setTextFormat(a)}}else{let i=X();j(i)&&(i.style!==r.getTextStyle()||i.format!==r.getTextFormat())&&i.isCollapsed()&&r.is(i.anchor.getNode())&&r.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform(Ln,(r)=>{let s=r.getParent();if(Le(s)&&r.is(s.getFirstChild())){let i=r.getStyle(),a=r.getFormat();i===s.getTextStyle()&&a===s.getTextFormat()||s.setTextStyle(i).setTextFormat(a)}}))}function y0(e){let n=(r)=>{let s=r.getParent();if($e(r.getFirstChild())||!$e(s))return;let i=he(r,(a)=>Le(a)&&$e(a.getParent())&&Le(a.getPreviousSibling()));if(i===null&&r.getIndent()>0)r.setIndent(0);else if(Le(i)){let a=i.getPreviousSibling();if(Le(a)){let l=function(d){let f=d,g=f.getFirstChild();for(;$e(g);){let p=g.getLastChild();if(!Le(p))break;f=p,g=f.getFirstChild()}return f}(a),c=l.getParent();if($e(c)){let d=Sd(c);d+1<Sd(s)&&r.setIndent(d)}}}};return e.registerNodeTransform(Qi,(r)=>{let s=[r];for(;s.length>0;){let i=s.shift();if($e(i)){for(let a of i.getChildren())if(Le(a)){n(a);let l=a.getFirstChild();$e(l)&&s.push(l)}}}})}var Th=_e({build:(e,n,r)=>Dt(n),config:We({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[co,sn(qo,{rules:p0})],name:"@lexical/list/List",nodes:()=>[Qi,Ys],register(e,n,r){let s=r.getOutput();return De(Nt(()=>C0(e,{restoreNumbering:s.shouldPreserveNumbering.value})),Nt(()=>s.hasStrictIndent.value?y0(e):void 0))}}),tk=_e({build:(e,n)=>Dt(n),config:We({disableTakeFocusOnClick:!1}),dependencies:[Th],name:"@lexical/list/CheckList",register:(e,n,r)=>u0(e,r.getOutput())}),nk=_e({dependencies:[Th],name:"@lexical/list/Import"});var Et=bh,{$createListItemNode:S0,$createListNode:N0,$getListDepth:Tz,$handleListInsertParagraph:bz,$insertList:vz,$isListItemNode:vh,$isListNode:Oo,$removeList:Oz,CheckListExtension:Az,INSERT_CHECK_LIST_COMMAND:E0,INSERT_ORDERED_LIST_COMMAND:T0,INSERT_UNORDERED_LIST_COMMAND:O0,ListExtension:Rz,ListImportExtension:Mz,ListImportRules:Dz,ListItemNode:ns,ListNode:Jo,ListSchema:$z,REMOVE_LIST_COMMAND:Ed,UPDATE_LIST_START_COMMAND:wz,registerCheckList:A0,registerList:Oh,registerListStrictIndentTransform:R0}=Et;var Ah={};Oe(Ah,{ListPlugin:()=>ok});S();function ok({hasStrictIndent:e=!1,shouldPreserveNumbering:n=!1}){let[r]=st();return h(()=>{if(!r.hasNodes([Jo,ns]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),h(()=>De(Oh(r,{restoreNumbering:n}),e?R0(r):()=>{}),[r,e,n]),function(s){h(()=>Oh(s),[s])}(r),null}var rk=Ah,M0=rk.ListPlugin;var Rh={};Oe(Rh,{CheckListPlugin:()=>sk});S();function sk({disableTakeFocusOnClick:e=!1}){let[n]=st();return h(()=>A0(n,{disableTakeFocusOnClick:e}),[n,e]),null}var ik=Rh,D0=ik.CheckListPlugin;var Mh={};Oe(Mh,{TabIndentationPlugin:()=>ak,registerTabIndentation:()=>Yu});S();function ak({maxIndent:e,$canIndent:n}){let[r]=st();return h(()=>Yu(r,e,n),[r,e,n]),null}var $0=Mh,{TabIndentationPlugin:k0,registerTabIndentation:Vz}=$0;var Ih={};Oe(Ih,{$createAutoLinkNode:()=>kh,$createLinkNode:()=>Bl,$isAutoLinkNode:()=>mn,$isLinkNode:()=>Bn,$toggleLink:()=>Td,AutoLinkExtension:()=>Ck,AutoLinkNode:()=>Kl,ClickableLinkExtension:()=>fk,LinkExtension:()=>Od,LinkImportExtension:()=>dk,LinkImportRules:()=>K0,LinkNode:()=>os,TOGGLE_LINK_COMMAND:()=>bd,autoLinkEmailMatcher:()=>hk,autoLinkUrlMatcher:()=>pk,createLinkMatcherWithRegExp:()=>H0,formatUrl:()=>Dh,registerAutoLink:()=>X0,registerClickableLink:()=>U0,registerLink:()=>z0});var I0=new Set(["http:","https:","mailto:","sms:","tel:"]);class os extends ct{__url;__target;__rel;__title;$config(){return this.config("link",{extends:ct,importDOM:{a:()=>({conversion:ck,priority:1})}})}constructor(e="",n={},r){super(r);let{target:s=null,rel:i=null,title:a=null}=n;this.__url=e,this.__target=s,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let n=Xe().createElement("a");return this.updateLinkDOM(null,n,e),et(n,e.theme.link),n}updateLinkDOM(e,n,r){if(wi(n)){e&&e.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];e&&e[i]===a||(a?n[s]=a:n.removeAttribute(s))}}}updateDOM(e,n,r){return this.updateLinkDOM(e,n,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let n=e;e=Dh(e);try{let r=new URL(Dh(e));if(!I0.has(r.protocol))return"about:blank"}catch(r){let s=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(s!=null&&!I0.has(`${s[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let n=this.getWritable();return n.__url=e,n}getTarget(){return this.getLatest().__target}setTarget(e){let n=this.getWritable();return n.__target=e,n}getRel(){return this.getLatest().__rel}setRel(e){let n=this.getWritable();return n.__rel=e,n}getTitle(){return this.getLatest().__title}setTitle(e){let n=this.getWritable();return n.__title=e,n}insertNewAfter(e,n=!0){let r=jt(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n,r){if(!j(n))return!1;let s=n.anchor.getNode(),i=n.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function L0(e){let n=dn(e,"next");return[n,n.getFlipped()]}function F0(e,n){for(let r of n)if(r.origin.isAttached()){let s=kt(r);return void Wo(e,s)}}function lk(e){let n=X(),r=null,s=null;function i(){j(n)&&(F0(n.anchor,r),F0(n.focus,s),Uo(n))}j(n)&&(r=L0(n.anchor),s=L0(n.focus));let a=!1;for(let c of bt(e,"next")){let d=c.origin;if(Q(d)&&!d.isInline()){let f=d.getChildren();if(f.length>0){let g=jt(e);g.append(...f),d.append(g),a=!0}zr(d,Ho(c),{$shouldSplit:()=>!1})}}function l(c,d,f){let[g,p]=c,m=(x)=>No(x)&&x.origin.is(d);if(!m(g)&&!m(p))return c;let _=kt(bt(f,"next"));return[_,_.getFlipped()]}if(e.isAttached()){let c=e.getPreviousSibling();if(Bn(c)&&c.shouldMergeAdjacentLink(e))return r&&(r=l(r,c,e)),s&&(s=l(s,c,e)),c.append(...e.getChildren()),e.remove(),void i();let d=e.getNextSibling();Bn(d)&&e.shouldMergeAdjacentLink(d)&&(r&&(r=l(r,e,d)),s&&(s=l(s,e,d)),e.append(...d.getChildren()),d.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let c=e.getParent();e.remove(),c&&c.isEmpty()&&c.remove()}i()}}function ck(e){let n=null;if(wi(e)){let r=e.textContent;(r!==null&&r!==""||e.children.length>0)&&(n=Bl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:n}}function Bl(e="",n){return un(new os(e,n))}function Bn(e){return e instanceof os}class Kl extends os{__isUnlinked;constructor(e="",n={},r){super(e,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}$config(){return this.config("autolink",{extends:os})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let n=this.getWritable();return n.__isUnlinked=e,n}createDOM(e){return this.__isUnlinked?Xe().createElement("span"):super.createDOM(e)}updateDOM(e,n,r){return super.updateDOM(e,n,r)||e.__isUnlinked!==this.__isUnlinked}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,n=!0){let r=kh(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function kh(e="",n){return un(new Kl(e,n))}function mn(e){return e instanceof Kl}var bd=bn("TOGGLE_LINK_COMMAND");function P0(e,n){if(e.type==="element"){let r=e.getNode();return Q(r)||function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);throw a.search=l.toString(),Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),r.getChildren()[e.offset+n]||null}return null}function Td(e,n={}){let r;if(e&&typeof e=="object"){let{url:g,...p}=e;r=g,n={...p,...n}}else r=e;let{target:s,title:i}=n,a=n.rel===void 0?"noreferrer":n.rel,l=X();if(l===null||!j(l)&&!Ze(l))return;if(Ze(l)){let g=l.getNodes();if(g.length===0)return;return void g.forEach((p)=>{if(r===null){let m=he(p,(_)=>!mn(_)&&Bn(_));m&&(m.insertBefore(p),m.getChildren().length===0&&m.remove())}else{let m=he(p,(_)=>!mn(_)&&Bn(_));if(m)m.setURL(r),s!==void 0&&m.setTarget(s),a!==void 0&&m.setRel(a);else{let _=Bl(r,{rel:a,target:s});p.insertBefore(_),_.append(p)}}})}if(l.isCollapsed()&&r===null)for(let g of l.getNodes()){let p=he(g,(m)=>!mn(m)&&Bn(m));return void(p!==null&&(p.getParentOrThrow().splice(p.getIndexWithinParent(),0,p.getChildren()),p.remove()))}let c=l.extract();if(r===null){let g=new Set;return void c.forEach((p)=>{let m=he(p,(_)=>!mn(_)&&Bn(_));if(m!==null){let _=m.getKey();if(g.has(_))return;(function(x,C){let y=new Set(C.filter((U)=>x.isParentOf(U)).map((U)=>U.getKey())),N=x.getChildren(),T=(U)=>y.has(U.getKey())||Q(U)&&C.some((W)=>x.isParentOf(W)&&U.isParentOf(W)),v=N.filter(T);if(v.length===N.length)return N.forEach((U)=>x.insertBefore(U)),void x.remove();let R=N.findIndex(T),F=N.findLastIndex(T),k=R===0,H=F===N.length-1;if(k)v.forEach((U)=>x.insertBefore(U));else if(H)for(let U=v.length-1;U>=0;U--)x.insertAfter(v[U]);else{for(let W=v.length-1;W>=0;W--)x.insertAfter(v[W]);let U=N.slice(F+1);if(U.length>0){let W=jt(x);v[v.length-1].insertAfter(W),U.forEach((J)=>W.append(J))}}})(m,c),g.add(_)}})}let d=new Set,f=(g)=>{d.has(g.getKey())||(d.add(g.getKey()),g.setURL(r),s!==void 0&&g.setTarget(s),a!==void 0&&g.setRel(a),i!==void 0&&g.setTitle(i))};if(c.length===1){let g=c[0],p=he(g,Bn);if(p!==null)return f(p)}(function(g){let p=X();if(!j(p))return g();let m=Uo(p),_=m.isBackward(),x=P0(m.anchor,_?-1:0),C=P0(m.focus,_?0:-1),y=g();if(x||C){let N=X();if(j(N)){let T=N.clone();if(x){let v=x.getParent();v&&T.anchor.set(v.getKey(),x.getIndexWithinParent()+(_?1:0),"element")}if(C){let v=C.getParent();v&&T.focus.set(v.getKey(),C.getIndexWithinParent()+(_?0:1),"element")}mt(Uo(T))}}})(()=>{let g=null;for(let p of c){if(!p.isAttached())continue;let m=he(p,Bn);if(m){f(m);continue}if(Q(p)){if(!p.isInline())continue;if(Bn(p)){if(!(mn(p)||g!==null&&g.getParentOrThrow().isParentOf(p))){f(p),g=p;continue}for(let x of p.getChildren())p.insertBefore(x);p.remove();continue}}let _=p.getPreviousSibling();Bn(_)&&_.is(g)?_.append(p):(g=Bl(r,{rel:a,target:s,title:i}),p.insertAfter(g),g.append(p))}})}var uk=/^\+?[0-9\s()-]{5,}$/;function Dh(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:uk.test(e)?`tel:${e}`:`https://${e}`}var K0=[ft({$import:(e,n)=>{if(!n.textContent&&n.children.length===0)return[];let r=n.getAttribute("href")||"",s={rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")};return qE(e.$importChildren(n),()=>Bl(r,s))},match:gt.tag("a"),name:"@lexical/link/a"})];function z0(e,n){return De(e.registerNodeTransform(os,lk),e.registerCommand(bd,(r)=>{let s=n.validateUrl.peek(),i=n.attributes.peek();if(r===null)return Td(null),!0;if(typeof r=="string")return!(s!==void 0&&!s(r))&&(Td(r,i),!0);{let{url:a,target:l,rel:c,title:d}=r;return Td(a,{...i,rel:c,target:l,title:d}),!0}},Te),Nt(()=>{let r=n.validateUrl.value;if(!r)return;let s=n.attributes.value;return e.registerCommand(Mi,(i)=>{let a=X();if(!j(a)||a.isCollapsed()||!Pn(i,ClipboardEvent))return!1;if(i.clipboardData===null)return!1;let l=i.clipboardData.getData("text");if(!r(l))return!1;return!a.getNodes().some((c)=>Q(c)||re(c)&&!c.isSimpleText())&&(e.dispatchCommand(bd,{...s,url:l}),i.preventDefault(),!0)},Pe)}))}var Od=_e({build:(e,n,r)=>Dt(n),config:{attributes:void 0,validateUrl:void 0},dependencies:[co,sn(qo,{rules:K0})],mergeConfig(e,n){let r=zt(e,n);return e.attributes&&(r.attributes=zt(e.attributes,r.attributes)),r},name:"@lexical/link/Link",nodes:()=>[os],register:(e,n,r)=>z0(e,r.getOutput())}),dk=_e({dependencies:[Od],name:"@lexical/link/Import"});function U0(e,n,r={}){let s=(a)=>{let l=a.target;if(!io(l))return;let c=vu(l);if(c===null)return;let d=null,f=null,g=!1;if(c.update(()=>{let _=vt(l);if(_!==null){let x=he(_,Q);if(!n.disabled.peek())if(Bn(x))g=mn(x)&&x.getIsUnlinked(),d=x.sanitizeUrl(x.getURL()),f=x.getTarget();else{let C=function(y,N){let T=y;for(;T!=null;){if(N(T))return T;T=T.parentNode}return null}(l,wi);C!==null&&(d=C.href,f=C.target)}}}),d===null||d===""||g)return;let p=e.read("latest",X);if(j(p)&&!p.isCollapsed())return void a.preventDefault();let m=a.type==="auxclick"&&a.button===1;window.open(d,n.newTab.peek()||m||a.metaKey||a.ctrlKey||f==="_blank"?"_blank":"_self"),a.preventDefault()},i=(a)=>{a.button===1&&s(a)};return e.registerRootListener((a)=>{if(a)return Jr(a,{click:s,mouseup:i},r)})}var fk=_e({build:(e,n,r)=>Dt(n),config:We({disabled:!1,newTab:!1}),dependencies:[Od],name:"@lexical/link/ClickableLink",register:(e,n,r)=>U0(e,r.getOutput())});function H0(e,n=(r)=>r){return(r)=>{let s=e.exec(r);return s===null?null:{index:s.index,length:s[0].length,text:s[0],url:n(s[0])}}}var gk=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,pk=(e)=>{let n=gk.exec(e);if(n===null)return null;let r=n[0],s=0;for(let i of r)i==="("?s++:i===")"&&s--;for(;s<0&&r.endsWith(")");)r=r.slice(0,-1),s++;return{index:n.index,length:r.length,text:r,url:r.startsWith("http")?r:`https://${r}`}},hk=H0(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,(e)=>`mailto:${e}`);function $h(e,n){for(let r=0;r<n.length;r++){let s=n[r](e);if(s)return s}return null}var W0=/[.,;\s]/;function vd(e,n){return n.test(e)}function G0(e,n){return vd(e[e.length-1],n)}function wh(e,n){return vd(e[0],n)}function j0(e,n){let r=e.getPreviousSibling();return Q(r)&&(r=r.getLastDescendant()),r===null||Ue(r)||re(r)&&G0(r.getTextContent(),n)}function Y0(e,n){let r=e.getNextSibling();return Q(r)&&(r=r.getFirstDescendant()),r===null||Ue(r)||re(r)&&wh(r.getTextContent(),n)}function mk(e,n,r,s,i){if(!(e>0?vd(s[e-1],r):j0(i[0],r)))return!1;return n<s.length?vd(s[n],r):Y0(i[i.length-1],r)}function _k(e,n,r){let s=[],i=[],a=[],l=0,c=0,d=[...e];for(;d.length>0;){let f=d[0],g=f.getTextContent().length,p=c;c+g<=n?(s.push(f),l+=g):p>=r?a.push(f):i.push(f),c+=g,d.shift()}return[l,s,i,a]}function xk(e,n,r,s){let i=kh(s.url,s.attributes);if(e.length===1){let a,l=e[0];n===0?[a,l]=l.splitText(r):[,a,l]=l.splitText(n,r);let c=yt(s.text);return c.setFormat(a.getFormat()),c.setDetail(a.getDetail()),c.setStyle(a.getStyle()),i.append(c),a.replace(i),l}if(e.length>1){let a=e[0],l,c=a.getTextContent().length;n===0?l=a:[,l]=a.splitText(n);let d=[],f;for(let _=1;_<e.length;_++){let x=e[_],C=x.getTextContent().length,y=c;if(y<r)if(c+C<=r)d.push(x);else{let[N,T]=x.splitText(r-y);d.push(N),f=T}c+=C}let g=X(),p=g?g.getNodes().find(re):void 0,m=yt(l.getTextContent());return m.setFormat(l.getFormat()),m.setDetail(l.getDetail()),m.setStyle(l.getStyle()),i.append(m,...d),p&&p===l&&(j(g)?m.select(g.anchor.offset,g.focus.offset):Ze(g)&&m.select(0,m.getTextContent().length)),l.replace(i),f}}function B0(e,n,r,s){let i=e.getChildren(),a=i.length;for(let f=0;f<a;f++){let g=i[f];if(!re(g)||!g.isSimpleText())return Pl(e),void r(null,e.getURL())}let l=e.getTextContent(),c=$h(l,n);if(c===null||c.text!==l)return Pl(e),void r(null,e.getURL());if(!j0(e,s)||!Y0(e,s))return Pl(e),void r(null,e.getURL());let d=e.getURL();if(d!==c.url&&(e.setURL(c.url),r(c.url,d)),c.attributes){let f=e.getRel();f!==c.attributes.rel&&(e.setRel(c.attributes.rel||null),r(c.attributes.rel||null,f));let g=e.getTarget();g!==c.attributes.target&&(e.setTarget(c.attributes.target||null),r(c.attributes.target||null,g))}}function Pl(e){let n=e.getChildren();for(let r=n.length-1;r>=0;r--)e.insertAfter(n[r]);return e.remove(),n.map((r)=>r.getLatest())}var V0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:W0};function X0(e,n=V0){let{matchers:r,changeHandlers:s,excludeParents:i,separatorRegex:a=W0}=n,l=(c,d)=>{for(let f of s)f(c,d)};return De(e.registerNodeTransform(Ln,(c)=>{let d=c.getParentOrThrow(),f=c.getPreviousSibling();if(mn(d))B0(d,r,l,a);else if(!Bn(d)&&!i.some((g)=>g(d))){if(c.isSimpleText()&&(wh(c.getTextContent(),a)||!mn(f))){let g=function(p){let m=[p],_=p.getNextSibling();for(;_!==null&&re(_)&&_.isSimpleText()&&(m.push(_),!/[\s]/.test(_.getTextContent()));)_=_.getNextSibling();return m}(c);(function(p,m,_,x){for(let R of p){let F=R.getParent();if(mn(F)&&!F.getIsUnlinked())return}let C=[...p],y=C.map((R)=>R.getTextContent()).join(""),N,T=y,v=0;for(;(N=$h(T,m))&&N!==null;){let R=N.index,F=R+N.length;if(mk(v+R,v+F,x,y,C)){let[k,,H,U]=_k(C,v+R,v+F),W=!1;for(let G of H){let ne=G.getParent();if(mn(ne)&&!ne.getIsUnlinked()){W=!0;break}}if(W){v+=F,T=T.substring(F);continue}let J=xk(H,v+R-k,v+F-k,N);C=J?[J,...U]:U,_(N.url,null),v=0}else v+=F;T=T.substring(F)}})(g,r,l,a)}(function(g,p,m,_){let x=g.getParent(),C=g.getPreviousSibling(),y=g.getNextSibling(),N=g.getTextContent();if(!mn(x)||x.getIsUnlinked()){if(mn(C)&&!C.getIsUnlinked()&&C.is(g.getPreviousSibling())&&g.getParent()===C.getParent()){if(!wh(N,_))return Pl(C),void m(null,C.getURL());if(T=N,C.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(T):/^\.[a-zA-Z0-9]{1,}/.test(T)){let v=C.getTextContent()+N,R=$h(v,p);R!==null&&R.text===v&&(C.append(g),B0(C,p,m,_),m(null,C.getURL()))}}var T;!mn(y)||y.getIsUnlinked()||G0(N,_)||y.is(g.getNextSibling())&&g.getParent()===y.getParent()&&(Pl(y),m(null,y.getURL()))}})(c,r,l,a)}}),e.registerCommand(bd,(c)=>{let d=X();if(c!==null||!j(d))return!1;return d.extract().forEach((f)=>{let g=f.getParent();mn(g)&&(g.setIsUnlinked(!g.getIsUnlinked()),g.markDirty())}),!1},Pe))}var Ck=_e({config:V0,dependencies:[Od],mergeConfig(e,n){let r=zt(e,n);for(let s of["matchers","changeHandlers","excludeParents"]){let i=n[s];Array.isArray(i)&&(r[s]=[...e[s],...i])}return r},name:"@lexical/link/AutoLink",nodes:[Kl],register:X0});var Lt=Ih,{$createAutoLinkNode:eU,$createLinkNode:q0,$isAutoLinkNode:J0,$isLinkNode:ea,$toggleLink:tU,AutoLinkExtension:nU,AutoLinkNode:Z0,ClickableLinkExtension:oU,LinkExtension:rU,LinkImportExtension:sU,LinkImportRules:iU,LinkNode:ta,TOGGLE_LINK_COMMAND:Lh,autoLinkEmailMatcher:aU,autoLinkUrlMatcher:lU,createLinkMatcherWithRegExp:cU,formatUrl:uU,registerAutoLink:dU,registerClickableLink:fU,registerLink:Q0}=Lt;var Fh={};Oe(Fh,{LinkPlugin:()=>yk});S();function yk({validateUrl:e,attributes:n}){let[r]=st();return h(()=>{if(!r.hasNodes([ta]))throw Error("LinkPlugin: LinkNode not registered on editor")}),h(()=>Q0(r,Dt({attributes:n,validateUrl:e})),[r,e,n]),null}var Sk=Fh,eb=Sk.LinkPlugin;var Ph={};Oe(Ph,{AutoFocusPlugin:()=>Nk});S();function Nk({defaultSelection:e}){let[n]=st();return h(()=>{n.focus(()=>{let r=n.getRootElement(),s=r!==null?Eo(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,n]),null}var Ek=Ph,tb=Ek.AutoFocusPlugin;var Wh={};Oe(Wh,{$createCodeHighlightNode:()=>Uh,$createCodeNode:()=>Ao,$getCodeLineDirection:()=>cb,$getEndOfCodeInLine:()=>db,$getFirstCodeNodeOfLine:()=>rs,$getLastCodeNodeOfLine:()=>Xs,$getStartOfCodeInLine:()=>ub,$isCodeHighlightNode:()=>Ut,$isCodeNode:()=>An,$outdentLeadingSpaces:()=>fb,$plainifyCodeContent:()=>Tk,CodeExtension:()=>Hh,CodeHighlightNode:()=>Wl,CodeImportExtension:()=>kk,CodeImportRules:()=>yb,CodeIndentExtension:()=>Ik,CodeNode:()=>Hl,DEFAULT_CODE_LANGUAGE:()=>gb,getDefaultCodeLanguage:()=>bk,registerCodeIndentation:()=>Nb});function Rd(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lb(e,n){let r=e;for(let s=it(e,n);s&&(Ut(s.origin)||Yt(s.origin));s=s.getAdjacentCaret())r=s.origin;return r}function rs(e){return lb(e,"previous")}function Xs(e){return lb(e,"next")}function cb(e){let n=rs(e),r=Xs(e),s=n;for(;s!==null;){if(Ut(s)){let a=yS(s.getTextContent());if(a!==null)return a}if(s===r)break;s=s.getNextSibling()}let i=n.getParent();if(Q(i)){let a=i.getDirection();if(a==="ltr"||a==="rtl")return a}return null}function ub(e,n){let r=null,s=null,i=e,a=n,l=e.getTextContent();for(;;){if(a===0){let f=i.getPreviousSibling();if(f===null){i=null;break}if(Ut(f)||Yt(f)||Ue(f)||Rd(167),i=f,Ue(i)){r={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),l=i.getTextContent()}else a--;let d=l[a];Ut(i)&&d!==" "&&(s={node:i,offset:a})}if(s!==null)return s;let c=null;if(n<e.getTextContentSize())Ut(e)&&(c=e.getTextContent()[n]);else{let d=e.getNextSibling();Ut(d)&&(c=d.getTextContent()[0])}if(c!==null&&c!==" ")return r;{let d=function(f,g){let p=f,m=g,_=f.getTextContent(),x=f.getTextContentSize();for(;;){if(!Ut(p)||m===x){if(p=p.getNextSibling(),p===null||Ue(p))return null;Ut(p)&&(m=0,_=p.getTextContent(),x=p.getTextContentSize())}if(Ut(p)){if(_[m]!==" ")return{node:p,offset:m};m++}}}(e,n);return d!==null?d:r}}function db(e){let n=Xs(e);return Ue(n)&&Rd(168),n}function Tk(e){let n=[];return Li(e,{linebreak:()=>n.push(fn()),tab:()=>n.push(gn()),text:(r)=>n.push(Uh(r))}),n}function fb(e,n,r){if(!Number.isInteger(n)||n<=0)return!1;let s=e.getTextContent(),i=/^ +/.exec(s);if(!i)return!1;let a=Math.min(n,i[0].length),l=e.getKey(),c=r.anchor.key===l&&r.anchor.type==="text"?r.anchor.offset:null,d=r.focus.key===l&&r.focus.type==="text"?r.focus.offset:null;return e.spliceText(0,a,""),c!==null&&r.anchor.set(l,Math.max(0,c-a),"text"),d!==null&&r.focus.set(l,Math.max(0,d-a),"text"),!0}var gb="javascript",bk=()=>gb;function pb(e,n){for(let r of e.childNodes){if(ye(r)&&r.tagName===n)return!0;if(pb(r,n))return!0}return!1}var Ul="data-language",zl="data-highlight-language",Ad="data-theme",vk=()=>{};class Hl extends ct{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:ct,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||pb(e,"BR"))?{conversion:nb,priority:1}:null,div:()=>({conversion:Ok,priority:1}),pre:()=>({conversion:nb,priority:0}),table:(e)=>Bh(e)?{conversion:Ak,priority:3}:null,td:(e)=>{let n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Bh(r)?{conversion:ob,priority:3}:null},tr:(e)=>{let n=e.closest("table");return n&&Bh(n)?{conversion:ob,priority:3}:null}}})}constructor(e=void 0,n){super(n),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let n=Xe().createElement("code");et(n,e.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Ul,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(zl,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),n}updateDOM(e,n,r){let s=this.__language,i=e.__language;s?s!==i&&n.setAttribute(Ul,s):i&&n.removeAttribute(Ul);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&s?s!==i&&n.setAttribute(zl,s):n.removeAttribute(zl):a&&s&&n.setAttribute(zl,s);let l=this.__theme,c=e.__theme;l?l!==c&&n.setAttribute(Ad,l):c&&n.removeAttribute(Ad);let d=this.__style,f=e.__style;return d!==f&&fr(n.style,d,f),!1}exportDOM(e){let n=Xe().createElement("pre");et(n,e._config.theme.code),n.setAttribute("spellcheck","false");let r=this.getLanguage();r&&(n.setAttribute(Ul,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(zl,r));let s=this.getTheme();s&&n.setAttribute(Ad,s);let i=this.getStyle();return i&&fr(n.style,i),{element:n}}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!lo(Ge(),"@lexical/code")){vk();let a=hb(e);if(a)return a}let{anchor:r,focus:s}=e,i=(r.isBefore(s)?r:s).getNode();if(re(i)){let a=rs(i),l=[];for(;;)if(Yt(a))l.push(gn()),a=a.getNextSibling();else{if(!Ut(a))break;{let _=0,x=a.getTextContent(),C=a.getTextContentSize();for(;_<C&&x[_]===" ";)_++;if(_!==0&&l.push(Uh(" ".repeat(_))),_!==C)break;a=a.getNextSibling()}}let c=i.splitText(r.offset)[0],d=r.offset===0?0:1,f=c.getIndexWithinParent()+d,g=i.getParentOrThrow(),p=[fn(),...l];g.splice(f,0,p);let m=l[l.length-1];m?m.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(An(i)){let{offset:a}=e.anchor;i.splice(a,0,[fn()]),i.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Se();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}setLanguage(e){let n=this.getWritable();return n.__language=e||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let n=this.getWritable();return n.__isSyntaxHighlightSupported=e,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let n=this.getWritable();return n.__theme=e||void 0,n}getTheme(){return this.getLatest().__theme}}function Ao(e,n){return jc(Hl).setLanguage(e).setTheme(n)}function An(e){return e instanceof Hl}function nb(e){return{node:Ao(e.getAttribute(Ul))}}function Ok(e){let n=e,r=rb(n);return r||function(s){let i=s.parentElement;for(;i!==null;){if(rb(i))return!0;i=i.parentElement}return!1}(n)?{node:r?Ao():null}:{node:null}}function Ak(){return{node:Ao()}}function ob(){return{node:null}}function rb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){return e.classList.contains("js-file-line-container")}function hb(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type==="element"){let r=n.getNode();if(An(r)){let s=r.getChildrenSize();if(s>=2&&n.offset===s){let i=r.getLastChild();if(Ue(i)&&Ue(i.getPreviousSibling())){let a=Se();return r.splice(s-2,2,[]).insertAfter(a,!1),a.select(),a}}}}return null}class Wl extends Ln{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:Ln})}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let n=this.getWritable();return n.__highlightType=e||void 0,n}canHaveFormat(){return!1}createDOM(e){let n=super.createDOM(e),r=Kh(e.theme,this.__highlightType);return et(n,r),n}updateDOM(e,n,r){let s=super.updateDOM(e,n,r),i=Kh(r.theme,e.__highlightType),a=Kh(r.theme,this.__highlightType);return i!==a&&(i&&an(n,i),a&&et(n,a)),s}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Ao()}}function Kh(e,n){return n&&e&&e.codeHighlight&&e.codeHighlight[n]}function Uh(e="",n){return un(new Wl(e,n))}function Ut(e){return e instanceof Wl}var mb="data-language";function _b(e){return e.style.fontFamily.match("monospace")!==null}function zh(e){let n=e.parentElement;for(;n!==null;){if(_b(n))return!0;n=n.parentElement}return!1}var Rk=ih([ft({$import:(e,n)=>e.$importChildren(n),match:gt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Mk=ft({$import:(e,n)=>[Ao(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))],match:gt.tag("pre"),name:"@lexical/code/pre"}),Dk=ft({$import:(e,n,r)=>{let s=n.textContent||"";return/\r?\n/.test(s)||n.querySelector("br")!==null?[Ao(n.getAttribute(mb)).splice(0,0,e.$importChildren(n))]:r()},match:gt.tag("code"),name:"@lexical/code/code-multiline"});function na(e){if(!ye(e))return!1;let n=e.style.fontFamily,r=e.style.whiteSpace;return typeof n=="string"&&/monospace/i.test(n)&&typeof r=="string"&&r.startsWith("pre")}function xb(e){let n=!1,r=[],s="",i=!1,a=()=>{i&&(r.push(s),s="",i=!1)};for(let l of Array.from(e.childNodes))if(ye(l))l.tagName==="DIV"?(a(),r.push(l.textContent||""),n=!0):l.tagName==="BR"?(a(),r.push(""),n=!0):(s+=l.textContent||"",i=!0);else if(Fs(l)){let c=l.textContent||"";c.length>0&&(s+=c,i=!0)}return a(),n?r:null}function Cb(e){for(let n of Array.from(e.children)){if(ye(n)&&na(n)){if(xb(n)!==null)return!0;let r=n.nextElementSibling;if(r&&na(r))return!0;continue}if(Cb(n))return!0}return!1}var $k=ih([ft({$import:(e,n,r)=>{if(!na(n)||zh(n))return r();let s=xb(n);return s===null||s.length===0?r():[Ao().splice(0,0,sl(s.join(`
16
16
  `)))]},match:gt.tag("div"),name:"@lexical/code/vscode-wrapper"}),ft({$import:(e,n,r)=>{if(!na(n)||zh(n))return r();let s=n.previousElementSibling;if(s&&na(s))return[];let i=[],a=n;for(;a&&na(a);)i.push(a.tagName==="BR"?"":a.textContent||""),a=a.nextElementSibling;return i.length<2?r():[Ao().splice(0,0,sl(i.join(`
17
17
  `)))]},match:gt.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),wk=ft({$import:(e,n,r)=>_b(n)?[Ao().splice(0,0,e.$importChildren(n))]:zh(n)?e.$importChildren(n):r(),match:gt.tag("div"),name:"@lexical/code/div"}),yb=[ft({$import:(e,n)=>[Ao().splice(0,0,e.$importChildren(n,{rules:Rk}))],match:gt.tag("table").classAll("js-file-line-container"),name:"@lexical/code/github-code-table"}),ft({$import:(e,n)=>e.$importChildren(n),match:gt.tag("td").classAll("js-file-line"),name:"@lexical/code/github-code-cell-by-class"}),Dk,Mk,wk],Hh=_e({dependencies:[co,sn(qo,{preprocess:[(e,n,r)=>{Cb(qr(e)?e.body:e)&&n.session.update(nT,(s)=>[...s,$k]),r()}],rules:yb})],name:"@lexical/code",nodes:()=>[Hl,Wl],register:(e)=>De(e.registerCommand(Oi,(n)=>{let r=X();return!(!j(r)||!hb(r))&&(n!==null&&n.preventDefault(),!0)},Pe),e.registerNodeTransform(Nu,(n)=>{n.getFormat()!==0&&An(n.getParent())&&n.setFormat(0)}))}),kk=_e({dependencies:[Hh],name:"@lexical/code/Import"});function Vs(e){if(!j(e))return!1;let n=e.anchor.getNode(),r=An(n)?n:n.getParent(),s=e.focus.getNode(),i=An(s)?s:s.getParent();return An(r)&&r.is(i)}function Sb(e){let n=e.getNodes(),r=[];if(n.length===1&&An(n[0]))return r;let s=[];for(let i=0;i<n.length;i++){let a=n[i];Ut(a)||Yt(a)||Ue(a)||Rd(169),Ue(a)?s.length>0&&(r.push(s),s=[]):s.push(a)}if(s.length>0){let i=e.isBackward()?e.anchor:e.focus,a=Jn(s[0].getKey(),0,"text");i.is(a)||r.push(s)}return r}function sb(e,n){let r=X();if(!j(r)||!Vs(r))return!1;let s=Sb(r),i=s.length;if(i===0&&r.isCollapsed())return e===no&&r.insertNodes([gn()]),!0;if(i===0&&e===no&&r.getTextContent()===`
18
- `){let a=gn(),l=fn(),c=r.isBackward()?"previous":"next";return r.insertNodes([a,l]),kn(dr(Zn(Xc(a,"next",0),kt(it(l,"next"))),c)),!0}for(let a=0;a<i;a++){let l=s[a];if(l.length>0){let c=l[0];if(a===0&&(c=rs(c)),e===no){let d=gn();if(c.insertBefore(d),a===0){let f=r.isBackward()?"focus":"anchor",g=Jn(c.getKey(),0,"text");r[f].is(g)&&r[f].set(d.getKey(),0,"text")}}else Yt(c)?c.remove():n!==void 0&&Ut(c)&&fb(c,n,r)}}return!0}function ib(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.offset,l=i.offset,c=s.getNode(),d=i.getNode(),f=e===oo;if(!Vs(r)||!Ut(c)&&!Yt(c)||!Ut(d)&&!Yt(d))return!1;if(!n.altKey){if(r.isCollapsed()){let N=c.getParentOrThrow();if(f&&a===0&&c.getPreviousSibling()===null){if(N.getPreviousSibling()===null)return N.selectPrevious(),n.preventDefault(),!1}else if(!f&&a===c.getTextContentSize()&&c.getNextSibling()===null){if(N.getNextSibling()===null)return N.selectNext(),n.preventDefault(),!1}}return!1}let g,p;if(c.isBefore(d)?(g=rs(c),p=Xs(d)):(g=rs(d),p=Xs(c)),g==null||p==null)return!1;let m=g.getNodesBetween(p);for(let N=0;N<m.length;N++){let T=m[N];if(!Ut(T)&&!Yt(T)&&!Ue(T))return!1}n.preventDefault(),n.stopPropagation();let _=f?g.getPreviousSibling():p.getNextSibling();if(!Ue(_))return!0;let x=f?_.getPreviousSibling():_.getNextSibling();if(x==null)return!0;let C=Ut(x)||Yt(x)||Ue(x)?f?rs(x):Xs(x):null,y=C!=null?C:x;return _.remove(),m.forEach((N)=>N.remove()),e===oo?(m.forEach((N)=>y.insertBefore(N)),y.insertBefore(_)):(y.insertAfter(_),y=_,m.forEach((N)=>{y.insertAfter(N),y=N})),r.setTextNodeRange(c,a,d,l),!0}function ab(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.getNode(),l=i.getNode(),c=e===Ri;if(!Vs(r)||!Ut(a)&&!Yt(a)||!Ut(l)&&!Yt(l))return!1;let d=l,f=cb(d)==="rtl"?!c:c,{key:g,offset:p,type:m}=s;if(f){let _=ub(d,i.offset);if(_!==null){let{node:x,offset:C}=_;Ue(x)?x.selectNext(0,0):r.setTextNodeRange(x,C,x,C)}else d.getParentOrThrow().selectStart()}else db(d).select();return n.shiftKey&&r.anchor.set(g,p,m),n.preventDefault(),n.stopPropagation(),!0}function Nb(e,n,r){return De(...r?[e.registerCommand(jo,(s)=>!s.altKey&&_p(An,s),Pe),e.registerCommand(bi,(s)=>_p(An,s),Pe),e.registerCommand(oo,(s)=>!s.altKey&&xp(An,s),Pe),e.registerCommand(Yr,(s)=>xp(An,s),Pe)]:[],e.registerCommand(Vr,(s)=>{let i=function(a){let l=X();if(!j(l)||!Vs(l))return null;let c=a?Yo:no,d=a?Yo:Ds,{anchor:f,focus:g}=l;if(f.is(g))return d;let p=Sb(l);if(p.length!==1)return c;let m=p[0],_,x;m.length===0&&Rd(285),l.isBackward()?(_=g,x=f):(_=f,x=g);let C=rs(m[0]),y=Xs(m[0]),N=Jn(C.getKey(),0,"text"),T=Jn(y.getKey(),y.getTextContentSize(),"text");return _.isBefore(N)||T.isBefore(x)?c:N.isBefore(_)||x.isBefore(T)?d:c}(s.shiftKey);return i!==null&&(s.preventDefault(),e.dispatchCommand(i),!0)},Pe),e.registerCommand(Ds,()=>!!Vs(X())&&(qc([gn()]),!0),Pe),e.registerCommand(no,()=>sb(no),Pe),e.registerCommand(Yo,()=>sb(Yo,n),Pe),e.registerCommand(oo,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();if(!Vs(i))return!1;let c=l.getParent();return i.isCollapsed()&&a.offset===0&&l.getPreviousSibling()===null&&An(c)&&c.getPreviousSibling()===null?(s.preventDefault(),!0):ib(oo,s)},Pe),e.registerCommand(jo,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();return!!Vs(i)&&(i.isCollapsed()&&a.offset===l.getTextContentSize()&&l.getNextSibling()===null&&An(l.getParentOrThrow())&&l.getParentOrThrow().getNextSibling()===null?(s.preventDefault(),!0):ib(jo,s))},Pe),e.registerCommand(Ri,(s)=>ab(Ri,s),Pe),e.registerCommand(yl,(s)=>ab(yl,s),Pe))}var Ik=_e({build:(e,n)=>Dt(n),config:We({disabled:!1,escapeWithArrows:!1,tabSize:void 0}),dependencies:[Hh],name:"@lexical/code-indent",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Nb(e,s.tabSize.value,s.escapeWithArrows.value)})}});var Ft=Wh,{$createCodeHighlightNode:Md,$createCodeNode:qs,$getCodeLineDirection:Eb,$getEndOfCodeInLine:Tb,$getFirstCodeNodeOfLine:bb,$getLastCodeNodeOfLine:vb,$getStartOfCodeInLine:Ob,$isCodeHighlightNode:oa,$isCodeNode:Zo,$outdentLeadingSpaces:Ab,$plainifyCodeContent:Rb,CodeExtension:Dd,CodeHighlightNode:Gl,CodeImportExtension:OU,CodeImportRules:AU,CodeIndentExtension:$d,CodeNode:ss,DEFAULT_CODE_LANGUAGE:wd,getDefaultCodeLanguage:Mb,registerCodeIndentation:Db}=Ft;var Qh={};Oe(Qh,{$convertFromMarkdownString:()=>qk,$convertSelectionToMarkdownString:()=>Qk,$convertToMarkdownString:()=>Zk,$generateNodesFromMarkdownString:()=>Jk,BOLD_ITALIC_STAR:()=>iv,BOLD_ITALIC_UNDERSCORE:()=>av,BOLD_STAR:()=>lv,BOLD_UNDERSCORE:()=>cv,CHECK_LIST:()=>Kk,CODE:()=>Yl,ELEMENT_TRANSFORMERS:()=>pv,HEADING:()=>ev,HIGHLIGHT:()=>sv,INLINE_CODE:()=>rv,ITALIC_STAR:()=>dv,ITALIC_UNDERSCORE:()=>fv,LINK:()=>gv,MULTILINE_ELEMENT_TRANSFORMERS:()=>hv,ORDERED_LIST:()=>ov,QUOTE:()=>tv,STRIKETHROUGH:()=>uv,TEXT_FORMAT_TRANSFORMERS:()=>mv,TEXT_MATCH_TRANSFORMERS:()=>_v,TRANSFORMERS:()=>ra,UNORDERED_LIST:()=>nv,isTableRowDivider:()=>qb,registerMarkdownShortcuts:()=>Xk});function Gh(e,n){let r={};for(let s of e){let i=n(s);i&&(r[i]?r[i].push(s):r[i]=[s])}return r}function Ld(e){let n=Gh(e,(r)=>r.type);return{element:n.element||[],multilineElement:n["multiline-element"]||[],textFormat:n["text-format"]||[],textMatch:n["text-match"]||[]}}var $b=/[!-/:-@[-`{-~\s]/,wb=/\s/,jh=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Lk=/^\s{0,3}$/;function Xl(e){if(!wn(e))return!1;let n=e.getFirstChild();return n==null||e.getChildrenSize()===1&&re(n)&&Lk.test(n.getTextContent())}function Yh(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(n,r)=>String.fromCodePoint(Number(r)))}var Gb=/^(\s*)(\d{1,})\.\s/,jb=/^(\s*)[-*+]\s/,Yb=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Vh=/^(#{1,6})\s/,Vb=/^>\s/,Xb=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Xh=/^[ \t]*`{3,}$/,Fk=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Pk=/^(?:\|)(.+)(?:\|)\s?$/;function qb(e){if(e[0]!=="|")return!1;let{length:n}=e,r=1,s=0;for(;r<n;){let i=r;for(e[i]===" "&&i++,e[i]===":"&&i++;e[i]==="-";)i++;if(e[i]===":"&&i++,e[i]===" "&&i++,e[i]!=="|")break;s++,r=i+1}return s>0&&(r===n||r===n-1&&/\s/.test(e[r]))}var kb=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Ib=/^<\/[a-z_][\w-]*\s*>/i,Lb=(e)=>new RegExp(`(?:${e.source})$`,e.flags),jl=Vo("mdListMarker",{parse:(e)=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),Fb=Vo("mdCodeFence",{parse:(e)=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Jb=Vo("mdHardLineBreak",{parse:(e)=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function qh(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let n=e.match(/^(.*?\S)( {2,})$/);return n?[n[1],n[2]]:null}function Bk(e){let n=e.getChildren(),r=n.length-1,s=n[r];if(!re(s))return null;let i=s.getTextContent(),a=qh(i);if(a!==null){let[l,c]=a;return s.setTextContent(l),c}return/^ {2,}$/.test(i)&&function(l,c){for(let d=c-1;d>=0;d--){if(Ue(l[d]))return!1;if(/\S/.test(l[d].getTextContent()))return!0}return!1}(n,r)?(s.setTextContent(""),i):null}function Zb(e){let n=fn(),r=Bk(e);return r!==null&&to(n,Jb,r),n}var Qb=(e)=>(n,r,s,i)=>{let a=e(s);a.append(...r),n.replace(a),i||a.select(0,0)},Zh=(e)=>(n,r,s,i)=>{if(Fl(n))return!1;let a=n.getPreviousSibling(),l=n.getNextSibling(),c=E0(e==="check"?s[3]==="x":void 0),d=s[0].trim()[0],f=e!=="bullet"&&e!=="check"||d!==jl.parse(d)?void 0:d;if(Oo(l)&&l.getListType()===e){f&&to(l,jl,f);let p=l.getFirstChild();p!==null?p.insertBefore(c):l.append(c),e==="number"&&l.setStart(Number(s[2])),n.remove()}else if(Oo(a)&&a.getListType()===e)f&&to(a,jl,f),a.append(c),n.remove();else{let p=T0(e,e==="number"?Number(s[2]):void 0);f&&to(p,jl,f),p.append(c),n.replace(p)}c.append(...r),i||c.select(0,0);let g=function(p){let m=p.match(/\t/g),_=p.match(/ /g),x=0;return m&&(x+=m.length),_&&(x+=Math.floor(_.length/4)),x}(s[1]);g&&c.setIndent(g)},Fd=(e,n,r,s)=>{let i=[],a=e.getChildren(),l=0;for(let c of a)if(vh(c)){if(c.getChildrenSize()===1){let _=c.getFirstChild();if(Oo(_)){let x=Fd(_,n,r+1,s);x&&i.push(x);continue}}if(s&&!c.getChildren().some((_)=>_.isSelected(s)))continue;let d=" ".repeat(4*r),f=e.getListType(),g=Ko(e,jl),p=f==="number"?`${e.getStart()+l}. `:f==="check"?`${g} [${c.getChecked()?"x":" "}] `:g+" ",m=n(c);f!=="number"&&(m=m.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(d+p+m),l++}return i.join(`
18
+ `){let a=gn(),l=fn(),c=r.isBackward()?"previous":"next";return r.insertNodes([a,l]),kn(dr(Zn(Xc(a,"next",0),kt(it(l,"next"))),c)),!0}for(let a=0;a<i;a++){let l=s[a];if(l.length>0){let c=l[0];if(a===0&&(c=rs(c)),e===no){let d=gn();if(c.insertBefore(d),a===0){let f=r.isBackward()?"focus":"anchor",g=Jn(c.getKey(),0,"text");r[f].is(g)&&r[f].set(d.getKey(),0,"text")}}else Yt(c)?c.remove():n!==void 0&&Ut(c)&&fb(c,n,r)}}return!0}function ib(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.offset,l=i.offset,c=s.getNode(),d=i.getNode(),f=e===oo;if(!Vs(r)||!Ut(c)&&!Yt(c)||!Ut(d)&&!Yt(d))return!1;if(!n.altKey){if(r.isCollapsed()){let N=c.getParentOrThrow();if(f&&a===0&&c.getPreviousSibling()===null){if(N.getPreviousSibling()===null)return N.selectPrevious(),n.preventDefault(),!1}else if(!f&&a===c.getTextContentSize()&&c.getNextSibling()===null){if(N.getNextSibling()===null)return N.selectNext(),n.preventDefault(),!1}}return!1}let g,p;if(c.isBefore(d)?(g=rs(c),p=Xs(d)):(g=rs(d),p=Xs(c)),g==null||p==null)return!1;let m=g.getNodesBetween(p);for(let N=0;N<m.length;N++){let T=m[N];if(!Ut(T)&&!Yt(T)&&!Ue(T))return!1}n.preventDefault(),n.stopPropagation();let _=f?g.getPreviousSibling():p.getNextSibling();if(!Ue(_))return!0;let x=f?_.getPreviousSibling():_.getNextSibling();if(x==null)return!0;let C=Ut(x)||Yt(x)||Ue(x)?f?rs(x):Xs(x):null,y=C!=null?C:x;return _.remove(),m.forEach((N)=>N.remove()),e===oo?(m.forEach((N)=>y.insertBefore(N)),y.insertBefore(_)):(y.insertAfter(_),y=_,m.forEach((N)=>{y.insertAfter(N),y=N})),r.setTextNodeRange(c,a,d,l),!0}function ab(e,n){let r=X();if(!j(r))return!1;let{anchor:s,focus:i}=r,a=s.getNode(),l=i.getNode(),c=e===Ri;if(!Vs(r)||!Ut(a)&&!Yt(a)||!Ut(l)&&!Yt(l))return!1;let d=l,f=cb(d)==="rtl"?!c:c,{key:g,offset:p,type:m}=s;if(f){let _=ub(d,i.offset);if(_!==null){let{node:x,offset:C}=_;Ue(x)?x.selectNext(0,0):r.setTextNodeRange(x,C,x,C)}else d.getParentOrThrow().selectStart()}else db(d).select();return n.shiftKey&&r.anchor.set(g,p,m),n.preventDefault(),n.stopPropagation(),!0}function Nb(e,n,r){return De(...r?[e.registerCommand(jo,(s)=>!s.altKey&&_p(An,s),Pe),e.registerCommand(bi,(s)=>_p(An,s),Pe),e.registerCommand(oo,(s)=>!s.altKey&&Cp(An,s),Pe),e.registerCommand(Yr,(s)=>Cp(An,s),Pe)]:[],e.registerCommand(Vr,(s)=>{let i=function(a){let l=X();if(!j(l)||!Vs(l))return null;let c=a?Yo:no,d=a?Yo:$s,{anchor:f,focus:g}=l;if(f.is(g))return d;let p=Sb(l);if(p.length!==1)return c;let m=p[0],_,x;m.length===0&&Rd(285),l.isBackward()?(_=g,x=f):(_=f,x=g);let C=rs(m[0]),y=Xs(m[0]),N=Jn(C.getKey(),0,"text"),T=Jn(y.getKey(),y.getTextContentSize(),"text");return _.isBefore(N)||T.isBefore(x)?c:N.isBefore(_)||x.isBefore(T)?d:c}(s.shiftKey);return i!==null&&(s.preventDefault(),e.dispatchCommand(i),!0)},Pe),e.registerCommand($s,()=>!!Vs(X())&&(qc([gn()]),!0),Pe),e.registerCommand(no,()=>sb(no),Pe),e.registerCommand(Yo,()=>sb(Yo,n),Pe),e.registerCommand(oo,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();if(!Vs(i))return!1;let c=l.getParent();return i.isCollapsed()&&a.offset===0&&l.getPreviousSibling()===null&&An(c)&&c.getPreviousSibling()===null?(s.preventDefault(),!0):ib(oo,s)},Pe),e.registerCommand(jo,(s)=>{let i=X();if(!j(i))return!1;let{anchor:a}=i,l=a.getNode();return!!Vs(i)&&(i.isCollapsed()&&a.offset===l.getTextContentSize()&&l.getNextSibling()===null&&An(l.getParentOrThrow())&&l.getParentOrThrow().getNextSibling()===null?(s.preventDefault(),!0):ib(jo,s))},Pe),e.registerCommand(Ri,(s)=>ab(Ri,s),Pe),e.registerCommand(yl,(s)=>ab(yl,s),Pe))}var Ik=_e({build:(e,n)=>Dt(n),config:We({disabled:!1,escapeWithArrows:!1,tabSize:void 0}),dependencies:[Hh],name:"@lexical/code-indent",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Nb(e,s.tabSize.value,s.escapeWithArrows.value)})}});var Ft=Wh,{$createCodeHighlightNode:Md,$createCodeNode:qs,$getCodeLineDirection:Eb,$getEndOfCodeInLine:Tb,$getFirstCodeNodeOfLine:bb,$getLastCodeNodeOfLine:vb,$getStartOfCodeInLine:Ob,$isCodeHighlightNode:oa,$isCodeNode:Zo,$outdentLeadingSpaces:Ab,$plainifyCodeContent:Rb,CodeExtension:Dd,CodeHighlightNode:Gl,CodeImportExtension:OU,CodeImportRules:AU,CodeIndentExtension:$d,CodeNode:ss,DEFAULT_CODE_LANGUAGE:wd,getDefaultCodeLanguage:Mb,registerCodeIndentation:Db}=Ft;var Qh={};Oe(Qh,{$convertFromMarkdownString:()=>qk,$convertSelectionToMarkdownString:()=>Qk,$convertToMarkdownString:()=>Zk,$generateNodesFromMarkdownString:()=>Jk,BOLD_ITALIC_STAR:()=>iv,BOLD_ITALIC_UNDERSCORE:()=>av,BOLD_STAR:()=>lv,BOLD_UNDERSCORE:()=>cv,CHECK_LIST:()=>Kk,CODE:()=>Yl,ELEMENT_TRANSFORMERS:()=>pv,HEADING:()=>ev,HIGHLIGHT:()=>sv,INLINE_CODE:()=>rv,ITALIC_STAR:()=>dv,ITALIC_UNDERSCORE:()=>fv,LINK:()=>gv,MULTILINE_ELEMENT_TRANSFORMERS:()=>hv,ORDERED_LIST:()=>ov,QUOTE:()=>tv,STRIKETHROUGH:()=>uv,TEXT_FORMAT_TRANSFORMERS:()=>mv,TEXT_MATCH_TRANSFORMERS:()=>_v,TRANSFORMERS:()=>ra,UNORDERED_LIST:()=>nv,isTableRowDivider:()=>qb,registerMarkdownShortcuts:()=>Xk});function Gh(e,n){let r={};for(let s of e){let i=n(s);i&&(r[i]?r[i].push(s):r[i]=[s])}return r}function Ld(e){let n=Gh(e,(r)=>r.type);return{element:n.element||[],multilineElement:n["multiline-element"]||[],textFormat:n["text-format"]||[],textMatch:n["text-match"]||[]}}var $b=/[!-/:-@[-`{-~\s]/,wb=/\s/,jh=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Lk=/^\s{0,3}$/;function Xl(e){if(!wn(e))return!1;let n=e.getFirstChild();return n==null||e.getChildrenSize()===1&&re(n)&&Lk.test(n.getTextContent())}function Yh(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(n,r)=>String.fromCodePoint(Number(r)))}var Gb=/^(\s*)(\d{1,})\.\s/,jb=/^(\s*)[-*+]\s/,Yb=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Vh=/^(#{1,6})\s/,Vb=/^>\s/,Xb=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Xh=/^[ \t]*`{3,}$/,Fk=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Pk=/^(?:\|)(.+)(?:\|)\s?$/;function qb(e){if(e[0]!=="|")return!1;let{length:n}=e,r=1,s=0;for(;r<n;){let i=r;for(e[i]===" "&&i++,e[i]===":"&&i++;e[i]==="-";)i++;if(e[i]===":"&&i++,e[i]===" "&&i++,e[i]!=="|")break;s++,r=i+1}return s>0&&(r===n||r===n-1&&/\s/.test(e[r]))}var kb=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Ib=/^<\/[a-z_][\w-]*\s*>/i,Lb=(e)=>new RegExp(`(?:${e.source})$`,e.flags),jl=Vo("mdListMarker",{parse:(e)=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),Fb=Vo("mdCodeFence",{parse:(e)=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Jb=Vo("mdHardLineBreak",{parse:(e)=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function qh(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let n=e.match(/^(.*?\S)( {2,})$/);return n?[n[1],n[2]]:null}function Bk(e){let n=e.getChildren(),r=n.length-1,s=n[r];if(!re(s))return null;let i=s.getTextContent(),a=qh(i);if(a!==null){let[l,c]=a;return s.setTextContent(l),c}return/^ {2,}$/.test(i)&&function(l,c){for(let d=c-1;d>=0;d--){if(Ue(l[d]))return!1;if(/\S/.test(l[d].getTextContent()))return!0}return!1}(n,r)?(s.setTextContent(""),i):null}function Zb(e){let n=fn(),r=Bk(e);return r!==null&&to(n,Jb,r),n}var Qb=(e)=>(n,r,s,i)=>{let a=e(s);a.append(...r),n.replace(a),i||a.select(0,0)},Zh=(e)=>(n,r,s,i)=>{if(Fl(n))return!1;let a=n.getPreviousSibling(),l=n.getNextSibling(),c=S0(e==="check"?s[3]==="x":void 0),d=s[0].trim()[0],f=e!=="bullet"&&e!=="check"||d!==jl.parse(d)?void 0:d;if(Oo(l)&&l.getListType()===e){f&&to(l,jl,f);let p=l.getFirstChild();p!==null?p.insertBefore(c):l.append(c),e==="number"&&l.setStart(Number(s[2])),n.remove()}else if(Oo(a)&&a.getListType()===e)f&&to(a,jl,f),a.append(c),n.remove();else{let p=N0(e,e==="number"?Number(s[2]):void 0);f&&to(p,jl,f),p.append(c),n.replace(p)}c.append(...r),i||c.select(0,0);let g=function(p){let m=p.match(/\t/g),_=p.match(/ /g),x=0;return m&&(x+=m.length),_&&(x+=Math.floor(_.length/4)),x}(s[1]);g&&c.setIndent(g)},Fd=(e,n,r,s)=>{let i=[],a=e.getChildren(),l=0;for(let c of a)if(vh(c)){if(c.getChildrenSize()===1){let _=c.getFirstChild();if(Oo(_)){let x=Fd(_,n,r+1,s);x&&i.push(x);continue}}if(s&&!c.getChildren().some((_)=>_.isSelected(s)))continue;let d=" ".repeat(4*r),f=e.getListType(),g=Ko(e,jl),p=f==="number"?`${e.getStart()+l}. `:f==="check"?`${g} [${c.getChecked()?"x":" "}] `:g+" ",m=n(c);f!=="number"&&(m=m.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(d+p+m),l++}return i.join(`
19
19
  `)},ev={dependencies:[md],export:(e,n)=>{if(!Fl(e))return null;let r=Number(e.getTag().slice(1));return"#".repeat(r)+" "+n(e)},regExp:Vh,replace:Qb((e)=>{let n="h"+e[1].length;return gd(n)}),triggerOnEnter:!0,type:"element"},tv={dependencies:[_d],export:(e,n)=>{if(!hd(e))return null;let r=n(e).split(`
20
20
  `),s=[];for(let i of r)s.push("> "+i);return s.join(`
21
21
  `)},regExp:Vb,replace:(e,n,r,s)=>{if(s){let a=e.getPreviousSibling();if(hd(a))return a.splice(a.getChildrenSize(),0,[Zb(a),...n]),void e.remove()}let i=pd();i.append(...n),e.replace(i),s||i.select(0,0)},triggerOnEnter:!0,type:"element"},Yl={dependencies:[ss],export:(e)=>{if(!Zo(e))return null;let n=e.getTextContent(),r=Ko(e,Fb);if(n.indexOf(r)>-1){let s=n.match(/`{3,}/g);if(s){let i=Math.max(...s.map((a)=>a.length));r="`".repeat(i+1)}}return r+(e.getLanguage()||"")+(n?`
@@ -29,7 +29,7 @@ import{ks,aa,at,O,P,dt,h,He,D,b,u,S,Z,t,o,K,L,B,Me,Qa,tn,A,I,ke,Po,nn,Re,E,h0,g0
29
29
  `.concat(C):C)}return p.join(`
30
30
  `)}}(e,r)(n)}function Qk(e=ra,n,r=!1){if(!n||j(n)&&n.isCollapsed())return"";return function(i,a=!1){let l=Ld(i),c=[...l.multilineElement,...l.element],d=!a,f=l.textFormat.filter((g)=>g.format.length===1).sort((g,p)=>Number(g.format.includes("code"))-Number(p.format.includes("code")));return(g)=>{let p=[],m=Je().getChildren();for(let _=0;_<m.length;_++){let x=m[_],{shouldInclude:C,markdown:y}=zk(x,g,c,f,l.textMatch,a);C&&y!=null&&p.push(d&&_>0&&!Xl(x)&&!Xl(m[_-1])?`
31
31
  `.concat(y):y)}return p.join(`
32
- `)}}(e,r)(n)}var lt=Qh,{$convertFromMarkdownString:em,$convertSelectionToMarkdownString:LU,$convertToMarkdownString:Nv,$generateNodesFromMarkdownString:FU,BOLD_ITALIC_STAR:PU,BOLD_ITALIC_UNDERSCORE:BU,BOLD_STAR:KU,BOLD_UNDERSCORE:zU,CHECK_LIST:Ev,CODE:UU,ELEMENT_TRANSFORMERS:Tv,HEADING:HU,HIGHLIGHT:WU,INLINE_CODE:GU,ITALIC_STAR:jU,ITALIC_UNDERSCORE:YU,LINK:VU,MULTILINE_ELEMENT_TRANSFORMERS:bv,ORDERED_LIST:XU,QUOTE:qU,STRIKETHROUGH:JU,TEXT_FORMAT_TRANSFORMERS:vv,TEXT_MATCH_TRANSFORMERS:Ov,TRANSFORMERS:Av,UNORDERED_LIST:ZU,isTableRowDivider:QU,registerMarkdownShortcuts:Rv}=lt;var tm={};Oe(tm,{DEFAULT_TRANSFORMERS:()=>Mv,MarkdownShortcutPlugin:()=>eI});S();var Mv=[{dependencies:[ju],export:(e)=>zN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,n,r,s)=>{let i=Gu();s||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...Av];function eI({transformers:e=Mv}){let[n]=st();return h(()=>Rv(n,e),[n,e]),null}var Dv=tm,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:$v}=Dv;var nm={};Oe(nm,{OnChangePlugin:()=>nI});S();var tI=pn?He:h;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:n=!1,onChange:r}){let[s]=st();return tI(()=>{if(r)return s.registerUpdateListener(({editorState:i,dirtyElements:a,dirtyLeaves:l,prevEditorState:c,tags:d})=>{n&&a.size===0&&l.size===0||e&&d.has(Gr)||c.isEmpty()||r(i,s,d)})},[s,e,n,r]),null}var oI=nm,wv=oI.OnChangePlugin;S();var om={};Oe(om,{LexicalErrorBoundary:()=>rI});class kv extends ks{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:n,onError:r}){return t(kv,{fallback:n===void 0?t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):n,onError:r,children:e})}var sI=om,Iv=sI.LexicalErrorBoundary;var hH=z(rm(),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(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&amp;/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:Prism.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,n){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\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:[n,"language-"+n],inside:Prism.languages[n]},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(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(g){return g=g.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.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:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:e.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:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<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:r(/!?\[(?:(?!\])<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(g){["url","bold","italic","strike","code-snippet"].forEach(function(p){if(g!==p)e.languages.markdown[g].inside.content.inside[p]=e.languages.markdown[p]})}),e.hooks.add("after-tokenize",function(g){if(g.language!=="markdown"&&g.language!=="md")return;function p(m){if(!m||typeof m==="string")return;for(var _=0,x=m.length;_<x;_++){var C=m[_];if(C.type!=="code"){p(C.content);continue}var y=C.content[1],N=C.content[3];if(y&&N&&y.type==="code-language"&&N.type==="code-block"&&typeof y.content==="string"){var T=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");T=(/[a-z][\w-]*/i.exec(T)||[""])[0].toLowerCase();var v="language-"+T;if(!N.alias)N.alias=[v];else if(typeof N.alias==="string")N.alias=[N.alias,v];else N.alias.push(v)}}}p(g.tokens)}),e.hooks.add("wrap",function(g){if(g.type!=="code-block")return;var p="";for(var m=0,_=g.classes.length;m<_;m++){var x=g.classes[m],C=/language-(.+)/.exec(x);if(C){p=C[1];break}}var y=e.languages[p];if(!y){if(p&&p!=="none"&&e.plugins.autoloader){var N="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);g.attributes.id=N,e.plugins.autoloader.loadLanguages(p,function(){var T=document.getElementById(N);if(T)T.innerHTML=e.highlight(T.textContent,e.languages[p],p)})}}else g.content=e.highlight(f(g.content),y,p)});var l=RegExp(e.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;function f(g){var p=g.replace(l,"");return p=p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(m,_){if(_=_.toLowerCase(),_[0]==="#"){var x;if(_[1]==="x")x=parseInt(_.slice(2),16);else x=Number(_.slice(1));return d(x)}else{var C=c[_];if(C)return C;return m}}),p}e.languages.md=e.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(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.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(e){var n=e.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:/[|{}[\];(),.]/};n.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:n},boolean:n.boolean,variable:n.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(e){var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.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(e){e.inside.interpolation.inside=Prism.languages.swift});(function(e){e.languages.typescript=e.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/}),e.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 e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.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:n}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var n=/\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/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[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:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.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/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.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":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var n=/\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/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.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:n,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/}),e.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 r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.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:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];if(!/^\w+$/.test(r))i.push(/\w+/.exec(r)[0]);if(r==="diff")i.push("bold");e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
32
+ `)}}(e,r)(n)}var lt=Qh,{$convertFromMarkdownString:em,$convertSelectionToMarkdownString:LU,$convertToMarkdownString:Nv,$generateNodesFromMarkdownString:FU,BOLD_ITALIC_STAR:PU,BOLD_ITALIC_UNDERSCORE:BU,BOLD_STAR:KU,BOLD_UNDERSCORE:zU,CHECK_LIST:Ev,CODE:UU,ELEMENT_TRANSFORMERS:Tv,HEADING:HU,HIGHLIGHT:WU,INLINE_CODE:GU,ITALIC_STAR:jU,ITALIC_UNDERSCORE:YU,LINK:VU,MULTILINE_ELEMENT_TRANSFORMERS:bv,ORDERED_LIST:XU,QUOTE:qU,STRIKETHROUGH:JU,TEXT_FORMAT_TRANSFORMERS:vv,TEXT_MATCH_TRANSFORMERS:Ov,TRANSFORMERS:Av,UNORDERED_LIST:ZU,isTableRowDivider:QU,registerMarkdownShortcuts:Rv}=lt;var tm={};Oe(tm,{DEFAULT_TRANSFORMERS:()=>Mv,MarkdownShortcutPlugin:()=>eI});S();var Mv=[{dependencies:[ju],export:(e)=>zN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,n,r,s)=>{let i=Gu();s||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...Av];function eI({transformers:e=Mv}){let[n]=st();return h(()=>Rv(n,e),[n,e]),null}var Dv=tm,{DEFAULT_TRANSFORMERS:sH,MarkdownShortcutPlugin:$v}=Dv;var nm={};Oe(nm,{OnChangePlugin:()=>nI});S();var tI=pn?He:h;function nI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:n=!1,onChange:r}){let[s]=st();return tI(()=>{if(r)return s.registerUpdateListener(({editorState:i,dirtyElements:a,dirtyLeaves:l,prevEditorState:c,tags:d})=>{n&&a.size===0&&l.size===0||e&&d.has(Gr)||c.isEmpty()||r(i,s,d)})},[s,e,n,r]),null}var oI=nm,wv=oI.OnChangePlugin;S();var om={};Oe(om,{LexicalErrorBoundary:()=>rI});class kv extends Rs{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),n)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function rI({children:e,fallback:n,onError:r}){return t(kv,{fallback:n===void 0?t("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):n,onError:r,children:e})}var sI=om,Iv=sI.LexicalErrorBoundary;var hH=z(rm(),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(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&amp;/,"&")});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:Prism.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,n){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\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:[n,"language-"+n],inside:Prism.languages[n]},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(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(g){return g=g.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+g+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.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:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:e.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:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<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:r(/!?\[(?:(?!\])<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(g){["url","bold","italic","strike","code-snippet"].forEach(function(p){if(g!==p)e.languages.markdown[g].inside.content.inside[p]=e.languages.markdown[p]})}),e.hooks.add("after-tokenize",function(g){if(g.language!=="markdown"&&g.language!=="md")return;function p(m){if(!m||typeof m==="string")return;for(var _=0,x=m.length;_<x;_++){var C=m[_];if(C.type!=="code"){p(C.content);continue}var y=C.content[1],N=C.content[3];if(y&&N&&y.type==="code-language"&&N.type==="code-block"&&typeof y.content==="string"){var T=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");T=(/[a-z][\w-]*/i.exec(T)||[""])[0].toLowerCase();var v="language-"+T;if(!N.alias)N.alias=[v];else if(typeof N.alias==="string")N.alias=[N.alias,v];else N.alias.push(v)}}}p(g.tokens)}),e.hooks.add("wrap",function(g){if(g.type!=="code-block")return;var p="";for(var m=0,_=g.classes.length;m<_;m++){var x=g.classes[m],C=/language-(.+)/.exec(x);if(C){p=C[1];break}}var y=e.languages[p];if(!y){if(p&&p!=="none"&&e.plugins.autoloader){var N="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);g.attributes.id=N,e.plugins.autoloader.loadLanguages(p,function(){var T=document.getElementById(N);if(T)T.innerHTML=e.highlight(T.textContent,e.languages[p],p)})}}else g.content=e.highlight(f(g.content),y,p)});var l=RegExp(e.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;function f(g){var p=g.replace(l,"");return p=p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(m,_){if(_=_.toLowerCase(),_[0]==="#"){var x;if(_[1]==="x")x=parseInt(_.slice(2),16);else x=Number(_.slice(1));return d(x)}else{var C=c[_];if(C)return C;return m}}),p}e.languages.md=e.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(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.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\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var r=e.languages.markup;if(r)r.tag.addInlined("style","css"),r.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(e){var n=e.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:/[|{}[\];(),.]/};n.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:n},boolean:n.boolean,variable:n.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(e){var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;for(var r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.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(e){e.inside.interpolation.inside=Prism.languages.swift});(function(e){e.languages.typescript=e.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/}),e.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 e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.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:n}}}}),e.languages.ts=e.languages.typescript})(Prism);(function(e){var n=/\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/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[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:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.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/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.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":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.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 n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism);(function(e){var n=/\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/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.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:n,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/}),e.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 r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.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:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];if(!/^\w+$/.test(r))i.push(/\w+/.exec(r)[0]);if(r==="diff")i.push("bold");e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
33
33
  ?|
34
34
  |(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:n})})(Prism);Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var DH=globalThis.Prism||window.Prism;var cm={};Oe(cm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>am,CODE_LANGUAGE_MAP:()=>Pv,CodePrismExtension:()=>hI,PrismTokenizer:()=>lm,getCodeLanguageOptions:()=>uI,getCodeLanguages:()=>cI,getCodeThemeOptions:()=>dI,getLanguageFriendlyName:()=>lI,isCodeLanguageLoaded:()=>Kv,loadCodeLanguage:()=>zv,normalizeCodeLanguage:()=>Bv,registerCodeHighlighting:()=>pI});var IH=z(rm(),1);(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),e.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
35
35
  ?|
@@ -37,6 +37,6 @@ import{ks,aa,at,O,P,dt,h,He,D,b,u,S,Z,t,o,K,L,B,Me,Qa,tn,A,I,ke,Po,nn,Re,E,h0,g0
37
37
  `+ ++l);r.setAttribute("data-gutter",a)}function Uv(e,n,r,s){let{nodesCurrentlyHighlighting:i}=r,a=s.getKey();s.getLanguage()===void 0&&n.defaultLanguage!==null&&s.setLanguage(n.defaultLanguage);let l=s.getLanguage()||n.defaultLanguage;if(l){if(!Kv(l))return s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1),void zv();s.getIsSyntaxHighlightSupported()||s.setIsSyntaxHighlightSupported(!0)}else s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1);i.has(a)||(i.add(a),r.didTransform||(r.didTransform=!0,zy(()=>{r.didTransform=!1,i.clear()})),function(c,d){let f=Rt(c);if(!Zo(f)||!f.isAttached())return;let g=X();if(!j(g))return void d();let p=g.anchor,m=p.offset,_=p.type==="element"&&Ue(f.getChildAtIndex(p.offset-1)),x=0;if(!_){let C=p.getNode();x=m+C.getPreviousSiblings().reduce((y,N)=>y+N.getTextContentSize(),0)}if(!d())return;if(_)return void p.getNode().select(m,m);f.getChildren().some((C)=>{let y=re(C);if(y||Ue(C)){let N=C.getTextContentSize();if(y&&N>=x)return C.select(x,x),!0;x-=N}return!1})}(a,()=>{let c=Rt(a);if(!Zo(c)||!c.isAttached())return!1;let d=c.getLanguage()||n.defaultLanguage,f=n.$tokenize(c,d??void 0),g=function(x,C){let y=0;for(;y<x.length&&Fv(x[y],C[y]);)y++;let N=x.length,T=C.length,v=Math.min(N,T)-y,R=0;for(;R<v;)if(R++,!Fv(x[N-R],C[T-R])){R--;break}let F=y,k=N-R,H=C.slice(y,T-R);return{from:F,nodesForReplacement:H,to:k}}(c.getChildren(),f),{from:p,to:m,nodesForReplacement:_}=g;return!(p===m&&!_.length)&&(s.splice(p,m-p,_),!0)}))}function Fv(e,n){return oa(e)&&oa(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||Yt(e)&&Yt(n)||Ue(e)&&Ue(n)}function Hv(e,n){let r=[];e._headless!==!0&&r.push(e.registerMutationListener(ss,(i)=>{e.read("latest",()=>{for(let[a,l]of i)if(l!=="destroyed"){let c=Rt(a);c!==null&&gI(c,e)}})},{skipInitialization:!1}));let s={didTransform:!1,nodesCurrentlyHighlighting:new Set};return r.push(e.registerNodeTransform(ss,Uv.bind(null,e,n,s)),e.registerNodeTransform(Ln,Lv.bind(null,e,n,s)),e.registerNodeTransform(Gl,Lv.bind(null,e,n,s))),De(...r)}function pI(e,n=lm){if(!e.hasNodes([ss,Gl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return De(Hv(e,n),Db(e))}var hI=_e({build:(e,n)=>Dt(n),config:We({disabled:!1,tokenizer:lm}),dependencies:[Dd,$d],name:"@lexical/code-prism",register:(e,n,r)=>{let s=r.getOutput();return Nt(()=>{if(!s.disabled.value)return Hv(e,s.tokenizer.value)})}});var go=cm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:um,CODE_LANGUAGE_MAP:dm,CodePrismExtension:JH,PrismTokenizer:fm,getCodeLanguageOptions:gm,getCodeLanguages:pm,getCodeThemeOptions:hm,getLanguageFriendlyName:mm,isCodeLanguageLoaded:ZH,loadCodeLanguage:QH,normalizeCodeLanguage:Bd,registerCodeHighlighting:_m}=go;var xm={};Oe(xm,{$createCodeHighlightNode:()=>Md,$createCodeNode:()=>qs,$getCodeLineDirection:()=>Eb,$getEndOfCodeInLine:()=>Tb,$getFirstCodeNodeOfLine:()=>bb,$getLastCodeNodeOfLine:()=>vb,$getStartOfCodeInLine:()=>Ob,$isCodeHighlightNode:()=>oa,$isCodeNode:()=>Zo,$outdentLeadingSpaces:()=>Ab,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>_I,CODE_LANGUAGE_MAP:()=>xI,CodeExtension:()=>Dd,CodeHighlightNode:()=>Gl,CodeIndentExtension:()=>$d,CodeNode:()=>ss,DEFAULT_CODE_LANGUAGE:()=>wd,PrismTokenizer:()=>bI,getCodeLanguageOptions:()=>CI,getCodeLanguages:()=>yI,getCodeThemeOptions:()=>SI,getDefaultCodeLanguage:()=>Mb,getLanguageFriendlyName:()=>NI,normalizeCodeLang:()=>EI,normalizeCodeLanguage:()=>TI,registerCodeHighlighting:()=>vI});var _I=um,xI=dm,CI=gm,yI=pm,SI=hm,NI=mm,EI=Bd,TI=Bd,bI=fm,vI=_m;var pt=xm,{$createCodeHighlightNode:tW,$createCodeNode:Gv,$getCodeLineDirection:nW,$getEndOfCodeInLine:oW,$getFirstCodeNodeOfLine:rW,$getLastCodeNodeOfLine:sW,$getStartOfCodeInLine:iW,$isCodeHighlightNode:aW,$isCodeNode:lW,$outdentLeadingSpaces:cW,CODE_LANGUAGE_FRIENDLY_NAME_MAP:uW,CODE_LANGUAGE_MAP:dW,CodeExtension:fW,CodeHighlightNode:gW,CodeIndentExtension:pW,CodeNode:jv,DEFAULT_CODE_LANGUAGE:hW,PrismTokenizer:mW,getCodeLanguageOptions:_W,getCodeLanguages:xW,getCodeThemeOptions:CW,getDefaultCodeLanguage:yW,getLanguageFriendlyName:SW,normalizeCodeLang:NW,normalizeCodeLanguage:EW,registerCodeHighlighting:TW}=pt;var Fm={};Oe(Fm,{$computeTableCellRectBoundary:()=>Jl,$computeTableMap:()=>ln,$computeTableMapSkipCellCheck:()=>po,$createTableCellNode:()=>_n,$createTableNode:()=>nc,$createTableNodeWithDimensions:()=>eO,$createTableRowNode:()=>Sr,$createTableSelection:()=>GI,$createTableSelectionFrom:()=>Gd,$deleteTableColumn:()=>LI,$deleteTableColumnAtSelection:()=>sO,$deleteTableColumn__EXPERIMENTAL:()=>PI,$deleteTableRowAtSelection:()=>rO,$deleteTableRow__EXPERIMENTAL:()=>FI,$findCellNode:()=>la,$findTableNode:()=>Qs,$getElementForTableNode:()=>mO,$getNodeTriplet:()=>Ht,$getTableAndElementByKey:()=>Im,$getTableCellNodeFromLexicalNode:()=>AI,$getTableCellNodeRect:()=>Tm,$getTableColumnIndexFromTableCellNode:()=>MI,$getTableNodeFromLexicalNodeOrThrow:()=>Yd,$getTableRowIndexFromTableCellNode:()=>RI,$getTableRowNodeFromTableCellNodeOrThrow:()=>Dm,$insertTableColumn:()=>kI,$insertTableColumnAtNode:()=>Wd,$insertTableColumnAtSelection:()=>oO,$insertTableColumn__EXPERIMENTAL:()=>II,$insertTableRow:()=>$I,$insertTableRowAtNode:()=>Hd,$insertTableRowAtSelection:()=>nO,$insertTableRow__EXPERIMENTAL:()=>wI,$isScrollableTablesActive:()=>ec,$isSimpleTable:()=>km,$isStickyScrollbarActive:()=>Mm,$isTableCellNode:()=>xe,$isTableNode:()=>rt,$isTableRowNode:()=>Ke,$isTableSelection:()=>je,$mergeCells:()=>iO,$moveTableColumn:()=>zI,$moveTableRow:()=>UI,$removeTableRowAtIndex:()=>DI,$setTableColumnIsHeader:()=>WI,$setTableRowIsHeader:()=>HI,$unmergeCell:()=>KI,$unmergeCellNode:()=>wm,INSERT_TABLE_COMMAND:()=>Qv,TableCellHeaderStates:()=>ve,TableCellNode:()=>Cr,TableExtension:()=>SO,TableImportExtension:()=>f1,TableImportRules:()=>yO,TableNode:()=>Nr,TableObserver:()=>Lm,TableRowNode:()=>fa,TableRowSchema:()=>d1,TableSchema:()=>u1,applyTableHandlers:()=>uO,getDOMCellFromTarget:()=>Zl,getTableElement:()=>Qo,getTableObserverFromTableElement:()=>bm,registerTableCellUnmergeTransform:()=>_O,registerTablePlugin:()=>CO,registerTableSelectionObserver:()=>xO,setScrollableTablesActive:()=>hO});var ca=/^(\d+(?:\.\d+)?)px$/,ve={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Cr extends ct{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:ct,importDOM:{td:()=>({conversion:Yv,priority:0}),th:()=>({conversion:Yv,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign,this.__colSpan=e.__colSpan,this.__headerState=e.__headerState,this.__width=e.__width}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=ve.NO_STATUS,n=1,r,s){super(s),this.__colSpan=n,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let n=Xe().createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),Nm(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),n}exportDOM(e){let n=super.exportDOM(e);if(ye(n.element)){let r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...Nm(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(e){let n=this.getWritable();return n.__colSpan=e,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let n=this.getWritable();return n.__rowSpan=e,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,n=ve.BOTH){let r=this.getWritable();return r.__headerState=e&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let n=this.getWritable();return n.__width=e,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let n=this.getWritable();return n.__backgroundColor=e,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let n=this.getWritable();return n.__verticalAlign=e||void 0,n}toggleHeaderStyle(e){let n=this.getWritable();return(n.__headerState&e)===e?n.__headerState-=e:n.__headerState+=e,n}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ve.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Nm(e){return e==="middle"||e==="bottom"}function Yv(e){let n=e,r=e.nodeName.toLowerCase(),s;ca.test(n.style.width)&&(s=parseFloat(n.style.width));let i=ve.NO_STATUS;if(r==="th"){let C=n.getAttribute("scope");if(C==="col")i=ve.COLUMN;else if(C==="row")i=ve.ROW;else{let y=n.parentElement,N=ye(y)&&y.nodeName.toLowerCase()==="tr"&&ye(y.parentElement)&&(y.parentElement.nodeName.toLowerCase()==="thead"||y.rowIndex===0),T=n.cellIndex===0;N&&(i|=ve.ROW),T&&(i|=ve.COLUMN),i===ve.NO_STATUS&&(i=ve.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;Nm(c)&&(a.__verticalAlign=c);let d=n.style,f=(d&&d.textDecoration||"").split(" "),g=d.fontWeight==="700"||d.fontWeight==="bold",p=f.includes("line-through"),m=d.fontStyle==="italic",_=f.includes("underline"),x=d.color;return{after:(C)=>{let y=[],N=null,T=()=>{if(N){let v=N.getFirstChild();Ue(v)&&N.getChildrenSize()===1&&v.remove()}};for(let v of C)if(Ug(v)||re(v)||Ue(v)){if(re(v)&&(g&&v.toggleFormat("bold"),p&&v.toggleFormat("strikethrough"),m&&v.toggleFormat("italic"),_&&v.toggleFormat("underline"),x)){let R=v.getStyle();R.includes("color:")||v.setStyle(R+`color: ${x};`)}N?N.append(v):(N=Se().append(v),y.push(N))}else y.push(v),T(),N=null;return T(),y.length===0&&y.push(Se()),y},node:a}}function _n(e=ve.NO_STATUS,n=1,r){return un(new Cr(e,n,r))}function xe(e){return e instanceof Cr}var Qv=bn("INSERT_TABLE_COMMAND");function pe(e,...n){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(let i of n)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class fa extends ct{__height;$config(){return this.config("tablerow",{extends:ct,importDOM:{tr:()=>({conversion:OI,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__height=e.__height}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e=void 0,n){super(n),this.__height=e}exportJSON(){let e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){let n=Xe().createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,e.theme.tableRow),n}extractWithChild(e,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){let n=this.getWritable();return n.__height=e,n}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function OI(e){let n=e,r;return ca.test(n.style.height)&&(r=parseFloat(n.style.height)),{after:(s)=>Tl(s,xe),node:Sr(r)}}function Sr(e){return un(new fa(e))}function Ke(e){return e instanceof fa}function eO(e,n,r=!0){let s=nc();for(let i=0;i<e;i++){let a=Sr();for(let l=0;l<n;l++){let c=ve.NO_STATUS;typeof r=="object"?(i===0&&r.rows&&(c|=ve.ROW),l===0&&r.columns&&(c|=ve.COLUMN)):r&&(i===0&&(c|=ve.ROW),l===0&&(c|=ve.COLUMN));let d=_n(c),f=Se();f.append(yt()),d.append(f),a.append(d)}s.append(a)}return s}function AI(e){let n=he(e,(r)=>xe(r));return xe(n)?n:null}function Dm(e){let n=he(e,(r)=>Ke(r));if(Ke(n))return n;throw Error("Expected table cell to be inside of table row.")}function Yd(e){let n=he(e,(r)=>rt(r));if(rt(n))return n;throw Error("Expected table cell to be inside of table.")}function RI(e){let n=Dm(e);return Yd(n).getChildren().findIndex((r)=>r.is(n))}function MI(e){return Dm(e).getChildren().findIndex((n)=>n.is(e))}function tO(e,n){let r=Yd(e),{x:s,y:i}=r.getCordsFromCellNode(e,n);return{above:r.getCellNodeFromCords(s,i-1,n),below:r.getCellNodeFromCords(s,i+1,n),left:r.getCellNodeFromCords(s-1,i,n),right:r.getCellNodeFromCords(s+1,i,n)}}function DI(e,n){let r=e.getChildren();if(n>=r.length||n<0)throw Error("Expected table cell to be inside of table row.");return r[n].remove(),e}function $I(e,n,r=!0,s,i){let a=e.getChildren();if(n>=a.length||n<0)throw Error("Table row target index out of range");let l=a[n];if(!Ke(l))throw Error("Row before insertion index does not exist.");for(let c=0;c<s;c++){let d=l.getChildren(),f=d.length,g=Sr();for(let p=0;p<f;p++){let m=d[p];xe(m)||pe(12);let{above:_,below:x}=tO(m,i),C=ve.NO_STATUS,y=_&&_.getWidth()||x&&x.getWidth()||void 0;(_&&_.hasHeaderState(ve.COLUMN)||x&&x.hasHeaderState(ve.COLUMN))&&(C|=ve.COLUMN);let N=_n(C,1,y);N.append(Se()),g.append(N)}r?l.insertAfter(g):l.insertBefore(g)}return e}var Em=(e,n)=>e===ve.BOTH||e===n?n:ve.NO_STATUS;function nO(e=!0){let n=X();j(n)||je(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=ln(l,a,i),{startRow:f}=d,{startRow:g}=c;return e?Hd(f+i.__rowSpan>g+a.__rowSpan?i:a,!0):Hd(g<f?a:i,!1)}var wI=nO;function Hd(e,n=!0){let[,,r]=Ht(e),[s,i]=ln(r,e,e),a=s[0].length,{startRow:l}=i,c=null;if(n){let d=l+e.__rowSpan-1,f=s[d],g=Sr();for(let m=0;m<a;m++){let{cell:_,startRow:x}=f[m];if(x+_.__rowSpan-1<=d){let C=f[m].cell.__headerState,y=Em(C,ve.COLUMN);g.append(_n(y).append(Se()))}else _.setRowSpan(_.__rowSpan+1)}let p=r.getChildAtIndex(d);Ke(p)||pe(256),p.insertAfter(g),c=g}else{let d=l,f=s[d],g=Sr();for(let m=0;m<a;m++){let{cell:_,startRow:x}=f[m];if(x===d){let C=f[m].cell.__headerState,y=Em(C,ve.COLUMN);g.append(_n(y).append(Se()))}else _.setRowSpan(_.__rowSpan+1)}let p=r.getChildAtIndex(d);Ke(p)||pe(257),p.insertBefore(g),c=g}return c}function kI(e,n,r=!0,s,i){let a=e.getChildren(),l=[];for(let c=0;c<a.length;c++){let d=a[c];if(Ke(d))for(let f=0;f<s;f++){let g=d.getChildren();if(n>=g.length||n<0)throw Error("Table column target index out of range");let p=g[n];xe(p)||pe(12);let{left:m,right:_}=tO(p,i),x=ve.NO_STATUS;(m&&m.hasHeaderState(ve.ROW)||_&&_.hasHeaderState(ve.ROW))&&(x|=ve.ROW);let C=_n(x);C.append(Se()),l.push({newTableCell:C,targetCell:p})}}return l.forEach(({newTableCell:c,targetCell:d})=>{r?d.insertAfter(c):d.insertBefore(c)}),e}function oO(e=!0){let n=X();j(n)||je(n)||pe(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ht(r),[a,,l]=Ht(s),[,c,d]=ln(l,a,i),{startColumn:f}=d,{startColumn:g}=c;return e?Wd(f+i.__colSpan>g+a.__colSpan?i:a,!0):Wd(g<f?a:i,!1)}var II=oO;function Wd(e,n=!0,r=!0){let[,,s]=Ht(e),[i,a]=ln(s,e,e),l=i.length,{startColumn:c}=a,d=n?c+e.__colSpan-1:c-1,f=s.getFirstChild();Ke(f)||pe(120);let g=null;function p(x=ve.NO_STATUS){let C=_n(x).append(Se());return g===null&&(g=C),C}let m=f;e:for(let x=0;x<l;x++){if(x!==0){let F=m.getNextSibling();Ke(F)||pe(121),m=F}let C=i[x],y=C[d<0?0:d].cell.__headerState,N=Em(y,ve.ROW);if(d<0){$m(m,p(N));continue}let{cell:T,startColumn:v,startRow:R}=C[d];if(v+T.__colSpan-1<=d){let F=T,k=R,H=d;for(;k!==x&&F.__rowSpan>1;){if(H-=T.__colSpan,!(H>=0)){m.append(p(N));continue e}{let{cell:U,startRow:W}=C[H];F=U,k=W}}F.insertAfter(p(N))}else T.setColSpan(T.__colSpan+1)}g!==null&&r&&ql(g);let _=s.getColWidths();if(_){let x=[..._],C=d<0?0:d,y=x[C];x.splice(C,0,y),s.setColWidths(x)}return g}function LI(e,n){let r=e.getChildren();for(let s=0;s<r.length;s++){let i=r[s];if(Ke(i)){let a=i.getChildren();if(n>=a.length||n<0)throw Error("Table column target index out of range");a[n].remove()}}return e}function rO(){let e=X();j(e)||je(e)||pe(188);let[n,r]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=ln(i,s,a),{startRow:f}=c,{startRow:g}=d,p=g+a.__rowSpan-1;if(l.length===p-f+1)return void i.remove();let m=l[0].length,_=l[p+1],x=i.getChildAtIndex(p+1);for(let C=p;C>=f;C--){for(let N=m-1;N>=0;N--){let{cell:T,startRow:v,startColumn:R}=l[C][N];if(R===N){if(v<f||v+T.__rowSpan-1>p){let F=Math.max(v,f),k=Math.min(T.__rowSpan+v-1,p),H=F<=k?k-F+1:0;T.setRowSpan(T.__rowSpan-H)}if(v>=f&&v+T.__rowSpan-1>p&&C===p){Ke(x)||pe(387);let F=null;for(let k=0;k<N;k++){let H=_[k],U=H.cell;H.startRow===C+1&&(F=U),U.__colSpan>1&&(k+=U.__colSpan-1)}F===null?$m(x,T):F.insertAfter(T)}}}let y=i.getChildAtIndex(C);Ke(y)||pe(206,String(C)),y.remove()}if(_!==void 0){let{cell:C}=_[0];ql(C)}else{let C=l[f-1],{cell:y}=C[0];ql(y)}}var FI=rO;function sO(){let e=X();j(e)||je(e)||pe(188);let n=e.anchor.getNode(),r=e.focus.getNode(),[s,,i]=Ht(n),[a]=Ht(r),[l,c,d]=ln(i,s,a),{startColumn:f}=c,{startRow:g,startColumn:p}=d,m=Math.min(f,p),_=Math.max(f+s.__colSpan-1,p+a.__colSpan-1),x=_-m+1;if(l[0].length===_-m+1)return i.selectPrevious(),void i.remove();let C=l.length;for(let v=0;v<C;v++)for(let R=m;R<=_;R++){let{cell:F,startColumn:k}=l[v][R];if(k<m){if(R===m){let H=m-k;F.setColSpan(F.__colSpan-Math.min(x,F.__colSpan-H))}}else if(k+F.__colSpan-1>_){if(R===_){let H=_-k+1;F.setColSpan(F.__colSpan-H)}}else F.remove()}let y=l[g],N=f>p?y[f+s.__colSpan]:y[p+a.__colSpan];if(N!==void 0){let{cell:v}=N;ql(v)}else{let v=p<f?y[p-1]:y[f-1],{cell:R}=v;ql(R)}let T=i.getColWidths();if(T){let v=[...T];v.splice(m,x),i.setColWidths(v)}}var PI=sO;function ql(e){let n=e.getFirstDescendant();n==null?e.selectStart():n.getParentOrThrow().selectStart()}function $m(e,n){let r=e.getFirstChild();r!==null?r.insertBefore(n):e.append(n)}function iO(e){if(e.length===0)return null;let n=Yd(e[0]),[r]=po(n,null,null),s=1/0,i=-1/0,a=1/0,l=-1/0,c=new Set;for(let _ of r)for(let x of _){if(!x||!x.cell)continue;let C=x.cell.getKey();if(!c.has(C)&&e.some((y)=>y.is(x.cell))){c.add(C);let{startRow:y,startColumn:N}=x,T=x.cell.__rowSpan||1,v=x.cell.__colSpan||1;s=Math.min(s,y),i=Math.max(i,y+T-1),a=Math.min(a,N),l=Math.max(l,N+v-1)}}if(s===1/0||a===1/0)return null;let d=i-s+1,f=l-a+1,g=r[s][a];if(!g.cell)return null;let p=g.cell;p.setColSpan(f),p.setRowSpan(d);let m=new Set([p.getKey()]);for(let _=s;_<=i;_++)for(let x=a;x<=l;x++){let C=r[_][x];if(!C.cell)continue;let y=C.cell,N=y.getKey();if(!m.has(N))m.add(N),BI(y)||p.append(...y.getChildren()),y.remove()}return p.getChildrenSize()===0&&p.append(Se()),p}function BI(e){if(e.getChildrenSize()!==1)return!1;let n=e.getFirstChildOrThrow();return!(!wn(n)||!n.isEmpty())}function KI(){let e=X();j(e)||je(e)||pe(188);let n=e.anchor.getNode(),r=he(n,xe);return xe(r)||pe(148),wm(r)}function wm(e){let[n,r,s]=Ht(e),{__colSpan:i,__rowSpan:a}=n;if(i===1&&a===1)return;let[l,c]=ln(s,n,n),{startColumn:d,startRow:f}=c,g=n.__headerState&ve.COLUMN,p=Array.from({length:i},(x,C)=>{let y=g;for(let N=0;y!==0&&N<l.length;N++)y&=l[N][C+d].cell.__headerState;return y}),m=n.__headerState&ve.ROW,_=Array.from({length:a},(x,C)=>{let y=m;for(let N=0;y!==0&&N<l[0].length;N++)y&=l[C+f][N].cell.__headerState;return y});if(i>1){for(let x=1;x<i;x++)n.insertAfter(_n(p[x]|_[0]).append(Se()));n.setColSpan(1)}if(a>1){let x;for(let C=1;C<a;C++){let y=f+C,N=l[y];x=(x||r).getNextSibling(),Ke(x)||pe(125);let T=null;for(let v=0;v<d;v++){let R=N[v],F=R.cell;R.startRow===y&&(T=F),F.__colSpan>1&&(v+=F.__colSpan-1)}if(T===null)for(let v=i-1;v>=0;v--)$m(x,_n(p[v]|_[C]).append(Se()));else for(let v=i-1;v>=0;v--)T.insertAfter(_n(p[v]|_[C]).append(Se()))}n.setRowSpan(1)}}function ln(e,n,r){let[s,i,a]=po(e,n,r);return i===null&&pe(207),a===null&&pe(208),[s,i,a]}function po(e,n,r){let s=[],i=null,a=null;function l(d){let f=s[d];return f===void 0&&(s[d]=f=[]),f}let c=e.getChildren();for(let d=0;d<c.length;d++){let f=c[d];Ke(f)||pe(209);let g=l(d);for(let p=f.getFirstChild(),m=0;p!=null;p=p.getNextSibling()){for(xe(p)||pe(147);g[m]!==void 0;)m++;let _={cell:p,startColumn:m,startRow:d},{__rowSpan:x,__colSpan:C}=p;for(let y=0;y<x&&!(d+y>=c.length);y++){let N=l(d+y);for(let T=0;T<C;T++)N[m+T]=_}n!==null&&i===null&&n.is(p)&&(i=_),r!==null&&a===null&&r.is(p)&&(a=_)}}return[s,i,a]}function Ht(e){let n;if(e instanceof Cr)n=e;else if("__type"in e){let i=he(e,xe);xe(i)||pe(148),n=i}else{let i=he(e.getNode(),xe);xe(i)||pe(148),n=i}let r=n.getParent();Ke(r)||pe(149);let s=r.getParent();return rt(s)||pe(210),[n,r,s]}function Jl(e,n,r){let s,i=Math.min(n.startColumn,r.startColumn),a=Math.min(n.startRow,r.startRow),l=Math.max(n.startColumn+n.cell.__colSpan-1,r.startColumn+r.cell.__colSpan-1),c=Math.max(n.startRow+n.cell.__rowSpan-1,r.startRow+r.cell.__rowSpan-1);do{s=!1;for(let d=0;d<e.length;d++)for(let f=0;f<e[0].length;f++){let g=e[d][f];if(!g)continue;let p=g.startColumn+g.cell.__colSpan-1,m=g.startRow+g.cell.__rowSpan-1,_=g.startColumn<=l&&p>=i,x=g.startRow<=c&&m>=a;if(_&&x){let C=Math.min(i,g.startColumn),y=Math.max(l,p),N=Math.min(a,g.startRow),T=Math.max(c,m);C===i&&y===l&&N===a&&T===c||(i=C,l=y,a=N,c=T,s=!0)}}}while(s);return{maxColumn:l,maxRow:c,minColumn:i,minRow:a}}function km(e){let n=e.getChildren(),r=null;for(let s of n){if(!Ke(s))return!1;if(r===null&&(r=s.getChildrenSize()),s.getChildrenSize()!==r)return!1;let i=s.getChildren();for(let a of i)if(!xe(a)||a.getRowSpan()!==1||a.getColSpan()!==1)return!1}return(r||0)>0}function zI(e,n,r){if(n===r)return;let s=e.getColumnCount();if(n<0||n>=s||r<0||r>=s)return;if(!km(e))return;e.getChildren().filter(Ke).forEach((a)=>{let l=a.getChildren(),[c]=l.splice(n,1);l.splice(r,0,c),a.splice(0,l.length,l)});let i=e.getColWidths();if(i&&i.length===s){let a=[...i],[l]=a.splice(n,1);a.splice(r,0,l),e.setColWidths(a)}}function UI(e,n,r){if(n===r)return;let s=e.getChildren().filter(Ke),i=s.length;if(n<0||n>=i||r<0||r>=i)return;if(!km(e))return;let a=s[n],l=s[r];r>n?l.insertAfter(a):l.insertBefore(a)}function Tm(e){let[n,,r]=Ht(e),s=r.getChildren().filter(Ke),i=s.length,a=s[0].getChildren().length,l=Array(i);for(let c=0;c<i;c++)l[c]=Array(a);for(let c=0;c<i;c++){let d=s[c].getChildren().filter(xe),f=0;for(let g=0;g<d.length;g++){for(;l[c][f];)f++;let p=d[g],m=p.__rowSpan||1,_=p.__colSpan||1;for(let x=0;x<m;x++)for(let C=0;C<_;C++)l[c+x][f+C]=p;if(n===p)return{colSpan:_,columnIndex:f,rowIndex:c,rowSpan:m};f+=_}}return null}function aO(e,n){let r=n.getStartEndPoints(),s=je(n);if(r===null)return!1;let[i,a]=r,[l,c,d]=Ht(i),f=he(a.getNode(),(G)=>xe(G));if(!(xe(l)&&xe(f)&&Ke(c)&&rt(d)))return!1;let[g,p,m]=ln(d,l,f),[_]=po(e,null,null),x=g.length,C=x>0?g[0].length:0,{startRow:y,startColumn:N}=p,T=_.length,v=T>0?_[0].length:0;if(s){let G=Jl(g,p,m),ne=G.maxRow-G.minRow+1,ee=G.maxColumn-G.minColumn+1;y=G.minRow,N=G.minColumn,T=Math.min(T,ne),v=Math.min(v,ee)}let R=!1,F=Math.min(x,y+T)-1,k=Math.min(C,N+v)-1,H=new Set;for(let G=y;G<=F;G++)for(let ne=N;ne<=k;ne++){let ee=g[G][ne];H.has(ee.cell.getKey())||(ee.cell.__rowSpan===1&&ee.cell.__colSpan===1||(wm(ee.cell),H.add(ee.cell.getKey()),R=!0))}let[U]=po(d.getWritable(),null,null),W=T-x+y;for(let G=0;G<W;G++)Hd(U[x-1][0].cell);let J=v-C+N;for(let G=0;G<J;G++)Wd(U[0][C-1].cell,!0,!1);[U]=po(d.getWritable(),null,null);for(let G=y;G<y+T;G++)for(let ne=N;ne<N+v;ne++){let ee=G-y,se=ne-N,V=_[ee][se];if(V.startRow!==ee||V.startColumn!==se)continue;let fe=V.cell;if(fe.__rowSpan!==1||fe.__colSpan!==1){let ae=[],ue=Math.min(G+fe.__rowSpan,y+T)-1,we=Math.min(ne+fe.__colSpan,N+v)-1;for(let Ie=G;Ie<=ue;Ie++)for(let ht=ne;ht<=we;ht++){let Qt=U[Ie][ht];ae.push(Qt.cell)}iO(ae),R=!0}let{cell:Ce}=U[G][ne],Ae=fe.getBackgroundColor();Ae!=null&&Ce.setBackgroundColor(Ae);let oe=Ce.getChildren();fe.getChildren().forEach((ae)=>{if(re(ae))Se().append(ae),Ce.append(ae);else Ce.append(ae)}),oe.forEach((ae)=>ae.remove())}if(s&&R){let[G]=po(d.getWritable(),null,null);G[p.startRow][p.startColumn].cell.selectEnd()}return!0}function HI(e,n,r){let[s]=po(e,null,null);n>=0&&n<s.length||pe(396,String(n));let i=s[n],a=r?ve.ROW:ve.NO_STATUS,l=new Set;for(let c=0;c<i.length;c++){let d=i[c];d!=null&&(l.has(d.cell)||(l.add(d.cell),d.cell.setHeaderStyles(a,ve.ROW)))}}function WI(e,n,r){let[s]=po(e,null,null);s.length>0&&n>=0&&n<s[0].length||pe(397,String(n));let i=r?ve.COLUMN:ve.NO_STATUS,a=new Set;for(let l=0;l<s.length;l++){let c=s[l][n];c!=null&&(a.has(c.cell)||(a.add(c.cell),c.cell.setHeaderStyles(i,ve.COLUMN)))}}function Cm(e){let[[n,r,s,i],[a,l,c,d]]=["anchor","focus"].map((f)=>{let g=e[f].getNode(),p=he(g,xe);xe(p)||pe(238,f,g.getKey(),g.getType());let m=p.getParent();Ke(m)||pe(239,f);let _=m.getParent();return rt(_)||pe(240,f),[g,p,m,_]});return i.is(d)||pe(241),{anchorCell:r,anchorNode:n,anchorRow:s,anchorTable:i,focusCell:l,focusNode:a,focusRow:c,focusTable:d}}class tc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}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 e=Rt(this.tableKey),n=Rt(this.anchor.key),r=Rt(this.focus.key);return e!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return je(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,n,r){this.dirty=this.dirty||e!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new tc(this.tableKey,Jn(this.anchor.key,this.anchor.offset,this.anchor.type),Jn(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e==="")return;let n=(e.endsWith(`
38
38
  `)?e.slice(0,-1):e).split(`
39
39
  `).map((i)=>i.split("\t")),r=nc();for(let i of n){let a=Sr();for(let l of i){let c=_n(ve.NO_STATUS),d=Se();l&&d.append(yt(l)),c.append(d),a.append(c)}r.append(a)}let{anchorCell:s}=Cm(this);aO(r,s.select(0,s.getChildrenSize()))}insertText(){}hasFormat(e){let n=0;this.getNodes().filter(xe).forEach((s)=>{let i=s.getFirstChild();wn(i)&&(n|=i.getTextFormat())});let r=$i[e];return(n&r)!==0}insertNodes(e){let n=this.focus.getNode();Q(n)||pe(151),Uo(n.select(0,n.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:n}=Cm(this),r=Tm(e);r===null&&pe(153);let s=Tm(n);s===null&&pe(155);let i=Math.min(r.columnIndex,s.columnIndex),a=Math.max(r.columnIndex+r.colSpan-1,s.columnIndex+s.colSpan-1),l=Math.min(r.rowIndex,s.rowIndex),c=Math.max(r.rowIndex+r.rowSpan-1,s.rowIndex+s.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(l,c),toX:Math.max(i,a),toY:Math.max(l,c)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:n,anchorCell:r,focusCell:s}=Cm(this),i=s.getParents()[1];if(i!==n){if(n.isParentOf(s)){let C=i.getParent();C==null&&pe(159),this.set(this.tableKey,s.getKey(),C.getKey())}else{let C=n.getParent();C==null&&pe(158),this.set(this.tableKey,C.getKey(),s.getKey())}return this.getNodes()}let[a,l,c]=ln(n,r,s),{minColumn:d,maxColumn:f,minRow:g,maxRow:p}=Jl(a,l,c),m=new Map([[n.getKey(),n]]),_=null;for(let C=g;C<=p;C++)for(let y=d;y<=f;y++){let{cell:N}=a[C][y],T=N.getParent();Ke(T)||pe(160),T!==_&&(m.set(T.getKey(),T),_=T),m.has(N.getKey())||jI(N,(v)=>{m.set(v.getKey(),v)})}let x=Array.from(m.values());return SS()||(this._cachedNodes=x),x}getTextContent(){let e=this.getNodes().filter((r)=>xe(r)),n="";for(let r=0;r<e.length;r++){let s=e[r],i=s.__parent,a=(e[r+1]||{}).__parent;n+=s.getTextContent()+(a!==i?`
40
- `:"\t")}return n}}function je(e){return e instanceof tc}function GI(){let e=Jn("root",0,"element"),n=Jn("root",0,"element");return new tc("root",e,n)}function Gd(e,n,r){e.getKey(),n.getKey(),r.getKey();let s=X(),i=je(s)?s.clone():new tc("root",Jn("root",0,"element"),Jn("root",0,"element"));return i.set(e.getKey(),n.getKey(),r.getKey()),i}function jI(e,n){let r=[[e]];for(let s=r.at(-1);s!==void 0&&r.length>0;s=r.at(-1)){let i=s.pop();i===void 0?r.pop():n(i)!==!1&&Q(i)&&r.push(i.getChildren())}}function Im(e,n=Ge()){let r=Rt(e);rt(r)||pe(231,e);let s=Qo(r,n.getElementByKey(e));return s===null&&pe(232,e),{tableElement:s,tableNode:r}}class lO{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let n=this.observers.get(e);return n!==void 0&&(n[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[n,[r]]of Array.from(this.observers.entries())){let s=Rt(n);rt(s)?e.push([s,r]):this.removeObserver(n)}return e}}class Lm{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=e,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((e)=>e()),this.listenersToRemove.clear()}$lookup(){return Im(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver((n)=>{this.editor.read("latest",()=>{let r=!1;for(let a=0;a<n.length;a++){let l=n[a].target.nodeName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TR"){r=!0;break}}if(!r)return;let{tableNode:s,tableElement:i}=this.$lookup();this.table=da(s,i)})});this.editor.read("latest",()=>{let{tableNode:n,tableElement:r}=this.$lookup();this.table=da(n,r),e.observe(r,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let n=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:r,tableElement:s}=this.$lookup();Kd(n,da(r,s),null),e&&X()!==null&&(mt(null),n.dispatchCommand(ro))}$enableHighlightStyle(){let e=this.editor,{tableElement:n}=this.$lookup();an(n,e._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();et(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&pe(233,e.tableKey,this.tableNodeKey);let n=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(n,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=Fn(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,n=!1){let r=this.editor,{tableNode:s}=this.$lookup(),{x:i,y:a}=e;if(this.focusCell=e,!this.isHighlightingCells)(n||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let l=Om(s,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let c=l;if(c===null&&n&&(c=s.getCellNodeFromCords(i,a,this.table)),c!==null){let d=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=c.getKey(),this.tableSelection=Gd(s,d,c),mt(this.tableSelection),r.dispatchCommand(ro),Kd(r,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Rt(this.anchorCellNodeKey):null;return xe(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&pe(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Rt(this.focusCellNodeKey):null;return xe(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&pe(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:n}=this.$lookup(),r=Om(n,e.elem);if(r!==null){let s=r.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(n.getKey(),s,s)):this.tableSelection=Gd(n,r,r),this.anchorCellNodeKey=s}}$formatCells(e){let n=X();je(n)||pe(236);let r=Kr(),{anchor:s,focus:i}=r,a=n.getNodes().filter(xe);a.length>0||pe(237);let l=a[0].getFirstChild(),c=wn(l)?l.getFormatFlags(e,null):null;a.forEach((d)=>{s.set(d.getKey(),0,"element"),i.set(d.getKey(),d.getChildrenSize(),"element"),r.formatText(e,c)}),mt(n),this.editor.dispatchCommand(ro)}$clearText(){let{editor:e}=this,n=Rt(this.tableNodeKey);if(!rt(n))throw Error("Expected TableNode.");let r=X();je(r)||pe(253);let s=r.getNodes().filter(xe),i=n.getFirstChild(),a=n.getLastChild();if(s.length>0&&i!==null&&a!==null&&Ke(i)&&Ke(a)&&s[0]===i.getFirstChild()&&s[s.length-1]===a.getLastChild()){n.selectPrevious();let l=n.getParent();return n.remove(),void(So(l)&&l.isEmpty()&&e.dispatchCommand(jr))}s.forEach((l)=>{if(Q(l)){let c=Se(),d=yt();c.append(d),l.append(c),l.getChildren().forEach((f)=>{f!==c&&f.remove()})}}),Kd(e,this.table,null),mt(null),e.dispatchCommand(ro)}}var ua="__lexicalTableSelection";function cO(e){let n=Ly(e);return rt(n)||pe(386,e),n}var sa=40;function ym(e,n,r){let s=(i)=>Math.max(1,Math.ceil(Math.min(sa,i)/sa*18));return e<=n+sa?-s(n+sa-e):e>=r-sa?s(e-(r-sa)):0}function as(e){return ye(e)&&e.nodeName==="TABLE"}function Qo(e,n){if(!n)return n;let r=as(n)?n:n.querySelector("table");return as(r)||pe(341,e.constructor.name,e.getType(),e.getKey(),n.nodeName),r}function Vd(e){return e._window}function Xd(e,n){for(let r=n,s=null;r!==null;r=r.getParent()){if(e.is(r))return s;xe(r)&&(s=r)}return null}var YI=[[jo,"down"],[oo,"up"],[Yr,"backward"],[bi,"forward"]],VI=[au,iu,Ei],XI=[vi,hu];function qI(e,n){return e.registerRootListener((r)=>{if(r===null)return;let s=e._window;if(s===null)return;return ao(s,"pointerdown",(i)=>{let a=Sl(i);if(i.button!==0||!io(a)||!r.contains(a))return;let l=function(c){let d=Zl(c);if(d===null)return null;let f=d.elem;for(;f!=null;){if(f.nodeName==="TABLE"&&ua in f&&f[ua])return{cellElement:d,tableElement:f,tableObserver:f[ua]};f=f.parentNode}return null}(a);e.update(()=>{if(je(X())){for(let[g]of n.observers.values())g.$clearHighlight(!1);mt(null),e.dispatchCommand(ro)}if(!l)return;let{tableObserver:c,tableElement:d,cellElement:f}=l;(function(g,p,m,_,x,C){let y=g._window;if(!y)return;let N=(R)=>{if(x.isSelecting)return;x.isSelecting=!0,R!==null&&x.anchorCell===null&&g.update(()=>{x.$setAnchorCellForSelection(R)});let{clientX:F,clientY:k}=p,H=null,U=()=>{x.isSelecting=!1,H!==null&&(y.cancelAnimationFrame(H),H=null),y.removeEventListener("pointerup",Ce),y.removeEventListener("pointermove",Ae)},W=(oe,ae)=>{let ue=_.getRootNode();if(!qr(ue)&&!Au(ue))return null;for(let we of ue.elementsFromPoint(oe,ae)){let Ie=Vv(_,we);if(Ie)return Ie}return null},J=(oe,ae)=>{x.anchorCell===null&&g.update(()=>{x.$setAnchorCellForSelection(oe)}),x.focusCell!==null&&oe.elem===x.focusCell.elem||(C.setNextFocus({focusCell:oe,override:ae,tableKey:x.tableNodeKey}),g.dispatchCommand(ro))},G=(oe)=>{for(let ae=_.parentElement;ae;ae=ae.parentElement)if(oe==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ue=y.getComputedStyle(ae),we=oe==="x"?ue.overflowX:ue.overflowY;if(we==="auto"||we==="scroll")return ae}return null},ne=(oe,ae,ue)=>{let we,Ie;if(oe===null)we=0,Ie=ue==="x"?y.innerWidth:y.innerHeight;else{let Be=oe.getBoundingClientRect();we=ue==="x"?Be.left:Be.top,Ie=ue==="x"?Be.right:Be.bottom}let ht=ym(ae,we,Ie);if(ht===0)return!1;if(oe===null){let Be=ue==="x"?y.scrollX:y.scrollY;return y.scrollBy(ue==="x"?ht:0,ue==="x"?0:ht),(ue==="x"?y.scrollX:y.scrollY)!==Be}if(ue==="x"){let Be=oe.scrollLeft;return oe.scrollLeft+=ht,oe.scrollLeft!==Be}let Qt=oe.scrollTop;return oe.scrollTop+=ht,oe.scrollTop!==Qt},ee=(oe,ae)=>{let ue=F,we=k;if(oe===null)ue=Math.min(Math.max(ue,1),y.innerWidth-1);else{let Ie=oe.getBoundingClientRect();ue=Math.min(Math.max(ue,Ie.left+1),Ie.right-1)}if(ae===null)we=Math.min(Math.max(we,1),y.innerHeight-1);else{let Ie=ae.getBoundingClientRect();we=Math.min(Math.max(we,Ie.top+1),Ie.bottom-1)}return[ue,we]},se=()=>{let oe=G("x");if(oe!==null){let Ie=oe.getBoundingClientRect();if(ym(F,Ie.left,Ie.right)!==0)return!0}let ae=G("y"),ue=ae===null?0:ae.getBoundingClientRect().top,we=ae===null?y.innerHeight:ae.getBoundingClientRect().bottom;return ym(k,ue,we)!==0},V=()=>{if(H=null,!x.isSelecting)return;let oe=G("x"),ae=G("y"),ue=oe!==null&&ne(oe,F,"x"),we=ne(ae,k,"y");if(ue||we){let[Ie,ht]=ee(oe,ae),Qt=W(Ie,ht);Qt&&J(Qt,!1),H=y.requestAnimationFrame(V)}},fe=()=>{H===null&&x.pointerType!=="touch"&&se()&&(H=y.requestAnimationFrame(V))},Ce=()=>{U()},Ae=(oe)=>{if(!((Ie)=>!(1&~Ie.buttons))(oe)&&x.isSelecting)return void U();let ae=Sl(oe);if(!io(ae))return;F=oe.clientX,k=oe.clientY;let ue=null,we=!($s||_.contains(ae));ue=we?Vv(_,ae):W(oe.clientX,oe.clientY),ue&&J(ue,we),fe()};y.addEventListener("pointerup",Ce,x.listenerOptions),y.addEventListener("pointermove",Ae,x.listenerOptions)};x.pointerType=p.pointerType;let T=cO(x.tableNodeKey),v=En();if($s&&p.shiftKey&&Ro(v,T)&&(j(v)||je(v))){let R=v.anchor.getNode(),F=Xd(T,v.anchor.getNode());if(F)x.$setAnchorCellForSelection(Zs(x,F)),x.$setFocusCellForSelection(m),xr(p);else(T.isBefore(R)?T.selectStart():T.selectEnd()).anchor.set(v.anchor.key,v.anchor.offset,v.anchor.type)}else p.pointerType!=="touch"&&x.$setAnchorCellForSelection(m);N(m)})(e,i,f,d,c,n)})})})}function uO(e,n,r,s,i){let a=r.getRootElement(),l=Vd(r);a!==null&&l!==null||pe(246);let c=new Lm(r,e.getKey()),d=Qo(e,n);(function(m,_){bm(m)!==null&&pe(205),m[ua]=_})(d,c),c.listenersToRemove.add(()=>function(m,_){bm(m)===_&&delete m[ua]}(d,c)),c.listenersToRemove.add(ao(d,"mousedown",(m)=>{let _=Sl(m);if(m.detail>=3&&io(_))Zl(_)!==null&&m.preventDefault()},c.listenerOptions));for(let[m,_]of YI)c.listenersToRemove.add(r.registerCommand(m,(x)=>gO(r,x,_,e,c,i),In));c.listenersToRemove.add(r.registerCommand(Ai,(m)=>{let _=X();if(je(_)){let x=Xd(e,_.focus.getNode());if(x!==null)return xr(m),x.selectEnd(),!0}return!1},In));let f=()=>{let m=X();return!!Ro(m,e)&&(!!je(m)&&(c.$clearText(),!0))};for(let m of VI)c.listenersToRemove.add(r.registerCommand(m,f,In));let g=(m)=>{let _=X();if(!je(_)&&!j(_))return!1;let x=e.isParentOf(_.anchor.getNode());if(x!==e.isParentOf(_.focus.getNode())){let C=x?"anchor":"focus",y=x?"focus":"anchor",{key:N,offset:T,type:v}=_[y];return e[_[C].isBefore(_[y])?"selectPrevious":"selectNext"]()[y].set(N,T,v),!1}return!!Ro(_,e)&&(!!je(_)&&(m&&(m.preventDefault(),m.stopPropagation()),c.$clearText(),!0))};for(let m of XI)c.listenersToRemove.add(r.registerCommand(m,g,In));c.listenersToRemove.add(r.registerCommand(ru,(m)=>{let _=X();if(_){if(!je(_)&&!j(_))return!1;wl(r,Pn(m,ClipboardEvent)?m:null,ad(_));let x=g(m);return j(_)?(_.removeText(),!0):x}return!1},In));let p=a.ownerDocument;return c.listenersToRemove.add(ao(p,"paste",(m)=>{if(m.defaultPrevented)return;r.read("latest",()=>{let _=X();return a.contains(p.activeElement)&&je(_)&&Ro(_,e)})&&(m.preventDefault(),r.dispatchCommand(Mi,m))})),c.listenersToRemove.add(ao(p,"copy",(m)=>{if(m.defaultPrevented)return;let _=Sl(m);if(_===a||io(_)&&a.contains(_))return;r.read("latest",()=>{let x=X();return a.contains(Eo(a))&&je(x)&&Ro(x,e)})&&(m.preventDefault(),r.dispatchCommand(Ni,m))})),c.listenersToRemove.add(r.registerCommand(Go,(m)=>{let _=X();return!!Ro(_,e)&&(!!je(_)&&(c.$formatCells(m),!0))},In)),c.listenersToRemove.add(r.registerCommand(cu,(m)=>{let _=X();if(!je(_)||!Ro(_,e))return!1;let x=_.anchor.getNode(),C=_.focus.getNode();if(!xe(x)||!xe(C))return!1;let[y,N,T]=ln(e,x,C),v=Math.max(N.startRow+N.cell.__rowSpan-1,T.startRow+T.cell.__rowSpan-1),R=Math.max(N.startColumn+N.cell.__colSpan-1,T.startColumn+T.cell.__colSpan-1),F=Math.min(N.startRow,T.startRow),k=Math.min(N.startColumn,T.startColumn);if(F===0&&k===0&&v===y.length-1&&R===y[0].length-1)return e.setFormat(m),!0;let H=new Set;for(let U=F;U<=v;U++)for(let W=k;W<=R;W++){let J=y[U][W].cell;if(H.has(J))continue;H.add(J),J.setFormat(m);let G=J.getChildren();for(let ne=0;ne<G.length;ne++){let ee=G[ne];Q(ee)&&!ee.isInline()&&ee.setFormat(m)}}return!0},In)),c.listenersToRemove.add(r.registerCommand(ou,(m)=>{let _=X();if(!Ro(_,e))return!1;if(je(_))return c.$clearHighlight(),!1;if(j(_)){let x=he(_.anchor.getNode(),(C)=>xe(C));if(!xe(x))return!1;if(typeof m=="string"){let C=qv(r,_,e);if(C)return Xv(C,e,[yt(m)]),!0}}return!1},In)),s&&c.listenersToRemove.add(r.registerCommand(Vr,(m)=>{let _=X();if(!j(_)||!_.isCollapsed()||!Ro(_,e))return!1;let x=la(_.anchor.getNode());return!(x===null||!e.is(Qs(x)))&&(xr(m),function(C,y){let N=y==="next"?"getNextSibling":"getPreviousSibling",T=y==="next"?"getFirstChild":"getLastChild",v=C[N]();if(Q(v))return v.selectEnd();let R=he(C,Ke);R===null&&pe(247);for(let k=R[N]();Ke(k);k=k[N]()){let H=k[T]();if(Q(H))return H.selectEnd()}let F=he(R,rt);F===null&&pe(248),y==="next"?F.selectNext():F.selectPrevious()}(x,m.shiftKey?"previous":"next"),!0)},In)),c.listenersToRemove.add(r.registerCommand(eS,(m)=>e.isSelected(),In)),c.listenersToRemove.add(r.registerCommand(jr,()=>{let m=X();if(!j(m)||!m.isCollapsed()||!Ro(m,e))return!1;let _=qv(r,m,e);return!!_&&(Xv(_,e),!0)},In)),c}function JI(e,n){let r=X(),s=En(),i=e.getAndClearNextFocus();if(i!==null){let{tableKey:l,focusCell:c}=i,d=e.observers.get(l);d||pe(335,l);let[f]=d;if(je(r)&&r.tableKey===f.tableNodeKey)return(c.x!==f.focusX||c.y!==f.focusY)&&(f.$setFocusCellForSelection(c),!0);if(f.anchorCell!==null&&f.anchorCellNodeKey!==null&&c.elem!==f.anchorCell.elem&&f.tableSelection!==null)return f.$setFocusCellForSelection(c,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&j(s)&&j(r)&&r.isCollapsed()){let l=Rt(a);if(rt(l)){let c=r.anchor.getNode(),d=l.getFirstChild(),f=la(c);if(f!==null&&Ke(d)){let g=d.getFirstChild();if(xe(g)&&l.is(he(f,(p)=>p.is(l)||p.is(g))))return g.selectStart(),!0}}}je(r)&&function(l,c){let d=Vd(l),f=En();if(!c.is(f))return;let g=cO(c.tableKey),p=Fn(d),m=p&&ws(p,l.getRootElement());if(p&&m&&m.anchorNode&&m.focusNode){let _=vt(m.focusNode),x=_&&!g.isParentOf(_),C=vt(m.anchorNode),y=C&&g.isParentOf(C);if(x&&y&&p.rangeCount>0){let N=My(p,l);N&&(N.anchor.set(g.getKey(),c.isBackward()?g.getChildrenSize():0,"element"),p.removeAllRanges(),mt(N))}}}(n,r),j(r)&&function(l,c){let d=En(),{anchor:f,focus:g}=l,p=f.getNode(),m=g.getNode(),_=la(p),x=la(m),C=_?Qs(_):null,y=x?Qs(x):null,N=l.isBackward(),T=_&&x&&C&&y&&C.is(y),v=y&&(!C||C.isParentOf(y)),R=C&&(!y||y.isParentOf(C));if(v){let F=l.clone(),[k]=ln(y,x,x),H=k[0][0].cell,U=k[k.length-1].at(-1).cell;F.focus.set(N?H.getKey():U.getKey(),N?0:U.getChildrenSize(),"element"),mt(F)}else if(R){let F=l.clone(),[k]=ln(C,_,_),H=k[0][0].cell,U=k[k.length-1].at(-1).cell;F.anchor.set(N?U.getKey():H.getKey(),N?U.getChildrenSize():0,"element"),mt(F)}else if(T){let F=c.observers.get(C.getKey());F||pe(335,C.getKey());let[k]=F;if(_.is(x)||(k.$setAnchorCellForSelection(Zs(k,_)),k.$setFocusCellForSelection(Zs(k,x),!0)),k.pointerType==="touch"&&k.isSelecting&&l.isCollapsed()&&j(d)&&d.isCollapsed()){let H=la(d.anchor.getNode());H&&!H.is(x)&&(k.$setAnchorCellForSelection(Zs(k,H)),k.$setFocusCellForSelection(Zs(k,x),!0),k.pointerType=null)}}}(r,e);for(let[l,c]of e.$getTableNodesAndObservers())ZI(n,l,c);return!1}function ZI(e,n,r){let s=X(),i=En();s&&!s.is(i)&&(je(s)||je(i))&&r.tableSelection&&!r.tableSelection.is(i)&&(je(s)&&s.tableKey===r.tableNodeKey?r.$updateTableTableSelection(s):!je(s)&&je(i)&&i.tableKey===r.tableNodeKey&&r.$updateTableTableSelection(null)),r.hasHijackedSelectionStyles&&!n.isSelected()?function(a,l){l.$enableHighlightStyle(),vm(l.table,(c)=>{let d=c.elem;c.highlighted=!1,fO(a,c),d.getAttribute("style")||d.removeAttribute("style")})}(e,r):!r.hasHijackedSelectionStyles&&n.isSelected()&&function(a,l){l.$disableHighlightStyle(),vm(l.table,(c)=>{c.highlighted=!0,dO(a,c)})}(e,r)}function bm(e){return e[ua]||null}function Zl(e){let n=e;for(;n!=null;){let r=n.nodeName;if(r==="TD"||r==="TH"){let s=n._cell;return s===void 0?null:s}n=n.parentNode}return null}function Vv(e,n){if(!e.contains(n))return null;let r=null;for(let s=n;s!=null;s=s.parentNode){if(s===e)return r;let i=s.nodeName;i!=="TD"&&i!=="TH"||(r=s._cell||null)}return null}function da(e,n){let r=[],s={columns:0,domRows:r,rows:0},i=Qo(e,n).querySelector("tr"),a=0,l=0;for(r.length=0;i!=null;){let c=i.nodeName;if(c==="TD"||c==="TH"){let g={elem:i,hasBackgroundColor:i.style.backgroundColor!=="",highlighted:!1,x:a,y:l};i._cell=g;let p=r[l];p===void 0&&(p=r[l]=[]),p[a]=g}else{let g=i.firstChild;if(g!=null){i=g;continue}}let d=i.nextSibling;if(d!=null){a++,i=d;continue}let f=i.parentNode;if(f!=null){let g=f.nextSibling;if(g==null)break;l++,a=0,i=g}}return s.columns=a+1,s.rows=l+1,s}function Kd(e,n,r){let s=new Set(r?r.getNodes():[]);vm(n,(i,a)=>{let l=i.elem;s.has(a)?(i.highlighted=!0,dO(e,i)):(i.highlighted=!1,fO(e,i),l.getAttribute("style")||l.removeAttribute("style"))})}function vm(e,n){let{domRows:r}=e;for(let s=0;s<r.length;s++){let i=r[s];if(i)for(let a=0;a<i.length;a++){let l=i[a];if(!l)continue;let c=vt(l.elem);c!==null&&n(l,c,{x:a,y:s})}}}var QI=(e,n,r,s,i)=>{let a=i==="forward";switch(i){case"backward":case"forward":return r!==(a?e.table.columns-1:0)?Ud(n.getCellNodeFromCordsOrThrow(r+(a?1:-1),s,e.table),a):s!==(a?e.table.rows-1:0)?Ud(n.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,s+(a?1:-1),e.table),a):a?n.selectNext():n.selectPrevious(),!0;case"up":return s!==0?Ud(n.getCellNodeFromCordsOrThrow(r,s-1,e.table),!1):n.selectPrevious(),!0;case"down":return s!==e.table.rows-1?Ud(n.getCellNodeFromCordsOrThrow(r,s+1,e.table),!0):n.selectNext(),!0;default:return!1}};function Sm(e,n){let r,s;if(n.startColumn===e.minColumn)r="minColumn";else{if(n.startColumn+n.cell.__colSpan-1!==e.maxColumn)return null;r="maxColumn"}if(n.startRow===e.minRow)s="minRow";else{if(n.startRow+n.cell.__rowSpan-1!==e.maxRow)return null;s="maxRow"}return[r,s]}function zd([e,n]){return[e==="minColumn"?"maxColumn":"minColumn",n==="minRow"?"maxRow":"minRow"]}function ia(e,n,[r,s]){let i=n[s],a=e[i];a===void 0&&pe(250,s,String(i));let l=n[r],c=a[l];return c===void 0&&pe(250,r,String(l)),c}function e1(e,n,r,s,i){let a=Jl(n,r,s),l=function(k,H){let{minColumn:U,maxColumn:W,minRow:J,maxRow:G}=H,ne=1,ee=1,se=1,V=1,fe=k[J],Ce=k[G];for(let Ae=U;Ae<=W;Ae++)ne=Math.max(ne,fe[Ae].cell.__rowSpan),V=Math.max(V,Ce[Ae].cell.__rowSpan);for(let Ae=J;Ae<=G;Ae++)ee=Math.max(ee,k[Ae][U].cell.__colSpan),se=Math.max(se,k[Ae][W].cell.__colSpan);return{bottomSpan:V,leftSpan:ee,rightSpan:se,topSpan:ne}}(n,a),{topSpan:c,leftSpan:d,bottomSpan:f,rightSpan:g}=l,p=function(k,H){let U=Sm(k,H);return U===null&&pe(249,H.cell.getKey()),U}(a,r),[m,_]=zd(p),x=a[m],C=a[_];i==="forward"?x+=m==="maxColumn"?1:d:i==="backward"?x-=m==="minColumn"?1:g:i==="down"?C+=_==="maxRow"?1:c:i==="up"&&(C-=_==="minRow"?1:f);let y=n[C];if(y===void 0)return!1;let N=y[x];if(N===void 0)return!1;let[T,v]=function(k,H,U){let W=Jl(k,H,U),J=Sm(W,H);if(J)return[ia(k,W,J),ia(k,W,zd(J))];let G=Sm(W,U);if(G)return[ia(k,W,zd(G)),ia(k,W,G)];let ne=["minColumn","minRow"];return[ia(k,W,ne),ia(k,W,zd(ne))]}(n,r,N),R=Zs(e,T.cell),F=Zs(e,v.cell);return e.$setAnchorCellForSelection(R),e.$setFocusCellForSelection(F,!0),!0}function Ro(e,n){if(j(e)||je(e)){let r=n.isParentOf(e.anchor.getNode()),s=n.isParentOf(e.focus.getNode());return r&&s}return!1}function Ud(e,n){n?e.selectStart():e.selectEnd()}function dO(e,n){let r=n.elem,s=e._config.theme;xe(vt(r))||pe(131),et(r,s.tableCellSelected)}function fO(e,n){let r=n.elem;xe(vt(r))||pe(131);let s=e._config.theme;an(r,s.tableCellSelected)}function la(e){let n=he(e,xe);return xe(n)?n:null}function Qs(e){let n=he(e,rt);return rt(n)?n:null}function t1(e,n,r,s,i,a,l){let c=dn(r.focus,i?"previous":"next");if(ll(c))return!1;let d=c;for(let y of bs(c).iterNodeCarets("shadowRoot")){if(!No(y)||!Q(y.origin))return!1;d=y}let f=d.getParentAtCaret();if(!xe(f))return!1;let g=f,p=function(y){for(let N of bs(y).iterNodeCarets("root")){let{origin:T}=N;if(xe(T)){if(zo(N))return bt(T,y.direction)}else if(!Ke(T))break}return null}(it(g,d.direction)),m=he(g,rt);if(!m||!m.is(a))return!1;let _=e.getElementByKey(g.getKey()),x=Zl(_);if(!_||!x)return!1;let C=mO(e,m);if(l.table=C,p)if(s==="extend"){let y=Zl(e.getElementByKey(p.origin.getKey()));if(!y)return!1;l.$setAnchorCellForSelection(x),l.$setFocusCellForSelection(y,!0)}else{let y=kt(p);Wo(r.anchor,y),Wo(r.focus,y)}else if(s==="extend")l.$setAnchorCellForSelection(x),l.$setFocusCellForSelection(x,!0);else{let y=function(N){let T=il(N);return zo(T)?kt(T):N}(it(m,c.direction));Wo(r.anchor,y),Wo(r.focus,y)}return xr(n),!0}function gO(e,n,r,s,i,a){if((r==="up"||r==="down")&&function(c){let d=c.getRootElement();if(!d)return!1;return d.hasAttribute("aria-controls")&&d.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let l=X();if(!Ro(l,s)){if(j(l)){if(r==="backward"){if(l.focus.offset>0)return!1;let c=function(f){for(let g=f,p=f;p!==null;g=p,p=p.getParent())if(Q(p)){if(p!==g&&p.getFirstChild()!==g)return null;if(!p.isInline())return p}return null}(l.focus.getNode());if(!c)return!1;let d=c.getPreviousSibling();return!!rt(d)&&(xr(n),n.shiftKey?l.focus.set(d.getParentOrThrow().getKey(),d.getIndexWithinParent(),"element"):d.selectEnd(),!0)}if(n.shiftKey&&(r==="up"||r==="down")){let c=l.focus.getNode();if(!l.isCollapsed()&&(r==="up"&&!l.isBackward()||r==="down"&&l.isBackward())){let d=he(c,(_)=>rt(_));if(xe(d)&&(d=he(d,rt)),d!==s)return!1;if(!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(!f)return!1;let g=0;r==="up"&&Q(f)&&(g=f.getChildrenSize());let p=f;if(r==="up"&&Q(f))p=f.getLastChild()||f,g=re(p)?p.getTextContentSize():0;let m=l.clone();return m.focus.set(p.getKey(),g,re(p)?"text":"element"),mt(m),xr(n),!0}if(Mt(c)){let d=r==="up"?l.getNodes()[l.getNodes().length-1]:l.getNodes()[0];if(d){if(Xd(s,d)!==null){let f=s.getFirstDescendant(),g=s.getLastDescendant();if(!f||!g)return!1;let[p]=Ht(f),[m]=Ht(g),_=s.getCordsFromCellNode(p,i.table),x=s.getCordsFromCellNode(m,i.table),C=s.getDOMCellFromCordsOrThrow(_.x,_.y,i.table),y=s.getDOMCellFromCordsOrThrow(x.x,x.y,i.table);return i.$setAnchorCellForSelection(C),i.$setFocusCellForSelection(y,!0),!0}}return!1}{let d=he(c,(g)=>Q(g)&&!g.isInline());if(xe(d)&&(d=he(d,rt)),!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(rt(f)&&i.tableNodeKey===f.getKey()){let g=f.getFirstDescendant(),p=f.getLastDescendant();if(!g||!p)return!1;let[m]=Ht(g),[_]=Ht(p),x=l.clone();return x.focus.set((r==="up"?m:_).getKey(),r==="up"?0:_.getChildrenSize(),"element"),xr(n),mt(x),!0}}}}return r==="down"&&ec(e)&&a.setShouldCheckSelectionForTable(s.getKey()),!1}if(j(l)){if(r==="backward"||r==="forward")return t1(e,n,l,n.shiftKey?"extend":"move",r==="backward",s,i);if(l.isCollapsed()){let{anchor:c,focus:d}=l,f=he(c.getNode(),xe),g=he(d.getNode(),xe);if(!xe(f)||!f.is(g))return!1;let p=Qs(f);if(p!==s&&p!=null){let T=Qo(p,e.getElementByKey(p.getKey()));if(T!=null)return i.table=da(p,T),gO(e,n,r,p,i,a)}let m=e.getElementByKey(f.__key),_=e.getElementByKey(c.key);if(_==null||m==null)return!1;let x;if(c.type==="element")x=_.getBoundingClientRect();else{let T=Fn(Vd(e));if(T===null||T.rangeCount===0)return!1;let v=mS(T,e.getRootElement());if(v===null)return!1;x=v.getBoundingClientRect()}let C=r==="up"?f.getFirstChild():f.getLastChild();if(C==null)return!1;let y=e.getElementByKey(C.__key);if(y==null)return!1;let N=y.getBoundingClientRect();if(r==="up"?N.top>x.top-x.height:x.bottom+x.height>N.bottom){xr(n);let T=s.getCordsFromCellNode(f,i.table);if(!n.shiftKey)return QI(i,s,T.x,T.y,r);{let v=s.getDOMCellFromCordsOrThrow(T.x,T.y,i.table);i.$setAnchorCellForSelection(v),i.$setFocusCellForSelection(v,!0)}return!0}}}else if(je(l)){let{anchor:c,focus:d,tableKey:f}=l;if(f!==s.getKey())return!1;let g=he(c.getNode(),xe),p=he(d.getNode(),xe),[m]=l.getNodes();rt(m)||pe(251);let _=Qo(m,e.getElementByKey(m.getKey()));if(!xe(g)||!xe(p)||!rt(m)||_==null)return!1;i.$updateTableTableSelection(l);let x=da(m,_),C=s.getCordsFromCellNode(g,x),y=s.getDOMCellFromCordsOrThrow(C.x,C.y,x);if(i.$setAnchorCellForSelection(y),xr(n),n.shiftKey){let[N,T,v]=ln(s,g,p);return e1(i,N,T,v,r)}return p.selectEnd(),!0}return!1}function xr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Xv(e,n,r){let s=Se();e==="first"?n.insertBefore(s):n.insertAfter(s),s.append(...r||[]),s.selectEnd()}function qv(e,n,r){let s=r.getParent();if(!s)return;let i=Fn(Vd(e));if(!i)return;let a=ws(i,e.getRootElement()).anchorNode,l=e.getElementByKey(s.getKey()),c=Qo(r,e.getElementByKey(r.getKey()));if(!a||!l||!c||!l.contains(a)||c.contains(a))return;let d=he(n.anchor.getNode(),(T)=>xe(T));if(!d)return;let f=he(d,(T)=>rt(T));if(!rt(f)||!f.is(r))return;let[g,p]=ln(r,d,d),m=g[0][0],_=g[g.length-1][g[0].length-1],{startRow:x,startColumn:C}=p,y=x===m.startRow&&C===m.startColumn,N=x===_.startRow&&C===_.startColumn;return y?"first":N?"last":void 0}function Zs(e,n){let{tableNode:r}=e.$lookup(),s=r.getCordsFromCellNode(n,e.table);return r.getDOMCellFromCordsOrThrow(s.x,s.y,e.table)}function Om(e,n,r){return Xd(e,vt(n,r))}function jd(e){return ye(e)&&e.nodeName==="DIV"}function Jv(e,n,r){let s=e.querySelector(":scope > colgroup");if(!r)return void(s&&s.remove());s||(s=Xe().createElement("colgroup"),Mu(s),e.insertBefore(s,e.firstChild));let i=[];for(let a=0;a<n;a++){let l=Xe().createElement("col"),c=r[a];c&&(l.style.width=`${c}px`),i.push(l)}s.replaceChildren(...i)}function Zv(e,n,r){if(!n.theme.tableAlignment)return;let s=[],i=[];for(let a of["center","right"]){let l=n.theme.tableAlignment[a];l&&(a===r?i:s).push(l)}an(e,...s),et(e,...i)}var pO=new WeakSet;function n1(e){let{scrollable:n,scrollbar:r,tableElement:s}=e;if(r.classList.length===0&&function(c){let d=c.style.display;c.style.display="";let f=c.offsetHeight-c.clientHeight;return c.style.display=d,f}(r)===0)return pO.add(r),r.style.display="none",n.style.scrollbarWidth="auto",()=>{};let i=()=>{r.scrollLeft!==n.scrollLeft&&(r.scrollLeft=n.scrollLeft)},a=()=>{n.scrollLeft!==r.scrollLeft&&(n.scrollLeft=r.scrollLeft)};n.addEventListener("scroll",i,{passive:!0}),r.addEventListener("scroll",a,{passive:!0});let l=null;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(()=>{Am(n,r)}),l.observe(n),l.observe(s)),Am(n,r),()=>{n.removeEventListener("scroll",i),r.removeEventListener("scroll",a),l&&l.disconnect()}}function Am(e,n){if(pO.has(n))return;let r=n.firstElementChild;if(!r||!ye(r)||!e.isConnected)return;let s=e.ownerDocument.defaultView;if(!s)return void(n.style.display="none");let i=s.getComputedStyle(e).overflowX,a=i==="auto"||i==="scroll",{scrollWidth:l,clientWidth:c}=e,d=l+"px";r.style.width!==d&&(r.style.width=d);let f=a&&l>c;n.style.display=f?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let n=e.firstElementChild;if(!jd(n))return null;let r=n.querySelector(":scope > table");if(!as(r))return null;let s=n.nextElementSibling;return jd(s)?{scrollable:n,scrollbar:s,tableElement:r}:null}var Rm=new WeakSet;function ec(e=Ge()){return Rm.has(e)}function Mm(e=Ge()){let n=lo(e,"@lexical/table/Table");return!!n&&(n.output.hasStickyScrollbar.peek()&&n.output.hasHorizontalScroll.peek())}function hO(e,n){n?Rm.add(e):Rm.delete(e)}class Nr extends ct{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:ct,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let n=this.getWritable();return n.__colWidths=e,n}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}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(e,n,r){return r==="html"}getDOMSlot(e){let n=as(e)?e:e.querySelector("table");return as(n)||pe(229),super.getDOMSlot(e).withElement(n).withAfter(n.querySelector(":scope > colgroup"))}createDOM(e,n){let r=Xe().createElement("table");if(this.__style&&fr(r.style,this.__style),this.getColWidths()){let s=Xe().createElement("colgroup");r.appendChild(s),Mu(s)}if(et(r,e.theme.table),this.updateTableElement(null,r,e),ec(n)){let s=Mm(n),i=function(a,l,c){let d=Xe().createElement("div"),f=l.theme.tableScrollableWrapper;return f?et(d,f):d.style.overflowX="auto",c&&(d.style.scrollbarWidth="none"),d.appendChild(a),d}(r,e,s);if(this.updateTableWrapper(null,i,r,e),s){let a=function(c){let d=Xe(),f=d.createElement("div"),g=c.theme.tableStickyScrollbar;g?et(f,g):(f.style.position="sticky",f.style.bottom="0",f.style.overflowX="scroll",f.style.overflowY="hidden"),f.style.display="none",f.setAttribute("aria-hidden","true"),f.tabIndex=-1;let p=d.createElement("div");return p.style.height="1px",p.style.width="0px",f.appendChild(p),f}(e),l=Xe().createElement("div");return l.setAttribute("data-lexical-sticky-scrollbar","true"),l.appendChild(i),l.appendChild(a),Mu(a),l}return i}return r}updateTableWrapper(e,n,r,s){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenColumn),a.setAttribute("data-lexical-frozen-column","true")):(an(i,l.theme.tableFrozenColumn),a.removeAttribute("data-lexical-frozen-column"))}(n,r,s,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenRow),a.setAttribute("data-lexical-frozen-row","true")):(an(i,l.theme.tableFrozenRow),a.removeAttribute("data-lexical-frozen-row"))}(n,r,s,this.__frozenRowCount)}updateTableElement(e,n,r){this.__style!==(e?e.__style:"")&&fr(n.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(a,l,c){c?(et(a,l.theme.tableRowStriping),a.setAttribute("data-lexical-row-striping","true")):(an(a,l.theme.tableRowStriping),a.removeAttribute("data-lexical-row-striping"))}(n,r,this.__rowStriping);let s=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===s&&this.getColWidths()===i||Jv(n,this.getColumnCount(),this.getColWidths()),Zv(n,r,this.getFormatType())}updateDOM(e,n,r){let s=Qo(this,n);if(n===s===ec())return!0;if(jd(n)){if(n.hasAttribute("data-lexical-sticky-scrollbar")!==Mm())return!0;let i=s.parentElement;jd(i)&&this.updateTableWrapper(e,i,s,r)}return this.updateTableElement(e,s,r),!1}scaleDOMColWidths(e,n){let r=this.getColWidths();if(!r)return;Jv(Qo(this,e),this.getColumnCount(),r.map((s)=>s*n))}exportDOM(e){let n=super.exportDOM(e),{element:r}=n;return{after:(s)=>{if(n.after&&(s=n.after(s)),!as(s)&&ye(s)&&(s=s.querySelector("table")),!as(s))return null;Zv(s,e._config,this.getFormatType());let[i]=po(this,null,null),a=new Map;for(let f of i)for(let g of f){let p=g.cell.getKey();a.has(p)||a.set(p,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn})}let l=new Set;for(let f of s.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let g=f.getAttribute("data-temporary-table-cell-lexical-key");if(g){let p=a.get(g);if(f.removeAttribute("data-temporary-table-cell-lexical-key"),p){a.delete(g);for(let m=0;m<p.colSpan;m++)l.add(m+p.startColumn)}}}let c=s.querySelector(":scope > colgroup");if(c){let f=Array.from(s.querySelectorAll(":scope > colgroup > col")).filter((g,p)=>l.has(p));c.replaceChildren(...f)}let d=s.querySelectorAll(":scope > tr");if(d.length>0){let f=Xe().createElement("tbody");for(let g of d)f.appendChild(g);s.append(f)}return s},element:!as(r)&&ye(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,n){let{rows:r,domRows:s}=n;for(let i=0;i<r;i++){let a=s[i];if(a!=null)for(let l=0;l<a.length;l++){let c=a[l];if(c==null)continue;let{elem:d}=c,f=Om(this,d);if(f!==null&&e.is(f))return{x:l,y:i}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:s}=r,i=s[n];if(i==null)return null;let a=i[e<i.length?e:i.length-1];return a==null?null:a}getDOMCellFromCordsOrThrow(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(!s)throw Error("Cell not found at cords.");return s}getCellNodeFromCords(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(s==null)return null;let i=vt(s.elem);return xe(i)?i:null}getCellNodeFromCordsOrThrow(e,n,r){let s=this.getCellNodeFromCords(e,n,r);if(!s)throw Error("Node at cords not TableCellNode.");return s}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let n=this.getWritable();return n.__rowStriping=e,n}setFrozenColumns(e){let n=this.getWritable();return n.__frozenColumnCount=e,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let n=this.getWritable();return n.__frozenRowCount=e,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!Ke(e))return 0;let n=0;return e.getChildren().forEach((r)=>{xe(r)&&(n+=r.getColSpan())}),n}}function mO(e,n){let r=e.getElementByKey(n.getKey());return r===null&&pe(230),da(n,r)}function r1(e){let n=nc();e.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let r=e.querySelector(":scope > colgroup");if(r){let s=[];for(let i of r.querySelectorAll(":scope > col")){let a=i.style.width||"";if(!ca.test(a)&&(a=i.getAttribute("width")||"",!/^\d+$/.test(a))){s=void 0;break}s.push(parseFloat(a))}s&&n.setColWidths(s)}return{after:(s)=>Tl(s,Ke),node:n}}function nc(){return un(new Nr)}function rt(e){return e instanceof Nr}function s1(e){Ke(e.getParent())?e.isEmpty()&&e.append(Se()):e.remove()}function i1(e){rt(e.getParent())?Cp(e,xe):e.remove()}function a1(e){Cp(e,Ke);let[n]=po(e,null,null),r=n.reduce((l,c)=>Math.max(l,c.length),0),s=e.getChildren();for(let l=0;l<n.length;++l){let c=s[l];if(!c)continue;Ke(c)||pe(254,c.constructor.name,c.getType());let d=n[l].reduce((f,g)=>g?1+f:f,0);if(d!==r)for(let f=d;f<r;++f){let g=_n();g.append(Se()),c.append(g)}}let i=e.getColWidths(),a=e.getColumnCount();if(i&&i.length!==a){let l;if(a<i.length)l=i.slice(0,a);else if(i.length>0){let c=i[i.length-1];l=[...i,...Array(a-i.length).fill(c)]}e.setColWidths(l)}}function l1(e){if(e.detail<3||!io(e.target))return!1;let n=vt(e.target);if(n===null)return!1;let r=he(n,(s)=>Q(s)&&!s.isInline());if(r===null)return!1;return!!xe(r.getParent())&&(r.select(0),!0)}function c1(){let e=X();if(!j(e))return!1;let n=Qs(e.anchor.getNode());if(n===null)return!1;let r=Je();if(!r.is(n.getParent())||r.getChildrenSize()!==1)return!1;let[s]=po(n,null,null);if(s.length===0||s[0].length===0)return!1;let i=s[0][0];if(!i||!i.cell)return!1;let a=s[s.length-1],l=a[a.length-1];if(!l||!l.cell)return!1;let c=Gd(n,i.cell,l.cell);return mt(c),!0}function _O(e){return e.registerNodeTransform(Cr,(n)=>{if(n.getColSpan()>1||n.getRowSpan()>1){let[,,r]=Ht(n),[s]=ln(r,n,n),i=s.length,a=s[0].length,l=r.getFirstChild();Ke(l)||pe(175);let c=[];for(let d=0;d<i;d++){d!==0&&(l=l.getNextSibling(),Ke(l)||pe(175));let f=null;for(let g=0;g<a;g++){let p=s[d][g],m=p.cell;if(p.startRow===d&&p.startColumn===g)f=m,c.push(m);else if(m.getColSpan()>1||m.getRowSpan()>1){xe(m)||pe(176);let _=_n(m.__headerState);f!==null?f.insertAfter(_):iN(l,_)}}}for(let d of c)d.setColSpan(1),d.setRowSpan(1)}})}function xO(e,n=!0){let r=new lO,s=(i,a,l)=>{let c=Qo(i,l),d=uO(i,c,e,n,r);r.observers.set(a,[d,c])};return De(qI(e,r),e.registerCommand(ro,()=>JI(r,e),In),e.registerMutationListener(Nr,(i)=>{e.read("latest",()=>{for(let[a,l]of i){let c=r.observers.get(a);if(l==="created"||l==="updated"){let{tableNode:d,tableElement:f}=Im(a);c===void 0?s(d,a,f):f!==c[1]&&(r.removeObserver(a),s(d,a,f))}else l==="destroyed"&&r.removeObserver(a)}})},{skipInitialization:!1}),()=>{r.removeAllObservers()})}function CO(e,n){e.hasNodes([Nr])||pe(255);let{hasNestedTables:r=zs(!1)}=n??{};return De(e.registerCommand(Qv,(s)=>function({rows:i,columns:a,includeHeaders:l},c){let d=X()||En();if(!d||!j(d))return!1;if(!c&&Qs(d.anchor.getNode()))return!1;let f=eO(Number(i),Number(a),l);Lu(f);let g=f.getFirstDescendant();return re(g)&&g.select(),!0}(s,r.peek()),Te),e.registerCommand(yu,(s,i)=>e===i&&function(a,l){let{nodes:c,selection:d}=a;if(!c.some((p)=>rt(p)||sN(p).some((m)=>rt(m.node)))){if(je(d)){let p="",m=!1;for(let _ of c){let x=Q(_)&&!_.isInline();p.length>0&&(x||m)&&(p+=`
41
- `),p+=_.getTextContent(),m=x}return d.insertRawText(p),!0}return!1}let f=je(d),g=j(d);if(!(g&&he(d.anchor.getNode(),(p)=>xe(p))!==null&&he(d.focus.getNode(),(p)=>xe(p))!==null||f))return!1;if(c.length===1&&rt(c[0]))return aO(c[0],d);if(g&&l.peek()&&!function(p){if(je(p)&&!p.focus.getNode().is(p.anchor.getNode()))return!0;if(j(p)&&xe(p.anchor.getNode())&&!p.anchor.getNode().is(p.focus.getNode()))return!0;return!1}(d))return!1;return!0}(s,r),Te),e.registerCommand(Di,c1,Pe),e.registerCommand(yi,l1,Te),e.registerNodeTransform(Nr,a1),e.registerNodeTransform(fa,i1),e.registerNodeTransform(Cr,s1))}var u1={$accepts:Ke,$packageRun:(e)=>e.every(xe)?[Sr().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:xe,name:"TableRowSchema"},yO=[ft({$import:(e,n)=>{let r=nc();n.hasAttribute("data-lexical-row-striping")&&r.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&r.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&r.setFrozenRows(1);let s=n.querySelector(":scope > colgroup");if(s){let i=[];for(let a of s.querySelectorAll(":scope > col")){let l=a.style.width||"";if(!ca.test(l)&&(l=a.getAttribute("width")||"",!/^\d+$/.test(l))){i=void 0;break}i.push(parseFloat(l))}i&&r.setColWidths(i)}return[r.splice(0,0,Tl(e.$importChildren(n),Ke))]},match:gt.tag("table"),name:"@lexical/table/table"}),ft({$import:(e,n)=>[Sr(ca.test(n.style.height)?parseFloat(n.style.height):void 0).splice(0,0,Tl(e.$importChildren(n),xe))],match:gt.tag("tr"),name:"@lexical/table/tr"}),ft({$import:(e,n)=>{let r=n.nodeName==="TH",s=ca.test(n.style.width)?parseFloat(n.style.width):void 0,i=ve.NO_STATUS;if(r){let y=n.getAttribute("scope");if(y==="col")i=ve.COLUMN;else if(y==="row")i=ve.ROW;else{let N=n.parentElement,T=ES(N)&&(N.parentElement&&N.parentElement.nodeName==="THEAD"||N.rowIndex===0),v=n.cellIndex===0;T&&(i|=ve.ROW),v&&(i|=ve.COLUMN),i===ve.NO_STATUS&&(i=ve.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;(function(y){return y==="middle"||y==="bottom"})(c)&&(a.__verticalAlign=c);let d=e.get(rh),f=d|function(y){let N=0,T=y.fontWeight;T!=="700"&&T!=="bold"||(N|=hl),y.fontStyle==="italic"&&(N|=_l);let v=(y.textDecoration||"").split(" ");return v.includes("underline")&&(N|=Cl),v.includes("line-through")&&(N|=xl),N}(n.style),g=e.get(sh),p=n.style.color,m=p?{...g,color:p}:g,_=[];f!==d&&_.push(Gi(rh,f)),m!==g&&_.push(Gi(sh,m));let x=function(y){let N=[],T=null,v=()=>{if(T!==null){let R=T.getFirstChild();Ue(R)&&T.getChildrenSize()===1&&R.remove()}};for(let R of y)Ug(R)||re(R)||Ue(R)?T!==null?T.append(R):(T=Se().append(R),N.push(T)):(v(),T=null,N.push(R));return v(),N.length===0&&N.push(Se()),N}(e.$importChildren(n,{context:_})),C=r?x:od(x,n);return[a.splice(0,0,C)]},match:gt.tag("td","th"),name:"@lexical/table/cell"})],SO=_e({build:(e,n,r)=>Dt(n),config:We({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[co,sn(qo,{rules:yO})],name:"@lexical/table/Table",nodes:()=>[Nr,fa,Cr],register(e,n,r){let s=r.getOutput(),i=!1;return De(Nt(()=>{let a=s.hasHorizontalScroll.value,l=s.hasStickyScrollbar.value&&a,c=ec(e);c!==a&&hO(e,a),c===a&&i===l||e.update(xi),i=l}),CO(e,s),Nt(()=>xO(e,s.hasTabHandler.value)),Nt(()=>{if(s.hasStickyScrollbar.value&&s.hasHorizontalScroll.value)return e.registerRootListener((a)=>{if(a)return function(l){let c=new Map;return De(()=>{for(let{cleanup:d}of c.values())d();c.clear()},l.registerMutationListener(Nr,(d)=>{for(let[f,g]of d){let p=c.get(f);if(g==="destroyed"){p&&(p.cleanup(),c.delete(f));continue}let m=l.getElementByKey(f),_=m&&ye(m)?o1(m):null;p&&_&&p.parts.scrollable===_.scrollable&&p.parts.scrollbar===_.scrollbar&&p.parts.tableElement===_.tableElement?Am(_.scrollable,_.scrollbar):(p&&(p.cleanup(),c.delete(f)),_&&c.set(f,{cleanup:n1(_),parts:_}))}},{skipInitialization:!1}))}(e)})}),Nt(()=>s.hasCellMerge.value?void 0:_O(e)),Nt(()=>s.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(Cr,(a)=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})))}}),f1=_e({dependencies:[SO],name:"@lexical/table/Import"});var le=Fm,{$computeTableCellRectBoundary:DW,$computeTableMap:$W,$computeTableMapSkipCellCheck:wW,$createTableCellNode:kW,$createTableNode:IW,$createTableNodeWithDimensions:LW,$createTableRowNode:FW,$createTableSelection:PW,$createTableSelectionFrom:BW,$deleteTableColumn:KW,$deleteTableColumnAtSelection:zW,$deleteTableColumn__EXPERIMENTAL:UW,$deleteTableRowAtSelection:HW,$deleteTableRow__EXPERIMENTAL:WW,$findCellNode:GW,$findTableNode:jW,$getElementForTableNode:YW,$getNodeTriplet:VW,$getTableAndElementByKey:XW,$getTableCellNodeFromLexicalNode:qW,$getTableCellNodeRect:JW,$getTableColumnIndexFromTableCellNode:ZW,$getTableNodeFromLexicalNodeOrThrow:QW,$getTableRowIndexFromTableCellNode:e2,$getTableRowNodeFromTableCellNodeOrThrow:t2,$insertTableColumn:n2,$insertTableColumnAtNode:o2,$insertTableColumnAtSelection:r2,$insertTableColumn__EXPERIMENTAL:s2,$insertTableRow:i2,$insertTableRowAtNode:a2,$insertTableRowAtSelection:l2,$insertTableRow__EXPERIMENTAL:c2,$isScrollableTablesActive:u2,$isSimpleTable:d2,$isStickyScrollbarActive:f2,$isTableCellNode:g2,$isTableNode:p2,$isTableRowNode:h2,$isTableSelection:m2,$mergeCells:_2,$moveTableColumn:x2,$moveTableRow:C2,$removeTableRowAtIndex:y2,$setTableColumnIsHeader:S2,$setTableRowIsHeader:N2,$unmergeCell:E2,$unmergeCellNode:T2,INSERT_TABLE_COMMAND:b2,TableCellHeaderStates:v2,TableCellNode:NO,TableExtension:O2,TableImportExtension:A2,TableImportRules:R2,TableNode:EO,TableObserver:M2,TableRowNode:TO,TableRowSchema:D2,TableSchema:$2,applyTableHandlers:w2,getDOMCellFromTarget:k2,getTableElement:I2,getTableObserverFromTableElement:L2,registerTableCellUnmergeTransform:F2,registerTablePlugin:P2,registerTableSelectionObserver:B2,setScrollableTablesActive:K2}=le;S();var g1={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 p1(e){let{anchor:n,focus:r}=e,s=e.anchor.getNode(),i=e.focus.getNode();if(s===i)return s;if(e.isBackward())return ap(r)?s:i;else return ap(n)?i:s}function bO({rightContent:e}={}){let[n]=st(),[r,s]=u(!1),[i,a]=u(!1),[l,c]=u("paragraph"),[d,f]=u(!1),[g,p]=u(!1),[m,_]=u(!1),[x,C]=u(!1),[y,N]=u(!1),[T,v]=u(!1),R=P(()=>{let V=X();if(j(V)){f(V.hasFormat("bold")),p(V.hasFormat("italic")),_(V.hasFormat("underline")),C(V.hasFormat("strikethrough")),N(V.hasFormat("code"));let fe=p1(V),Ce=fe.getParent();v(ea(Ce)||ea(fe));let Ae=V.anchor.getNode(),oe=Ae.getKey()==="root"?Ae:Ae.getTopLevelElementOrThrow(),ae=oe.getKey();if(n.getElementByKey(ae)!==null)if(Oo(oe)){let we=Iu(Ae,Jo),Ie=we?we.getListType():oe.getListType();c(Ie)}else if(Fl(oe))c(oe.getTag());else{let we=oe.getType();if(we in g1)c(we);else c("paragraph")}}},[n]);h(()=>n.registerCommand(ro,()=>(R(),!1),Si),[n,R]),h(()=>n.registerUpdateListener(({editorState:V})=>{V.read(()=>{R()})}),[n,R]),h(()=>{let V=n.registerCommand(Ms,(Ce)=>(s(Ce),!1),Pe),fe=n.registerCommand(Rs,(Ce)=>(a(Ce),!1),Pe);return()=>{V(),fe()}},[n]);let F=()=>{n.update(()=>{let V=X();if(j(V))Fi(V,()=>Se())})},k=(V)=>{n.update(()=>{let fe=X();if(j(fe))Fi(fe,()=>gd(V))})},H=()=>{if(l!=="bullet")n.dispatchCommand(O0,void 0);else n.dispatchCommand(Ed,void 0)},U=()=>{if(l!=="number")n.dispatchCommand(v0,void 0);else n.dispatchCommand(Ed,void 0)},W=()=>{if(l!=="check")n.dispatchCommand(b0,void 0);else n.dispatchCommand(Ed,void 0)},J=()=>{if(l!=="quote")n.update(()=>{let V=X();if(j(V))Fi(V,()=>pd())});else F()},G=()=>{if(l!=="code")n.update(()=>{let V=X();if(j(V))Fi(V,()=>Gv())});else F()},ne=P(()=>{if(!T){let V=prompt("Enter link URL (e.g., https://example.com):");if(V)n.dispatchCommand(Lh,V)}else n.dispatchCommand(Lh,null)},[n,T]),ee=P(()=>{n.update(()=>{let V=X();if(j(V))V.setFormat(0),Fi(V,()=>Se())})},[n]);return o("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[o("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[t("button",{type:"button",disabled:!r,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:t(qm,{className:"h-4 w-4"})}),t("button",{type:"button",disabled:!i,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:t(jm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),o("select",{value:l,onChange:(V)=>{let fe=V.target.value;switch(fe){case"paragraph":F();break;case"h1":case"h2":case"h3":k(fe);break;case"bullet":H();break;case"number":U();break;case"check":W();break;case"quote":J();break;case"code":G();break}},"aria-label":"Block formatting",children:[t("option",{value:"paragraph",children:"Normal"}),t("option",{value:"h1",children:"Heading 1"}),t("option",{value:"h2",children:"Heading 2"}),t("option",{value:"h3",children:"Heading 3"}),t("option",{value:"bullet",children:"Bullet List"}),t("option",{value:"number",children:"Numbered List"}),t("option",{value:"check",children:"Check List"}),t("option",{value:"quote",children:"Quote"}),t("option",{value:"code",children:"Code Block"})]}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:d?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:t(Pm,{className:"h-4 w-4"})}),t("button",{type:"button",className:g?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:t(Hm,{className:"h-4 w-4"})}),t("button",{type:"button",className:m?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:t(Xm,{className:"h-4 w-4"})}),t("button",{type:"button",className:x?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:t(Vm,{className:"h-4 w-4"})}),t("button",{type:"button",className:y?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"code"),title:"Inline Code","aria-label":"Inline Code",children:t(Ql,{className:"h-4 w-4"})}),t("button",{type:"button",className:T?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:ne,title:"Insert Link","aria-label":"Link",children:t(qi,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:l==="h1"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h1"),title:"H1","aria-label":"Heading 1",children:t(Km,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h2"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h2"),title:"H2","aria-label":"Heading 2",children:t(zm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h3"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h3"),title:"H3","aria-label":"Heading 3",children:t(Um,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="bullet"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:H,title:"Bullet List","aria-label":"Bullet List",children:t(Po,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="number"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:U,title:"Numbered List","aria-label":"Numbered List",children:t(Wm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="check"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:W,title:"Check List","aria-label":"Check List",children:t(Bi,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="quote"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:J,title:"Quote","aria-label":"Quote",children:t(Gm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",onMouseDown:(V)=>V.preventDefault(),onClick:ee,title:"Clear Formatting","aria-label":"Clear Formatting",children:t(Ym,{className:"h-4 w-4"})})]}),e&&t("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var vO={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 oc=[Ev,...Tv,...bv,...vv,...Ov];function h1({value:e,initialContent:n="",onChange:r}){let[s]=st(),i=b(!1),a=b("");return h(()=>{if(!i.current){i.current=!0;let l=e!==void 0?e:n;if(l)s.update(()=>{em(l,oc)}),a.current=l}},[s,n,e]),h(()=>{if(i.current&&e!==void 0&&e!==a.current)s.update(()=>{em(e,oc)}),a.current=e},[s,e]),t(wv,{ignoreSelectionChange:!0,onChange:(l)=>{l.read(()=>{let c=Nv(oc);if(c!==a.current)a.current=c,r?.(c)})}})}function OO({initialContent:e="",value:n,onChange:r,placeholder:s="Write your markdown content here...",readOnly:i=!1,autoFocus:a=!1,className:l="",hideToolbar:c=!1,rightToolbarContent:d}){let f={namespace:"ShumaiWysiwygMarkdownEditor",theme:vO,editable:!i,onError:(g)=>{console.error("[MarkdownEditor] Error:",g)},nodes:[md,_d,Jo,ns,jv,EO,NO,TO,Z0,ta]};return t("div",{className:`shumai-editor-wrapper ${i?"read-only":""} ${l}`,children:o(AS,{initialConfig:f,children:[!i&&!c?t(bO,{rightContent:d}):d?t("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:d}):null,o(ce,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[t("div",{className:"relative min-h-full",children:t(FT,{contentEditable:t(UT,{className:"editor-input"}),placeholder:t("div",{className:"editor-placeholder",children:s}),ErrorBoundary:Iv})}),t(VT,{}),t(D0,{}),t($0,{}),t(k0,{}),t(eb,{}),t($v,{transformers:oc}),t(h1,{value:n,initialContent:e,onChange:r}),a&&t(tb,{})]})]})})}function AO({projectId:e,assetId:n,rootFolderId:r,isRoot:s}){let i=Me(),a=K(),{canAdmin:l}=Pt(e),{data:c,isLoading:d}=L({queryKey:["folders",n,"agentsmd"],queryFn:async()=>{let ee=await A.api.folders[":folderId"].agentsmd.$get({param:{folderId:n}});if(!ee.ok)throw Error("Failed to fetch agents.md");return await ee.json()}}),[f,g]=u(""),[p,m]=u(!1),[_,x]=u("idle"),C=b(null),y=b(null),N=b(""),T=b(null),v=b(Promise.resolve());h(()=>{if(!p&&c!==void 0){let ee=c.content??"";g(ee),N.current=ee,T.current=ee,m(!0)}},[c,p]);let[R,F]=u(!1),k=B({mutationFn:async(ee)=>{let se=await A.api.folders[":folderId"].agentsmd.$patch({param:{folderId:n},json:{content:ee}});if(!se.ok)throw Error("Failed to save agents.md");return await se.json()},onSuccess:(ee,se)=>{if(x("saved"),T.current=se,a.setQueryData(["folders",n,"agentsmd"],{content:se}),a.invalidateQueries({queryKey:["folders",n]}),y.current)clearTimeout(y.current);y.current=setTimeout(()=>{x("idle")},2500)},onError:()=>{x("error")}}),H=b(k.mutateAsync);H.current=k.mutateAsync;let U=P((ee)=>{if(!l)return Promise.resolve();if(T.current===ee)return x("saved"),Promise.resolve();x("saving");let se=v.current.then(async()=>{await H.current(ee)}).catch(()=>{});return v.current=se,se},[l]),W=P((ee)=>{if(!l)return;if(g(ee),N.current=ee,C.current)clearTimeout(C.current);x("saving"),C.current=setTimeout(()=>{C.current=null,U(ee)},1000)},[l,U]),J=P(()=>{if(C.current)return clearTimeout(C.current),C.current=null,U(N.current);return v.current},[U]);h(()=>()=>{if(J(),y.current)clearTimeout(y.current)},[J]);let G=async()=>{F(!0);try{J(),await v.current}catch{}finally{if(s||n===r)i({to:"/projects/$projectId",params:{projectId:e}});else i({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:n}})}},ne=o("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[l?o("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(_==="saving"||R)&&o("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[t(si,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:vp()})]}),_==="saved"&&!R&&o("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[t(ke,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:kg()})]}),_==="error"&&!R&&o("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[t(vn,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:A0()})]})]}):o("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:Bm(),children:[t(nn,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Bm()})]}),o("div",{className:"flex items-center gap-2 shrink-0",children:[l&&t(so,{orientation:"vertical",className:"h-4 shrink-0"}),o(E,{variant:"ghost",size:"sm",onClick:G,disabled:R,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Dc(),children:[t(Re,{className:"h-4 w-4 mr-1 shrink-0"}),t("span",{children:Dc()})]})]})]});if(d||!p)return o("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[t(si,{className:"h-4 w-4 animate-pulse mr-2"}),t("span",{children:h0()})]});return t("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:t(OO,{value:f,onChange:W,placeholder:g0(),readOnly:!l,rightToolbarContent:ne,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function Zi({teamId:e,projectId:n,projectName:r,assetId:s,rootFolderId:i,isRoot:a}){let l=Me(),[c,d]=u(240),[f,g]=u(360),{fileListLeftSidebarCollapsed:p,setFileListLeftSidebarCollapsed:m}=$t(),{isChatbotOpen:_,setIsChatbotOpen:x}=ir(),C=hr((v)=>Boolean(v.metadata["appearance.hideAgent"])),{data:y}=L({queryKey:["folders",s],queryFn:async()=>{let v=await A.api.folders[":folderId"].$get({param:{folderId:s}});if(!v.ok)throw Error("failed to fetch folder");return await v.json()},enabled:!!s}),{setProjectState:N,clearProjectState:T}=on();return h(()=>{let R=a||s===i?[]:y?.name?[{id:s,name:y.name},...y?.ancestorFolders??[]]:y?.ancestorFolders??[];return N({teamId:e,projectId:n,projectName:r,ancestorFolders:R,currentAsset:{name:y?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(F)=>{l({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:F}})}}),()=>T()},[e,n,r,y?.ancestorFolders,y?.name,a,s,i,N,T,l]),t("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:o("div",{className:"flex-1 flex overflow-hidden relative",children:[!p&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>m(!0)}),_&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>x(!1)}),!p&&o(Z,{children:[t("div",{className:"bg-background flex-shrink-0",style:{width:c},children:t(yr,{teamId:e,projectId:n,projectName:r,rootFolderId:i,selectedFolderId:s,ancestorFolders:y?.ancestorFolders??[]})}),t(Er,{onResize:(v)=>{d((R)=>Math.max(180,Math.min(400,R+v)))},className:"hidden md:block"})]}),t("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:t(AO,{projectId:n,assetId:s,rootFolderId:i,isRoot:a})}),_&&!C&&o(Z,{children:[t(Er,{onResize:(v)=>{g((R)=>Math.max(240,Math.min(600,R-v)))},className:"hidden md:block"}),t("div",{style:{width:f},className:"bg-background flex flex-col flex-shrink-0",children:t(va,{projectId:n,contextAssetId:s})})]})]})})}
40
+ `:"\t")}return n}}function je(e){return e instanceof tc}function GI(){let e=Jn("root",0,"element"),n=Jn("root",0,"element");return new tc("root",e,n)}function Gd(e,n,r){e.getKey(),n.getKey(),r.getKey();let s=X(),i=je(s)?s.clone():new tc("root",Jn("root",0,"element"),Jn("root",0,"element"));return i.set(e.getKey(),n.getKey(),r.getKey()),i}function jI(e,n){let r=[[e]];for(let s=r.at(-1);s!==void 0&&r.length>0;s=r.at(-1)){let i=s.pop();i===void 0?r.pop():n(i)!==!1&&Q(i)&&r.push(i.getChildren())}}function Im(e,n=Ge()){let r=Rt(e);rt(r)||pe(231,e);let s=Qo(r,n.getElementByKey(e));return s===null&&pe(232,e),{tableElement:s,tableNode:r}}class lO{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let n=this.observers.get(e);return n!==void 0&&(n[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[n,[r]]of Array.from(this.observers.entries())){let s=Rt(n);rt(s)?e.push([s,r]):this.removeObserver(n)}return e}}class Lm{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=e,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((e)=>e()),this.listenersToRemove.clear()}$lookup(){return Im(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver((n)=>{this.editor.read("latest",()=>{let r=!1;for(let a=0;a<n.length;a++){let l=n[a].target.nodeName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TR"){r=!0;break}}if(!r)return;let{tableNode:s,tableElement:i}=this.$lookup();this.table=da(s,i)})});this.editor.read("latest",()=>{let{tableNode:n,tableElement:r}=this.$lookup();this.table=da(n,r),e.observe(r,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let n=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:r,tableElement:s}=this.$lookup();Kd(n,da(r,s),null),e&&X()!==null&&(mt(null),n.dispatchCommand(ro))}$enableHighlightStyle(){let e=this.editor,{tableElement:n}=this.$lookup();an(n,e._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();et(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&pe(233,e.tableKey,this.tableNodeKey);let n=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Kd(n,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=Fn(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,n=!1){let r=this.editor,{tableNode:s}=this.$lookup(),{x:i,y:a}=e;if(this.focusCell=e,!this.isHighlightingCells)(n||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle());if(this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let l=Om(s,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let c=l;if(c===null&&n&&(c=s.getCellNodeFromCords(i,a,this.table)),c!==null){let d=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=c.getKey(),this.tableSelection=Gd(s,d,c),mt(this.tableSelection),r.dispatchCommand(ro),Kd(r,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?Rt(this.anchorCellNodeKey):null;return xe(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&pe(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?Rt(this.focusCellNodeKey):null;return xe(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&pe(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:n}=this.$lookup(),r=Om(n,e.elem);if(r!==null){let s=r.getKey();this.tableSelection!=null?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(n.getKey(),s,s)):this.tableSelection=Gd(n,r,r),this.anchorCellNodeKey=s}}$formatCells(e){let n=X();je(n)||pe(236);let r=Kr(),{anchor:s,focus:i}=r,a=n.getNodes().filter(xe);a.length>0||pe(237);let l=a[0].getFirstChild(),c=wn(l)?l.getFormatFlags(e,null):null;a.forEach((d)=>{s.set(d.getKey(),0,"element"),i.set(d.getKey(),d.getChildrenSize(),"element"),r.formatText(e,c)}),mt(n),this.editor.dispatchCommand(ro)}$clearText(){let{editor:e}=this,n=Rt(this.tableNodeKey);if(!rt(n))throw Error("Expected TableNode.");let r=X();je(r)||pe(253);let s=r.getNodes().filter(xe),i=n.getFirstChild(),a=n.getLastChild();if(s.length>0&&i!==null&&a!==null&&Ke(i)&&Ke(a)&&s[0]===i.getFirstChild()&&s[s.length-1]===a.getLastChild()){n.selectPrevious();let l=n.getParent();return n.remove(),void(So(l)&&l.isEmpty()&&e.dispatchCommand(jr))}s.forEach((l)=>{if(Q(l)){let c=Se(),d=yt();c.append(d),l.append(c),l.getChildren().forEach((f)=>{f!==c&&f.remove()})}}),Kd(e,this.table,null),mt(null),e.dispatchCommand(ro)}}var ua="__lexicalTableSelection";function cO(e){let n=Ly(e);return rt(n)||pe(386,e),n}var sa=40;function ym(e,n,r){let s=(i)=>Math.max(1,Math.ceil(Math.min(sa,i)/sa*18));return e<=n+sa?-s(n+sa-e):e>=r-sa?s(e-(r-sa)):0}function as(e){return ye(e)&&e.nodeName==="TABLE"}function Qo(e,n){if(!n)return n;let r=as(n)?n:n.querySelector("table");return as(r)||pe(341,e.constructor.name,e.getType(),e.getKey(),n.nodeName),r}function Vd(e){return e._window}function Xd(e,n){for(let r=n,s=null;r!==null;r=r.getParent()){if(e.is(r))return s;xe(r)&&(s=r)}return null}var YI=[[jo,"down"],[oo,"up"],[Yr,"backward"],[bi,"forward"]],VI=[au,iu,Ei],XI=[vi,hu];function qI(e,n){return e.registerRootListener((r)=>{if(r===null)return;let s=e._window;if(s===null)return;return ao(s,"pointerdown",(i)=>{let a=Sl(i);if(i.button!==0||!io(a)||!r.contains(a))return;let l=function(c){let d=Zl(c);if(d===null)return null;let f=d.elem;for(;f!=null;){if(f.nodeName==="TABLE"&&ua in f&&f[ua])return{cellElement:d,tableElement:f,tableObserver:f[ua]};f=f.parentNode}return null}(a);e.update(()=>{if(je(X())){for(let[g]of n.observers.values())g.$clearHighlight(!1);mt(null),e.dispatchCommand(ro)}if(!l)return;let{tableObserver:c,tableElement:d,cellElement:f}=l;(function(g,p,m,_,x,C){let y=g._window;if(!y)return;let N=(R)=>{if(x.isSelecting)return;x.isSelecting=!0,R!==null&&x.anchorCell===null&&g.update(()=>{x.$setAnchorCellForSelection(R)});let{clientX:F,clientY:k}=p,H=null,U=()=>{x.isSelecting=!1,H!==null&&(y.cancelAnimationFrame(H),H=null),y.removeEventListener("pointerup",Ce),y.removeEventListener("pointermove",Ae)},W=(oe,ae)=>{let ue=_.getRootNode();if(!qr(ue)&&!Au(ue))return null;for(let we of ue.elementsFromPoint(oe,ae)){let Ie=Vv(_,we);if(Ie)return Ie}return null},J=(oe,ae)=>{x.anchorCell===null&&g.update(()=>{x.$setAnchorCellForSelection(oe)}),x.focusCell!==null&&oe.elem===x.focusCell.elem||(C.setNextFocus({focusCell:oe,override:ae,tableKey:x.tableNodeKey}),g.dispatchCommand(ro))},G=(oe)=>{for(let ae=_.parentElement;ae;ae=ae.parentElement)if(oe==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ue=y.getComputedStyle(ae),we=oe==="x"?ue.overflowX:ue.overflowY;if(we==="auto"||we==="scroll")return ae}return null},ne=(oe,ae,ue)=>{let we,Ie;if(oe===null)we=0,Ie=ue==="x"?y.innerWidth:y.innerHeight;else{let Be=oe.getBoundingClientRect();we=ue==="x"?Be.left:Be.top,Ie=ue==="x"?Be.right:Be.bottom}let ht=ym(ae,we,Ie);if(ht===0)return!1;if(oe===null){let Be=ue==="x"?y.scrollX:y.scrollY;return y.scrollBy(ue==="x"?ht:0,ue==="x"?0:ht),(ue==="x"?y.scrollX:y.scrollY)!==Be}if(ue==="x"){let Be=oe.scrollLeft;return oe.scrollLeft+=ht,oe.scrollLeft!==Be}let Qt=oe.scrollTop;return oe.scrollTop+=ht,oe.scrollTop!==Qt},ee=(oe,ae)=>{let ue=F,we=k;if(oe===null)ue=Math.min(Math.max(ue,1),y.innerWidth-1);else{let Ie=oe.getBoundingClientRect();ue=Math.min(Math.max(ue,Ie.left+1),Ie.right-1)}if(ae===null)we=Math.min(Math.max(we,1),y.innerHeight-1);else{let Ie=ae.getBoundingClientRect();we=Math.min(Math.max(we,Ie.top+1),Ie.bottom-1)}return[ue,we]},se=()=>{let oe=G("x");if(oe!==null){let Ie=oe.getBoundingClientRect();if(ym(F,Ie.left,Ie.right)!==0)return!0}let ae=G("y"),ue=ae===null?0:ae.getBoundingClientRect().top,we=ae===null?y.innerHeight:ae.getBoundingClientRect().bottom;return ym(k,ue,we)!==0},V=()=>{if(H=null,!x.isSelecting)return;let oe=G("x"),ae=G("y"),ue=oe!==null&&ne(oe,F,"x"),we=ne(ae,k,"y");if(ue||we){let[Ie,ht]=ee(oe,ae),Qt=W(Ie,ht);Qt&&J(Qt,!1),H=y.requestAnimationFrame(V)}},fe=()=>{H===null&&x.pointerType!=="touch"&&se()&&(H=y.requestAnimationFrame(V))},Ce=()=>{U()},Ae=(oe)=>{if(!((Ie)=>!(1&~Ie.buttons))(oe)&&x.isSelecting)return void U();let ae=Sl(oe);if(!io(ae))return;F=oe.clientX,k=oe.clientY;let ue=null,we=!(ws||_.contains(ae));ue=we?Vv(_,ae):W(oe.clientX,oe.clientY),ue&&J(ue,we),fe()};y.addEventListener("pointerup",Ce,x.listenerOptions),y.addEventListener("pointermove",Ae,x.listenerOptions)};x.pointerType=p.pointerType;let T=cO(x.tableNodeKey),v=En();if(ws&&p.shiftKey&&Ro(v,T)&&(j(v)||je(v))){let R=v.anchor.getNode(),F=Xd(T,v.anchor.getNode());if(F)x.$setAnchorCellForSelection(Zs(x,F)),x.$setFocusCellForSelection(m),xr(p);else(T.isBefore(R)?T.selectStart():T.selectEnd()).anchor.set(v.anchor.key,v.anchor.offset,v.anchor.type)}else p.pointerType!=="touch"&&x.$setAnchorCellForSelection(m);N(m)})(e,i,f,d,c,n)})})})}function uO(e,n,r,s,i){let a=r.getRootElement(),l=Vd(r);a!==null&&l!==null||pe(246);let c=new Lm(r,e.getKey()),d=Qo(e,n);(function(m,_){bm(m)!==null&&pe(205),m[ua]=_})(d,c),c.listenersToRemove.add(()=>function(m,_){bm(m)===_&&delete m[ua]}(d,c)),c.listenersToRemove.add(ao(d,"mousedown",(m)=>{let _=Sl(m);if(m.detail>=3&&io(_))Zl(_)!==null&&m.preventDefault()},c.listenerOptions));for(let[m,_]of YI)c.listenersToRemove.add(r.registerCommand(m,(x)=>gO(r,x,_,e,c,i),In));c.listenersToRemove.add(r.registerCommand(Ai,(m)=>{let _=X();if(je(_)){let x=Xd(e,_.focus.getNode());if(x!==null)return xr(m),x.selectEnd(),!0}return!1},In));let f=()=>{let m=X();return!!Ro(m,e)&&(!!je(m)&&(c.$clearText(),!0))};for(let m of VI)c.listenersToRemove.add(r.registerCommand(m,f,In));let g=(m)=>{let _=X();if(!je(_)&&!j(_))return!1;let x=e.isParentOf(_.anchor.getNode());if(x!==e.isParentOf(_.focus.getNode())){let C=x?"anchor":"focus",y=x?"focus":"anchor",{key:N,offset:T,type:v}=_[y];return e[_[C].isBefore(_[y])?"selectPrevious":"selectNext"]()[y].set(N,T,v),!1}return!!Ro(_,e)&&(!!je(_)&&(m&&(m.preventDefault(),m.stopPropagation()),c.$clearText(),!0))};for(let m of XI)c.listenersToRemove.add(r.registerCommand(m,g,In));c.listenersToRemove.add(r.registerCommand(ru,(m)=>{let _=X();if(_){if(!je(_)&&!j(_))return!1;wl(r,Pn(m,ClipboardEvent)?m:null,ad(_));let x=g(m);return j(_)?(_.removeText(),!0):x}return!1},In));let p=a.ownerDocument;return c.listenersToRemove.add(ao(p,"paste",(m)=>{if(m.defaultPrevented)return;r.read("latest",()=>{let _=X();return a.contains(p.activeElement)&&je(_)&&Ro(_,e)})&&(m.preventDefault(),r.dispatchCommand(Mi,m))})),c.listenersToRemove.add(ao(p,"copy",(m)=>{if(m.defaultPrevented)return;let _=Sl(m);if(_===a||io(_)&&a.contains(_))return;r.read("latest",()=>{let x=X();return a.contains(Eo(a))&&je(x)&&Ro(x,e)})&&(m.preventDefault(),r.dispatchCommand(Ni,m))})),c.listenersToRemove.add(r.registerCommand(Go,(m)=>{let _=X();return!!Ro(_,e)&&(!!je(_)&&(c.$formatCells(m),!0))},In)),c.listenersToRemove.add(r.registerCommand(cu,(m)=>{let _=X();if(!je(_)||!Ro(_,e))return!1;let x=_.anchor.getNode(),C=_.focus.getNode();if(!xe(x)||!xe(C))return!1;let[y,N,T]=ln(e,x,C),v=Math.max(N.startRow+N.cell.__rowSpan-1,T.startRow+T.cell.__rowSpan-1),R=Math.max(N.startColumn+N.cell.__colSpan-1,T.startColumn+T.cell.__colSpan-1),F=Math.min(N.startRow,T.startRow),k=Math.min(N.startColumn,T.startColumn);if(F===0&&k===0&&v===y.length-1&&R===y[0].length-1)return e.setFormat(m),!0;let H=new Set;for(let U=F;U<=v;U++)for(let W=k;W<=R;W++){let J=y[U][W].cell;if(H.has(J))continue;H.add(J),J.setFormat(m);let G=J.getChildren();for(let ne=0;ne<G.length;ne++){let ee=G[ne];Q(ee)&&!ee.isInline()&&ee.setFormat(m)}}return!0},In)),c.listenersToRemove.add(r.registerCommand(ou,(m)=>{let _=X();if(!Ro(_,e))return!1;if(je(_))return c.$clearHighlight(),!1;if(j(_)){let x=he(_.anchor.getNode(),(C)=>xe(C));if(!xe(x))return!1;if(typeof m=="string"){let C=qv(r,_,e);if(C)return Xv(C,e,[yt(m)]),!0}}return!1},In)),s&&c.listenersToRemove.add(r.registerCommand(Vr,(m)=>{let _=X();if(!j(_)||!_.isCollapsed()||!Ro(_,e))return!1;let x=la(_.anchor.getNode());return!(x===null||!e.is(Qs(x)))&&(xr(m),function(C,y){let N=y==="next"?"getNextSibling":"getPreviousSibling",T=y==="next"?"getFirstChild":"getLastChild",v=C[N]();if(Q(v))return v.selectEnd();let R=he(C,Ke);R===null&&pe(247);for(let k=R[N]();Ke(k);k=k[N]()){let H=k[T]();if(Q(H))return H.selectEnd()}let F=he(R,rt);F===null&&pe(248),y==="next"?F.selectNext():F.selectPrevious()}(x,m.shiftKey?"previous":"next"),!0)},In)),c.listenersToRemove.add(r.registerCommand(eS,(m)=>e.isSelected(),In)),c.listenersToRemove.add(r.registerCommand(jr,()=>{let m=X();if(!j(m)||!m.isCollapsed()||!Ro(m,e))return!1;let _=qv(r,m,e);return!!_&&(Xv(_,e),!0)},In)),c}function JI(e,n){let r=X(),s=En(),i=e.getAndClearNextFocus();if(i!==null){let{tableKey:l,focusCell:c}=i,d=e.observers.get(l);d||pe(335,l);let[f]=d;if(je(r)&&r.tableKey===f.tableNodeKey)return(c.x!==f.focusX||c.y!==f.focusY)&&(f.$setFocusCellForSelection(c),!0);if(f.anchorCell!==null&&f.anchorCellNodeKey!==null&&c.elem!==f.anchorCell.elem&&f.tableSelection!==null)return f.$setFocusCellForSelection(c,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&j(s)&&j(r)&&r.isCollapsed()){let l=Rt(a);if(rt(l)){let c=r.anchor.getNode(),d=l.getFirstChild(),f=la(c);if(f!==null&&Ke(d)){let g=d.getFirstChild();if(xe(g)&&l.is(he(f,(p)=>p.is(l)||p.is(g))))return g.selectStart(),!0}}}je(r)&&function(l,c){let d=Vd(l),f=En();if(!c.is(f))return;let g=cO(c.tableKey),p=Fn(d),m=p&&ks(p,l.getRootElement());if(p&&m&&m.anchorNode&&m.focusNode){let _=vt(m.focusNode),x=_&&!g.isParentOf(_),C=vt(m.anchorNode),y=C&&g.isParentOf(C);if(x&&y&&p.rangeCount>0){let N=My(p,l);N&&(N.anchor.set(g.getKey(),c.isBackward()?g.getChildrenSize():0,"element"),p.removeAllRanges(),mt(N))}}}(n,r),j(r)&&function(l,c){let d=En(),{anchor:f,focus:g}=l,p=f.getNode(),m=g.getNode(),_=la(p),x=la(m),C=_?Qs(_):null,y=x?Qs(x):null,N=l.isBackward(),T=_&&x&&C&&y&&C.is(y),v=y&&(!C||C.isParentOf(y)),R=C&&(!y||y.isParentOf(C));if(v){let F=l.clone(),[k]=ln(y,x,x),H=k[0][0].cell,U=k[k.length-1].at(-1).cell;F.focus.set(N?H.getKey():U.getKey(),N?0:U.getChildrenSize(),"element"),mt(F)}else if(R){let F=l.clone(),[k]=ln(C,_,_),H=k[0][0].cell,U=k[k.length-1].at(-1).cell;F.anchor.set(N?U.getKey():H.getKey(),N?U.getChildrenSize():0,"element"),mt(F)}else if(T){let F=c.observers.get(C.getKey());F||pe(335,C.getKey());let[k]=F;if(_.is(x)||(k.$setAnchorCellForSelection(Zs(k,_)),k.$setFocusCellForSelection(Zs(k,x),!0)),k.pointerType==="touch"&&k.isSelecting&&l.isCollapsed()&&j(d)&&d.isCollapsed()){let H=la(d.anchor.getNode());H&&!H.is(x)&&(k.$setAnchorCellForSelection(Zs(k,H)),k.$setFocusCellForSelection(Zs(k,x),!0),k.pointerType=null)}}}(r,e);for(let[l,c]of e.$getTableNodesAndObservers())ZI(n,l,c);return!1}function ZI(e,n,r){let s=X(),i=En();s&&!s.is(i)&&(je(s)||je(i))&&r.tableSelection&&!r.tableSelection.is(i)&&(je(s)&&s.tableKey===r.tableNodeKey?r.$updateTableTableSelection(s):!je(s)&&je(i)&&i.tableKey===r.tableNodeKey&&r.$updateTableTableSelection(null)),r.hasHijackedSelectionStyles&&!n.isSelected()?function(a,l){l.$enableHighlightStyle(),vm(l.table,(c)=>{let d=c.elem;c.highlighted=!1,fO(a,c),d.getAttribute("style")||d.removeAttribute("style")})}(e,r):!r.hasHijackedSelectionStyles&&n.isSelected()&&function(a,l){l.$disableHighlightStyle(),vm(l.table,(c)=>{c.highlighted=!0,dO(a,c)})}(e,r)}function bm(e){return e[ua]||null}function Zl(e){let n=e;for(;n!=null;){let r=n.nodeName;if(r==="TD"||r==="TH"){let s=n._cell;return s===void 0?null:s}n=n.parentNode}return null}function Vv(e,n){if(!e.contains(n))return null;let r=null;for(let s=n;s!=null;s=s.parentNode){if(s===e)return r;let i=s.nodeName;i!=="TD"&&i!=="TH"||(r=s._cell||null)}return null}function da(e,n){let r=[],s={columns:0,domRows:r,rows:0},i=Qo(e,n).querySelector("tr"),a=0,l=0;for(r.length=0;i!=null;){let c=i.nodeName;if(c==="TD"||c==="TH"){let g={elem:i,hasBackgroundColor:i.style.backgroundColor!=="",highlighted:!1,x:a,y:l};i._cell=g;let p=r[l];p===void 0&&(p=r[l]=[]),p[a]=g}else{let g=i.firstChild;if(g!=null){i=g;continue}}let d=i.nextSibling;if(d!=null){a++,i=d;continue}let f=i.parentNode;if(f!=null){let g=f.nextSibling;if(g==null)break;l++,a=0,i=g}}return s.columns=a+1,s.rows=l+1,s}function Kd(e,n,r){let s=new Set(r?r.getNodes():[]);vm(n,(i,a)=>{let l=i.elem;s.has(a)?(i.highlighted=!0,dO(e,i)):(i.highlighted=!1,fO(e,i),l.getAttribute("style")||l.removeAttribute("style"))})}function vm(e,n){let{domRows:r}=e;for(let s=0;s<r.length;s++){let i=r[s];if(i)for(let a=0;a<i.length;a++){let l=i[a];if(!l)continue;let c=vt(l.elem);c!==null&&n(l,c,{x:a,y:s})}}}var QI=(e,n,r,s,i)=>{let a=i==="forward";switch(i){case"backward":case"forward":return r!==(a?e.table.columns-1:0)?Ud(n.getCellNodeFromCordsOrThrow(r+(a?1:-1),s,e.table),a):s!==(a?e.table.rows-1:0)?Ud(n.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,s+(a?1:-1),e.table),a):a?n.selectNext():n.selectPrevious(),!0;case"up":return s!==0?Ud(n.getCellNodeFromCordsOrThrow(r,s-1,e.table),!1):n.selectPrevious(),!0;case"down":return s!==e.table.rows-1?Ud(n.getCellNodeFromCordsOrThrow(r,s+1,e.table),!0):n.selectNext(),!0;default:return!1}};function Sm(e,n){let r,s;if(n.startColumn===e.minColumn)r="minColumn";else{if(n.startColumn+n.cell.__colSpan-1!==e.maxColumn)return null;r="maxColumn"}if(n.startRow===e.minRow)s="minRow";else{if(n.startRow+n.cell.__rowSpan-1!==e.maxRow)return null;s="maxRow"}return[r,s]}function zd([e,n]){return[e==="minColumn"?"maxColumn":"minColumn",n==="minRow"?"maxRow":"minRow"]}function aa(e,n,[r,s]){let i=n[s],a=e[i];a===void 0&&pe(250,s,String(i));let l=n[r],c=a[l];return c===void 0&&pe(250,r,String(l)),c}function e1(e,n,r,s,i){let a=Jl(n,r,s),l=function(k,H){let{minColumn:U,maxColumn:W,minRow:J,maxRow:G}=H,ne=1,ee=1,se=1,V=1,fe=k[J],Ce=k[G];for(let Ae=U;Ae<=W;Ae++)ne=Math.max(ne,fe[Ae].cell.__rowSpan),V=Math.max(V,Ce[Ae].cell.__rowSpan);for(let Ae=J;Ae<=G;Ae++)ee=Math.max(ee,k[Ae][U].cell.__colSpan),se=Math.max(se,k[Ae][W].cell.__colSpan);return{bottomSpan:V,leftSpan:ee,rightSpan:se,topSpan:ne}}(n,a),{topSpan:c,leftSpan:d,bottomSpan:f,rightSpan:g}=l,p=function(k,H){let U=Sm(k,H);return U===null&&pe(249,H.cell.getKey()),U}(a,r),[m,_]=zd(p),x=a[m],C=a[_];i==="forward"?x+=m==="maxColumn"?1:d:i==="backward"?x-=m==="minColumn"?1:g:i==="down"?C+=_==="maxRow"?1:c:i==="up"&&(C-=_==="minRow"?1:f);let y=n[C];if(y===void 0)return!1;let N=y[x];if(N===void 0)return!1;let[T,v]=function(k,H,U){let W=Jl(k,H,U),J=Sm(W,H);if(J)return[aa(k,W,J),aa(k,W,zd(J))];let G=Sm(W,U);if(G)return[aa(k,W,zd(G)),aa(k,W,G)];let ne=["minColumn","minRow"];return[aa(k,W,ne),aa(k,W,zd(ne))]}(n,r,N),R=Zs(e,T.cell),F=Zs(e,v.cell);return e.$setAnchorCellForSelection(R),e.$setFocusCellForSelection(F,!0),!0}function Ro(e,n){if(j(e)||je(e)){let r=n.isParentOf(e.anchor.getNode()),s=n.isParentOf(e.focus.getNode());return r&&s}return!1}function Ud(e,n){n?e.selectStart():e.selectEnd()}function dO(e,n){let r=n.elem,s=e._config.theme;xe(vt(r))||pe(131),et(r,s.tableCellSelected)}function fO(e,n){let r=n.elem;xe(vt(r))||pe(131);let s=e._config.theme;an(r,s.tableCellSelected)}function la(e){let n=he(e,xe);return xe(n)?n:null}function Qs(e){let n=he(e,rt);return rt(n)?n:null}function t1(e,n,r,s,i,a,l){let c=dn(r.focus,i?"previous":"next");if(ll(c))return!1;let d=c;for(let y of bs(c).iterNodeCarets("shadowRoot")){if(!No(y)||!Q(y.origin))return!1;d=y}let f=d.getParentAtCaret();if(!xe(f))return!1;let g=f,p=function(y){for(let N of bs(y).iterNodeCarets("root")){let{origin:T}=N;if(xe(T)){if(zo(N))return bt(T,y.direction)}else if(!Ke(T))break}return null}(it(g,d.direction)),m=he(g,rt);if(!m||!m.is(a))return!1;let _=e.getElementByKey(g.getKey()),x=Zl(_);if(!_||!x)return!1;let C=mO(e,m);if(l.table=C,p)if(s==="extend"){let y=Zl(e.getElementByKey(p.origin.getKey()));if(!y)return!1;l.$setAnchorCellForSelection(x),l.$setFocusCellForSelection(y,!0)}else{let y=kt(p);Wo(r.anchor,y),Wo(r.focus,y)}else if(s==="extend")l.$setAnchorCellForSelection(x),l.$setFocusCellForSelection(x,!0);else{let y=function(N){let T=il(N);return zo(T)?kt(T):N}(it(m,c.direction));Wo(r.anchor,y),Wo(r.focus,y)}return xr(n),!0}function gO(e,n,r,s,i,a){if((r==="up"||r==="down")&&function(c){let d=c.getRootElement();if(!d)return!1;return d.hasAttribute("aria-controls")&&d.getAttribute("aria-controls")==="typeahead-menu"}(e))return!1;let l=X();if(!Ro(l,s)){if(j(l)){if(r==="backward"){if(l.focus.offset>0)return!1;let c=function(f){for(let g=f,p=f;p!==null;g=p,p=p.getParent())if(Q(p)){if(p!==g&&p.getFirstChild()!==g)return null;if(!p.isInline())return p}return null}(l.focus.getNode());if(!c)return!1;let d=c.getPreviousSibling();return!!rt(d)&&(xr(n),n.shiftKey?l.focus.set(d.getParentOrThrow().getKey(),d.getIndexWithinParent(),"element"):d.selectEnd(),!0)}if(n.shiftKey&&(r==="up"||r==="down")){let c=l.focus.getNode();if(!l.isCollapsed()&&(r==="up"&&!l.isBackward()||r==="down"&&l.isBackward())){let d=he(c,(_)=>rt(_));if(xe(d)&&(d=he(d,rt)),d!==s)return!1;if(!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(!f)return!1;let g=0;r==="up"&&Q(f)&&(g=f.getChildrenSize());let p=f;if(r==="up"&&Q(f))p=f.getLastChild()||f,g=re(p)?p.getTextContentSize():0;let m=l.clone();return m.focus.set(p.getKey(),g,re(p)?"text":"element"),mt(m),xr(n),!0}if(Mt(c)){let d=r==="up"?l.getNodes()[l.getNodes().length-1]:l.getNodes()[0];if(d){if(Xd(s,d)!==null){let f=s.getFirstDescendant(),g=s.getLastDescendant();if(!f||!g)return!1;let[p]=Ht(f),[m]=Ht(g),_=s.getCordsFromCellNode(p,i.table),x=s.getCordsFromCellNode(m,i.table),C=s.getDOMCellFromCordsOrThrow(_.x,_.y,i.table),y=s.getDOMCellFromCordsOrThrow(x.x,x.y,i.table);return i.$setAnchorCellForSelection(C),i.$setFocusCellForSelection(y,!0),!0}}return!1}{let d=he(c,(g)=>Q(g)&&!g.isInline());if(xe(d)&&(d=he(d,rt)),!d)return!1;let f=r==="down"?d.getNextSibling():d.getPreviousSibling();if(rt(f)&&i.tableNodeKey===f.getKey()){let g=f.getFirstDescendant(),p=f.getLastDescendant();if(!g||!p)return!1;let[m]=Ht(g),[_]=Ht(p),x=l.clone();return x.focus.set((r==="up"?m:_).getKey(),r==="up"?0:_.getChildrenSize(),"element"),xr(n),mt(x),!0}}}}return r==="down"&&ec(e)&&a.setShouldCheckSelectionForTable(s.getKey()),!1}if(j(l)){if(r==="backward"||r==="forward")return t1(e,n,l,n.shiftKey?"extend":"move",r==="backward",s,i);if(l.isCollapsed()){let{anchor:c,focus:d}=l,f=he(c.getNode(),xe),g=he(d.getNode(),xe);if(!xe(f)||!f.is(g))return!1;let p=Qs(f);if(p!==s&&p!=null){let T=Qo(p,e.getElementByKey(p.getKey()));if(T!=null)return i.table=da(p,T),gO(e,n,r,p,i,a)}let m=e.getElementByKey(f.__key),_=e.getElementByKey(c.key);if(_==null||m==null)return!1;let x;if(c.type==="element")x=_.getBoundingClientRect();else{let T=Fn(Vd(e));if(T===null||T.rangeCount===0)return!1;let v=mS(T,e.getRootElement());if(v===null)return!1;x=v.getBoundingClientRect()}let C=r==="up"?f.getFirstChild():f.getLastChild();if(C==null)return!1;let y=e.getElementByKey(C.__key);if(y==null)return!1;let N=y.getBoundingClientRect();if(r==="up"?N.top>x.top-x.height:x.bottom+x.height>N.bottom){xr(n);let T=s.getCordsFromCellNode(f,i.table);if(!n.shiftKey)return QI(i,s,T.x,T.y,r);{let v=s.getDOMCellFromCordsOrThrow(T.x,T.y,i.table);i.$setAnchorCellForSelection(v),i.$setFocusCellForSelection(v,!0)}return!0}}}else if(je(l)){let{anchor:c,focus:d,tableKey:f}=l;if(f!==s.getKey())return!1;let g=he(c.getNode(),xe),p=he(d.getNode(),xe),[m]=l.getNodes();rt(m)||pe(251);let _=Qo(m,e.getElementByKey(m.getKey()));if(!xe(g)||!xe(p)||!rt(m)||_==null)return!1;i.$updateTableTableSelection(l);let x=da(m,_),C=s.getCordsFromCellNode(g,x),y=s.getDOMCellFromCordsOrThrow(C.x,C.y,x);if(i.$setAnchorCellForSelection(y),xr(n),n.shiftKey){let[N,T,v]=ln(s,g,p);return e1(i,N,T,v,r)}return p.selectEnd(),!0}return!1}function xr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Xv(e,n,r){let s=Se();e==="first"?n.insertBefore(s):n.insertAfter(s),s.append(...r||[]),s.selectEnd()}function qv(e,n,r){let s=r.getParent();if(!s)return;let i=Fn(Vd(e));if(!i)return;let a=ks(i,e.getRootElement()).anchorNode,l=e.getElementByKey(s.getKey()),c=Qo(r,e.getElementByKey(r.getKey()));if(!a||!l||!c||!l.contains(a)||c.contains(a))return;let d=he(n.anchor.getNode(),(T)=>xe(T));if(!d)return;let f=he(d,(T)=>rt(T));if(!rt(f)||!f.is(r))return;let[g,p]=ln(r,d,d),m=g[0][0],_=g[g.length-1][g[0].length-1],{startRow:x,startColumn:C}=p,y=x===m.startRow&&C===m.startColumn,N=x===_.startRow&&C===_.startColumn;return y?"first":N?"last":void 0}function Zs(e,n){let{tableNode:r}=e.$lookup(),s=r.getCordsFromCellNode(n,e.table);return r.getDOMCellFromCordsOrThrow(s.x,s.y,e.table)}function Om(e,n,r){return Xd(e,vt(n,r))}function jd(e){return ye(e)&&e.nodeName==="DIV"}function Jv(e,n,r){let s=e.querySelector(":scope > colgroup");if(!r)return void(s&&s.remove());s||(s=Xe().createElement("colgroup"),Mu(s),e.insertBefore(s,e.firstChild));let i=[];for(let a=0;a<n;a++){let l=Xe().createElement("col"),c=r[a];c&&(l.style.width=`${c}px`),i.push(l)}s.replaceChildren(...i)}function Zv(e,n,r){if(!n.theme.tableAlignment)return;let s=[],i=[];for(let a of["center","right"]){let l=n.theme.tableAlignment[a];l&&(a===r?i:s).push(l)}an(e,...s),et(e,...i)}var pO=new WeakSet;function n1(e){let{scrollable:n,scrollbar:r,tableElement:s}=e;if(r.classList.length===0&&function(c){let d=c.style.display;c.style.display="";let f=c.offsetHeight-c.clientHeight;return c.style.display=d,f}(r)===0)return pO.add(r),r.style.display="none",n.style.scrollbarWidth="auto",()=>{};let i=()=>{r.scrollLeft!==n.scrollLeft&&(r.scrollLeft=n.scrollLeft)},a=()=>{n.scrollLeft!==r.scrollLeft&&(n.scrollLeft=r.scrollLeft)};n.addEventListener("scroll",i,{passive:!0}),r.addEventListener("scroll",a,{passive:!0});let l=null;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(()=>{Am(n,r)}),l.observe(n),l.observe(s)),Am(n,r),()=>{n.removeEventListener("scroll",i),r.removeEventListener("scroll",a),l&&l.disconnect()}}function Am(e,n){if(pO.has(n))return;let r=n.firstElementChild;if(!r||!ye(r)||!e.isConnected)return;let s=e.ownerDocument.defaultView;if(!s)return void(n.style.display="none");let i=s.getComputedStyle(e).overflowX,a=i==="auto"||i==="scroll",{scrollWidth:l,clientWidth:c}=e,d=l+"px";r.style.width!==d&&(r.style.width=d);let f=a&&l>c;n.style.display=f?"":"none"}function o1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let n=e.firstElementChild;if(!jd(n))return null;let r=n.querySelector(":scope > table");if(!as(r))return null;let s=n.nextElementSibling;return jd(s)?{scrollable:n,scrollbar:s,tableElement:r}:null}var Rm=new WeakSet;function ec(e=Ge()){return Rm.has(e)}function Mm(e=Ge()){let n=lo(e,"@lexical/table/Table");return!!n&&(n.output.hasStickyScrollbar.peek()&&n.output.hasHorizontalScroll.peek())}function hO(e,n){n?Rm.add(e):Rm.delete(e)}class Nr extends ct{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:ct,importDOM:{table:()=>({conversion:r1,priority:1})}})}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let n=this.getWritable();return n.__colWidths=e,n}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}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(e,n,r){return r==="html"}getDOMSlot(e){let n=as(e)?e:e.querySelector("table");return as(n)||pe(229),super.getDOMSlot(e).withElement(n).withAfter(n.querySelector(":scope > colgroup"))}createDOM(e,n){let r=Xe().createElement("table");if(this.__style&&fr(r.style,this.__style),this.getColWidths()){let s=Xe().createElement("colgroup");r.appendChild(s),Mu(s)}if(et(r,e.theme.table),this.updateTableElement(null,r,e),ec(n)){let s=Mm(n),i=function(a,l,c){let d=Xe().createElement("div"),f=l.theme.tableScrollableWrapper;return f?et(d,f):d.style.overflowX="auto",c&&(d.style.scrollbarWidth="none"),d.appendChild(a),d}(r,e,s);if(this.updateTableWrapper(null,i,r,e),s){let a=function(c){let d=Xe(),f=d.createElement("div"),g=c.theme.tableStickyScrollbar;g?et(f,g):(f.style.position="sticky",f.style.bottom="0",f.style.overflowX="scroll",f.style.overflowY="hidden"),f.style.display="none",f.setAttribute("aria-hidden","true"),f.tabIndex=-1;let p=d.createElement("div");return p.style.height="1px",p.style.width="0px",f.appendChild(p),f}(e),l=Xe().createElement("div");return l.setAttribute("data-lexical-sticky-scrollbar","true"),l.appendChild(i),l.appendChild(a),Mu(a),l}return i}return r}updateTableWrapper(e,n,r,s){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenColumn),a.setAttribute("data-lexical-frozen-column","true")):(an(i,l.theme.tableFrozenColumn),a.removeAttribute("data-lexical-frozen-column"))}(n,r,s,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(i,a,l,c){c>0?(et(i,l.theme.tableFrozenRow),a.setAttribute("data-lexical-frozen-row","true")):(an(i,l.theme.tableFrozenRow),a.removeAttribute("data-lexical-frozen-row"))}(n,r,s,this.__frozenRowCount)}updateTableElement(e,n,r){this.__style!==(e?e.__style:"")&&fr(n.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(a,l,c){c?(et(a,l.theme.tableRowStriping),a.setAttribute("data-lexical-row-striping","true")):(an(a,l.theme.tableRowStriping),a.removeAttribute("data-lexical-row-striping"))}(n,r,this.__rowStriping);let s=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===s&&this.getColWidths()===i||Jv(n,this.getColumnCount(),this.getColWidths()),Zv(n,r,this.getFormatType())}updateDOM(e,n,r){let s=Qo(this,n);if(n===s===ec())return!0;if(jd(n)){if(n.hasAttribute("data-lexical-sticky-scrollbar")!==Mm())return!0;let i=s.parentElement;jd(i)&&this.updateTableWrapper(e,i,s,r)}return this.updateTableElement(e,s,r),!1}scaleDOMColWidths(e,n){let r=this.getColWidths();if(!r)return;Jv(Qo(this,e),this.getColumnCount(),r.map((s)=>s*n))}exportDOM(e){let n=super.exportDOM(e),{element:r}=n;return{after:(s)=>{if(n.after&&(s=n.after(s)),!as(s)&&ye(s)&&(s=s.querySelector("table")),!as(s))return null;Zv(s,e._config,this.getFormatType());let[i]=po(this,null,null),a=new Map;for(let f of i)for(let g of f){let p=g.cell.getKey();a.has(p)||a.set(p,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn})}let l=new Set;for(let f of s.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){let g=f.getAttribute("data-temporary-table-cell-lexical-key");if(g){let p=a.get(g);if(f.removeAttribute("data-temporary-table-cell-lexical-key"),p){a.delete(g);for(let m=0;m<p.colSpan;m++)l.add(m+p.startColumn)}}}let c=s.querySelector(":scope > colgroup");if(c){let f=Array.from(s.querySelectorAll(":scope > colgroup > col")).filter((g,p)=>l.has(p));c.replaceChildren(...f)}let d=s.querySelectorAll(":scope > tr");if(d.length>0){let f=Xe().createElement("tbody");for(let g of d)f.appendChild(g);s.append(f)}return s},element:!as(r)&&ye(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,n){let{rows:r,domRows:s}=n;for(let i=0;i<r;i++){let a=s[i];if(a!=null)for(let l=0;l<a.length;l++){let c=a[l];if(c==null)continue;let{elem:d}=c,f=Om(this,d);if(f!==null&&e.is(f))return{x:l,y:i}}}throw Error("Cell not found in table.")}getDOMCellFromCords(e,n,r){let{domRows:s}=r,i=s[n];if(i==null)return null;let a=i[e<i.length?e:i.length-1];return a==null?null:a}getDOMCellFromCordsOrThrow(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(!s)throw Error("Cell not found at cords.");return s}getCellNodeFromCords(e,n,r){let s=this.getDOMCellFromCords(e,n,r);if(s==null)return null;let i=vt(s.elem);return xe(i)?i:null}getCellNodeFromCordsOrThrow(e,n,r){let s=this.getCellNodeFromCords(e,n,r);if(!s)throw Error("Node at cords not TableCellNode.");return s}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){let n=this.getWritable();return n.__rowStriping=e,n}setFrozenColumns(e){let n=this.getWritable();return n.__frozenColumnCount=e,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let n=this.getWritable();return n.__frozenRowCount=e,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!Ke(e))return 0;let n=0;return e.getChildren().forEach((r)=>{xe(r)&&(n+=r.getColSpan())}),n}}function mO(e,n){let r=e.getElementByKey(n.getKey());return r===null&&pe(230),da(n,r)}function r1(e){let n=nc();e.hasAttribute("data-lexical-row-striping")&&n.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&n.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&n.setFrozenRows(1);let r=e.querySelector(":scope > colgroup");if(r){let s=[];for(let i of r.querySelectorAll(":scope > col")){let a=i.style.width||"";if(!ca.test(a)&&(a=i.getAttribute("width")||"",!/^\d+$/.test(a))){s=void 0;break}s.push(parseFloat(a))}s&&n.setColWidths(s)}return{after:(s)=>Tl(s,Ke),node:n}}function nc(){return un(new Nr)}function rt(e){return e instanceof Nr}function s1(e){Ke(e.getParent())?e.isEmpty()&&e.append(Se()):e.remove()}function i1(e){rt(e.getParent())?yp(e,xe):e.remove()}function a1(e){yp(e,Ke);let[n]=po(e,null,null),r=n.reduce((l,c)=>Math.max(l,c.length),0),s=e.getChildren();for(let l=0;l<n.length;++l){let c=s[l];if(!c)continue;Ke(c)||pe(254,c.constructor.name,c.getType());let d=n[l].reduce((f,g)=>g?1+f:f,0);if(d!==r)for(let f=d;f<r;++f){let g=_n();g.append(Se()),c.append(g)}}let i=e.getColWidths(),a=e.getColumnCount();if(i&&i.length!==a){let l;if(a<i.length)l=i.slice(0,a);else if(i.length>0){let c=i[i.length-1];l=[...i,...Array(a-i.length).fill(c)]}e.setColWidths(l)}}function l1(e){if(e.detail<3||!io(e.target))return!1;let n=vt(e.target);if(n===null)return!1;let r=he(n,(s)=>Q(s)&&!s.isInline());if(r===null)return!1;return!!xe(r.getParent())&&(r.select(0),!0)}function c1(){let e=X();if(!j(e))return!1;let n=Qs(e.anchor.getNode());if(n===null)return!1;let r=Je();if(!r.is(n.getParent())||r.getChildrenSize()!==1)return!1;let[s]=po(n,null,null);if(s.length===0||s[0].length===0)return!1;let i=s[0][0];if(!i||!i.cell)return!1;let a=s[s.length-1],l=a[a.length-1];if(!l||!l.cell)return!1;let c=Gd(n,i.cell,l.cell);return mt(c),!0}function _O(e){return e.registerNodeTransform(Cr,(n)=>{if(n.getColSpan()>1||n.getRowSpan()>1){let[,,r]=Ht(n),[s]=ln(r,n,n),i=s.length,a=s[0].length,l=r.getFirstChild();Ke(l)||pe(175);let c=[];for(let d=0;d<i;d++){d!==0&&(l=l.getNextSibling(),Ke(l)||pe(175));let f=null;for(let g=0;g<a;g++){let p=s[d][g],m=p.cell;if(p.startRow===d&&p.startColumn===g)f=m,c.push(m);else if(m.getColSpan()>1||m.getRowSpan()>1){xe(m)||pe(176);let _=_n(m.__headerState);f!==null?f.insertAfter(_):iN(l,_)}}}for(let d of c)d.setColSpan(1),d.setRowSpan(1)}})}function xO(e,n=!0){let r=new lO,s=(i,a,l)=>{let c=Qo(i,l),d=uO(i,c,e,n,r);r.observers.set(a,[d,c])};return De(qI(e,r),e.registerCommand(ro,()=>JI(r,e),In),e.registerMutationListener(Nr,(i)=>{e.read("latest",()=>{for(let[a,l]of i){let c=r.observers.get(a);if(l==="created"||l==="updated"){let{tableNode:d,tableElement:f}=Im(a);c===void 0?s(d,a,f):f!==c[1]&&(r.removeObserver(a),s(d,a,f))}else l==="destroyed"&&r.removeObserver(a)}})},{skipInitialization:!1}),()=>{r.removeAllObservers()})}function CO(e,n){e.hasNodes([Nr])||pe(255);let{hasNestedTables:r=zs(!1)}=n??{};return De(e.registerCommand(Qv,(s)=>function({rows:i,columns:a,includeHeaders:l},c){let d=X()||En();if(!d||!j(d))return!1;if(!c&&Qs(d.anchor.getNode()))return!1;let f=eO(Number(i),Number(a),l);Lu(f);let g=f.getFirstDescendant();return re(g)&&g.select(),!0}(s,r.peek()),Te),e.registerCommand(yu,(s,i)=>e===i&&function(a,l){let{nodes:c,selection:d}=a;if(!c.some((p)=>rt(p)||sN(p).some((m)=>rt(m.node)))){if(je(d)){let p="",m=!1;for(let _ of c){let x=Q(_)&&!_.isInline();p.length>0&&(x||m)&&(p+=`
41
+ `),p+=_.getTextContent(),m=x}return d.insertRawText(p),!0}return!1}let f=je(d),g=j(d);if(!(g&&he(d.anchor.getNode(),(p)=>xe(p))!==null&&he(d.focus.getNode(),(p)=>xe(p))!==null||f))return!1;if(c.length===1&&rt(c[0]))return aO(c[0],d);if(g&&l.peek()&&!function(p){if(je(p)&&!p.focus.getNode().is(p.anchor.getNode()))return!0;if(j(p)&&xe(p.anchor.getNode())&&!p.anchor.getNode().is(p.focus.getNode()))return!0;return!1}(d))return!1;return!0}(s,r),Te),e.registerCommand(Di,c1,Pe),e.registerCommand(yi,l1,Te),e.registerNodeTransform(Nr,a1),e.registerNodeTransform(fa,i1),e.registerNodeTransform(Cr,s1))}var u1={$accepts:Ke,$packageRun:(e)=>e.every(xe)?[Sr().splice(0,0,e)]:[],name:"TableSchema"},d1={$accepts:xe,name:"TableRowSchema"},yO=[ft({$import:(e,n)=>{let r=nc();n.hasAttribute("data-lexical-row-striping")&&r.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&r.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&r.setFrozenRows(1);let s=n.querySelector(":scope > colgroup");if(s){let i=[];for(let a of s.querySelectorAll(":scope > col")){let l=a.style.width||"";if(!ca.test(l)&&(l=a.getAttribute("width")||"",!/^\d+$/.test(l))){i=void 0;break}i.push(parseFloat(l))}i&&r.setColWidths(i)}return[r.splice(0,0,Tl(e.$importChildren(n),Ke))]},match:gt.tag("table"),name:"@lexical/table/table"}),ft({$import:(e,n)=>[Sr(ca.test(n.style.height)?parseFloat(n.style.height):void 0).splice(0,0,Tl(e.$importChildren(n),xe))],match:gt.tag("tr"),name:"@lexical/table/tr"}),ft({$import:(e,n)=>{let r=n.nodeName==="TH",s=ca.test(n.style.width)?parseFloat(n.style.width):void 0,i=ve.NO_STATUS;if(r){let y=n.getAttribute("scope");if(y==="col")i=ve.COLUMN;else if(y==="row")i=ve.ROW;else{let N=n.parentElement,T=ES(N)&&(N.parentElement&&N.parentElement.nodeName==="THEAD"||N.rowIndex===0),v=n.cellIndex===0;T&&(i|=ve.ROW),v&&(i|=ve.COLUMN),i===ve.NO_STATUS&&(i=ve.ROW)}}let a=_n(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;(function(y){return y==="middle"||y==="bottom"})(c)&&(a.__verticalAlign=c);let d=e.get(rh),f=d|function(y){let N=0,T=y.fontWeight;T!=="700"&&T!=="bold"||(N|=hl),y.fontStyle==="italic"&&(N|=_l);let v=(y.textDecoration||"").split(" ");return v.includes("underline")&&(N|=Cl),v.includes("line-through")&&(N|=xl),N}(n.style),g=e.get(sh),p=n.style.color,m=p?{...g,color:p}:g,_=[];f!==d&&_.push(Gi(rh,f)),m!==g&&_.push(Gi(sh,m));let x=function(y){let N=[],T=null,v=()=>{if(T!==null){let R=T.getFirstChild();Ue(R)&&T.getChildrenSize()===1&&R.remove()}};for(let R of y)Ug(R)||re(R)||Ue(R)?T!==null?T.append(R):(T=Se().append(R),N.push(T)):(v(),T=null,N.push(R));return v(),N.length===0&&N.push(Se()),N}(e.$importChildren(n,{context:_})),C=r?x:od(x,n);return[a.splice(0,0,C)]},match:gt.tag("td","th"),name:"@lexical/table/cell"})],SO=_e({build:(e,n,r)=>Dt(n),config:We({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[co,sn(qo,{rules:yO})],name:"@lexical/table/Table",nodes:()=>[Nr,fa,Cr],register(e,n,r){let s=r.getOutput(),i=!1;return De(Nt(()=>{let a=s.hasHorizontalScroll.value,l=s.hasStickyScrollbar.value&&a,c=ec(e);c!==a&&hO(e,a),c===a&&i===l||e.update(xi),i=l}),CO(e,s),Nt(()=>xO(e,s.hasTabHandler.value)),Nt(()=>{if(s.hasStickyScrollbar.value&&s.hasHorizontalScroll.value)return e.registerRootListener((a)=>{if(a)return function(l){let c=new Map;return De(()=>{for(let{cleanup:d}of c.values())d();c.clear()},l.registerMutationListener(Nr,(d)=>{for(let[f,g]of d){let p=c.get(f);if(g==="destroyed"){p&&(p.cleanup(),c.delete(f));continue}let m=l.getElementByKey(f),_=m&&ye(m)?o1(m):null;p&&_&&p.parts.scrollable===_.scrollable&&p.parts.scrollbar===_.scrollbar&&p.parts.tableElement===_.tableElement?Am(_.scrollable,_.scrollbar):(p&&(p.cleanup(),c.delete(f)),_&&c.set(f,{cleanup:n1(_),parts:_}))}},{skipInitialization:!1}))}(e)})}),Nt(()=>s.hasCellMerge.value?void 0:_O(e)),Nt(()=>s.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(Cr,(a)=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})))}}),f1=_e({dependencies:[SO],name:"@lexical/table/Import"});var le=Fm,{$computeTableCellRectBoundary:DW,$computeTableMap:$W,$computeTableMapSkipCellCheck:wW,$createTableCellNode:kW,$createTableNode:IW,$createTableNodeWithDimensions:LW,$createTableRowNode:FW,$createTableSelection:PW,$createTableSelectionFrom:BW,$deleteTableColumn:KW,$deleteTableColumnAtSelection:zW,$deleteTableColumn__EXPERIMENTAL:UW,$deleteTableRowAtSelection:HW,$deleteTableRow__EXPERIMENTAL:WW,$findCellNode:GW,$findTableNode:jW,$getElementForTableNode:YW,$getNodeTriplet:VW,$getTableAndElementByKey:XW,$getTableCellNodeFromLexicalNode:qW,$getTableCellNodeRect:JW,$getTableColumnIndexFromTableCellNode:ZW,$getTableNodeFromLexicalNodeOrThrow:QW,$getTableRowIndexFromTableCellNode:e2,$getTableRowNodeFromTableCellNodeOrThrow:t2,$insertTableColumn:n2,$insertTableColumnAtNode:o2,$insertTableColumnAtSelection:r2,$insertTableColumn__EXPERIMENTAL:s2,$insertTableRow:i2,$insertTableRowAtNode:a2,$insertTableRowAtSelection:l2,$insertTableRow__EXPERIMENTAL:c2,$isScrollableTablesActive:u2,$isSimpleTable:d2,$isStickyScrollbarActive:f2,$isTableCellNode:g2,$isTableNode:p2,$isTableRowNode:h2,$isTableSelection:m2,$mergeCells:_2,$moveTableColumn:x2,$moveTableRow:C2,$removeTableRowAtIndex:y2,$setTableColumnIsHeader:S2,$setTableRowIsHeader:N2,$unmergeCell:E2,$unmergeCellNode:T2,INSERT_TABLE_COMMAND:b2,TableCellHeaderStates:v2,TableCellNode:NO,TableExtension:O2,TableImportExtension:A2,TableImportRules:R2,TableNode:EO,TableObserver:M2,TableRowNode:TO,TableRowSchema:D2,TableSchema:$2,applyTableHandlers:w2,getDOMCellFromTarget:k2,getTableElement:I2,getTableObserverFromTableElement:L2,registerTableCellUnmergeTransform:F2,registerTablePlugin:P2,registerTableSelectionObserver:B2,setScrollableTablesActive:K2}=le;S();var g1={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 p1(e){let{anchor:n,focus:r}=e,s=e.anchor.getNode(),i=e.focus.getNode();if(s===i)return s;if(e.isBackward())return ap(r)?s:i;else return ap(n)?i:s}function bO({rightContent:e}={}){let[n]=st(),[r,s]=u(!1),[i,a]=u(!1),[l,c]=u("paragraph"),[d,f]=u(!1),[g,p]=u(!1),[m,_]=u(!1),[x,C]=u(!1),[y,N]=u(!1),[T,v]=u(!1),R=P(()=>{let V=X();if(j(V)){f(V.hasFormat("bold")),p(V.hasFormat("italic")),_(V.hasFormat("underline")),C(V.hasFormat("strikethrough")),N(V.hasFormat("code"));let fe=p1(V),Ce=fe.getParent();v(ea(Ce)||ea(fe));let Ae=V.anchor.getNode(),oe=Ae.getKey()==="root"?Ae:Ae.getTopLevelElementOrThrow(),ae=oe.getKey();if(n.getElementByKey(ae)!==null)if(Oo(oe)){let we=Iu(Ae,Jo),Ie=we?we.getListType():oe.getListType();c(Ie)}else if(Fl(oe))c(oe.getTag());else{let we=oe.getType();if(we in g1)c(we);else c("paragraph")}}},[n]);h(()=>n.registerCommand(ro,()=>(R(),!1),Si),[n,R]),h(()=>n.registerUpdateListener(({editorState:V})=>{V.read(()=>{R()})}),[n,R]),h(()=>{let V=n.registerCommand(Ds,(Ce)=>(s(Ce),!1),Pe),fe=n.registerCommand(Ms,(Ce)=>(a(Ce),!1),Pe);return()=>{V(),fe()}},[n]);let F=()=>{n.update(()=>{let V=X();if(j(V))Fi(V,()=>Se())})},k=(V)=>{n.update(()=>{let fe=X();if(j(fe))Fi(fe,()=>gd(V))})},H=()=>{if(l!=="bullet")n.dispatchCommand(O0,void 0);else n.dispatchCommand(Ed,void 0)},U=()=>{if(l!=="number")n.dispatchCommand(T0,void 0);else n.dispatchCommand(Ed,void 0)},W=()=>{if(l!=="check")n.dispatchCommand(E0,void 0);else n.dispatchCommand(Ed,void 0)},J=()=>{if(l!=="quote")n.update(()=>{let V=X();if(j(V))Fi(V,()=>pd())});else F()},G=()=>{if(l!=="code")n.update(()=>{let V=X();if(j(V))Fi(V,()=>Gv())});else F()},ne=P(()=>{if(!T){let V=prompt("Enter link URL (e.g., https://example.com):");if(V)n.dispatchCommand(Lh,V)}else n.dispatchCommand(Lh,null)},[n,T]),ee=P(()=>{n.update(()=>{let V=X();if(j(V))V.setFormat(0),Fi(V,()=>Se())})},[n]);return o("div",{className:"shumai-editor-toolbar flex items-center justify-between",children:[o("div",{className:"shumai-editor-toolbar-left flex items-center flex-wrap gap-1",children:[t("button",{type:"button",disabled:!r,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Eu,void 0),title:"Undo","aria-label":"Undo",children:t(qm,{className:"h-4 w-4"})}),t("button",{type:"button",disabled:!i,onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(xu,void 0),title:"Redo","aria-label":"Redo",children:t(jm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),o("select",{value:l,onChange:(V)=>{let fe=V.target.value;switch(fe){case"paragraph":F();break;case"h1":case"h2":case"h3":k(fe);break;case"bullet":H();break;case"number":U();break;case"check":W();break;case"quote":J();break;case"code":G();break}},"aria-label":"Block formatting",children:[t("option",{value:"paragraph",children:"Normal"}),t("option",{value:"h1",children:"Heading 1"}),t("option",{value:"h2",children:"Heading 2"}),t("option",{value:"h3",children:"Heading 3"}),t("option",{value:"bullet",children:"Bullet List"}),t("option",{value:"number",children:"Numbered List"}),t("option",{value:"check",children:"Check List"}),t("option",{value:"quote",children:"Quote"}),t("option",{value:"code",children:"Code Block"})]}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:d?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:t(Pm,{className:"h-4 w-4"})}),t("button",{type:"button",className:g?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:t(Hm,{className:"h-4 w-4"})}),t("button",{type:"button",className:m?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:t(Xm,{className:"h-4 w-4"})}),t("button",{type:"button",className:x?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:t(Vm,{className:"h-4 w-4"})}),t("button",{type:"button",className:y?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>n.dispatchCommand(Go,"code"),title:"Inline Code","aria-label":"Inline Code",children:t(Ql,{className:"h-4 w-4"})}),t("button",{type:"button",className:T?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:ne,title:"Insert Link","aria-label":"Link",children:t(qi,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:l==="h1"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h1"),title:"H1","aria-label":"Heading 1",children:t(Bm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h2"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h2"),title:"H2","aria-label":"Heading 2",children:t(Km,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h3"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:()=>k("h3"),title:"H3","aria-label":"Heading 3",children:t(zm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="bullet"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:H,title:"Bullet List","aria-label":"Bullet List",children:t(Po,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="number"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:U,title:"Numbered List","aria-label":"Numbered List",children:t(Wm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="check"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:W,title:"Check List","aria-label":"Check List",children:t(Bi,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="quote"?"active":"",onMouseDown:(V)=>V.preventDefault(),onClick:J,title:"Quote","aria-label":"Quote",children:t(Gm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",onMouseDown:(V)=>V.preventDefault(),onClick:ee,title:"Clear Formatting","aria-label":"Clear Formatting",children:t(Ym,{className:"h-4 w-4"})})]}),e&&t("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var vO={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 oc=[Ev,...Tv,...bv,...vv,...Ov];function h1({value:e,initialContent:n="",onChange:r}){let[s]=st(),i=b(!1),a=b("");return h(()=>{if(!i.current){i.current=!0;let l=e!==void 0?e:n;if(l)s.update(()=>{em(l,oc)}),a.current=l}},[s,n,e]),h(()=>{if(i.current&&e!==void 0&&e!==a.current)s.update(()=>{em(e,oc)}),a.current=e},[s,e]),t(wv,{ignoreSelectionChange:!0,onChange:(l)=>{l.read(()=>{let c=Nv(oc);if(c!==a.current)a.current=c,r?.(c)})}})}function OO({initialContent:e="",value:n,onChange:r,placeholder:s="Write your markdown content here...",readOnly:i=!1,autoFocus:a=!1,className:l="",hideToolbar:c=!1,rightToolbarContent:d}){let f={namespace:"ShumaiWysiwygMarkdownEditor",theme:vO,editable:!i,onError:(g)=>{console.error("[MarkdownEditor] Error:",g)},nodes:[md,_d,Jo,ns,jv,EO,NO,TO,Z0,ta]};return t("div",{className:`shumai-editor-wrapper ${i?"read-only":""} ${l}`,children:o(AS,{initialConfig:f,children:[!i&&!c?t(bO,{rightContent:d}):d?t("div",{className:"shumai-editor-toolbar flex items-center justify-between px-3 py-1.5 border-b",children:d}):null,o(ce,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[t("div",{className:"relative min-h-full",children:t(FT,{contentEditable:t(UT,{className:"editor-input"}),placeholder:t("div",{className:"editor-placeholder",children:s}),ErrorBoundary:Iv})}),t(VT,{}),t(M0,{}),t(D0,{}),t(k0,{}),t(eb,{}),t($v,{transformers:oc}),t(h1,{value:n,initialContent:e,onChange:r}),a&&t(tb,{})]})]})})}function AO({projectId:e,assetId:n,rootFolderId:r,isRoot:s}){let i=Me(),a=K(),{canAdmin:l}=Pt(e),{data:c,isLoading:d}=Z({queryKey:["folders",n,"agentsmd"],queryFn:async()=>{let ee=await A.api.folders[":folderId"].agentsmd.$get({param:{folderId:n}});if(!ee.ok)throw Error("Failed to fetch agents.md");return await ee.json()}}),[f,g]=u(""),[p,m]=u(!1),[_,x]=u("idle"),C=b(null),y=b(null),N=b(""),T=b(null),v=b(Promise.resolve());h(()=>{if(!p&&c!==void 0){let ee=c.content??"";g(ee),N.current=ee,T.current=ee,m(!0)}},[c,p]);let[R,F]=u(!1),k=B({mutationFn:async(ee)=>{let se=await A.api.folders[":folderId"].agentsmd.$patch({param:{folderId:n},json:{content:ee}});if(!se.ok)throw Error("Failed to save agents.md");return await se.json()},onSuccess:(ee,se)=>{if(x("saved"),T.current=se,a.setQueryData(["folders",n,"agentsmd"],{content:se}),a.invalidateQueries({queryKey:["folders",n]}),y.current)clearTimeout(y.current);y.current=setTimeout(()=>{x("idle")},2500)},onError:()=>{x("error")}}),H=b(k.mutateAsync);H.current=k.mutateAsync;let U=P((ee)=>{if(!l)return Promise.resolve();if(T.current===ee)return x("saved"),Promise.resolve();x("saving");let se=v.current.then(async()=>{await H.current(ee)}).catch(()=>{});return v.current=se,se},[l]),W=P((ee)=>{if(!l)return;if(g(ee),N.current=ee,C.current)clearTimeout(C.current);x("saving"),C.current=setTimeout(()=>{C.current=null,U(ee)},1000)},[l,U]),J=P(()=>{if(C.current)return clearTimeout(C.current),C.current=null,U(N.current);return v.current},[U]);h(()=>()=>{if(J(),y.current)clearTimeout(y.current)},[J]);let G=async()=>{F(!0);try{J(),await v.current}catch{}finally{if(s||n===r)i({to:"/projects/$projectId",params:{projectId:e}});else i({to:"/projects/$projectId/folders/$folderId",params:{projectId:e,folderId:n}})}},ne=o("div",{className:"flex items-center justify-between w-full gap-2 shrink-0",children:[l?o("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[(_==="saving"||R)&&o("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[t(si,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:xp()})]}),_==="saved"&&!R&&o("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[t(ke,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Pg()})]}),_==="error"&&!R&&o("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[t(vn,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:w0()})]})]}):o("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:Um(),children:[t(nn,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Um()})]}),o("div",{className:"flex items-center gap-2 shrink-0",children:[l&&t(so,{orientation:"vertical",className:"h-4 shrink-0"}),o(E,{variant:"ghost",size:"sm",onClick:G,disabled:R,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:Dc(),children:[t(Re,{className:"h-4 w-4 mr-1 shrink-0"}),t("span",{children:Dc()})]})]})]});if(d||!p)return o("div",{className:"flex-1 flex items-center justify-center p-8 text-sm text-muted-foreground",children:[t(si,{className:"h-4 w-4 animate-pulse mr-2"}),t("span",{children:b0()})]});return t("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:t(OO,{value:f,onChange:W,placeholder:v0(),readOnly:!l,rightToolbarContent:ne,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function Zi({teamId:e,projectId:n,projectName:r,assetId:s,rootFolderId:i,isRoot:a}){let l=Me(),[c,d]=u(240),[f,g]=u(360),{fileListLeftSidebarCollapsed:p,setFileListLeftSidebarCollapsed:m}=$t(),{isChatbotOpen:_,setIsChatbotOpen:x}=lr(),C=gr((v)=>Boolean(v.metadata["appearance.hideAgent"])),{data:y}=Z({queryKey:["folders",s],queryFn:async()=>{let v=await A.api.folders[":folderId"].$get({param:{folderId:s}});if(!v.ok)throw Error("failed to fetch folder");return await v.json()},enabled:!!s}),{setProjectState:N,clearProjectState:T}=on();return h(()=>{let R=a||s===i?[]:y?.name?[{id:s,name:y.name},...y?.ancestorFolders??[]]:y?.ancestorFolders??[];return N({teamId:e,projectId:n,projectName:r,ancestorFolders:R,currentAsset:{name:y?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(F)=>{l({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:F}})}}),()=>T()},[e,n,r,y?.ancestorFolders,y?.name,a,s,i,N,T,l]),t("div",{className:"flex-1 flex flex-col h-full overflow-hidden bg-background",children:o("div",{className:"flex-1 flex overflow-hidden relative",children:[!p&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>m(!0)}),_&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>x(!1)}),!p&&o(L,{children:[t("div",{className:"bg-background flex-shrink-0",style:{width:c},children:t(yr,{teamId:e,projectId:n,projectName:r,rootFolderId:i,selectedFolderId:s,ancestorFolders:y?.ancestorFolders??[]})}),t(Er,{onResize:(v)=>{d((R)=>Math.max(180,Math.min(400,R+v)))},className:"hidden md:block"})]}),t("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 bg-background overflow-hidden p-3",children:t(AO,{projectId:n,assetId:s,rootFolderId:i,isRoot:a})}),_&&!C&&o(L,{children:[t(Er,{onResize:(v)=>{g((R)=>Math.max(240,Math.min(600,R-v)))},className:"hidden md:block"}),t("div",{style:{width:f},className:"bg-background flex flex-col flex-shrink-0",children:t(wa,{projectId:n,contextAssetId:s})})]})]})})}
42
42
  export{Zi};