@shumai-one/shumai 0.4.3 → 0.4.4

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 (168) hide show
  1. package/bin/chunk-071x515q.js +4 -0
  2. package/bin/chunk-0cmx7k4c.js +1 -0
  3. package/bin/{chunk-cqb415s6.js → chunk-0qaq0sp8.js} +2 -2
  4. package/bin/chunk-0qjfahk9.js +2 -0
  5. package/bin/{chunk-9t1ne8xr.js → chunk-0zv3bks2.js} +2 -2
  6. package/bin/chunk-16xax8kk.js +1 -0
  7. package/bin/chunk-1gvscz88.js +5 -0
  8. package/bin/{chunk-6gg1ymer.js → chunk-1j27fzy1.js} +2 -2
  9. package/bin/chunk-1t167cvj.js +11 -0
  10. package/bin/{chunk-pb1zf0vb.js → chunk-1xh34aew.js} +2 -2
  11. package/bin/{chunk-zmv8cg4s.js → chunk-1zwajpwf.js} +3 -3
  12. package/bin/chunk-2w5xqhjm.js +1 -0
  13. package/bin/{chunk-f3ehv01n.js → chunk-3tedzb2j.js} +26 -26
  14. package/bin/{chunk-zehyn6vd.js → chunk-3ttrhqy3.js} +2 -2
  15. package/bin/chunk-3zkasqb8.js +1 -0
  16. package/bin/chunk-453ykvaw.js +2 -0
  17. package/bin/{chunk-3cyrcgm5.js → chunk-4991gz3y.js} +9 -9
  18. package/bin/chunk-4hkkdm2q.js +2 -0
  19. package/bin/chunk-4mjywsj8.js +3 -0
  20. package/bin/{chunk-cnxwmycy.js → chunk-4v41a1r9.js} +3 -3
  21. package/bin/{chunk-87zxtf66.js → chunk-4wy87hwd.js} +2 -2
  22. package/bin/{chunk-sfx2588q.js → chunk-579e4wv4.js} +2 -2
  23. package/bin/{chunk-1yacmegc.js → chunk-5adsx8x4.js} +2 -2
  24. package/bin/{chunk-b235azv4.js → chunk-5hg6kcfz.js} +13 -13
  25. package/bin/{chunk-rbj4fad9.js → chunk-5nm2jvg5.js} +13 -13
  26. package/bin/chunk-5tcdwep5.js +11 -0
  27. package/bin/chunk-5vzrpz50.js +2 -0
  28. package/bin/chunk-6ghcj4a9.js +3 -0
  29. package/bin/{chunk-b9yrw9et.js → chunk-77fmkpdz.js} +4 -4
  30. package/bin/chunk-7bcxj1jd.js +2 -0
  31. package/bin/{chunk-qf24e71w.js → chunk-7gmdnsdg.js} +1 -1
  32. package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
  33. package/bin/chunk-7kjgvxqa.js +2 -0
  34. package/bin/{chunk-bay038pj.js → chunk-7pw1550a.js} +2 -2
  35. package/bin/chunk-7rhz2gze.js +211 -0
  36. package/bin/chunk-837fky18.js +3 -0
  37. package/bin/chunk-84as6x83.js +1 -0
  38. package/bin/chunk-8e28hcny.js +2 -0
  39. package/bin/{chunk-k7hss0bd.js → chunk-914bp49r.js} +3 -3
  40. package/bin/chunk-97f2af6d.js +12 -0
  41. package/bin/{chunk-4r81ghg8.js → chunk-98715kc3.js} +2 -2
  42. package/bin/chunk-9ccw540k.js +2 -0
  43. package/bin/{chunk-ag6p3mbf.js → chunk-9t8n2des.js} +2 -2
  44. package/bin/chunk-9ybt6vbm.js +1 -0
  45. package/bin/{chunk-f15qyp41.js → chunk-a6gx7f5q.js} +1 -1
  46. package/bin/chunk-avwgktxb.js +2 -0
  47. package/bin/chunk-bkr5zm4h.js +2 -0
  48. package/bin/{chunk-2yxj593j.js → chunk-cbgq517y.js} +2 -2
  49. package/bin/chunk-d27mm390.js +1 -0
  50. package/bin/{chunk-185qefn1.js → chunk-dj92fss9.js} +2 -2
  51. package/bin/{chunk-v9w25rp2.js → chunk-dqxeztfa.js} +2 -2
  52. package/bin/chunk-drepsbb4.js +2 -0
  53. package/bin/chunk-f6svp4dp.js +2 -0
  54. package/bin/{chunk-q2bvyv39.js → chunk-fahk9h62.js} +2 -2
  55. package/bin/{chunk-v9b3w8q5.js → chunk-fb40xxz3.js} +2 -2
  56. package/bin/chunk-fnmwksnb.js +3 -0
  57. package/bin/chunk-fpc4p0j8.js +3 -0
  58. package/bin/{chunk-aqbrzx9z.js → chunk-fsyzs0tf.js} +1 -1
  59. package/bin/{chunk-e2mvmq2m.js → chunk-fxecgp5k.js} +1 -1
  60. package/bin/{chunk-wfzqnpc1.js → chunk-g3fpmyyn.js} +2 -2
  61. package/bin/{chunk-ehc9adfz.js → chunk-gc5sbfa5.js} +2 -2
  62. package/bin/chunk-gdm6yfqq.js +2 -0
  63. package/bin/{chunk-ea79xnn3.js → chunk-gk2q9a3f.js} +2 -2
  64. package/bin/{chunk-jje8nj8h.js → chunk-gt4csat6.js} +2 -2
  65. package/bin/chunk-gye8gabk.js +2 -0
  66. package/bin/{chunk-wry2hvrq.js → chunk-hk5rc6cd.js} +2 -2
  67. package/bin/{chunk-zqv0zhfb.js → chunk-hm0dkzed.js} +2 -2
  68. package/bin/chunk-hmpwg5za.js +16 -0
  69. package/bin/{chunk-rpywcvg1.js → chunk-j1tkmcae.js} +2 -2
  70. package/bin/chunk-j2bvj2yn.js +2 -0
  71. package/bin/chunk-jffktpqg.js +1 -0
  72. package/bin/chunk-jgs8an3h.js +18 -0
  73. package/bin/{chunk-8fmy5jtp.js → chunk-jmpb5633.js} +1 -1
  74. package/bin/{chunk-xp59apdb.js → chunk-jrjnqx78.js} +1 -1
  75. package/bin/chunk-k2k9vjq6.js +1 -0
  76. package/bin/{chunk-32pcmaqm.js → chunk-kpgfqkp0.js} +2 -2
  77. package/bin/{chunk-twdxayky.js → chunk-ks8xzc95.js} +2 -2
  78. package/bin/{chunk-qwqvt9v6.js → chunk-kswvyqq1.js} +2 -2
  79. package/bin/{chunk-gk3eqd50.js → chunk-m9pr03kn.js} +2 -2
  80. package/bin/chunk-mfn9qjm4.js +2 -0
  81. package/bin/{chunk-e99dv20z.js → chunk-msfw3jmc.js} +2 -2
  82. package/bin/chunk-mz0yjra0.js +5 -0
  83. package/bin/chunk-nbdw8fen.js +1 -0
  84. package/bin/{chunk-cak32x57.js → chunk-nkdk229f.js} +1 -1
  85. package/bin/chunk-nr20tvnw.js +3 -0
  86. package/bin/{chunk-ck8azecb.js → chunk-pazjhrnf.js} +5 -5
  87. package/bin/chunk-q806pqeh.js +1 -0
  88. package/bin/{chunk-abt0azmv.js → chunk-qka4mkmj.js} +2 -2
  89. package/bin/{chunk-0e4wawpq.js → chunk-qsr1a0rp.js} +1 -1
  90. package/bin/chunk-rchsme43.js +3 -0
  91. package/bin/{chunk-tf28796q.js → chunk-reyxk4bw.js} +1 -1
  92. package/bin/{chunk-av1a8fqp.js → chunk-rhvv1vvk.js} +2 -2
  93. package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
  94. package/bin/chunk-rqf7999q.js +42 -0
  95. package/bin/chunk-rssgmj7x.js +2 -0
  96. package/bin/chunk-ryzz5fht.js +2 -0
  97. package/bin/chunk-s2fnfyn9.js +2 -0
  98. package/bin/{chunk-83e12sjg.js → chunk-s2k4qntr.js} +2 -2
  99. package/bin/{chunk-c007p0t8.js → chunk-snhsjs4x.js} +56 -56
  100. package/bin/{chunk-j8fxp8ej.js → chunk-t2hy6tj9.js} +1 -1
  101. package/bin/chunk-t7nsgg5k.js +4 -0
  102. package/bin/chunk-tm7f32c7.js +14 -0
  103. package/bin/{chunk-2291ehh5.js → chunk-trveq4wg.js} +2 -2
  104. package/bin/chunk-vap4k11j.js +20 -0
  105. package/bin/chunk-vm5fx7td.js +3 -0
  106. package/bin/chunk-vy8gntez.js +1 -0
  107. package/bin/{chunk-awfwk64v.js → chunk-vyzptrea.js} +2 -2
  108. package/bin/{chunk-hfh0c082.js → chunk-w4ghe71n.js} +1 -1
  109. package/bin/chunk-wdsf44hs.js +2 -0
  110. package/bin/chunk-wjyaezs7.js +2 -0
  111. package/bin/{chunk-3a13dcs1.js → chunk-wndm3px3.js} +1 -1
  112. package/bin/chunk-x5jwwvs0.js +1 -0
  113. package/bin/chunk-x92cq59c.js +1 -0
  114. package/bin/{chunk-vgn5zcpv.js → chunk-xa18z1py.js} +2 -2
  115. package/bin/{chunk-4v5n0ayb.js → chunk-xarsrs08.js} +1 -1
  116. package/bin/{chunk-66hsjnw6.js → chunk-xx337zcw.js} +2 -2
  117. package/bin/chunk-xz6713tj.js +2 -0
  118. package/bin/chunk-yfnem6se.js +2 -0
  119. package/bin/{chunk-m7m9d4fb.js → chunk-ytdwk2fq.js} +2 -2
  120. package/bin/{chunk-jy006gcv.js → chunk-ze20rm02.js} +4 -4
  121. package/bin/chunk-zw86wnwe.js +7 -0
  122. package/bin/{chunk-h3tbf521.js → chunk-zxk7q0zk.js} +1 -1
  123. package/bin/shumai-app.html +1 -1
  124. package/bin/shumai-app.js +773 -776
  125. package/package.json +7 -7
  126. package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
  127. package/prisma/schema.prisma +1 -0
  128. package/bin/chunk-1kw2mbqb.js +0 -1
  129. package/bin/chunk-1wm6ptdx.js +0 -1
  130. package/bin/chunk-2520aq8j.js +0 -2
  131. package/bin/chunk-29zdp63z.js +0 -3
  132. package/bin/chunk-3swpwb9v.js +0 -1
  133. package/bin/chunk-3wmcx2bv.js +0 -2
  134. package/bin/chunk-5a8nt4me.js +0 -1
  135. package/bin/chunk-6bhn1p8v.js +0 -211
  136. package/bin/chunk-70c3xrgd.js +0 -2
  137. package/bin/chunk-7esm0hqb.js +0 -2
  138. package/bin/chunk-7fst8kdw.js +0 -12
  139. package/bin/chunk-8zqgaxvv.js +0 -1
  140. package/bin/chunk-a3dmtt2j.js +0 -1
  141. package/bin/chunk-ce8m4zeg.js +0 -3
  142. package/bin/chunk-e7mqtkzn.js +0 -2
  143. package/bin/chunk-ejbvfj4r.js +0 -1
  144. package/bin/chunk-ekfem7kf.js +0 -1
  145. package/bin/chunk-etwkk0xh.js +0 -1
  146. package/bin/chunk-evrdd32b.js +0 -2
  147. package/bin/chunk-fm6p03ad.js +0 -2
  148. package/bin/chunk-fyha3r13.js +0 -2
  149. package/bin/chunk-g0vs7k2x.js +0 -1
  150. package/bin/chunk-g84z2w7v.js +0 -16
  151. package/bin/chunk-h837fyed.js +0 -2
  152. package/bin/chunk-j20e0qsw.js +0 -7
  153. package/bin/chunk-n1jwdb0a.js +0 -1
  154. package/bin/chunk-p5gf1zdm.js +0 -4
  155. package/bin/chunk-pfgxggaj.js +0 -11
  156. package/bin/chunk-q16490pv.js +0 -2
  157. package/bin/chunk-qh81zhg1.js +0 -1
  158. package/bin/chunk-qwp3kwbz.js +0 -2
  159. package/bin/chunk-qydeqgyj.js +0 -5
  160. package/bin/chunk-r7dty1tg.js +0 -2
  161. package/bin/chunk-rhdxwebf.js +0 -2
  162. package/bin/chunk-rhh716z0.js +0 -42
  163. package/bin/chunk-rza4ae5z.js +0 -3
  164. package/bin/chunk-sk4e6rb1.js +0 -1
  165. package/bin/chunk-t2n1dbgx.js +0 -4
  166. package/bin/chunk-x8f4defx.js +0 -3
  167. package/bin/chunk-z3gkt8w1.js +0 -3
  168. package/bin/chunk-zh6fqq44.js +0 -1
@@ -1,42 +0,0 @@
1
- import{da,ja,wt,D,N,xt,h,He,O,v,u,C,B,t,o,Q,L,U,Me,Ts,Mn,A,T,Te,wo,Vr,Oe,S,DA,ZA,dm,LA,dc,Yh,Qf,se,Rt,fr,Kr,Kn,Ht,pr}from"./chunk-6bhn1p8v.js";import{ns}from"./chunk-6gg1ymer.js";import{br}from"./chunk-cqb415s6.js";import{js}from"./chunk-zehyn6vd.js";import{_l}from"./chunk-70c3xrgd.js";import{bi}from"./chunk-pb1zf0vb.js";import{wi}from"./chunk-4r81ghg8.js";import{an}from"./chunk-ea79xnn3.js";import{Ke,w,Ne}from"./chunk-rza4ae5z.js";var om=w(function(gH,Fd){var sI=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},he=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 x(E){if(E instanceof a)return new a(E.type,x(E.content),E.alias);else if(Array.isArray(E))return E.map(x);else return E.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(x){return Object.prototype.toString.call(x).slice(8,-1)},objId:function(x){if(!x.__id)Object.defineProperty(x,"__id",{value:++r});return x.__id},clone:function x(E,b){b=b||{};var R,M;switch(i.util.type(E)){case"Object":if(M=i.util.objId(E),b[M])return b[M];R={},b[M]=R;for(var k in E)if(E.hasOwnProperty(k))R[k]=x(E[k],b);return R;case"Array":if(M=i.util.objId(E),b[M])return b[M];return R=[],b[M]=R,E.forEach(function(P,F){R[F]=x(P,b)}),R;default:return E}},getLanguage:function(x){while(x){var E=n.exec(x.className);if(E)return E[1].toLowerCase();x=x.parentElement}return"none"},setLanguage:function(x,E){x.className=x.className.replace(RegExp(n,"gi"),""),x.classList.add("language-"+E)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(R){var x=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(R.stack)||[])[1];if(x){var E=document.getElementsByTagName("script");for(var b in E)if(E[b].src==x)return E[b]}return null}},isActive:function(x,E,b){var R="no-"+E;while(x){var M=x.classList;if(M.contains(E))return!0;if(M.contains(R))return!1;x=x.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(x,E){var b=i.util.clone(i.languages[x]);for(var R in E)b[R]=E[R];return b},insertBefore:function(x,E,b,R){R=R||i.languages;var M=R[x],k={};for(var P in M)if(M.hasOwnProperty(P)){if(P==E){for(var F in b)if(b.hasOwnProperty(F))k[F]=b[F]}if(!b.hasOwnProperty(P))k[P]=M[P]}var z=R[x];return R[x]=k,i.languages.DFS(i.languages,function(K,H){if(H===z&&K!=x)this[K]=k}),k},DFS:function x(E,b,R,M){M=M||{};var k=i.util.objId;for(var P in E)if(E.hasOwnProperty(P)){b.call(E,P,E[P],R||P);var F=E[P],z=i.util.type(F);if(z==="Object"&&!M[k(F)])M[k(F)]=!0,x(F,b,null,M);else if(z==="Array"&&!M[k(F)])M[k(F)]=!0,x(F,b,P,M)}}},plugins:{},highlightAll:function(x,E){i.highlightAllUnder(document,x,E)},highlightAllUnder:function(x,E,b){var R={callback:b,container:x,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",R),R.elements=Array.prototype.slice.apply(R.container.querySelectorAll(R.selector)),i.hooks.run("before-all-elements-highlight",R);for(var M=0,k;k=R.elements[M++];)i.highlightElement(k,E===!0,R.callback)},highlightElement:function(x,E,b){var R=i.util.getLanguage(x),M=i.languages[R];i.util.setLanguage(x,R);var k=x.parentElement;if(k&&k.nodeName.toLowerCase()==="pre")i.util.setLanguage(k,R);var P=x.textContent,F={element:x,language:R,grammar:M,code:P};function z(H){F.highlightedCode=H,i.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,i.hooks.run("after-highlight",F),i.hooks.run("complete",F),b&&b.call(F.element)}if(i.hooks.run("before-sanity-check",F),k=F.element.parentElement,k&&k.nodeName.toLowerCase()==="pre"&&!k.hasAttribute("tabindex"))k.setAttribute("tabindex","0");if(!F.code){i.hooks.run("complete",F),b&&b.call(F.element);return}if(i.hooks.run("before-highlight",F),!F.grammar){z(i.util.encode(F.code));return}if(E&&e.Worker){var K=new Worker(i.filename);K.onmessage=function(H){z(H.data)},K.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else z(i.highlight(F.code,F.grammar,F.language))},highlight:function(x,E,b){var R={code:x,grammar:E,language:b};if(i.hooks.run("before-tokenize",R),!R.grammar)throw Error('The language "'+R.language+'" has no grammar.');return R.tokens=i.tokenize(R.code,R.grammar),i.hooks.run("after-tokenize",R),a.stringify(i.util.encode(R.tokens),R.language)},tokenize:function(x,E){var b=E.rest;if(b){for(var R in b)E[R]=b[R];delete E.rest}var M=new d;return f(M,M.head,x),c(x,M,E,M.head,0),p(M)},hooks:{all:{},add:function(x,E){var b=i.hooks.all;b[x]=b[x]||[],b[x].push(E)},run:function(x,E){var b=i.hooks.all[x];if(!b||!b.length)return;for(var R=0,M;M=b[R++];)M(E)}},Token:a};e.Prism=i;function a(x,E,b,R){this.type=x,this.content=E,this.alias=b,this.length=(R||"").length|0}a.stringify=function x(E,b){if(typeof E=="string")return E;if(Array.isArray(E)){var R="";return E.forEach(function(z){R+=x(z,b)}),R}var M={type:E.type,content:x(E.content,b),tag:"span",classes:["token",E.type],attributes:{},language:b},k=E.alias;if(k)if(Array.isArray(k))Array.prototype.push.apply(M.classes,k);else M.classes.push(k);i.hooks.run("wrap",M);var P="";for(var F in M.attributes)P+=" "+F+'="'+(M.attributes[F]||"").replace(/"/g,"&quot;")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+P+">"+M.content+"</"+M.tag+">"};function l(x,E,b,R){x.lastIndex=E;var M=x.exec(b);if(M&&R&&M[1]){var k=M[1].length;M.index+=k,M[0]=M[0].slice(k)}return M}function c(x,E,b,R,M,k){for(var P in b){if(!b.hasOwnProperty(P)||!b[P])continue;var F=b[P];F=Array.isArray(F)?F:[F];for(var z=0;z<F.length;++z){if(k&&k.cause==P+","+z)return;var K=F[z],H=K.inside,q=!!K.lookbehind,W=!!K.greedy,te=K.alias;if(W&&!K.pattern.global){var Z=K.pattern.toString().match(/[imsuy]*$/)[0];K.pattern=RegExp(K.pattern.source,Z+"g")}var re=K.pattern||K;for(var Y=R.next,de=M;Y!==E.tail;de+=Y.value.length,Y=Y.next){if(k&&de>=k.reach)break;var xe=Y.value;if(E.length>x.length)return;if(xe instanceof a)continue;var Re=1,ne;if(W){if(ne=l(re,de,x,q),!ne||ne.index>=x.length)break;var ke=ne.index,ae=ne.index+ne[0].length,ce=de;ce+=Y.value.length;while(ke>=ce)Y=Y.next,ce+=Y.value.length;if(ce-=Y.value.length,de=ce,Y.value instanceof a)continue;for(var we=Y;we!==E.tail&&(ce<ae||typeof we.value==="string");we=we.next)Re++,ce+=we.value.length;Re--,xe=x.slice(de,ce),ne.index-=de}else if(ne=l(re,0,xe,q),!ne)continue;var ke=ne.index,gt=ne[0],Qt=xe.slice(0,ke),Pe=xe.slice(ke+gt.length),ht=de+xe.length;if(k&&ht>k.reach)k.reach=ht;var Vt=Y.prev;if(Qt)Vt=f(E,Vt,Qt),de+=Qt.length;g(E,Vt,Re);var yr=new a(P,H?i.tokenize(gt,H):gt,te,gt);if(Y=f(E,Vt,yr),Pe)f(E,Y,Pe);if(Re>1){var Zo={cause:P+","+z,reach:ht};if(c(x,E,b,Y.prev,de,Zo),k&&Zo.reach>k.reach)k.reach=Zo.reach}}}}}function d(){var x={value:null,prev:null,next:null},E={value:null,prev:x,next:null};x.next=E,this.head=x,this.tail=E,this.length=0}function f(x,E,b){var R=E.next,M={value:b,prev:E,next:R};return E.next=M,R.prev=M,x.length++,M}function g(x,E,b){var R=E.next;for(var M=0;M<b&&R!==x.tail;M++)R=R.next;E.next=R,R.prev=E,x.length-=M}function p(x){var E=[],b=x.head.next;while(b!==x.tail)E.push(b.value),b=b.next;return E}if(!e.document){if(!e.addEventListener)return i;if(!i.disableWorkerMessageHandler)e.addEventListener("message",function(x){var E=JSON.parse(x.data),{language:b,code:R,immediateClose:M}=E;if(e.postMessage(i.highlight(R,i.languages[b],b)),M)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 y=document.readyState;if(y==="loading"||y==="interactive"&&m&&m.defer)document.addEventListener("DOMContentLoaded",_);else if(window.requestAnimationFrame)window.requestAnimationFrame(_);else window.setTimeout(_,16)}return i}(sI);if(typeof Fd<"u"&&Fd.exports)Fd.exports=he;if(typeof global<"u")global.Prism=he;he.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]};he.languages.markup.tag.inside["attr-value"].inside.entity=he.languages.markup.entity;he.languages.markup.doctype.inside["internal-subset"].inside=he.languages.markup;he.hooks.add("wrap",function(e){if(e.type==="entity")e.attributes.title=e.content.replace(/&amp;/,"&")});Object.defineProperty(he.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:he.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:he.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},he.languages.insertBefore("markup","cdata",a)}});Object.defineProperty(he.languages.markup.tag,"addAttribute",{value:function(e,n){he.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:he.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});he.languages.html=he.languages.markup;he.languages.mathml=he.languages.markup;he.languages.svg=he.languages.markup;he.languages.xml=he.languages.extend("markup",{});he.languages.ssml=he.languages.xml;he.languages.atom=he.languages.xml;he.languages.rss=he.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")})(he);he.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:/[{}[\];(),.:]/};he.languages.javascript=he.languages.extend("clike",{"class-name":[he.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}|\?\?=?|\?\.?|[~:]/});he.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;he.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:he.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:he.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:he.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:he.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:he.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});he.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:he.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"}});he.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(he.languages.markup)he.languages.markup.tag.addInlined("script","javascript"),he.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");he.languages.js=he.languages.javascript;(function(){if(typeof he>"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,_,y){var x=new XMLHttpRequest;x.open("GET",m,!0),x.onreadystatechange=function(){if(x.readyState==4)if(x.status<400&&x.responseText)_(x.responseText);else if(x.status>=400)y(n(x.status,x.statusText));else y(r)},x.send(null)}function g(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var y=Number(_[1]),x=_[2],E=_[3];if(!x)return[y,y];if(!E)return[y,void 0];return[y,Number(E)]}return}he.hooks.add("before-highlightall",function(m){m.selector+=", "+d}),he.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(d)){m.code="",_.setAttribute(i,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=e;var x=_.getAttribute("data-src"),E=m.language;if(E==="none"){var b=(/\.(\w+)$/.exec(x)||[,"none"])[1];E=s[b]||b}he.util.setLanguage(y,E),he.util.setLanguage(_,E);var R=he.plugins.autoloader;if(R)R.loadLanguages(E);f(x,function(M){_.setAttribute(i,l);var k=g(_.getAttribute("data-range"));if(k){var P=M.split(/\r\n?|\n/g),F=k[0],z=k[1]==null?P.length:k[1];if(F<0)F+=P.length;if(F=Math.max(0,Math.min(F-1,P.length)),z<0)z+=P.length;if(z=Math.max(0,Math.min(z,P.length)),M=P.slice(F,z).join(`
2
- `),!_.hasAttribute("data-start"))_.setAttribute("data-start",String(F+1))}y.textContent=M,he.highlightElement(y)},function(M){_.setAttribute(i,c),y.textContent=M})}}),he.plugins.fileHighlight={highlight:function(_){var y=(_||document).querySelectorAll(d);for(var x=0,E;E=y[x++];)he.highlightElement(E)}};var p=!1;he.fileHighlight=function(){if(!p)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),p=!0;he.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var bO=[["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=T("bold",bO);var vO=[["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=T("heading-1",vO);var OO=[["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=T("heading-2",OO);var AO=[["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=T("heading-3",AO);var RO=[["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"}]],Um=T("italic",RO);var MO=[["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"}]],Hm=T("list-ordered",MO);var DO=[["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"}]],Wm=T("quote",DO);var $O=[["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"}]],Gm=T("redo-2",$O);var wO=[["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"}]],jm=T("remove-formatting",wO);var kO=[["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"}]],Ym=T("strikethrough",kO);var IO=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Vm=T("underline",IO);var LO=[["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"}]],Xm=T("undo-2",LO);C();C();C();C();var Xd={};Ne(Xd,{LexicalComposerContext:()=>qm,createLexicalComposerContext:()=>FO,useLexicalComposerContext:()=>PO});var qm=wt(null);function FO(e,n){let r=null;return e!=null&&(r=e[1]),{getTheme:function(){return n!=null?n:r!=null?r.getTheme():null}}}function PO(){let e=xt(qm);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 qd=Xd,{LexicalComposerContext:Jm,createLexicalComposerContext:Zm,useLexicalComposerContext:st}=qd;var Fg={};Ne(Fg,{$addUpdateTag:()=>xs,$applyNodeReplacement:()=>Za,$assumeActiveEditor:()=>lR,$caretFromPoint:()=>kr,$caretRangeFromSelection:()=>Lf,$cloneWithProperties:()=>bg,$cloneWithPropertiesEphemeral:()=>jR,$comparePointCaretNext:()=>wg,$copyNode:()=>Sg,$create:()=>VR,$createChildrenArray:()=>Ba,$createLineBreakNode:()=>Pc,$createNodeSelection:()=>bc,$createParagraphNode:()=>On,$createPoint:()=>mo,$createRangeSelection:()=>yC,$createRangeSelectionFromDom:()=>rR,$createTabNode:()=>aC,$createTextNode:()=>_n,$extendCaretToRange:()=>Dg,$findMatchingParent:()=>Sr,$formatText:()=>dC,$fullReconcile:()=>TC,$generateNodesFromRawText:()=>ig,$getAdjacentChildCaret:()=>fi,$getAdjacentNode:()=>WC,$getAdjacentSiblingOrParentSiblingCaret:()=>sM,$getCaretInDirection:()=>Lo,$getCaretRange:()=>wr,$getCaretRangeInDirection:()=>Ig,$getCharacterOffsets:()=>Af,$getChildCaret:()=>ir,$getChildCaretAtIndex:()=>Ty,$getChildCaretOrSelf:()=>Cy,$getCollapsedCaretRange:()=>yy,$getCommonAncestor:()=>kc,$getCommonAncestorResultBranchOrder:()=>kg,$getDOMSlot:()=>Rn,$getDOMTextNode:()=>rr,$getDocument:()=>Cn,$getEditor:()=>xo,$getEditorDOMRenderConfig:()=>Tg,$getNearestNodeFromDOMNode:()=>gg,$getNearestRootOrShadowRoot:()=>Cg,$getNodeByKey:()=>ot,$getNodeByKeyOrThrow:()=>VC,$getNodeFromDOMNode:()=>fg,$getPreviousSelection:()=>Ns,$getRoot:()=>An,$getSelection:()=>ze,$getSiblingCaret:()=>yt,$getSlot:()=>Mr,$getSlotFrame:()=>py,$getSlotHost:()=>Un,$getSlotNameWithinHost:()=>gy,$getSlotNames:()=>Gn,$getState:()=>mc,$getStateChange:()=>mA,$getTextContent:()=>iR,$getTextNodeOffset:()=>ho,$getTextPointCaret:()=>$r,$getTextPointCaretSlice:()=>If,$getWritableNodeState:()=>Hf,$hasAncestor:()=>Fa,$hasUpdateTag:()=>kR,$insertNodeToNearestRootAtCaret:()=>vy,$insertNodes:()=>sR,$isBlockElementNode:()=>xC,$isChildCaret:()=>jn,$isDecoratorNode:()=>qe,$isEditorState:()=>dR,$isElementDOMSlot:()=>sy,$isElementNode:()=>j,$isExtendableTextPointCaret:()=>Ey,$isInlineElementOrDecoratorNode:()=>YC,$isInlineFormattable:()=>Tc,$isLeafNode:()=>MR,$isLexicalNode:()=>og,$isLineBreakNode:()=>Io,$isNodeCaret:()=>eM,$isNodeSelection:()=>gi,$isParagraphNode:()=>$C,$isRangeSelection:()=>fe,$isRootNode:()=>Bt,$isRootOrShadowRoot:()=>Ot,$isSelectionCapturedInDecoratorInput:()=>Kc,$isShadowRootNode:()=>yg,$isSiblingCaret:()=>Dr,$isSlotChild:()=>Rr,$isSlotHost:()=>Mo,$isTabNode:()=>sg,$isTextNode:()=>ee,$isTextPointCaret:()=>po,$isTextPointCaretSlice:()=>rM,$isTokenOrSegmented:()=>Wn,$isTokenOrTab:()=>La,$markSlotEditable:()=>uy,$needsBlockCursorBeside:()=>gc,$nodesOfType:()=>wR,$normalizeCaret:()=>Do,$normalizeSelection__EXPERIMENTAL:()=>oi,$onUpdate:()=>jC,$parseSerializedNode:()=>cR,$removeFromParent:()=>zn,$removeSlot:()=>_y,$removeTextFromCaretRange:()=>Ny,$rewindSiblingCaret:()=>bs,$selectAll:()=>$R,$setCompositionKey:()=>Pt,$setDirectionFromDOM:()=>ay,$setFormatFromDOM:()=>ly,$setPointFromCaret:()=>za,$setSelection:()=>tn,$setSelectionFromCaretRange:()=>Sy,$setSlot:()=>Og,$setState:()=>_A,$setTextFormat:()=>nR,$splitAtPointCaretNext:()=>by,$splitNode:()=>FR,$updateDOMSelection:()=>SC,$updateRangeSelectionFromCaretRange:()=>ya,ArtificialNode__DO_NOT_USE:()=>lg,BEFORE_INPUT_COMMAND:()=>Gf,BLUR_COMMAND:()=>Gx,CAN_REDO_COMMAND:()=>$A,CAN_UNDO_COMMAND:()=>wA,CAN_USE_BEFORE_INPUT:()=>Sa,CAN_USE_DOM:()=>Vn,CLEAR_EDITOR_COMMAND:()=>RA,CLEAR_HISTORY_COMMAND:()=>MA,CLICK_COMMAND:()=>Ox,COLLABORATION_TAG:()=>eC,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>ER,COMMAND_PRIORITY_BEFORE_EDITOR:()=>CR,COMMAND_PRIORITY_BEFORE_HIGH:()=>NR,COMMAND_PRIORITY_BEFORE_LOW:()=>yR,COMMAND_PRIORITY_BEFORE_NORMAL:()=>SR,COMMAND_PRIORITY_CRITICAL:()=>xR,COMMAND_PRIORITY_EDITOR:()=>ni,COMMAND_PRIORITY_HIGH:()=>_R,COMMAND_PRIORITY_LOW:()=>hR,COMMAND_PRIORITY_NORMAL:()=>mR,COMPOSITION_END_COMMAND:()=>Vf,COMPOSITION_END_TAG:()=>Ec,COMPOSITION_START_COMMAND:()=>Yf,COMPOSITION_START_TAG:()=>oC,CONTROLLED_TEXT_INSERTION_COMMAND:()=>ai,COPY_COMMAND:()=>eg,CUT_COMMAND:()=>tg,CUT_TAG:()=>jA,DEFAULT_EDITOR_DOM_CONFIG:()=>Ia,DELETE_CHARACTER_COMMAND:()=>Ra,DELETE_LINE_COMMAND:()=>Da,DELETE_WORD_COMMAND:()=>Ma,DRAGEND_COMMAND:()=>Ux,DRAGOVER_COMMAND:()=>zx,DRAGSTART_COMMAND:()=>Kx,DROP_COMMAND:()=>Bx,DecoratorNode:()=>Fc,ElementNode:()=>ko,FOCUS_COMMAND:()=>Wx,FORMAT_ELEMENT_COMMAND:()=>AA,FORMAT_TEXT_COMMAND:()=>Nr,HISTORIC_TAG:()=>HA,HISTORY_MERGE_TAG:()=>cc,HISTORY_PUSH_TAG:()=>WA,INDENT_CONTENT_COMMAND:()=>vA,INPUT_COMMAND:()=>jf,INSERT_LINE_BREAK_COMMAND:()=>xa,INSERT_PARAGRAPH_COMMAND:()=>Sf,INSERT_TAB_COMMAND:()=>bA,INTERNAL_$isBlock:()=>mn,IS_ALL_FORMATTING:()=>qO,IS_ANDROID:()=>Ff,IS_ANDROID_CHROME:()=>Na,IS_APPLE:()=>Pn,IS_APPLE_WEBKIT:()=>Ha,IS_BOLD:()=>HO,IS_CHROME:()=>Pf,IS_CODE:()=>YO,IS_FIREFOX:()=>$o,IS_HIGHLIGHT:()=>Bf,IS_IOS:()=>gs,IS_ITALIC:()=>WO,IS_SAFARI:()=>Ua,IS_STRIKETHROUGH:()=>GO,IS_SUBSCRIPT:()=>VO,IS_SUPERSCRIPT:()=>XO,IS_UNDERLINE:()=>jO,KEY_ARROW_DOWN_COMMAND:()=>wx,KEY_ARROW_LEFT_COMMAND:()=>Mx,KEY_ARROW_RIGHT_COMMAND:()=>Ax,KEY_ARROW_UP_COMMAND:()=>$x,KEY_BACKSPACE_COMMAND:()=>Ix,KEY_DELETE_COMMAND:()=>Fx,KEY_DOWN_COMMAND:()=>Zf,KEY_ENTER_COMMAND:()=>xc,KEY_ESCAPE_COMMAND:()=>Lx,KEY_MODIFIER_COMMAND:()=>jx,KEY_SPACE_COMMAND:()=>kx,KEY_TAB_COMMAND:()=>Px,LineBreakNode:()=>Va,MOVE_TO_END:()=>Rx,MOVE_TO_START:()=>Dx,NODE_STATE_DIRECT:()=>df,NODE_STATE_KEY:()=>cA,NODE_STATE_LATEST:()=>ff,OUTDENT_CONTENT_COMMAND:()=>OA,PASTE_COMMAND:()=>Xf,PASTE_TAG:()=>GA,ParagraphNode:()=>Xa,REDO_COMMAND:()=>Jf,REMOVE_TEXT_COMMAND:()=>ic,RootNode:()=>Ga,SELECTION_CHANGE_COMMAND:()=>Wf,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>EA,SELECT_ALL_COMMAND:()=>Hx,SET_TEXT_FORMAT_COMMAND:()=>TA,SKIP_COLLAB_TAG:()=>YA,SKIP_DOM_SELECTION_TAG:()=>nC,SKIP_SCROLL_INTO_VIEW_TAG:()=>tC,SKIP_SELECTION_FOCUS_TAG:()=>Nc,TEXT_TYPE_TO_FORMAT:()=>Xt,TabNode:()=>Wa,TextNode:()=>ms,UNDO_COMMAND:()=>qf,addClassNamesToElement:()=>gM,buildImportMap:()=>UA,configExtension:()=>cM,createCommand:()=>Ee,createEditor:()=>TR,createRefCountedRegistry:()=>Yx,createSharedNodeState:()=>_x,createState:()=>hA,declarePeerDependency:()=>uM,defineExtension:()=>lM,findAllLexicalElementsDeep:()=>JC,flipDirection:()=>Ir,getActiveElement:()=>wc,getActiveElementDeep:()=>di,getComposedEventTarget:()=>Ng,getComposedStaticRange:()=>mi,getDOMOwnerDocument:()=>Uc,getDOMSelection:()=>Xn,getDOMSelectionFromTarget:()=>XC,getDOMSelectionPoints:()=>Yn,getDOMSelectionRange:()=>QC,getDOMSelectionRangeAndPoints:()=>LR,getDOMShadowRoots:()=>qC,getDOMTextNode:()=>LC,getDeclaredSlots:()=>hy,getEditorPropertyFromDOMNode:()=>Ja,getNearestEditorFromDOMNode:()=>fs,getParentElement:()=>Es,getRegisteredNode:()=>Bc,getRegisteredNodeOrThrow:()=>dg,getRegisteredSubtypeMap:()=>YR,getRootOwnerDocument:()=>ZC,getStaticNodeConfig:()=>Qa,getStyleObjectFromCSS:()=>vf,getTextDirection:()=>RR,getTransformSetFromKlass:()=>kC,isBlockDomNode:()=>Eg,isCurrentlyReadOnlyMode:()=>Or,isDOMCapturingSelection:()=>Pa,isDOMDocumentNode:()=>pi,isDOMNode:()=>xi,isDOMShadowRoot:()=>sr,isDOMTextNode:()=>_o,isDOMUnmanaged:()=>vg,isDocumentFragment:()=>oy,isExactShortcutMatch:()=>Qe,isHTMLAnchorElement:()=>PR,isHTMLElement:()=>_t,isHTMLTableCellElement:()=>KR,isHTMLTableRowElement:()=>BR,isInlineDomNode:()=>ry,isLastChildInBlockNode:()=>DC,isLexicalEditor:()=>zc,isModifierMatch:()=>HC,isOnlyChildInBlockNode:()=>MC,isSelectionCapturedInDecoratorInput:()=>AR,isSelectionWithinEditor:()=>qa,iterStaticNodeConfigChain:()=>el,makeStepwiseIterator:()=>$g,mergeRegister:()=>Lg,mountSlotContainer:()=>HR,normalizeClassNames:()=>nl,registerEventListener:()=>ng,registerEventListeners:()=>hM,removeClassNamesFromElement:()=>pM,removeFromParent:()=>DR,resetRandomKey:()=>vR,safeCast:()=>dM,setDOMStyleFromCSS:()=>Of,setDOMStyleObject:()=>XA,setDOMUnmanaged:()=>cy,setNodeIndentFromDOM:()=>iy,shallowMergeConfig:()=>fM,stopLexicalPropagation:()=>Tf,toggleTextFormatType:()=>Ar,tokenizeRawText:()=>NC,unmountSlotContainer:()=>WR});function X(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 ax(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 Vn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,BO=Vn&&"documentMode"in document?document.documentMode:null,Pn=Vn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$o=Vn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Sa=!(!Vn||!("InputEvent"in window)||BO)&&"getTargetRanges"in new window.InputEvent("input"),gs=Vn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ff=Vn&&/Android/.test(navigator.userAgent),Ua=Vn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Ff,Pf=Vn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Na=Vn&&Ff&&Pf,Ha=Vn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Pn&&!Pf,KO=0,zO=1,UO=2,HO=1,WO=2,GO=4,jO=8,YO=16,VO=32,XO=64,Bf=128,qO=2047,JO=1,ZO=2,QO=3,eA=4,tA=5,nA=6,Ea=Ua||gs||Ha?" ":"​",ds=`
3
-
4
- `,Kf=$o?" ":Ea,lx="֑-߿יִ-﷽ﹰ-ﻼ",cx="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",oA=new RegExp("^[^"+cx+"]*["+lx+"]"),rA=new RegExp("^[^"+lx+"]*["+cx+"]"),Xt={bold:1,capitalize:1024,code:16,highlight:Bf,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},sA={directionless:1,unmergeable:2},pc={center:2,end:6,justify:4,left:1,right:3,start:5},iA={[ZO]:"center",[nA]:"end",[eA]:"justify",[JO]:"left",[QO]:"right",[tA]:"start"},aA={normal:0,segmented:2,token:1},lA={[KO]:"normal",[UO]:"segmented",[zO]:"token"},cA="$",Qm="$config";function e_(){return xo()._blockCursorElement}function uA(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}class si{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new si(this.element,e,this.after)}withAfter(e){return new si(this.element,this.before,e)}withElement(e){return this.element===e?this:new si(e,this.before,this.after)}insertChild(e){let n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&X(357),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&X(358),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&X(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=t_(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=t_(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 t_(e,n){let r=n;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}class ii extends si{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(;uA(n);)e=n,n=n.nextSibling;let r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===e_()?r:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Ha||gs||Ua);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=Cn().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,s),e){let a=Cn().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=e_(),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=n_(n,r);i.push(s);let a=n_(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 n_(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&&X(225),r.reverse()}var ux;try{ux="0.49.0+prod.esm"}catch(e){}var dx=ux??'"<unknown>+source"';class ti{_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 fx(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(j(e)){let l=e.getFirstChild();for(;l!==null;){let c=l.__key;l.__parent===n&&((j(l)||Mo(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 Mo(e)&&e.__slots!==null?e.__slots.values():[]){let c=s.get(l);c!==void 0&&Rr(c)&&c.__slotHost===n&&((j(c)||Mo(c)&&c.__slots!==null)&&hc(c,l,r,s,i,a),r.has(l)||a.delete(l),i.push(l))}}var uf=!1,zf=0;function dA(e){zf=e.timeStamp}function Jd(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 fA(e,n,r){let s=Xn(yn(r)),i=s&&Yn(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 gA(e,n,r){if(fe(e)){let s=e.anchor.getNode();if(s.is(r)&&e.format!==s.getFormat())return!1}return _o(n)&&r.isAttached()}function pA(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)||!_t(s)?void 0:[s,a]}}}function gx(e,n,r){uf=!0;let s=performance.now()-zf>100;try{Hn(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:y}=m,x=pA(y,e,l);if(!x)continue;let[E,b]=x;if(_==="characterData")s&&ee(b)&&_o(y)&&gA(i,y,b)&&fA(y,b,e);else if(_==="childList"){d=!0;let R=m.addedNodes;for(let P=0;P<R.length;P++){let F=R[P],z=fg(F),K=F.parentNode;if(!(K==null||F===c||z!==null||Jd(F,K,e)||e._slotsUsed&&_t(F)&&F.hasAttribute("data-lexical-slot")||vg(F))){if($o){let H=(_t(F)?F.innerText:null)||F.nodeValue;H&&(f+=H)}K.removeChild(F)}}let M=m.removedNodes,k=M.length;if(k>0){let P=0;for(let F=0;F<k;F++){let z=M[F];(Jd(z,y,e)||c===z)&&(y.appendChild(z),P++)}k!==P&&a.set(E,b)}}}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:y}=m;for(let x=0;x<_.length;x++){let E=_[x],b=E.parentNode;b==null||E.nodeName!=="BR"||Jd(E,y,e)||b.removeChild(E)}}r.takeRecords()}i!==null&&(d&&tn(i),$o&&GC(e)&&i.insertRawText(f))})}finally{uf=!1}}function px(e){let n=e._observer;if(n!==null)gx(e,n.takeRecords(),n)}function hx(e){(function(n){zf===0&&yn(n).addEventListener("textInput",dA,!0)})(e),e._observer=new MutationObserver((n,r)=>{gx(e,n,r)})}var df="direct",ff="latest";class mx{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||xA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}}function hA(e,n){return new mx(e,n)}function mc(e,n,r=ff){let s=(r===ff?e.getLatest():e).__state;return s?s.getValue(n):n.defaultValue}function mA(e,n,r){let s=mc(e,r,df),i=mc(n,r,df);return r.isEqual(s,i)?null:[s,i]}function _A(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 Hf(i).updateFromKnown(n,s),i}function _x(e){let n=new Map,r=new Set;for(let{ownNodeConfig:s}of el(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 o_=new Set(["__proto__","constructor","prototype"]);class Uf{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 r_(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 Uf(e,n,function(i,a,l){let c;if(l)for(let[d,f]of Object.entries(l)){if(o_.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=r_(i)),this.size++),s.set(e,n)}updateFromUnknown(e,n){if(o_.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 Hf(e){let n=e.getWritable(),r=n.__state?n.__state.getWritable(n):new Uf(n,xx(n));return n.__state=r,r}function xx(e){return e.__state?e.__state.sharedNodeState:dg(xo(),e.getType()).sharedNodeState}function r_(e){if(e)for(let n in e)return e}function xA(e){return e}function s_(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 i_(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 a_(e,n){let r=e.__state;return r&&r.node===e?r.getWritable(n):r}function l_(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&&s_(m,g,p)||p&&s_(m,p,g)||g&&i_(m,g,p)||p&&i_(m,p,g))}(d,f))}function c_(e,n){let r=e.mergeWithSibling(n),s=Ve()._normalizedNodes;return s.add(e.__key),s.add(n.__key),r}function u_(e){let n,r,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(n=s.getPreviousSibling())!==null&&ee(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(l_(n,s)){s=c_(n,s);break}break}n.remove()}for(;(r=s.getNextSibling())!==null&&ee(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(l_(s,r)){s=c_(s,r);break}break}r.remove()}}else s.remove()}function oi(e){return d_(e.anchor),d_(e.focus),e}function d_(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),ee(s)){e.set(s.__key,i?s.getTextContentSize():0,"text",!0);break}if(!j(s))break;e.set(s.__key,i?s.getChildrenSize():0,"element",!0)}}var ba=Symbol.for("@lexical/CachedTextSize");function f_(e,n){return pf.read(()=>{let r=0,s=e;for(let i=0;i<n&&s!==null;i++){let a=go.get(s);if(a===void 0&&X(345,s),j(a)){let l=mt.get(s);if(l!==void 0&&j(l)&&l.__parent!==a.__parent)r+=a.getTextContentSize();else{let c=ps.get(s),d=c&&c.__lexicalTextContent;typeof d!="string"&&X(346,a.getType()),r+=d.length}i<n-1&&!a.isInline()&&(r+=2)}else{let l=a[ba];l===void 0&&X(347,a.getType(),s),r+=l}s=a.__next}return r},{editor:Ye})}function Cx(e){j(e)||e[ba]===void 0&&(e[ba]=ee(e)?e.__text.length:e.getTextContentSize())}var CA=4,va,Ye,Oa,Le="",Et=null,en=null,qt=null;function Ao(){return{firstTextKey:qt,format:Et,style:en}}function Bn(e){e.firstTextKey!==null&&(Et=e.format,en=e.style,qt=e.firstTextKey)}function gf(e){if(qt!==null)return;let n=e.__lexicalFirstTextKey;if(n===void 0&&X(348),n===null)return;let r=mt.get(n);ee(r)&&(Et=r.getFormat(),en=r.getStyle(),qt=n)}var Ic,ma,_a,go,pf,mt,ps,hf,Aa,hs,or=!1,_c=!1;function Tr(e,n){let r=go.get(e),s=mt.has(e);if(n!==null){let i=yf(e);i.parentNode===n&&n.removeChild(i)}if(!s){if(Ye._keyToDOMMap.delete(e),j(r)){let i=Ba(r,go);mf(i,0,i.length-1,null)}if(r!==void 0){for(let i of vn(r).values()){let a=xf(i);Tr(i,null),a!==null&&a.remove()}_g(Aa,Oa,Ic,r,"destroyed")}}}function mf(e,n,r,s){for(let i=n;i<=r;++i){let a=e[i];a!==void 0&&Tr(a,s)}}function cs(e,n){e.setProperty("text-align",n)}var yA="40px";function yx(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, ${yA}))`)}function Sx(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 _f(e,n){let r=function(s){let i=s.__dir;if(i!==null)return i;if(Bt(s))return null;let a=s.getParent();return a===null||Ot(a)&&a.__dir===null?"auto":null}(n);r!==null?e.dir=r:e.removeAttribute("dir")}function Nx(e){let n=Cn().createElement("div");return n.setAttribute("data-lexical-slot",e),n.style.display="none",n}function Ex(e,n,r){n||e.contentEditable==="false"?uy(r,Ye):r.removeAttribute("contenteditable")}function g_(e,n,r){let s=Le,i=Ao();Le="";let a="",l=qe(e);for(let[c,d]of r){let f=Nx(c);Ex(n,l,f),n.appendChild(f),Le="";let g=Ao();vr(d,Rn(e,f,Ye)),Bn(g),Tx(e,c,n,f),a+=Le}return Bn(i),Le=s,a}function vn(e){return Mo(e)&&e.__slots!==null?e.__slots:fy}function Tx(e,n,r,s){let i=hs.$getSlotTargetElement(e,n,r,Ye);i!==null&&(s.parentElement!==i&&i.appendChild(s),s.style.display="")}function xf(e){let n=ps.get(e);return n!==void 0?n.parentElement:null}function p_(e,n,r){let s=vn(e),i=vn(n);for(let[g,p]of s)if(!i.has(g)){let m=xf(p);Tr(p,null),m!==null&&m.remove()}let a=Le,l=Ao(),c="",d=null,f=qe(n);for(let[g,p]of i){let m=s.get(g),_=m!==void 0?xf(m):null;Le="";let y=Ao();if(_===null){_=Nx(g);let x=null;for(let E of r.children)if(!E.hasAttribute("data-lexical-slot")){x=E;break}r.insertBefore(_,x),vr(p,Rn(n,_,Ye))}else m===p?nr(p,_):(m!==void 0&&Tr(m,_),vr(p,Rn(n,_,Ye)));if(Bn(y),Ex(r,f,_),Tx(n,g,r,_),c+=Le,_.parentElement===r){let x=d===null?r.firstChild:d.nextSibling;x!==_&&r.insertBefore(_,x),d=_}}return Bn(l),Le=a,c}function vr(e,n){let r=mt.get(e);if(r===void 0&&X(60),n!==null){let i=go.get(e);if(i!==void 0){let a=ps.get(e);if(a!==void 0){let l=Rr(i)?i.__slotHost:null,c=Rr(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),nr(e,n.element)}}}let s=hs.$createDOM(r,Ye);if(function(i,a,l){let c=l._keyToDOMMap;PC(a,l,i),c.set(i,a)}(e,s,Ye),ee(r)?s.setAttribute("data-lexical-text","true"):qe(r)&&(s.setAttribute("data-lexical-decorator","true"),cy(s,{captureSelection:!0})),j(r)){let{__indent:i,__size:a}=r;_f(s,r),i!==0&&yx(s,i);let l=vn(r),c=l.size>0?g_(r,s,l):"";if(a===0)s.__lexicalTextContent=c,s.__lexicalFirstTextKey=null,Le+=c,l.size>0&&(s.__lexicalSlotTextLength=c.length);else{let f=Le,g=a-1;if(Cf(Ba(r,mt),r,0,g,Rn(r,s,Ye)),c!==""){let p=s.__lexicalTextContent||"";s.__lexicalTextContent=c+p,Le=f+c+p}l.size>0&&(s.__lexicalSlotTextLength=c.length)}let d=r.__format;d!==0&&Sx(s,d),r.isInline()||bx(null,r,s)}else{let i=r.getTextContent();if(qe(r)){let a=r.decorate(Ye,va);a!==null&&vx(e,a),s.contentEditable="false";let l=vn(r);l.size>0&&g_(r,s,l)}Le+=i}return n!==null&&n.insertChild(s),hs.$decorateDOM(r,null,s,Ye),Cx(r),_g(Aa,Oa,Ic,r,"created"),s}function Cf(e,n,r,s,i){let a=Le,l=Ao();Le="",Et=null,en=null,qt=null;let c=r;for(;c<=s;++c){let f=Ao();vr(e[c],i);let g=mt.get(e[c]);g!==null&&ee(g)?Et===null&&(Et=g.getFormat(),en=g.getStyle(),qt=g.__key):j(g)&&c<s&&!g.isInline()&&(Le+=ds),Bn(f)}let d=Ye._keyToDOMMap.get(n.__key);d===void 0&&X(349,n.__key),d.__lexicalTextContent=Le,d.__lexicalFirstTextKey=qt,Le=a+Le,Bn(l)}function bx(e,n,r){let s=Rn(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 Io(f)?"line-break":qe(f)&&f.isInline()?"decorator":null}return vn(l).size>0?null:"empty"}return null}(n,mt);i!==a&&s.setManagedLineBreak(a)}function SA(e,n,r){var s;Et=null,en=null,qt=null,function(i,a,l){let c=Le,d=i.__size,f=a.__size;Le="";let g=l.element,p=Ye._keyToDOMMap.get(a.__key);p===void 0&&X(351,a.__key);let m=f-d;if(!or&&Math.abs(m)<=1&&d>=CA&&i.__first===a.__first&&(m!==0||!Ye._cloneNotNeeded.has(i.__key))){let _=p.__lexicalTextContent,y=hf.get(i.__key);if(!or&&typeof _=="string"&&y!==void 0){let x=function(E,b){let R=b.size;if(R===0||R>=E.__size)return null;let M=E.__last,k=null,P=0;for(;M!==null&&P<R;){if(!b.has(M))return null;k=M;let F=mt.get(M);if(F===void 0)return null;M=F.__prev,P++}if(P!==R)return null;if(M!==null&&b.has(M))return null;return k}(a,y);if(x!==null){let E=y.size;if(m===0){let b=f_(x,E),R=x,M=0;for(;R!==null&&M<E;){let K=mt.get(R);if(K===void 0)break;let H=Ao();nr(R,g),ee(K)&&Et===null&&(Et=K.getFormat(),en=K.getStyle(),qt=K.__key),Bn(H),R=K.__next,M++}let k="";for(R=x,M=0;R!==null&&M<E;){let K=mt.get(R);if(K===void 0)break;let H;if(j(K)){let q=Ye._keyToDOMMap.get(R),W=q&&q.__lexicalTextContent;typeof W!="string"&&X(352,K.getType()),H=W}else H=K.getTextContent();k+=H,M<E-1&&j(K)&&!K.isInline()&&(k+=ds),R=K.__next,M++}let P=p.__lexicalSlotTextLength||0,F=P>0?_.slice(P):_,z=F.slice(0,F.length-b)+k;return p.__lexicalTextContent=z,Le=c+z,void h_(a,p,y)}if(function(b,R,M,k,P,F,z,K){if(K!==1&&K!==-1)return!1;if(z!==(K===1?2:1))return!1;let q=z-K,W=b.__last;for(let Pe=0;Pe<q-1;Pe++){if(W===null)return!1;let ht=go.get(W);if(ht===void 0)return!1;W=ht.__prev}if(W===null)return!1;let te=mt.get(F),Z=go.get(W);if(te===void 0||Z===void 0)return!1;if(te.__prev!==Z.__prev)return!1;let re=[],Y=F;for(let Pe=0;Pe<z;Pe++){if(Y===null)return!1;re.push(Y);let ht=mt.get(Y);Y=ht?ht.__next:null}let de=[];Y=W;for(let Pe=0;Pe<q;Pe++){if(Y===null)return!1;de.push(Y);let ht=go.get(Y);Y=ht?ht.__next:null}let xe=new Set(de),Re=new Set(re),ne=[],ae=0,ce=0;for(;ae<q&&ce<z;)if(re[ce]===de[ae])ne.push({key:re[ce],kind:"reconcile"}),ae++,ce++;else if(Re.has(de[ae])){if(xe.has(re[ce]))return!1;ne.push({key:re[ce],kind:"create",nextIndex:ce}),ce++}else ne.push({key:de[ae],kind:"destroy"}),ae++;for(;ae<q;)ne.push({key:de[ae++],kind:"destroy"});for(;ce<z;)ne.push({key:re[ce],kind:"create",nextIndex:ce}),ce++;let we=f_(W,q);for(let Pe of ne){let ht=Ao();if(Pe.kind==="reconcile")nr(Pe.key,M.element);else if(Pe.kind==="destroy")Tr(Pe.key,M.element);else{let Vt=null;for(let yr=Pe.nextIndex+1;yr<z;yr++){let Zo=Ye._keyToDOMMap.get(re[yr]);if(Zo!==void 0){Vt=Zo;break}}vr(Pe.key,M.withBefore(Vt??M.before))}if(Pe.kind!=="destroy"){let Vt=mt.get(Pe.key);Vt&&ee(Vt)&&Et===null&&(Et=Vt.getFormat(),en=Vt.getStyle(),qt=Vt.__key)}Bn(ht)}let ke="";for(let Pe=0;Pe<z;Pe++){let ht=mt.get(re[Pe]);if(ht===void 0)return!1;let Vt;if(j(ht)){let yr=Ye._keyToDOMMap.get(re[Pe]),Zo=yr&&yr.__lexicalTextContent;typeof Zo!="string"&&X(350,ht.getType()),Vt=Zo}else Vt=ht.getTextContent();ke+=Vt,Pe<z-1&&j(ht)&&!ht.isInline()&&(ke+=ds)}let gt=k.__lexicalSlotTextLength||0,Qt=gt>0?P.slice(gt):P;return k.__lexicalTextContent=Qt.slice(0,Qt.length-we)+ke,!0}(i,0,l,p,_,x,E,m)){let b=p.__lexicalTextContent;return typeof b!="string"&&X(353),Le=c+b,void h_(a,p,y)}}}if(m===0){let x=i.__first,E=0;for(;x!==null;){let b=mt.get(x);if(b===void 0)break;let R=or||_a.has(x)||ma.has(x),M=Ao();if(R)nr(x,g);else{let k,P;if(j(b)){P=ps.get(x);let F=P&&P.__lexicalTextContent;typeof F!="string"&&X(354,b.getType()),k=F}else k=b.getTextContent();Le+=k,P!==void 0&&gf(P)}ee(b)?Et===null&&(Et=b.getFormat(),en=b.getStyle(),qt=b.__key):j(b)&&E<f-1&&!b.isInline()&&(Le+=ds),Bn(M),x=b.__next,E++}return p.__lexicalTextContent=Le,p.__lexicalFirstTextKey=qt,void(Le=c+Le)}}if(d===1&&f===1){let _=i.__first,y=a.__first;if(_===y)nr(_,g);else{let E=yf(_),b=vr(y,null);try{E.parentNode===g?g.replaceChild(b,E):l.insertChild(b)}catch(R){if(typeof R=="object"&&R!=null){let M=`${R.toString()} Parent: ${g.tagName}, new child: {tag: ${b.tagName} key: ${y}}, old child: {tag: ${E.tagName}, key: ${_}}.`;throw Error(M)}throw R}Tr(_,null)}let x=mt.get(y);ee(x)&&Et===null&&(Et=x.getFormat(),en=x.getStyle(),qt=x.__key)}else{let _=Ba(i,go),y=Ba(a,mt);if(_.length!==d&&X(227),y.length!==f&&X(228),d===0)f!==0&&Cf(y,a,0,f-1,l);else if(f===0){if(d!==0){let x=l.after==null&&l.before==null&&vn(a).size===0&&l.element.__lexicalLineBreak==null;mf(_,0,d-1,x?null:g),x&&(g.textContent="")}}else(function(x,E,b,R,M,k){let P=R-1,F=M-1,z,K,H=k.getFirstChild(),q=0,W=0;for(;q<=P&&W<=F;){let re=E[q],Y=b[W],de=Ao();if(re===Y)H=Zd(nr(Y,k.element)),q++,W++;else{if(K===void 0&&(K=m_(b,W)),z===void 0)z=m_(E,q);else if(!z.has(re)){q++,Bn(de);continue}if(!K.has(re)){H=Zd(yf(re)),Tr(re,k.element),q++,z.delete(re),Bn(de);continue}if(z.has(Y)){let Re=ui(Ye,Y);Re!==H&&k.withBefore(H??k.before).insertChild(Re),H=Zd(nr(Y,k.element)),q++,W++}else vr(Y,k.withBefore(H??k.before)),W++}let xe=mt.get(Y);xe!==null&&ee(xe)?Et===null&&(Et=xe.getFormat(),en=xe.getStyle(),qt=xe.__key):j(xe)&&W<=F&&!xe.isInline()&&(Le+=ds),Bn(de)}let te=q>P,Z=W>F;if(te&&!Z){let re=b[F+1],Y=re===void 0?null:Ye.getElementByKey(re);Cf(b,x,W,F,k.withBefore(Y??k.before))}else Z&&!te&&mf(E,q,P,k.element)})(a,_,y,d,f,l)}p.__lexicalTextContent=Le,p.__lexicalFirstTextKey=qt,Le=c+Le}(e,n,Rn(n,r,Ye)),Ot(n)||(s=n,Et==null||Et===s.__textFormat||_c||s.setTextFormat(Et),function(i){en==null||en===i.__textStyle||_c||i.setTextStyle(en)}(n))}function h_(e,n,r){let s=n.__lexicalFirstTextKey;if(s!=null){let i=e.__key,a=s;for(;a!==null;){let l=mt.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=mt.get(s);if(ee(l))return Et=l.getFormat(),void(en=l.getStyle())}}n.__lexicalFirstTextKey=qt}function nr(e,n){let r=go.get(e),s=mt.get(e);r!==void 0&&s!==void 0||X(61);let i=or||_a.has(e)||ma.has(e),a=ui(Ye,e);if(r===s&&!i){let l;if(j(r)){let c=a.__lexicalTextContent;typeof c!="string"&&X(355,r.getType()),l=c,gf(a)}else l=r.getTextContent();return Le+=l,a}if(r!==s&&i&&_g(Aa,Oa,Ic,s,"updated"),hs.$updateDOM(s,r,a,Ye)){let l=vr(e,null);return n===null&&X(62),n.replaceChild(l,a),Tr(e,null),l}if(j(r)){j(s)||X(334,e);let l=s.__indent;(or||l!==r.__indent)&&yx(a,l);let c=s.__format;(or||c!==r.__format)&&Sx(a,c);let d=i&&(vn(s).size>0||vn(r).size>0)?p_(r,s,a):"";if(i){let f=Le;if(SA(r,s,a),Bt(s)||s.isInline()||bx(0,s,a),d!==""){let g=a.__lexicalTextContent||"";a.__lexicalTextContent=d+g,Le=f+d+g,a.__lexicalSlotTextLength=d.length}else(vn(s).size>0||vn(r).size>0)&&(a.__lexicalSlotTextLength=0)}else{let f=a.__lexicalTextContent;typeof f!="string"&&X(356,r.getType()),Le+=f,gf(a)}if((or||s.__dir!==r.__dir||s.__parent!==r.__parent)&&(_f(a,s),Bt(s)&&!or)){for(let f of s.getChildren())if(j(f))_f(ui(Ye,f.getKey()),f)}}else{let l=s.getTextContent();if(qe(s)){let c=s.decorate(Ye,va);c!==null&&vx(e,c),i&&(vn(s).size>0||vn(r).size>0)&&p_(r,s,a)}Le+=l}if(!_c&&Bt(s)){let l=s.getLatest();if(l.__cachedText!==Le){let c=l.getWritable();c.__cachedText=Le,s=c}}return hs.$decorateDOM(s,r,a,Ye),Cx(s),a}function vx(e,n){let r=Ye._pendingDecorators,s=Ye._decorators;if(r===null){if(s[e]===n)return;r=BC(Ye)}r[e]=n}function Zd(e){let n=e.nextSibling;return n!==null&&n===Ye._blockCursorElement&&(n=n.nextSibling),n}function m_(e,n){let r=new Set;for(let s=n;s<e.length;s++)r.add(e[s]);return r}function NA(e,n,r,s,i,a){Le="",Et=null,en=null,qt=null,or=s===2,Ye=r,va=r._config,hs=r._config.dom||Ia,Oa=r._nodes,Ic=Ye._listeners.mutation,ma=i,_a=a,go=e._nodeMap,pf=e,mt=n._nodeMap,_c=n._readOnly,ps=fx(r._keyToDOMMap),hf=function(){let c=new Map,d=(f)=>{for(let g of f){let p=mt.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,nr("root",null),Ye=void 0,Oa=void 0,ma=void 0,_a=void 0,go=void 0,pf=void 0,mt=void 0,va=void 0,ps=void 0,hf=void 0,Aa=void 0,hs=Ia,l}function yf(e){let n=ps.get(e);return n===void 0&&X(75,e),n}function Ee(e){return{type:e}}var Wf=Ee("SELECTION_CHANGE_COMMAND"),EA=Ee("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ox=Ee("CLICK_COMMAND"),Gf=Ee("BEFORE_INPUT_COMMAND"),jf=Ee("INPUT_COMMAND"),Yf=Ee("COMPOSITION_START_COMMAND"),Vf=Ee("COMPOSITION_END_COMMAND"),Ra=Ee("DELETE_CHARACTER_COMMAND"),xa=Ee("INSERT_LINE_BREAK_COMMAND"),Sf=Ee("INSERT_PARAGRAPH_COMMAND"),ai=Ee("CONTROLLED_TEXT_INSERTION_COMMAND"),Xf=Ee("PASTE_COMMAND"),ic=Ee("REMOVE_TEXT_COMMAND"),Ma=Ee("DELETE_WORD_COMMAND"),Da=Ee("DELETE_LINE_COMMAND"),Nr=Ee("FORMAT_TEXT_COMMAND"),TA=Ee("SET_TEXT_FORMAT_COMMAND"),qf=Ee("UNDO_COMMAND"),Jf=Ee("REDO_COMMAND"),Zf=Ee("KEYDOWN_COMMAND"),Ax=Ee("KEY_ARROW_RIGHT_COMMAND"),Rx=Ee("MOVE_TO_END"),Mx=Ee("KEY_ARROW_LEFT_COMMAND"),Dx=Ee("MOVE_TO_START"),$x=Ee("KEY_ARROW_UP_COMMAND"),wx=Ee("KEY_ARROW_DOWN_COMMAND"),xc=Ee("KEY_ENTER_COMMAND"),kx=Ee("KEY_SPACE_COMMAND"),Ix=Ee("KEY_BACKSPACE_COMMAND"),Lx=Ee("KEY_ESCAPE_COMMAND"),Fx=Ee("KEY_DELETE_COMMAND"),Px=Ee("KEY_TAB_COMMAND"),bA=Ee("INSERT_TAB_COMMAND"),vA=Ee("INDENT_CONTENT_COMMAND"),OA=Ee("OUTDENT_CONTENT_COMMAND"),Bx=Ee("DROP_COMMAND"),AA=Ee("FORMAT_ELEMENT_COMMAND"),Kx=Ee("DRAGSTART_COMMAND"),zx=Ee("DRAGOVER_COMMAND"),Ux=Ee("DRAGEND_COMMAND"),eg=Ee("COPY_COMMAND"),tg=Ee("CUT_COMMAND"),Hx=Ee("SELECT_ALL_COMMAND"),RA=Ee("CLEAR_EDITOR_COMMAND"),MA=Ee("CLEAR_HISTORY_COMMAND"),$A=Ee("CAN_REDO_COMMAND"),wA=Ee("CAN_UNDO_COMMAND"),Wx=Ee("FOCUS_COMMAND"),Gx=Ee("BLUR_COMMAND"),jx=Ee("KEY_MODIFIER_COMMAND");function Yx(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 Qo=Object.freeze({}),Nf=[["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,Zf,e)}],["pointerdown",function(e,n){let r=Ng(e),s=e.pointerType;xi(r)&&s!=="touch"&&s!=="pen"&&e.button===0&&Hn(n,()=>{Pa(r,n)||(n._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,n){ie(n,Yf,e)}],["compositionend",function(e,n){let r=n._inputState;$o?r.compositionPhase="ending-firefox":gs||!Ua&&!Ha?ie(n,Vf,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,n){e.stopPropagation();let r=n._inputState;$a(r),Hn(n,()=>{Jx(e,n)||n.dispatchCommand(jf,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,n){Hn(n,()=>{let r=ze(),s=Xn(yn(n)),i=Ns();if(s){if(fe(r)){let a=r.anchor,l=a.getNode();a.type==="element"&&a.offset===0&&r.isCollapsed()&&!Bt(l)&&An().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=Yn(s,n._rootElement).anchorNode;if(_t(a)||_o(a))tn(wa(i,s,n,e))}}if($o&&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(_t(g)){let p=g.getBoundingClientRect();if(l<=(p.top+p.bottom)/2){c=f;break}}}s.setBaseAndExtent(a,c,a,c);let d=wa(i,s,n,e);d!==null?tn(d):s.removeAllRanges()}}ie(n,Ox,e)})}],["cut",Qo],["copy",Qo],["dragstart",Qo],["dragover",Qo],["dragend",Qo],["paste",Qo],["focus",Qo],["blur",Qo],["drop",Qo]];Sa&&Nf.push(["beforeinput",(e,n)=>function(r,s){let i=r.inputType;if(i==="deleteCompositionText"||$o&&GC(s))return;if(i==="insertCompositionText")return;Hn(s,()=>{Jx(r,s)||ie(s,Gf,r)},{event:r})}(e,n)]);var Ef=new WeakMap,Cc=new WeakMap,kA=Yx((e)=>(e.addEventListener("selectionchange",S_),()=>e.removeEventListener("selectionchange",S_)));function Vx(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 x=Xn(yn(f));g=x!==null?Yn(x,f._rootElement):null}let p=g!==null?g.anchorNode:null,m=l.key,_=f.getElementByKey(m),y=r.length;return m!==c.key||!ee(d)||(!i&&(!Sa||f._inputState.lastBeforeInputInsertTextTimeStamp<s+50)||d.isDirty()&&y<2||KC(r))&&l.offset!==c.offset&&!d.isComposing()||Wn(d)||d.isDirty()&&y>1||(i||!Sa)&&_!==null&&!d.isComposing()&&p!==rr(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(x,E){if(E.isSegmented())return!0;if(!x.isCollapsed())return!1;let b=x.anchor.offset,R=E.getParentOrThrow(),M=La(E);return b===0?!E.canInsertTextBefore()||!R.canInsertTextBefore()&&!E.isComposing()||M||function(k){let P=k.getPreviousSibling();return(ee(P)||j(P)&&P.isInline())&&!P.canInsertTextAfter()}(E):b===E.getTextContentSize()&&(!E.canInsertTextAfter()||!R.canInsertTextAfter()&&!E.isComposing()||M)}(e,d)}function __(e,n){return _o(e)&&e.nodeValue!==null&&n!==0&&n!==e.nodeValue.length}function x_(e,n,r){let{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:l}=Yn(e,n._rootElement),c=n._inputState;c.isSelectionChangeFromDOMUpdate&&(c.isSelectionChangeFromDOMUpdate=!1,__(s,i)&&__(a,l)&&!c.postDeleteSelectionToRestore)||Hn(n,()=>{if(!r)return void tn(null);if(!qa(n,s,a))return;let d=ze();if(c.postDeleteSelectionToRestore&&fe(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(),tn(d))}if(c.postDeleteSelectionToRestore=null,fe(d)){let f=d.anchor,g=f.getNode();if(d.isCollapsed()){e.type==="Range"&&s===a&&(d.dirty=!0);let p=yn(n).event,m=p?p.timeStamp:performance.now(),{format:_,style:y,offset:x,key:E,timeStamp:b}=c.collapsedSelectionFormat,R=An(),M=n.isComposing()===!1&&R.getTextContent()==="";if(m<b+200&&f.offset===x&&f.key===E)ac(d,_,y);else if(f.type==="text")ee(g)||X(141),Xx(d,g);else if(f.type==="element"&&!M){j(g)||X(259);let k=f.getNode();k.isEmpty()?function(P,F){let z=F.getTextFormat(),K=F.getTextStyle();ac(P,z,K)}(d,k):ac(d,d.format,"")}}else{let p=f.key,m=d.focus.key,_=d.getNodes(),y=_.length,x=d.isBackward(),E=x?l:i,b=x?i:l,R=x?m:p,M=x?p:m,k=2047,P=!1;for(let F=0;F<y;F++){let z=_[F],K=z.getTextContentSize();if(ee(z)&&K!==0&&!(F===0&&z.__key===R&&E===K||F===y-1&&z.__key===M&&b===0)&&(P=!0,k&=z.getFormat(),k===0))break}d.format=P?k:0}}ie(n,Wf)})}function ac(e,n,r){e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}function Xx(e,n){ac(e,n.getFormat(),n.getStyle())}function qx(e){if(!e.getTargetRanges)return null;let n=e.getTargetRanges();return n.length===0?null:n[0]}function C_(e){let{lastKeyCode:n}=Ve()._inputState;if(e==null||e.length<=1||n==null)return;let r=n.length===1?n:n==="Enter"?`
5
- `:n==="Tab"?"\t":null;if(!r)return;let s=ze();if(!fe(s)||!s.isCollapsed())return;let i=s.anchor.getNode();if(!ee(i))return;let{offset:a}=s.anchor;if(i.getTextContentSize()===a){let l=i.getNextSibling();if(r===`
6
- `){if(Io(l))l.selectEnd();else if(!l){let c=Sr(i,xC),d=c&&c.getNextSibling();j(d)&&d.selectStart()}}else r==="\t"?sg(l)&&l.selectEnd():ee(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 y_(e){$a(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>$a(e),0)}function Jx(e,n){let r=Ng(e);if(_t(r)&&Pa(r,n))return!0;let s=n.getRootElement();if(s===null)return!1;let i=di(s.ownerDocument);return i!==null&&s.contains(i)&&Pa(i,n)}function IA(e){let n=e.inputType,r=qx(e),s=Ve(),i=s._inputState,a=ze();if(n==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if($a(i),e.preventDefault(),fe(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(!fe(p))return!0;tn(p.clone())}if(fe(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(Pt(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Hn(s,()=>{Pt(null)})},30),fe(a)){let m=a.anchor.getNode();m.markDirty(),ee(m)||X(142),Xx(a,m)}}else{if(Pt(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(),y=m.canInsertTextAfter(),x=a.anchor.offset===0&&a.focus.offset===_.length,E=Na&&p&&!x&&y;if(E&&a.isCollapsed()&&(E=!qe(WC(a.anchor,!0))),!E){ie(s,Ra,!0);let b=ze();Na&&fe(b)&&b.isCollapsed()&&(i.postDeleteSelectionToRestore=b,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!fe(a))return!0;let l=e.data;i.unprocessedBeforeInputData!==null&&hg(!1,s,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||Bt(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,Sf);else if(l==null&&e.dataTransfer){let p=e.dataTransfer.getData("text/plain");e.preventDefault(),a.insertRawText(p)}else l!=null&&Vx(a,r,l,e.timeStamp,!0)?(e.preventDefault(),ie(s,ai,l),C_(l)):i.unprocessedBeforeInputData=l;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ie(s,ai,e),C_((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let p=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let m=s._compositionKey;Pt(null),p||ie(s,ai,e),lc(m);break}case"insertLineBreak":Pt(null),ie(s,xa,!1);break;case"insertParagraph":Pt(null),i.isInsertLineBreak&&!gs?(i.isInsertLineBreak=!1,ie(s,xa,!1)):ie(s,Sf);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ie(s,Xf,e);break;case"deleteByComposition":(function(p,m){return p!==m||j(p)||j(m)||!La(p)||!La(m)})(f,g)&&ie(s,ic,e);break;case"deleteByDrag":xs(Nc),ie(s,ic,e);break;case"deleteByCut":ie(s,ic,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,Nr,"strikethrough");break;case"formatBold":ie(s,Nr,"bold");break;case"formatItalic":ie(s,Nr,"italic");break;case"formatUnderline":ie(s,Nr,"underline");break;case"historyUndo":ie(s,qf);break;case"historyRedo":ie(s,Jf)}return!0}function FA(e){let n=Ve(),r=n._inputState,s=ze(),i=e.data,a=qx(e),l=!1;if(i!=null&&fe(s)){let c=Xn(yn(n)),d=c!==null?Yn(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()&&ee(g)&&Wn(g);if(!f&&!p&&Vx(s,a,i,e.timeStamp,!1,d)){if(l=!0,r.compositionPhase==="ending-firefox"){let b=yc(n,i);if(r.compositionPhase="idle",b)return xs(Ec),V_(),!0}let m=s.anchor.getNode();if(c===null||d===null)return!0;let _=s.isBackward(),y=_?s.anchor.offset:s.focus.offset,x=_?s.focus.offset:s.anchor.offset;Sa&&!s.isCollapsed()&&ee(m)&&d.anchorNode!==null&&m.getTextContent().slice(0,y)+i+m.getTextContent().slice(y+x)===UC(d.anchorNode)||ie(n,ai,i);let E=i.length;$o&&E>1&&e.inputType==="insertCompositionText"&&!n.isComposing()&&(s.anchor.offset-=E,s._cachedNodes=null,s._cachedIsBackward=null),Na&&n.isComposing()&&(r.lastKeyDownTimeStamp=0,Pt(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 V_(),!0}function PA(e){let n=Ve(),r=n._inputState,s=ze();if(fe(s)&&!n.isComposing()){r.compositionPhase="composing",r.hadOrphanedCompositionEvents=!1;let i=s.anchor,a=s.anchor.getNode();if(Pt(i.key),xs(oC),e.timeStamp<r.lastKeyDownTimeStamp+30||i.type==="element"||!s.isCollapsed()||!Na&&(a.getFormat()!==s.format||ee(a)&&a.getStyle()!==s.style)||ee(a)&&(Wn(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){ie(n,ai,Kf);let l=ze();fe(l)&&Pt(l.anchor.key)}}return!0}function BA(e){let n=Ve();return n._inputState.compositionPhase="idle",yc(n,e.data),xs(Ec),!0}function lc(e){if(e===null)return;let n=ot(e);if(!ee(n)||n.getType()==="text"||Wn(n)||!n.isAttached())return;let r=ze(),s=fe(r)&&r.anchor.key===e?r.anchor.offset:null,i=_n(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(Pt(null),r!==null&&n!=null){if(n===""){let i=ot(r),a=e.getElementByKey(r),l=a!==null&&ee(i)?rr(i,a,e):null;if(l!==null&&l.nodeValue!==null&&ee(i)){let c=Xn(yn(e)),d=c&&Yn(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 lc(r),!1}if(n[n.length-1]===`
8
- `){let i=ze();if(fe(i)||gi(i)){if(fe(i)){let a=i.focus;i.anchor.set(a.key,a.offset,a.type)}return ie(e,xc,null),lc(r),!1}}let s=ot(r);if(s!==null&&ee(s)&&Wn(s)){s.markDirty();let i=ze(),a=s.getTextContentSize(),l=fe(i)&&i.anchor.key===r?i.anchor.offset:a;return s.select(l,l).insertText(n),!0}}return hg(!0,e,n),lc(r),!1}function KA(e){let n=Ve(),r=n._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){let s=q_(e);if(s&&Hn(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,Ax,e);else if(function(s){return Qe(s,"ArrowRight",{...tr,shiftKey:"any"})}(e))ie(n,Rx,e);else if(function(s){return Qe(s,"ArrowLeft",{shiftKey:"any"})}(e))ie(n,Mx,e);else if(function(s){return Qe(s,"ArrowLeft",{...tr,shiftKey:"any"})}(e))ie(n,Dx,e);else if(function(s){return Qe(s,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))ie(n,$x,e);else if(function(s){return Qe(s,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))ie(n,wx,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,kx,e);else if(function(s){return Pn&&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"})||Pn&&Qe(s,"h",{ctrlKey:!0})}(e))q_(e)?ie(n,Ix,e)&&y_(r):(e.preventDefault(),ie(n,Ra,!0));else if(function(s){return s.key==="Escape"}(e))ie(n,Lx,e);else if(function(s){return Qe(s,"Delete",{})||Pn&&Qe(s,"d",{ctrlKey:!0})}(e))!function(s){return s.key==="Delete"}(e)?(e.preventDefault(),ie(n,Ra,!1)):ie(n,Fx,e);else if(function(s){return Qe(s,"Backspace",X_)}(e))e.preventDefault(),ie(n,Ma,!0);else if(function(s){return Qe(s,"Delete",X_)}(e))e.preventDefault(),ie(n,Ma,!1);else if(function(s){return Pn&&Qe(s,"Backspace",{metaKey:!0})}(e))e.preventDefault(),ie(n,Da,!0);else if(function(s){return Pn&&(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",tr)}(e))e.preventDefault(),ie(n,Nr,"bold");else if(function(s){return Qe(s,"u",tr)}(e))e.preventDefault(),ie(n,Nr,"underline");else if(function(s){return Qe(s,"i",tr)}(e))e.preventDefault(),ie(n,Nr,"italic");else if(function(s){return Qe(s,"Tab",{shiftKey:"any"})}(e))ie(n,Px,e);else if(function(s){return Qe(s,"z",tr)}(e))e.preventDefault(),ie(n,qf);else if(function(s){if(Pn)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,Jf);else{let s=n._editorState._selection;!function(i){return Qe(i,"a",tr)}(e)?s===null||fe(s)||(!function(i){return Qe(i,"c",tr)}(e)?function(i){return Qe(i,"x",tr)}(e)&&(e.preventDefault(),ie(n,tg,e)):(e.preventDefault(),ie(n,eg,e))):(e.preventDefault(),ie(n,Hx,e)&&y_(r))}return function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey}(e)&&n.dispatchCommand(jx,e),!0}function Zx(e){let n=e.__lexicalEventHandles;return n===void 0&&(n=[],e.__lexicalEventHandles=n),n}var li=new Map;function S_(e){let n=XC(e.target);if(n===null)return;let r=Uc(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&&sr(_._rootElement.getRootNode())){m=!0;break}a.hasShadowEditor=m}if(m){let _=null,y=null;for(let x of p){let E=x._rootElement;if(E===null)continue;let b=Yn(n,E).anchorNode;if(b!==null&&fs(b)===x){if(sr(E.getRootNode())){s=x,i=b;break}_===null&&(_=x,y=b)}}s===null&&_!==null&&(s=_,i=y)}else{let _=n.anchorNode;_===null||_t(_)&&_.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;Hn(s,()=>{let p=Ns(),m=i??Yn(n,s._rootElement).anchorNode;if(_t(m)||_o(m))tn(wa(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&&x_(n,g,!1),x_(n,s,!0),s!==c?li.set(d,s):f&&li.delete(d)}function Tf(e){e._lexicalHandled=!0}function N_(e){return e._lexicalHandled===!0}var E_=()=>{};function zA(e){let n=Ef.get(e);if(n===void 0)return void E_();let r=Cc.get(n);if(r===void 0)return void E_();Ef.delete(e);let s=Ja(e);zc(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&&X(198);let i=Zx(e);for(let a=0;a<i.length;a++)i[a]();e.__lexicalEventHandles=[]}function bf(e,n,r){Wt();let s=e.__key,i=e.getParent();if(i===null)return void(Jt(e)!==null&&X(367,s,String(Jt(e))));let a=function(c){let d=ze();if(!fe(d)||!j(c))return d;let{anchor:f,focus:g}=d,p=f.getNode(),m=g.getNode();return Fa(p,c)&&f.set(c.__key,0,"element"),Fa(m,c)&&g.set(c.__key,0,"element"),d}(e),l=!1;if(fe(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(fe(a)&&n&&!l){let c=e.getIndexWithinParent();zn(e),us(a,i,c,-1)}else zn(e);r||Ot(i)||i.canBeEmpty()||!i.isEmpty()||bf(i,n),n&&a&&Bt(i)&&i.isEmpty()&&i.selectEnd()}function UA(e){return e}var Qx=Symbol.for("ephemeral");function Sc(e){return e[Qx]||!1}var T_={configurable:!0,enumerable:!1,value:void 0,writable:!0};class sn{__type;__key;__parent;__prev;__next;__state;[ba];static getType(){let{ownNodeType:e}=Qa(this);return e===void 0&&X(64,this.name),e}static clone(e){X(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||dy(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",T_),Object.defineProperty(this,ba,T_),FC(this,e)}getType(){return this.__type}isInline(){X(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(ee(this))return r;if(fe(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&&X(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(Ot(n)||Jt(e)!==null)return j(e)||e===this&&qe(e)||X(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&X(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=j(this)?this:this.getParent(),r=j(e)?e:e.getParent(),s=n&&r?kc(n,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=kc(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?kg(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&X(279),!1)))}isParentOf(e){return Fa(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=j(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&&X(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&&X(113),e}getWritable(){if(Sc(this))return this;Wt();let e=Fo(),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 Dc(i),i;let c=bg(i);return a.add(s),Dc(c),r.set(s,c),c}getTextContent(){return my(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){X(70)}updateDOM(e,n,r){X(71)}getDOMSlot(e){return new si(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){X(18,this.name)}updateFromJSON(e){return function(n,r){let s=n.getWritable(),i=r.$,a=i;for(let l of xx(s).flatKeys)l in r&&(a!==void 0&&a!==i||(a={...i}),a[l]=r[l]);return(s.__state||a)&&Hf(n).updateFromJSON(a),s}(this,e)}static transform(){return null}remove(e){bf(this,!0,e)}replace(e,n){Wt();let r=ze();r!==null&&(r=r.clone()),lf(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;zn(l),f!==null&&fe(r)&&us(r,f,g,-1);let p=s.getPreviousSibling(),m=s.getNextSibling(),{__prev:_,__next:y,__parent:x}=s;if(bf(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=y,l.__parent=x,c.__size=d;let E=0;n&&(j(this)&&j(l)||X(139),E=l.getChildrenSize(),l.splice(E,0,this.getChildren()));let b=Gn(this);if(b.length>0){Mo(this)&&Mo(l)||X(368,this.__key,l.__key);for(let R of b){let M=Mr(this,R);M!==null&&(_y(this,R),Og(l,R,M))}}if(fe(r)){tn(r);let R=r.anchor,M=r.focus;R.key===i&&(n&&R.type==="element"?R.set(l.__key,E+R.offset,"element"):A_(R,l)),M.key===i&&(n&&M.type==="element"?M.set(l.__key,E+M.offset,"element"):A_(M,l))}return Ro()===i&&Pt(a),l}insertAfter(e,n=!0){Wt(),lf(this,e);let r=this.getWritable(),s=e.getWritable();rx(this.getParentOrThrow());let i=s.getParent(),a=ze(),l=!1,c=!1;if(i!==null){let m=e.getIndexWithinParent();if(fe(a)){let _=i.__key,{anchor:y,focus:x}=a;l=y.type==="element"&&y.key===_&&y.offset===m+1,c=x.type==="element"&&x.key===_&&x.offset===m+1}zn(s),n&&fe(a)&&us(a,i,m,-1)}else zn(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&&fe(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(),lf(this,e);let r=this.getWritable(),s=e.getWritable();rx(this.getParentOrThrow());let i=s.__key,a=ze(),l=s.getParent(),c=l!==null?s.getIndexWithinParent():-1;zn(s),l!==null&&n&&fe(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&&fe(a))us(a,this.getParentOrThrow(),p);return e}isParentRequired(){return!1}createParentElementNode(){return On()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){Wt();let r=Un(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(j(s))return s.select();if(!ee(s)){let a=s.getIndexWithinParent()+1;return i.select(a,a)}return s.select(e,n)}selectNext(e,n){Wt();let r=Un(this);if(r!==null)return r.selectNext(e,n);let s=this.getNextSibling(),i=this.getParentOrThrow();if(s===null)return i.select();if(j(s))return s.select(0,0);if(!ee(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 sn}var HA="historic",WA="history-push",cc="history-merge",GA="paste",jA="cut",eC="collaboration",YA="skip-collab",tC="skip-scroll-into-view",nC="skip-dom-selection",Nc="skip-selection-focus",oC="composition-start",Ec="composition-end",VA="!important";function vf(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 y=e[_];if(a)y==="*"&&e[_+1]==="/"&&(a=!1,_++);else if(l)g===-1&&(g=_),l=!1;else if(i===null)if(y!=="/"||e[_+1]!=="*")if(y!=='"'&&y!=="'")if(y!=="(")if(y!==")")if(c||y!==":"||d!==0){if(y===";"&&d===0){g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1);let x=r.trim(),E=s.trim();x!==""&&E!==""&&(n[x]=E),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=y;else g!==-1&&(c?s+=e.slice(g,_):r+=e.slice(g,_),g=-1),a=!0,_++;else g===-1&&(g=_),y==="\\"?l=!0:y===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 rC(e,n,r){let s=r.trimEnd(),i=s.length-10;i>=0&&s.slice(i).toLowerCase()===VA?e.setProperty(n,s.slice(0,i).trim(),"important"):e.setProperty(n,r,"")}function XA(e,n){for(let r in n){let s=n[r];s==null?e.removeProperty(r):rC(e,r,s)}}function Of(e,n,r=""){if(n===r)return;let s=vf(r),i=vf(n);for(let a in i)delete s[a],rC(e,a,i[a]);for(let a in s)e.removeProperty(a)}function Qd(e,n){return 16&n?"code":n&Bf?"mark":32&n?"sub":64&n?"sup":null}function ef(e,n){return 1&n?"strong":2&n?"em":"span"}function sC(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 iC(e,n,r){let s=r.isComposing(),i=e+(s?Ea:""),a=xo(),l=Tg(a).$getDOMSlot(r,n,a),c=l.getFirstChild();if(c===null||c.nodeType!==Node.TEXT_NODE)return void l.insertChild(Cn().createTextNode(i));let d=c,f=d.nodeValue;if(f!==i)if(s||$o){let[g,p,m]=function(_,y){let x=_.length,E=y.length,b=0,R=0;for(;b<x&&b<E&&_[b]===y[b];)b++;for(;R+b<x&&R+b<E&&_[x-R-1]===y[E-R-1];)R++;return[b,x-b-R,y.slice(b,E-R)]}(f,i);p!==0&&d.deleteData(g,p),d.insertData(g,m)}else d.nodeValue=i}function b_(e,n,r,s,i,a){iC(i,e,n);let l=a.theme.text;l!==void 0&&sC(0,0,s,e,l)}function oc(e,n){let r=Cn().createElement(n);return r.appendChild(e),r}function Tc(e){return e!=null&&e.__isInlineFormattable===!0}class ms extends sn{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:eR,priority:0}),b:()=>({conversion:JA,priority:0}),code:()=>({conversion:er,priority:0}),em:()=>({conversion:er,priority:0}),i:()=>({conversion:er,priority:0}),mark:()=>({conversion:er,priority:0}),s:()=>({conversion:er,priority:0}),span:()=>({conversion:qA,priority:0}),strong:()=>({conversion:er,priority:0}),sub:()=>({conversion:er,priority:0}),sup:()=>({conversion:er,priority:0}),u:()=>({conversion:er,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 lA[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ro()}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 Ar(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,s=Qd(0,r),i=ef(0,r),a=s===null?i:s,l=Cn().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Cn().createElement(i),l.appendChild(c)),b_(c,this,0,r,this.__text,e);let d=this.__style;return d!==""&&Of(l.style,d),l}updateDOM(e,n,r){let s=this.__text,i=e.__format,a=this.__format,l=Qd(0,i),c=Qd(0,a),d=ef(0,i),f=ef(0,a);if((l===null?d:l)!==(c===null?f:c))return!0;if(l===c&&d!==f){let y=n.firstChild;y==null&&X(48);let x=Cn().createElement(f);return b_(x,this,0,a,s,r),n.replaceChild(x,y),!1}let g=n;c!==null&&l!==null&&(g=n.firstChild,g==null&&X(49)),iC(s,g,this);let p=r.theme.text;p!==void 0&&i!==a&&sC(0,i,a,g,p);let m=e.__style,_=this.__style;return m!==_&&Of(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 _t(n)||X(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=oc(n,"b")),this.hasFormat("italic")&&(n=oc(n,"i")),this.hasFormat("strikethrough")&&(n=oc(n,"s")),this.hasFormat("underline")&&(n=oc(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"?sA[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Ar(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=aA[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(!fe(i))return CC(l,r,l,s,"text","text");{let c=Ro();c!==i.anchor.key&&c!==i.focus.key||Pt(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&&fe(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=Ro(),a=r.length;e.sort((z,K)=>z-K),e.push(a);let l=[],c=e.length;for(let z=0,K=0;z<a&&K<=c;K++){let H=e[K];H>z&&(l.push(r.slice(z,H)),z=H)}let d=l.length;if(d===1)return[n];let f=l[0],g=n.getParent(),p,m=n.getFormat(),_=n.getStyle(),y=n.__detail,x=!1,E=null,b=null,R=ze();if(fe(R)){let[z,K]=R.isBackward()?[R.focus,R.anchor]:[R.anchor,R.focus];z.type==="text"&&z.key===s&&(E=z),K.type==="text"&&K.key===s&&(b=K)}n.isSegmented()?(p=_n(f),p.__format=m,p.__style=_,p.__detail=y,p.__state=a_(n,p),x=!0):p=n.setTextContent(f);let M=[p];for(let z=1;z<d;z++){let K=_n(l[z]);K.__format=m,K.__style=_,K.__detail=y,K.__state=a_(n,K);let H=K.__key;i===s&&Pt(H),M.push(K)}let k=E?E.offset:null,P=b?b.offset:null,F=0;for(let z of M){if(!E&&!b)break;let K=F+z.getTextContentSize();if(E!==null&&k!==null&&k<=K&&k>=F&&(E.set(z.getKey(),k-F,"text"),k<K&&(E=null)),b!==null&&P!==null&&P<=K&&P>=F){b.set(z.getKey(),P-F,"text");break}F=K}if(g!==null){(function(H){let q=H.getPreviousSibling(),W=H.getNextSibling();q!==null&&Dc(q),W!==null&&Dc(W)})(this);let z=g.getWritable(),K=this.getIndexWithinParent();x?(z.splice(K,0,M),this.remove()):z.splice(K,1,M),fe(R)&&us(R,g,K,d-1)}return M}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||X(50);let r=this.__key,s=e.__key,i=this.__text,a=i.length;Ro()===s&&Pt(r);let l=ze();if(fe(l)){let{anchor:g,focus:p}=l;g!==null&&g.key===s&&F_(g,n,r,e,a),p!==null&&p.key===s&&F_(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 qA(e){return{forChild:rg(e.style),node:null}}function JA(e){let n=e,r=n.style.fontWeight==="normal";return{forChild:rg(n.style,r?void 0:"bold"),node:null}}var v_=new WeakMap;function QA(e){if(!_t(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function eR(e){let n=e;e.parentElement===null&&X(129);let r=n.textContent||"";if(function(s){let i,a=s.parentNode,l=[s];for(;a!==null&&(i=v_.get(a))===void 0&&!QA(a);)l.push(a),a=a.parentNode;let c=i===void 0?a:i;for(let d=0;d<l.length;d++)v_.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=O_(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=O_(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:_n(r)}}function O_(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,_t(r)){let a=r.style.display;if(a===""&&!ry(r)||a!==""&&!a.startsWith("inline"))return null}let i=r;for(;(i=n?r.firstChild:r.lastChild)!==null;)r=i;if(_o(r))return r;if(r.nodeName==="BR")return null}}var tR={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function er(e){let n=tR[e.nodeName.toLowerCase()];return n===void 0?{node:null}:{forChild:rg(e.style,n),node:null}}function _n(e=""){return Za(new ms(e))}function ee(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)=>ee(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 Wa 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||X(286),this}setDetail(e){return e!==2&&X(127),this}setMode(e){return e!=="normal"&&X(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function aC(){return Za(new Wa)}function sg(e){return e instanceof Wa}class lC{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(Do(kr(this,"next")),Do(kr(e,"next")))<0}getNode(){let e=ot(this.key);return e===null&&X(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,Or()||(Ro()===a&&Pt(e),i!==null&&(i.setCachedNodes(null),fe(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function mo(e,n,r){return new lC(e,n,r)}function tf(e,n){let r=n.__key,s=e.offset,i="element";if(ee(n)){i="text";let a=n.getTextContentSize();s>a&&(s=a)}else if(!j(n)){let a=n.getNextSibling();if(ee(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 A_(e,n){if(j(n)){let r=n.getLastDescendant();j(r)||ee(r)?tf(e,r):tf(e,n)}else tf(e,n)}function R_(e,n,r,s){let i=e.getNode(),a=i.getChildAtIndex(e.offset),l=_n();if(l.setFormat(r),l.setStyle(s),$C(a))a.splice(0,0,[l]);else if(a!==null){let c=Ot(i)?On().append(l):l;a.insertBefore(c)}else if(Ot(i)){let c=i.getLastChild();j(c)&&!c.isInline()&&c.isEmpty()?c.append(l):i.append(On().append(l))}else i.append(l);e.is(n)&&n.set(l.__key,0,"text"),e.set(l.__key,0,"text")}function M_(e,n,r,s){let i=e.anchor.getNode();ee(i)||X(398);let a=e.anchor.offset,l=_n(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 Lc{_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 Lc(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(ee(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 Or()||(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=yt(e[0],"next");Sy(wr(n,n))}for(let n of e)n.remove();cC()}}function cC(){let e=An();if(e.isEmpty()){let n=On();e.append(n),n.select()}}function fe(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!!fe(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(jn(d)){let{origin:f}=d;s.length===0?l.add(f):(c.add(f),s.push(f))}else{let{origin:f}=d;j(f)&&c.has(f)||s.push(f)}if(a&&s.push(a.caret.origin),Dr(r.focus)&&j(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let d=ir(r.focus.origin,"previous");jn(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(!j(d)||c.has(d)||d.isEmpty()||l.has(d))break;s.pop()}if(s.length===0&&r.isCollapsed()){let d=Do(r.anchor),f=Do(r.anchor.getFlipped()),g=(m)=>po(m)?m.origin:m.getNodeAtCaret(),p=g(d)||g(f)||(r.anchor.getNodeAtCaret()?d.origin:f.origin);s.push(p)}return s}(Ig(Lf(this),"next"));return Or()||(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]=Af(this),d="",f=!0;for(let g=0;g<e.length;g++){let p=e[g];if(j(p)&&!p.isInline()){f||(d+=`
9
- `);let m="";for(let _ of Gn(p)){let y=Mr(p,_);y!==null&&(m+=y.getTextContent())}m!==""?(d+=m,f=!1):f=!p.isEmpty()}else if(f=!1,ee(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)&&!Io(p)||p===r&&this.isCollapsed()||(d+=p.getTextContent())}return d}applyDOMRange(e){let n=Ve(),r=n.getEditorState()._selection,s=_C(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),oi(this)}clone(){let e=this.anchor,n=this.focus;return new Ss(mo(e.key,e.offset,e.type),mo(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Ar(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(ee(g)&&(n=g.getFormat(),r=g.getStyle()),this.removeText(),this.format=n,this.style=r,e==="")return;if(Ro()===null)return this.anchor.type==="element"&&R_(this.anchor,this.focus,n,r),void M_(this,e,n,r)}this.anchor.type==="element"&&R_(this.anchor,this.focus,n,r);let s=this.anchor.getNode();ee(s)||X(398);let i=this.anchor.offset,a=s.getParentOrThrow(),l=s.getTextContentSize();if(Wn(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(Ro()!==null)s.setMode("normal").setFormat(n).setStyle(r);else{let p=_n(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(ee(p)&&p.canInsertTextAfter()&&!Wn(p))p.select();else{let m=_n();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(ee(p)&&p.canInsertTextBefore()&&!Wn(p))p.select(0,0);else{let m=_n();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=_n(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 M_(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,Ny(Lf(this))),e&&ze()!==this&&tn(this)}formatText(e,n=null){dC(this,e,n)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&j(n)&&Jt(n)!==null){let y=n.isShadowRoot()?n.getFirstChild()??n.append(On()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&y!==null&&!j(y)){let x=On();y.insertBefore(x),y=x}if(y!==null){y.selectStart();let x=ze();return fe(x)||X(369),x.insertNodes(e)}}if(this.anchor.type==="element"&&Ot(n)){let y=of(e),x=y.getLastDescendant();return n.splice(this.anchor.offset,0,y.getChildren()),void(x!==null&&x.selectEnd())}let r=(this.isBackward()?this.focus:this.anchor).getNode(),s=Sr(r,mn),i=e[e.length-1];if(j(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let y=ga(this);s.splice(y,0,e),i.selectEnd()}return}if(!e.some((y)=>(j(y)||qe(y))&&!y.isInline())){j(s)||X(211,r.constructor.name,r.getType());let y=ga(this);return s.splice(y,0,e),void i.selectEnd()}if(j(s)&&Jt(s)!==null){let y=ga(this),x=Mf(e);s.splice(y,0,x);let E=x[x.length-1];return void(E!==void 0?E.selectEnd():s.select(y,y))}if(s===null){let y=of(e),x=y.getLastDescendant(),E=kr(this.anchor,"next");for(let b of y.getChildren())E=vy(b,E);return void(x!==null&&x.selectEnd())}if(j(s)&&!s.isParentRequired()&&!Ot(s.getParentOrThrow())){let y=ga(this),x=Mf(e);s.splice(y,0,x);let E=x[x.length-1];return void(E!==void 0?E.selectEnd():s.select(y,y))}let a=of(e),l=a.getLastDescendant(),c=a.getChildren(),d=!j(s)||!s.isEmpty()?this.insertParagraph():null;d&&!s.isAttached()&&(r=this.anchor.getNode(),s=Sr(r,mn));let f=c[c.length-1],g=c[0];var p;j(p=g)&&mn(p)&&!p.isEmpty()&&j(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(j(s)||X(211,r.constructor.name,r.getType()),s.append(...g.getChildren()),g=c[1]),g&&(s===null&&X(212,r.constructor.name,r.getType()),function(y,x){let E=x.getParentOrThrow().getLastChild(),b=x,R=[x];for(;b!==E;)b.getNextSibling()||X(140),b=b.getNextSibling(),R.push(b);let M=y;for(let k of R)M=M.insertAfter(k)}(s,g));let m=Sr(l,mn);d&&j(m)&&(d.canMergeWhenEmpty()||mn(f))&&(m.append(...d.getChildren()),d.remove()),j(s)&&s.isEmpty()&&s.remove(),l.selectEnd();let _=j(s)?s.getLastChild():null;Io(_)&&m!==s&&_.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type==="element"&&Ot(e)){let l=On();return e.splice(this.anchor.offset,0,[l]),l.select(),l}let n=ga(this),r=Sr(this.anchor.getNode(),mn);if(r!==null&&Jt(r)!==null)return null;j(r)||X(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=Pc();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]=Af(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(ee(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(ee(r)&&(f===r.getTextContentSize()?e.shift():f!==0&&([,r]=r.splitText(f),e[0]=r,c.set(r.getKey(),0,"text"))),ee(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=Xn(yn(i));if(!a)return;let{_blockCursorElement:l,_rootElement:c}=i,d=this.focus.getNode();c===null||l===null||!j(d)||d.isInline()||d.canBeEmpty()||$c(l,i,c);let f=ui(i,this.focus.key),g=f;if(this.focus.type==="text"&&(g=ee(d)?rr(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=ee(_)?rr(_,p,i):null}m&&g&&Oc(a,m,this.anchor.offset,g,this.focus.offset)}if(r==="character"&&ee(d)&&d.isUnmergeable()){if(n?this.focus.offset===0:this.focus.offset===d.getTextContentSize()){let p=yt(d,n?"previous":"next").getNodeAtCaret();if(ee(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?rr(p,m,i):null;if(_){let y=n?_.length:0;Oc(a,_,y,_,y)}}}}}if(gC(a,e,n?"backward":"forward",r),a.rangeCount>0){let p=mi(a,i._rootElement),m=p||a.getRangeAt(0),_=this.anchor.getNode(),y=Bt(_)?_:Cg(_);if(this.applyDOMRange(m),this.dirty=!0,!s)pC(this,n,y),(p?a.direction!=="backward":a.anchorNode===m.startContainer&&a.anchorOffset===m.startOffset)||fC(this)}r==="lineboundary"&&Ac(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&j(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(j(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(kr(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(jn(c))if(c.origin.isInline());else{if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){let d=Do(c);ya(this,wr(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(Dr(c)){if(j(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(Gn(c.origin).length>0){if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),tn(d)}}else if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let d=bc();d.add(c.origin.getKey()),tn(d)}else c.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:c,block:d}=l;if(Gn(d).length>0)return;return c.origin.isEmpty()&&!d.isEmpty()&&c.origin.getParent()===d.getParent()?void c.origin.remove(!0):(ya(this,wr(!c.origin.isEmpty()&&d.isEmpty()?bs(yt(d,c.direction)):i.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Jt(c)!==null)return;if(j(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(nf(this,e,"character"),this.isCollapsed()){if(e&&r.offset===0&&$_(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 w_(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 w_(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,y=g.offset,x=_<y,E=x?_:y,b=x?y:_,R=b-1;if(E!==R)(function(M){return!(KC(M)||oR(M))})(p.getTextContent().slice(E,b))&&(d?g.set(g.key,R,g.type):f.set(f.key,R,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()&&Bt(r.getParent())&&r.getPreviousSibling()===null&&$_(this,r),cC()}}deleteLine(e){let n=Rf(this.anchor);if(n!==null&&qe(Un(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);if(this.isCollapsed()&&nf(this,e,"lineboundary"),this.isCollapsed())this.deleteCharacter(e);else Sr(this.anchor.getNode(),mn)!==Sr(this.focus.getNode(),mn)?(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;nf(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 Or()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}}function gi(e){return e instanceof Lc}function uC(e,n){if(gi(e)){for(let b of e.getNodes())Tc(b)&&b.setFormat(n(b.getFormat()));return}if(e.isCollapsed())return e.setFormat(n(e.format)),void Pt(null);let r=[];for(let b of e.getNodes())ee(b)?r.push(b):j(b)?b.setTextFormat(n(b.getTextFormat())):Tc(b)&&b.setFormat(n(b.getFormat()));let s=r.length;if(s===0)return e.setFormat(n(e.format)),void Pt(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],y=d.type==="text"?d.offset:_.getTextContentSize();if(g.is(_)){if(p===y)return;let b=n(g.getFormat());if(Wn(g)||p===0&&y===g.getTextContentSize())g.setFormat(b);else{let R=g.splitText(p,y),M=p===0?R[0]:R[1];M.setFormat(b),c.type==="text"&&c.set(M.__key,0,"text"),d.type==="text"&&d.set(M.__key,y-p,"text")}return void(e.format=b)}p===0||Wn(g)||([,g]=g.splitText(p),p=0);let x=n(g.getFormat());g.setFormat(x);let E=n(_.getFormat());y>0&&(y===_.getTextContentSize()||Wn(_)||([_]=_.splitText(y)),_.setFormat(E));for(let b=f+1;b<m;b++){let R=r[b];R.setFormat(n(R.getFormat()))}c.type==="text"&&c.set(g.__key,p,"text"),d.type==="text"&&d.set(_.__key,y,"text"),e.format=x|E}function nR(e,n){let r=[];for(let[s,i]of Object.entries(n))typeof i=="boolean"&&r.push([s,i]);r.length!==0&&uC(e,(s)=>{for(let[i,a]of r)s=Ar(s,i,a?Xt[i]:0);return s})}function dC(e,n,r=null){let s=r===null&&fe(e)?Ar(e.format,n,null):r;uC(e,(i)=>Ar(i,n,s))}function D_(e){let n=e.offset;if(e.type==="text")return n;let r=e.getNode();return n===r.getChildrenSize()?r.getTextContent().length:0}function Af(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]:[D_(r),D_(s)]}function $_(e,n){for(let r=n;r;r=r.getParent()){if(j(r)){if(r.collapseAtStart(e))return!0;if(Ot(r))break}if(r.getPreviousSibling())break}return!1}function fC(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 gC(e,n,r,s){e.modify(n,r,s)}function pC(e,n,r){let s=e.getNodes(),i=s.filter((c)=>Fa(c,r));if(i.length===0||i.length===s.length)return!1;let a=n?i[0]:i[i.length-1],l=j(a)?a:a.getParentOrThrow();return n?l.selectStart():l.selectEnd(),!0}function nf(e,n,r){if(Ac(e,"extend",n,r))return;let s=Ve(),i=Xn(yn(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||!j(d)||d.isInline()||d.canBeEmpty()||$c(a,s,l);let f=(H)=>{let q=H.getNode(),W=s.getElementByKey(H.key);return W!==null&&H.type==="text"&&ee(q)?rr(q,W,s):W},g=c.getNode(),p=f(c);if(p===null)return;let m=c.offset,_=e.isCollapsed(),y=e.focus,x=_?p:f(y);if(x===null)return;let E=y.offset;if(Oc(i,x,E,x,E),gC(i,"move",n?"backward":"forward",r),i.rangeCount===0)return;let b=mi(i,l)||i.getRangeAt(0),{startContainer:R,startOffset:M}=b;if(_&&r==="character"&&c.type==="text"&&ee(g)&&g.isUnmergeable()){if(m===(n?0:g.getTextContentSize())){let H=yt(g,n?"previous":"next").getNodeAtCaret();if(ee(H)){let q=n?H.getTextContentSize()-1:1;return e.focus.set(H.__key,q,"text"),void(e.dirty=!0)}}}if(_&&r==="character"&&c.type==="text"){let H=n?0:g.getTextContentSize(),q=R===p?M:m!==H?H:-1;if(q>=0)return void(q!==m&&(e.focus.set(c.key,q,"text"),e.dirty=!0))}let[k,P,F,z]=n?[R,M,p,m]:[p,m,R,M],K=Bt(g)?g:Cg(g);e.applyDOMRange({collapsed:!1,endContainer:F,endOffset:z,startContainer:k,startOffset:P}),e.dirty=!0,!pC(e,n,K)&&n&&fC(e),r==="lineboundary"&&Ac(e,"extend",n,r,"decorators")}var oR=(()=>{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 w_(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 k_(e,n,r,s){let i,a=n,l=!1;if(_t(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||Pa(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=ri(p),ee(i))a=ho(i,c?"next":"previous");else{let _=ri(e);if(_===null)return null;if(j(_)){let y=s.getElementByKey(_.getKey());y===null&&X(214),[_,a]=Rn(_,y,s).resolveChildIndex(_,y,e,n),j(_)||X(215),c&&a>=_.getChildrenSize()&&(a=Math.max(0,_.getChildrenSize()-1));let E=_.getChildAtIndex(a);if(j(E)&&function(b,R,M){let k=b.getParent();return M===null||k===null||!k.canBeEmpty()||k!==M.getNode()}(E,0,r)){let b=c?E.getLastDescendant():E.getFirstDescendant();b===null?_=E:(E=b,_=j(E)?E:E.getParentOrThrow()),a=0}ee(E)?(i=E,_=null,a=ho(E,c?"next":"previous")):E!==_&&c&&!m&&(j(_)||X(216),a=Math.min(_.getChildrenSize(),a+1))}else{let y=Un(_),x=y!==null?y:_,E=x.getIndexWithinParent(),b=s.getElementByKey(_.getKey()),R="after";if(b!==null&&ri(e)===_){let M=Rn(_,b,s);M.element!==b?R=M.resolveLeafPosition(b,e,n):n===0&&qe(_)&&(R="before")}a=R==="before"?E:E+1,_=x.getParentOrThrow()}if(j(_))return[mo(_.__key,a,"element"),l]}}else i=ri(e);return ee(i)?[mo(i.__key,ho(i,a,"clamp"),"text"),l]:null}function I_(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&&j(l)&&l.isInline()){let c=l.getPreviousSibling();ee(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else j(a)&&!r&&a.isInline()?e.set(a.__key,a.getChildrenSize(),"element"):ee(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&&j(a)&&a.isInline())e.set(a.__key,0,"element");else if((r||n)&&a===null&&j(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let c=l.getNextSibling();ee(c)&&e.set(c.__key,0,"text")}}}function Rf(e){let n=ot(e.key);return n===null?null:py(n)}function hC(e,n,r){let s=Rf(e),i=Rf(n);if(s===i||s!==null&&i!==null&&s.is(i))return!1;let a=r(s,i);if(s!==null)return j(s)?n.set(s.getKey(),a?s.getChildrenSize():0,"element"):n.set(s.getKey(),a?s.getTextContentSize():0,"text"),!0;let l=Un(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 mC(e){let n=hC(e.anchor,e.focus,(r,s)=>function(i,a,l,c){if(l!==null&&c!==null){let g=Un(l),p=Un(c);if(g!==null&&g.is(p)){for(let m of Hc(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=Un(l),p=ot(a.key);return g===null||p===null||!(!g.is(p)&&!g.isParentOf(p))||g.isBefore(p)}let d=Un(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 _C(e,n,r,s,i,a){if(e===null||r===null||!qa(i,e,r))return null;let l=k_(e,n,fe(a)?a.anchor:null,i);if(l===null)return null;let c=k_(r,s,fe(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 _=ri(e),y=ri(r);if(qe(_)&&qe(y))return null}let m=i._slotsUsed&&hC(d,g,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(_,y){if(_.type==="text"&&y.type==="text"){let x=_.isBefore(y),E=_.is(y);I_(_,x,E),I_(y,!x,E),E&&y.set(_.key,_.offset,_.type)}}(d,g),[d,g,f||p||m]}function xC(e){return j(e)&&!e.isInline()}function CC(e,n,r,s,i,a){let l=Fo(),c=new Ss(mo(e,n,i),mo(r,s,a),0,"");return c.dirty=!0,l._selection=c,c}function yC(){let e=mo("root",0,"element"),n=mo("root",0,"element");return new Ss(e,n,0,"")}function bc(){return new Lc(new Set)}function rR(e,n){return wa(null,e,n,null)}function wa(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=!uf&&(c||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&a&&a.detail===3||l==="drop"||l===void 0),f,g,p,m;if(fe(e)&&!d)return e.clone();{if(n===null)return null;let k=Yn(n,r._rootElement);if(f=k.anchorNode,g=k.focusNode,p=k.anchorOffset,m=k.focusOffset,(c||l===void 0)&&fe(e)&&!qa(r,f,g))return e.clone()}let _=_C(f,p,g,m,r,e);if(_===null)return null;let[y,x,E]=_,b=0,R="";if(fe(e)){let k=e.anchor;if(y.key===k.key)b=e.format,R=e.style;else{let P=y.getNode();ee(P)?(b=P.getFormat(),R=P.getStyle()):j(P)&&(b=P.getTextFormat(),R=P.getTextStyle())}}let M=new Ss(y,x,b,R);return E&&(M.dirty=!0),M}function ze(){return Fo()._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"),L_(e)}}else{let f=e.isBackward(),g=f?a:i,p=g.getNode(),m=f?i:a,_=m.getNode();if(n.is(p)){let y=g.offset;(r<=y&&s>0||r<y&&s<0)&&g.set(d,Math.max(0,y+s),"element")}if(n.is(_)){let y=m.offset;(r<=y&&s>0||r<y&&s<0)&&m.set(d,Math.max(0,y+s),"element")}}L_(e)}function L_(e){let n=e.anchor,r=n.offset,s=e.focus,i=s.offset,a=n.getNode(),l=s.getNode();if(e.isCollapsed()){if(!j(a))return;let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(ee(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text"),s.set(f.__key,g,"text")}return}if(j(a)){let c=a.getChildrenSize(),d=r>=c,f=d?a.getChildAtIndex(c-1):a.getChildAtIndex(r);if(ee(f)){let g=0;d&&(g=f.getTextContentSize()),n.set(f.__key,g,"text")}}if(j(l)){let c=l.getChildrenSize(),d=i>=c,f=d?l.getChildAtIndex(c-1):l.getChildAtIndex(i);if(ee(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,ee(s)?(l=s.getTextContentSize(),c="text"):j(s)&&(l=s.getChildrenSize(),c="element")):i!==null&&(a=i.__key,ee(i)?c="text":j(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 F_(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 P_(e,n,r){let s=ui(e,n.getKey());if(j(n)){let i=Rn(n,s,e);return[i.element,r+i.getFirstChildOffset()]}return[s,r]}function SC(e,n,r,s,i,a){let l=a.getRootNode(),c=pi(l)||sr(l)?di(l):null;if(i.has(eC)&&c!==a||c!==null&&Kc(c,c))return;let d=Yn(s,a),f;if(!fe(n))return void(e!==null&&qa(r,d.anchorNode,d.focusNode)&&s.removeAllRanges());let{anchor:g,focus:p}=n,m=g.getNode(),_=p.getNode(),[y,x]=P_(r,m,g.offset),[E,b]=P_(r,_,p.offset),{format:R,style:M}=n,k=n.isCollapsed(),P=y,F=E,z=!1;if(g.type==="text"?(P=ee(m)?rr(m,y,r):null,z=m.getFormat()!==R||m.getStyle()!==M):fe(e)&&e.anchor.type==="text"&&(z=!0),p.type==="text"&&(F=ee(_)?rr(_,E,r):null),P!==null&&F!==null){if(k&&(e===null||z||fe(e)&&(e.format!==R||e.style!==M))&&function(K,H,q,W,te,Z){K._inputState.collapsedSelectionFormat={format:H,key:te,offset:W,style:q,timeStamp:Z}}(r,R,M,x,g.key,performance.now()),(s.type!=="Range"||!k)&&d.anchorOffset===x&&d.focusOffset===b&&d.anchorNode===P&&d.focusNode===F){if(c===null||!a.contains(c)){let K=c!==null?fs(c):null;K!==null&&K!==r||i.has(Nc)||a.focus({preventScroll:!0})}if(g.type!=="element")return}if(Oc(s,P,x,F,b),$o&&n.isCollapsed()&&a!==null&&!i.has(Nc)){let K=wc(a);if(K===null||!a.contains(K)){let H=di(a.ownerDocument),q=H!==null?fs(H):null;q!==null&&q!==r||a.focus({preventScroll:!0})}}if(!i.has(tC)&&n.isCollapsed()&&a!==null&&a===wc(a)){let K=fe(n)&&n.anchor.type==="element"?P.childNodes[x]||null:(f===void 0&&(f=QC(s,a)),f);if(K!==null){let H;if(_o(K)){let q=K.ownerDocument.createRange();q.selectNode(K),H=q.getBoundingClientRect()}else H=K.getBoundingClientRect();(function(q,W,te){let Z=Uc(te),re=xg(Z);if(Z===null||re===null)return;let Y=te.getBoundingClientRect();if(W.bottom<Y.top)return;let{top:de,bottom:xe}=W,Re=0,ne=0,ae=te;for(;ae!==null;){let ce=ae===Z.body;if(ce){let ke=re.visualViewport;if(ke){let ht=ke.offsetTop;Re=ht,ne=ht+ke.height}else Re=0,ne=yn(q).innerHeight;let gt=re.getComputedStyle(Z.documentElement),Qt=parseFloat(gt.scrollPaddingTop),Pe=parseFloat(gt.scrollPaddingBottom);isFinite(Qt)&&(Re+=Qt),isFinite(Pe)&&(ne-=Pe)}else{let ke=ae===te?Y:ae.getBoundingClientRect();Re=ke.top,ne=ke.bottom}let we=0;if(de<Re?we=-(Re-de):xe>ne&&(we=xe-ne),we!==0)if(ce)re.scrollBy(0,we);else{let ke=ae.scrollTop;ae.scrollTop+=we;let gt=ae.scrollTop-ke;de-=gt,xe-=gt}if(ce)break;ae=Es(ae)}})(r,H,a)}}(function(K){K._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function sR(e){let n=ze()||Ns();n===null&&(n=An().selectEnd()),n.insertNodes(e)}function NC(e,n){for(let r of e.split(/(\r?\n|\t)/))r===`
10
- `||r===`\r
11
- `?n.linebreak():r==="\t"?n.tab():r!==""&&n.text(r)}function ig(e){let n=[];return NC(e,{linebreak:()=>n.push(Pc()),tab:()=>n.push(aC()),text:(r)=>n.push(_n(r))}),n}function iR(){let e=ze();return e===null?"":e.getTextContent()}function Mf(e){let n=[];for(let r of e)Io(r)||(!j(r)&&!qe(r)||r.isInline()?n.push(r):j(r)&&n.push(...Mf(r.getChildren())));return n}function ga(e){let n=e;e.isCollapsed()||n.removeText();let r=ze();fe(r)&&(n=r),fe(n)||X(161);let s=n.anchor,i=s.getNode(),a=s.offset;for(;!mn(i)&&Jt(i)===null;){let l=i;if([i,a]=aR(i,a),l.is(i))break}return a}function aR(e,n){let r=e.getParent();if(!r){let i=On();return An().append(i),i.select(),[An(),0]}if(ee(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(!j(e)||n===0)return[r,e.getIndexWithinParent()];let s=e.getChildAtIndex(n);if(s){let i=new Ss(mo(e.__key,n,"element"),mo(e.__key,n,"element"),0,""),a=e.insertNewAfter(i);a&&a.append(s,...s.getNextSiblings())}return[r,e.getIndexWithinParent()+1]}function B_(e){return Io(e)||YC(e)||ee(e)||e.isParentRequired()}function of(e){let n=On(),r=null;for(let s=0;s<e.length;s++){let i=e[s];if(B_(i)){if(r===null){r=i.createParentElementNode(),n.append(r);let a=e[s+1];if(Io(i)&&(a===void 0||!B_(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=kr(e.focus,r?"previous":"next"),l=s==="lineboundary",c=n==="move",d=a,f=i==="decorators-and-blocks";if(!Ey(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(jn(g))g.origin.isInline()||(d=g);else{if(j(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()),tn(g),!0}return d=Do(d),c&&za(e.anchor,d),za(e.focus,d),f||!l}var Gt=null,vt=null,xn=!1,rf=!1,uc=!1,sf=new Set,fc=0,K_={characterData:!0,childList:!0,subtree:!0};function Or(){return xn||Gt!==null&&Gt._readOnly}function Wt(){xn&&X(13)}function EC(){fc>99&&X(14)}function Fo(){return Gt===null&&X(195,bC()),Gt}function lR(e){Fo()!==null&&vt===null&&(vt=e),vt!==e&&ax(378)}function Ve(){return vt===null&&X(337,bC()),vt}function TC(){Ve()._dirtyType=2}function bC(){let e=0,n=new Set,r=_s.version;if(typeof window<"u")for(let i of JC(document)){let a=Ja(i);if(zc(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 vC(){return vt}function z_(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 U_(e,n){return e!==void 0&&e.__key!==n&&e.isAttached()}function OC(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 cR(e){return Rc(e,Ve()._nodes)}function Rc(e,n){let r=e.type,s=n.get(r);s===void 0&&X(17,r);let i=s.klass;e.type!==i.getType()&&X(18,i.name);let a=i.importJSON(e),l=e.children;if(j(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){Mo(a)||X(379,i.name);for(let d in c)Og(a,d,Rc(c[d],n))}return a}function H_(e,n,r){let s=Gt,i=xn,a=vt;Gt=n,xn=!0,vt=e;try{return r()}finally{Gt=s,xn=i,vt=a}}function Er(e,n){let r=uc;uc=!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&&W_(s,s._deferred));let d=s._editorState,f=d._selection,g=a._selection,p=s._dirtyType!==0,m=Gt,_=xn,y=vt,{_updating:x,_observer:E}=s,b=null;if(s._pendingEditorState=null,s._editorState=a,!c&&p&&E!==null){vt=s,Gt=a,xn=!1,s._updating=!0;try{let{_dirtyType:K,_dirtyElements:H,_dirtyLeaves:q}=s;E.disconnect(),b=NA(d,a,s,K,H,q)}catch(K){if(K instanceof Error&&s._onError(K),rf)throw K;return wC(s,null,l,a),hx(s),s._dirtyType=2,rf=!0,Er(s,d),void(rf=!1)}finally{E.observe(l,K_),s._updating=x,Gt=m,xn=_,vt=y}}a._readOnly||(a._readOnly=!0);let{_dirtyLeaves:R,_dirtyElements:M,_normalizedNodes:k,_updateTags:P}=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(K,H){let q=K._decorators,W=K._pendingDecorators||q,te=H._nodeMap,Z;for(Z in W)te.has(Z)||(W===q&&(W=BC(K)),delete W[Z])}(s,a);let F=c?null:Xn(yn(s));if(s._editable&&F!==null&&(p||g===null||g.dirty||!g.is(f))&&l!==null&&!P.has(nC)){vt=s,Gt=a;try{if(E!==null&&E.disconnect(),p||g===null||g.dirty){let K=s._blockCursorElement;K!==null&&$c(K,s,l),SC(f,g,s,F,P,l)}(function(K,H,q){let W=K._blockCursorElement;if(fe(q)&&q.isCollapsed()&&q.anchor.type==="element"&&H.contains(wc(H))){let te=q.anchor,Z=te.getNode(),re=te.offset,Y=!1,de=null;if(re===Z.getChildrenSize())gc(Z.getChildAtIndex(re-1))&&(Y=!0);else{let xe=Z.getChildAtIndex(re);if(xe!==null&&gc(xe)){let Re=xe.getPreviousSibling();(Re===null||gc(Re))&&(Y=!0,de=K.getElementByKey(xe.__key))}}if(Y){let xe=Rn(Z,K.getElementByKey(Z.__key),K).element;return W===null&&(K._blockCursorElement=W=function(Re){let ne=Re.theme,ae=Cn().createElement("div");ae.contentEditable="false",ae.setAttribute("data-lexical-cursor","true");let ce=ne.blockCursor;if(ce!==void 0){if(typeof ce=="string"){let we=nl(ce);ce=ne.blockCursor=we}ce!==void 0&&ae.classList.add(...ce)}return ae}(K._config)),H.style.caretColor="transparent",void(de===null?xe.appendChild(W):xe.insertBefore(W,de))}}W!==null&&$c(W,K,H)})(s,l,g)}finally{E!==null&&E.observe(l,K_),vt=y,Gt=m}}b!==null&&function(K,H,q,W,te){let Z=Array.from(K._listeners.mutation),re=Z.length;for(let Y=0;Y<re;Y++){let[de,xe]=Z[Y];for(let Re of xe){let ne=H.get(Re);ne!==void 0&&de(ne,{dirtyLeaves:W,prevEditorState:te,updateTags:q})}}}(s,b,P,R,d),fe(g)||g===null||f!==null&&f.is(g)||s.dispatchCommand(Wf);let z=s._pendingDecorators;if(z!==null&&(s._decorators=z,s._pendingDecorators=null,Ca("decorator",s,!0,z)),function(K,H,q){let W=Y_(H),te=Y_(q);W!==te&&Ca("textcontent",K,!0,te)}(s,i||d,a),Ca("update",s,!0,{dirtyElements:M,dirtyLeaves:R,editorState:a,mutatedNodes:b,normalizedNodes:k,prevEditorState:i||d,tags:P}),!x)W_(s,s._deferred);(function(K){let H=K._updates;if(H.length===0)return void(K._cascadeCount=0);if(function(W){if(sf.has(W))return;sf.add(W),setTimeout(()=>{sf.delete(W),W._cascadeCount=0},0)}(K),K._cascadeCount++>99)return K._updates=[],K._cascadeCount=0,void K._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: ${K._config.namespace}`));let q=H.shift();if(q){let[W,te]=q;ka(K,W,te)}})(s)})(e,n)}finally{uc=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 AC(e,n,r,s){let i=pg(e),a;if(!uc)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(Hn(d,()=>{for(let m of g)if(m(r,s))return void(p=!0)}),p)return p}}}return a&&a.update(()=>{AC(a,n,r,s)}),!1}function W_(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 G_(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&&X(191),c._flushSync=!0),d&&e._deferred.push(d),OC(e,l.tag)),c==null?ka(e,a,l):a()}}return s}function ka(e,n,r){let s=e._updateTags,i,a=!1,l=!1;r!==void 0&&(i=r.onUpdate,OC(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=RC(d||c),f=!0),d._flushSync=l;let g=Gt,p=xn,m=vt,_=e._updating;Gt=d,xn=!1,e._updating=!0,vt=e;let y=e._headless||e.getRootElement()===null;cg(null);try{f&&(y?c._selection!==null&&(d._selection=c._selection.clone()):d._selection=function(R,M){let k=R.getEditorState()._selection,P=Xn(yn(R));return fe(k)||k==null?wa(k,P,R,M):k.clone()}(e,r&&r.event||null));let E=e._compositionKey;n(),a=G_(e,a),function(R,M){let k=M.getEditorState()._selection,P=R._selection;if(fe(P)){let{anchor:F,focus:z}=P,K;if(F.type==="text"&&(K=F.getNode(),K.selectionTransform(k,P)),z.type==="text"){let H=z.getNode();K!==H&&H.selectionTransform(k,P)}}}(d,e),e._dirtyType!==0&&(a?function(R,M){let k=M._dirtyLeaves,P=R._nodeMap;for(let F of k){let z=P.get(F);ee(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&u_(z)}}(d,e):function(R,M){let{_dirtyLeaves:k,_dirtyElements:P}=M,F=R._nodeMap,z=Ro(),K=new Map,H=k,q=H.size,W=P,te=W.size;for(;q>0||te>0;){if(q>0){M._dirtyLeaves=new Set;for(let Z of H){let re=F.get(Z);ee(re)&&re.isAttached()&&re.isSimpleText()&&!re.isUnmergeable()&&u_(re),re!==void 0&&U_(re,z)&&z_(M,re,K),k.add(Z)}if(H=M._dirtyLeaves,q=H.size,q>0){fc++;continue}}M._dirtyLeaves=new Set,M._dirtyElements=new Map,W.delete("root")&&W.set("root",!0);for(let Z of W){let re=Z[0],Y=Z[1];if(P.set(re,Y),!Y)continue;let de=F.get(re);de!==void 0&&U_(de,z)&&z_(M,de,K)}H=M._dirtyLeaves,q=H.size,W=M._dirtyElements,te=W.size,fc++}M._dirtyLeaves=k,M._dirtyElements=P}(d,e),G_(e),function(R,M,k,P){let F=R._nodeMap,z=M._nodeMap,K=[];for(let[W]of P){let te=z.get(W);te!==void 0&&(te.isAttached()||(j(te)&&hc(te,W,F,z,K,P),F.has(W)||P.delete(W),K.push(W)))}for(let W of k){let te=z.get(W);te===void 0||te.isAttached()||(Mo(te)&&te.__slots!==null&&hc(te,W,F,z,K,k),F.has(W)||k.delete(W),K.push(W))}for(let W of K)z.delete(W);let H=Ve(),q=H._compositionKey;q===null||z.has(q)||(H._compositionKey=null)}(c,d,e._dirtyLeaves,e._dirtyElements)),E!==e._compositionKey&&(d._flushSync=!0);let b=d._selection;if(fe(b)){e._slotsUsed&&mC(b);let R=d._nodeMap,M=b.anchor.key,k=b.focus.key;R.get(M)!==void 0&&R.get(k)!==void 0||X(19)}else gi(b)&&b._nodes.size===0&&(d._selection=null)}catch(E){return E instanceof Error&&e._onError(E),e._pendingEditorState=c,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Er(e)}finally{Gt=g,xn=p,vt=m,e._updating=_,fc=0}e._dirtyType!==0||e._deferred.length>0||function(E,b){let R=b.getEditorState()._selection,M=E._selection;if(M!==null){if(M.dirty||!M.is(R))return!0}else if(R!==null)return!0;return!1}(d,e)?d._flushSync?(d._flushSync=!1,Er(e)):f&&OR(()=>{Er(e)}):(d._flushSync=!1,f&&(s.clear(),e._deferred=[],e._pendingEditorState=null))}function Hn(e,n,r){vt===e&&r===void 0?Or()?ka(e,n,r):n():ka(e,n,r)}function uR(e){if(Ot(e)){let n=null;for(let r of e.getChildren())n=r.isInline()?(n||r.replace(r.createParentElementNode())).append(r):null}}class ko extends sn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:uR,extends:sn})}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&&X(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 iA[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&&Gn(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 Gn(this)){let s=Mr(this,r);j(s)&&e.push(...s.getAllTextNodes())}let n=this.getFirstChild();for(;n!==null;){if(ee(n)&&e.push(n),j(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;j(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;j(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 j(i)&&i.getLastDescendant()||i||null}let s=n[e];return j(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&&X(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:ot(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&X(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=my(this),n=this.getChildren(),r=n.length;for(let s=0;s<r;s++){let i=n[s];e+=i.getTextContent(),j(i)&&s!==r-1&&!i.isInline()&&(e+=ds)}return e}getTextContentSize(){let e=function(s){let i=0;for(let a of Gn(s)){let l=Mr(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(),j(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 Ar(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(ee(c)||j(c))return c.select(0,0)}else if(!(e!==void 0&&e!==a||n!==void 0&&n!==a)){let c=this.getLastChild();if(ee(c)||j(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return fe(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):CC(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)&&X(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();e+n<=s||X(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&&X(100);let y=m.getNextSibling(),x=m.__key;zn(m.getWritable()),c.push(x),m=y}}let p=f;for(let m of r){p!==null&&m.is(p)&&(f=p=p.getPreviousSibling());let _=m.getWritable();_.__parent===a&&g--,zn(_);let y=m.__key;if(p===null)i.__first=y,_.__prev=null;else{let x=p.getWritable();x.__next=y,_.__prev=x.__key}m.__key===a&&X(76),_.__parent=a,l.push(y),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(fe(m)){let _=new Set(c),y=new Set(l),{anchor:x,focus:E}=m;j_(x,_,y)&&vc(x,x.getNode(),this,f,d),j_(E,_,y)&&vc(E,E.getNode(),this,f,d),g!==0||this.canBeEmpty()||Ot(this)||this.remove()}}return i}getDOMSlot(e){return new ii(e)}exportDOM(e){let{element:n}=super.exportDOM(e);if(_t(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===""||Ot(this)||this.getChildren().some(ee)||(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=Rn(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 j(e){return e instanceof ko}function j_(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 Fc extends sn{__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&&X(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 Fc}class Ga extends ko{__cachedText;$config(){return this.config("root",{extends:ko})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){X(51)}getTextContent(){let e=this.__cachedText;return e===null||!Or()&&Ve()._dirtyType!==0?super.getTextContent():e}remove(){X(52)}replace(e){X(53)}insertBefore(e){X(54)}insertAfter(e){X(55)}updateDOM(e,n){return!1}splice(e,n,r){for(let s of r)j(s)||qe(s)||X(282);return super.splice(e,n,r)}static importJSON(e){return An().updateFromJSON(e)}collapseAtStart(){return!0}}function Bt(e){return e instanceof Ga}function RC(e){return new Ya(fx(e._nodeMap),null,e._slotsUsed)}function ag(){return new Ya(new Map([["root",new Ga]]),null,!1)}function Df(e){let n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&X(130,r.name),j(e)){let i=n.children;Array.isArray(i)||X(59,r.name);let a=e.getChildren();for(let l=0;l<a.length;l++){let c=Df(a[l]);i.push(c)}}let s=Gn(e);if(s.length>0){let i={};for(let a of s){let l=Mr(e,a);l===null&&X(366,r.name,a),i[a]=Df(l)}n.$slots=i}return n}function dR(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 H_(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 H_(null,this,()=>({root:Df(An())}))}}class lg extends ko{$config(){return this.config("artificial",{extends:ko})}createDOM(e){return Cn().createElement("div")}}class Va extends sn{$config(){return this.config("linebreak",{importDOM:{br:(e)=>MC(e)||DC(e)?null:{conversion:fR,priority:0}}})}getTextContent(){return`
12
- `}createDOM(){return Cn().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function fR(e){return{node:Pc()}}function Pc(){return Za(new Va)}function Io(e){return e instanceof Va}function MC(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 DC(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 _o(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class Xa extends ko{$config(){return this.config("paragraph",{extends:ko,importDOM:{p:()=>({conversion:gR,priority:0})}})}createDOM(e){let n=Cn().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(_t(n)){this.isEmpty()&&n.append(Cn().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(ee);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=On();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||ee(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 gR(e){let n=On();if(ly(n,e),iy(e,n),n.getFormatType()===""){let r=e.getAttribute("align");r&&r&&r in pc&&n.setFormat(r)}return ay(n,e),{node:n}}function On(){return Za(new Xa)}function $C(e){return e instanceof Xa}function pR(e){console.warn(e)}var ni=0,hR=1,mR=2,_R=3,xR=4,CR=-8,yR=-7,SR=-6,NR=-5,ER=-4;function wC(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),PC(r,e,"root"))}function kC(e){let n=new Set,r=new Set;for(let{klass:s,ownNodeConfig:i}of el(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 Ia={$createDOM:(e,n)=>e.createDOM(n._config,n),$decorateDOM:(e,n,r,s)=>{},$exportDOM:(e,n)=>{let r=Bc(n,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(n,e):e.exportDOM(n)},$extractWithChild:(e,n,r,s,i)=>j(e)&&e.extractWithChild(n,r,s),$getDOMSlot:(e,n,r)=>e.getDOMSlot(n),$getSlotTargetElement:(e,n,r,s)=>null,$shouldExclude:(e,n,r)=>j(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,n,r)=>!n||e.isSelected(n),$updateDOM:(e,n,r,s)=>e.updateDOM(n,r,s._config)};function TR(e){let n=e||{},r=vC(),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:zC()),d=n.editorState,f=[Ga,ms,Va,Wa,Xa,lg,...n.nodes||[]],{onError:g,onWarn:p,html:m}=n,_=n.editable===void 0||n.editable,y;if(e===void 0&&r!==null)y=r._nodes;else{y=new Map;for(let E=0;E<f.length;E++){let b=f[E],R=null,M=null;if(b&&typeof b=="object"){let F=b;b=F.replace,R=F.with,M=F.withKlass||null}if(typeof b!="function"||!b.prototype||!(b===sn||b.prototype instanceof sn)){let F="<unknown>";try{F=JSON.parse(dx)}catch(z){}X(365,String(E-f.length+(n.nodes?n.nodes.length:0)),typeof b=="function"?`${b.name}${typeof b.getType=="function"?` (type ${String(b.getType())})`:""}`:String(b),String(F))}Qa(b);let k=b.getType(),P=kC(b);y.set(k,{exportDOM:m&&m.export?m.export.get(b):void 0,klass:b,replace:R,replaceWithKlass:M,sharedNodeState:_x(f[E]),transforms:P})}}let x=new _s(l,i,y,{disableEvents:a,dom:{...Ia,...e&&e.dom},namespace:c,theme:s},g||console.error,p||pR,function(E,b){let R=new Map,M=new Set,k=(P)=>{Object.keys(P).forEach((F)=>{let z=R.get(F);z===void 0&&(z=[],R.set(F,z)),z.push(P[F])})};return E.forEach((P)=>{let F=P.klass.importDOM;if(F==null||M.has(F))return;M.add(F);let z=F.call(P.klass);z!==null&&k(z)}),b&&k(b),R}(y,m?m.import:void 0),_,e);return d!==void 0&&(x._pendingEditorState=d,x._dirtyType=2),function(E){E.registerCommand(Gf,IA,ni),E.registerCommand(jf,FA,ni),E.registerCommand(Yf,PA,ni),E.registerCommand(Vf,BA,ni),E.registerCommand(Zf,KA,ni)}(x),x}function bR(e,n){let r=e.get(n);e.delete(n),r&&r()}function pa(e,n,r){return e.set(n,r),bR.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=zC(),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&&X(35);let s=this._commands;s.has(e)||s.set(e,[new ti,new ti,new ti,new ti,new ti]);let i=s.get(e);i===void 0&&X(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&&X(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,s=wf(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=wf(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:cc}: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,wC(this,n,e,s,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||zA(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,hx(this),this._updateTags.add(cc),Er(this),this._config.disableEvents||function(l,c){let d=l.ownerDocument;Ef.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=Zx(l);g.push(kA.register(d));for(let p=0;p<Nf.length;p++){let[m,_]=Nf[p],y=typeof _=="function"?(x)=>{N_(x)||(Tf(x),(c.isEditable()||m==="click")&&_(x,c))}:(x)=>{if(N_(x))return;Tf(x);let E=c.isEditable();switch(m){case"cut":return E&&ie(c,tg,x);case"copy":return ie(c,eg,x);case"paste":return E&&ie(c,Xf,x);case"dragstart":return E&&ie(c,Kx,x);case"dragover":return E&&ie(c,zx,x);case"dragend":return E&&ie(c,Ux,x);case"focus":return E&&ie(c,Wx,x);case"blur":return E&&ie(c,Gx,x);case"drop":return E&&ie(c,Bx,x)}};g.push(ng(l,m,y))}}(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(cc),Er(this);Ca("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&X(38);let r=e;r._readOnly&&(r=RC(e),r._selection=e._selection?e._selection.clone():null),px(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),Er(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Hn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[a,l]of r._nodeMap.entries())j(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=xn,d=vt,{_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,xn=!1,vt=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,xn=c,vt=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"&&Er(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]):ka(r,s,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{let s=ze(),i=An();s!==null?s.dirty||tn(s.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),xs("focus"),jC(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=Xn(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(()=>TC()))}toJSON(){return{editorState:this._editorState.toJSON()}}}_s.version=dx;var $f=null;function cg(e){$f=e}var ug=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),IC=1;function vR(){IC=1}function dg(e,n){let r=Bc(e,n);return r===void 0&&X(30,n),r}function Bc(e,n){return e._nodes.get(n)}var OR=typeof queueMicrotask=="function"?queueMicrotask:(e)=>{Promise.resolve().then(e)};function Kc(e,n){let r=n!==void 0?n:(()=>{let a=e.getRootNode();return pi(a)||sr(a)?di(a):null})();if(!_t(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 AR=Kc;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",()=>!Kc(n))}function zc(e){return e instanceof _s}function fs(e){let n=e;for(;n!=null;){let r=Ja(n);if(zc(r))return r;n=Es(n)}return null}function Ja(e){return e?e.__lexicalEditor:null}function RR(e){return oA.test(e)?"rtl":rA.test(e)?"ltr":null}function La(e){return sg(e)||e.isToken()}function Wn(e){return La(e)||e.isSegmented()}function _o(e){return xi(e)&&e.nodeType===3}function pi(e){return xi(e)&&e.nodeType===9}function LC(e){let n=e;for(;n!=null;){if(_o(n))return n;n=n.firstChild}return null}function Ar(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 MR(e){return ee(e)||Io(e)||qe(e)}function FC(e,n){let r=function(){let l=$f;return $f=null,l}();if((n=n||r&&r.__key)!=null)return void(e.__key=n);Wt(),EC();let s=Ve(),i=Fo(),a=""+IC++;i._nodeMap.set(a,e),j(e)?s._dirtyElements.set(a,!0):s._dirtyLeaves.add(a),s._cloneNotNeeded.add(a),s._dirtyType===0&&(s._dirtyType=1),e.__key=a}function zn(e){Jt(e)!==null&&X(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 DR=zn;function Dc(e){EC(),Sc(e)&&X(323,e.__key,e.__type);let n=e.getLatest(),r=n.__parent!==null?n.__parent:Rr(n)?n.__slotHost:null,s=Fo(),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:Rr(m)?m.__slotHost:null}}(r,a,l);let c=n.__key;i._dirtyType===0&&(i._dirtyType=1),j(e)?l.set(c,!0):i._dirtyLeaves.add(c)}function Pt(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 Ro(){if(Or())return null;return Ve()._compositionKey}function ot(e,n){let r=(n||Fo())._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 PC(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 BC(e){let n=e._decorators,r=Object.assign({},n);return e._pendingDecorators=r,r}function Y_(e){return e.read(()=>An().getTextContent())}function An(){return Fo()._nodeMap.get("root")}function tn(e){Wt();let n=Fo();e!==null&&(e.dirty=!0,e.setCachedNodes(null),fe(e)&&Ve()._slotsUsed&&mC(e)),n._selection=e}function V_(){Wt(),px(Ve())}function ri(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 KC(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 zC(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function UC(e){return _o(e)?e.nodeValue:null}function hg(e,n,r){let s=Xn(yn(n));if(s===null)return;let i=Yn(s,n._rootElement),a=i.anchorNode,{anchorOffset:l,focusOffset:c}=i;if(a!==null){let d=UC(a),f=gg(a);if(d!==null&&ee(f)){if((d===Ea||d===Kf)&&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=Kf,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(Pt(null),Ua||gs||Ha)a.remove();else{let x=Ve();af(a,"",f),setTimeout(()=>{x.update(()=>{a.isAttached()&&a.getTextContent()===""&&a.remove()})},20)}return}let g=a.getParent(),p=Ns(),m=a.getTextContentSize(),_=Ro(),y=a.getKey();if(a.isToken()&&!l||_!==null&&y===_&&!l||fe(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(!fe(f)||r===null||s===null)return void af(a,c,f);if(f.setTextNodeRange(a,r,a,s),a.isSegmented()){let x=_n(a.getTextContent());a.replace(x),a=x}af(a,c,f)}}}function af(e,n,r){if(e.setTextContent(n),fe(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=ho(e,l.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function rc(e,n,r){let s=n[r]||!1;return s==="any"||s===e[r]}function HC(e,n){return rc(e,n,"altKey")&&rc(e,n,"ctrlKey")&&rc(e,n,"shiftKey")&&rc(e,n,"metaKey")}function Qe(e,n,r){if(!HC(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 tr={ctrlKey:!Pn,metaKey:Pn},X_={altKey:Pn,ctrlKey:!Pn};function q_(e){return e.key==="Backspace"}function $R(e){let n=An();if(fe(e)){let{anchor:r,focus:s}=e,i=r.getNode();if(Bt(i))return r.set(i.getKey(),0,"element"),s.set(i.getKey(),i.getChildrenSize(),"element"),oi(e),e;let a=i.getTopLevelElementOrThrow(),l=a.getParent();if(l===null)return j(a)&&(r.set(a.getKey(),0,"element"),s.set(a.getKey(),a.getChildrenSize(),"element"),oi(e)),e;let c=l;return r.set(c.getKey(),0,"element"),s.set(c.getKey(),c.getChildrenSize(),"element"),oi(e),e}{let r=n.select(0,n.getChildrenSize());return tn(oi(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=nl(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&&X(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 wR(e){let n=e.getType(),r=Fo();if(r._readOnly){let a=wf(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 J_(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 WC(e,n){let r=e.offset;if(e.type==="element")return J_(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?J_(s.getParentOrThrow(),n,s.getIndexWithinParent()+(n?0:1)):i}}return null}function GC(e){let n=yn(e).event,r=n&&n.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function ie(e,n,...r){return AC(e,n,r[0],e)}function ui(e,n){let r=e._keyToDOMMap.get(n);return r===void 0&&X(75,n),r}function Es(e){let n=e.assignedSlot||e.parentElement;if(n!==null)return n;let r=e.parentNode;return sr(r)?r.host:null}function Uc(e){return pi(e)?e:_t(e)?e.ownerDocument:null}function kR(e){return Ve()._updateTags.has(e)}function xs(e){Wt(),Ve()._updateTags.add(e)}function jC(e){Wt(),Ve()._deferred.push(e)}function Fa(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=Uc(e);return n?n.defaultView:null}function yn(e){let n=e._window;return n===null&&X(78),n}function YC(e){return j(e)&&e.isInline()||qe(e)&&e.isInline()}function Cg(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null&&j(n))return n;let r=n.getParentOrThrow();if(Ot(r))return r;n=r}return n}function yg(e){return j(e)&&e.isShadowRoot()}function Ot(e){return Bt(e)||yg(e)}function Sg(e,n=!1){let r=e.constructor.clone(e,ug);return FC(r,null),r.afterCloneFrom(e),n||r.resetOnCopyNodeFrom(e),r}function Za(e){let n=Ve(),r=e.getType(),s=Bc(n,r);s===void 0&&X(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||X(201,a.name,a.getType(),c.name,c.getType(),e.constructor.name,r):l instanceof e.constructor&&c!==e.constructor||X(202,c.name,c.getType(),e.constructor.name,r),l.__key===e.__key&&X(203,e.constructor.name,r,c.name,c.getType()),l}return e}function lf(e,n){!Bt(e.getParent())||j(n)||qe(n)||X(99)}function VC(e){let n=ot(e);return n===null&&X(63,e),n}function gc(e){if(!e||e.isInline())return!1;if(qe(e))return!0;if(j(e)){if(e.isShadowRoot()){let n=e.getParent();return!(j(n)&&n.isShadowRoot())}return!e.canBeEmpty()}return!1}function $c(e,n,r){r.style.removeProperty("caret-color"),n._blockCursorElement=null;let s=e.parentElement;s!==null&&s.removeChild(e)}function Xn(e){return Vn?(e||window).getSelection():null}function XC(e){let n=xg(e);return n?n.getSelection():null}function sr(e){return oy(e)&&"host"in e}var IR=[];function qC(e){let n=e.getRootNode();if(n===e||!sr(n))return IR;let r=[n],s=n.host;for(;;){let i=s.getRootNode();if(i===s||!sr(i))break;r.push(i),s=i.host}return r}function*JC(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 ZC(e){return e!==null?e.ownerDocument:document}function Cn(){let e=vC();return ZC(e!==null?e._rootElement:null)}function mi(e,n){if(n===null||typeof e.getComposedRanges!="function")return null;let r=qC(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 QC(e,n){let r=mi(e,n);if(r!==null){let s=ey(r);if(s!==null)return s}return e.rangeCount>0?e.getRangeAt(0):null}function Yn(e,n){let r=mi(e,n);return r===null?e:ty(r,ny(e))}function LR(e,n){let r=mi(e,n);if(r===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let s=ey(r)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:ty(r,ny(e)),range:s}}function ey(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 ty(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 ny(e){return e.direction}function wc(e){let n=e.getRootNode();return pi(n)||sr(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&&_t(n)&&n.shadowRoot!==null&&typeof e.composedPath=="function"){let r=e.composedPath();if(r.length>0)return r[0]}return n}function FR(e,n){let r=e.getChildAtIndex(n);r==null&&(r=e),Ot(e)&&X(102);let s=(l)=>{let c=l.getParentOrThrow(),d=Ot(c),f=l!==r||d?Sg(l):l;if(d)return j(l)&&j(f)||X(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 PR(e){return _t(e)&&e.tagName==="A"}function BR(e){return _t(e)&&e.tagName==="TR"}function KR(e){return _t(e)&&(e.tagName==="TD"||e.tagName==="TH")}function _t(e){return xi(e)&&e.nodeType===1}function xi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function oy(e){return xi(e)&&e.nodeType===11}var zR=/^(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 ry(e){return!(!_t(e)||!e.style.display.startsWith("inline"))||zR.test(e.nodeName)}var UR=/^(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(!_t(e)||!e.style.display.startsWith("inline"))&&UR.test(e.nodeName)}function mn(e){if(qe(e)&&!e.isInline())return!0;if(!j(e)||Ot(e))return!1;let n=e.getFirstChild(),r=n===null||Io(n)||ee(n)||n.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function xo(){return Ve()}function Tg(e=xo()){return e._config.dom||Ia}function Rn(e,n,r=xo()){let s=Tg(r).$getDOMSlot(e,n,r);return j(e)&&(sy(s)||X(344,e.getKey(),e.getType())),s}function HR(e,n,r,s){let i=e.read("latest",()=>{let a=ot(n);return a!==null?function(l,c,d=xo()){let f=Mr(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 WR(e,n,r){r.style.display="none";let s=e.getElementByKey(n);s!==null&&r.parentElement!==s&&s.insertBefore(r,s.firstChild)}function sy(e){return e instanceof ii}function rr(e,n,r=xo()){return LC(Rn(e,n,r).element)}var Z_=new WeakMap,GR=new Map;function wf(e){if(!e._readOnly&&e.isEmpty())return GR;e._readOnly||X(192);let n=Z_.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),Z_.set(e,n)),n}function bg(e){let n=e.constructor.clone(e,ug);return n.afterCloneFrom(e),n}function jR(e){return(n=bg(e))[Qx]=!0,n;var n}function iy(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 ay(e,n){let r=n.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function ly(e,n){let r=n.style.textAlign;return r&&r in pc?e.setFormat(r):e}function cy(e,n){e.__lexicalUnmanaged=!0,n&&n.captureSelection!==void 0&&(e.__lexicalCapturedSelection=n.captureSelection)}function vg(e){return e.__lexicalUnmanaged===!0}function uy(e,n=xo()){let r=n.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=n:delete e.__lexicalEditor}function Pa(e,n){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(_t(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]!==sn[n]}var Q_=new WeakMap,ex=Symbol("lexical.synthesizedGetType");function Qa(e){let n=Q_.get(e);if(n)return n;let r=e.prototype!=null&&Qm in e.prototype?e.prototype[Qm]():void 0,s=function(f){if(!(f===sn||f.prototype instanceof sn)){let g="<unknown>",p="<unknown>";try{g=f.getType()}catch(m){}try{_s.version&&(p=JSON.parse(_s.version))}catch(m){}X(290,f.name,g,p)}return f===Fc||f===ko||f===sn}(e),i=!s&&ha(e,"getType")?e.getType:void 0,a=i&&!(ex 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?sn.getType.call(this):c};g[ex]=!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 Q_.set(e,d),d}function*el(e){for(let n=e;n&&(n===sn||og(n.prototype));){let r=Qa(n);yield r,n=r.ownNodeConfig&&r.ownNodeConfig.extends||dy(n)}}function YR(e){let n=new Map,r=new Map;for(let s of e){let{ownNodeType:i}=Qa(s);i&&(r.set(i,s),n.set(i,new Set))}for(let[s,i]of r)for(let{ownNodeType:a}of el(i)){let l=a&&n.get(a);l&&l.add(s)}return n}function VR(e){let n=xo();return Wt(),new(n.resolveRegisteredNodeAfterReplacements(n.getRegisteredNode(e))).klass}var Sr=(e,n)=>{let r=e;for(;r!=null&&!Bt(r);){if(n(r))return r;r=r.getParent()}return null};function Ba(e,n){let r=[],s=e.__first;for(;s!==null;){let i=n===null?ot(s):n.get(s);i==null&&X(174),r.push(s),s=i.__next}return r}function dy(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 fy=new Map;function Mo(e){return j(e)||qe(e)}function Rr(e){return j(e)||qe(e)}function Jt(e){let n=e.getLatest();return Rr(n)?n.__slotHost:null}function Un(e){let n=Jt(e);if(n===null)return null;let r=ot(n);return j(r)||qe(r)||X(370),r}function gy(e){let n=Un(e);if(n===null)return null;let r=e.getLatest().__key;for(let[s,i]of Hc(n))if(i===r)return s;return null}function py(e){let n=e.getLatest();for(;n!==null;){if(Jt(n)!==null)return n;n=n.getParent()}return null}function Hc(e){let n=e.getLatest();return Mo(n)&&n.__slots!==null?n.__slots:fy}function Gn(e){return Array.from(Hc(e).keys())}function Mr(e,n){let r=Hc(e).get(n);return r===void 0?null:ot(r)}var XR=["__proto__","constructor","prototype"],tx=Symbol("slotMapOwner");function kf(e){let n=e.__slots;return n!==null&&n[tx]===e||(n=new Map(n),n[tx]=e,e.__slots=n),n}var nx=new WeakMap,qR=[];function hy(e){for(let{ownNodeConfig:n}of el(e)){let r=n&&n.slots;if(r)return r}return qR}function my(e){let n="";for(let r of Gn(e)){let s=Mr(e,r);s!==null&&(n+=s.getTextContent())}return n}function ox(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 JR(e){let n=e.__slots;if(n===null||n.size<2)return;let r=function(l){let c=nx.get(l);if(c===void 0){let d=hy(l),f=new Map;for(let g of d)XR.includes(g)&&X(371,l.name,g),f.has(g)&&X(372,l.name,g),f.set(g,f.size);c=f,nx.set(l,c)}return c}(e.constructor),s=null,i=!0;for(let l of n.keys()){if(s!==null&&ox(s,l,r)>0){i=!1;break}s=l}if(i)return;let a=Array.from(n).sort(([l],[c])=>ox(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"||X(373,n);let s=e.getLatest();if(s.__slots!==null&&s.__slots.get(n)===r.getLatest().__key)return s;(!j(r)&&!qe(r)||r.isInline())&&X(374,r.__key);let i=e.getWritable(),a=kf(i),l=a.get(n);l!==void 0&&xy(l);let c=r.getWritable(),d=Un(c);if(d!==null){let f=gy(c);f!==null&&kf(d.getWritable()).delete(f),c.__slotHost=null}return zn(c),c.__slotHost=i.__key,a.set(n,c.__key),JR(i),function(){let f=xo();f._slotsUsed=!0,f._pendingEditorState&&(f._pendingEditorState._slotsUsed=!0)}(),i}function _y(e,n){let r=e.getWritable();if(r.__slots===null)return r;let s=r.__slots.get(n);return s!==void 0&&(xy(s),kf(r).delete(n)),r}function rx(e,n){}function xy(e){let n=ot(e);if(n===null)return;let r=n.getWritable();Rr(r)||X(377,e),r.__slotHost=null,r.remove()}var ZR={next:"previous",previous:"next"};class tl{origin;constructor(e){this.origin=e}[Symbol.iterator](){return $g({hasNext:Dr,initial:this.getAdjacentCaret(),map:(e)=>e,step:(e)=>e.getAdjacentCaret()})}getAdjacentCaret(){return yt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return yt(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&&X(263,Array.from(l).join(" "))}else i.insert(c);i=yt(c,this.direction)}for(let c of l.values())c.remove();return this}}class Ka extends tl{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ir(e,this.direction)}getParentCaret(e="root"){return yt(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ir(this.direction);return yt(this.getNodeAtCaret(),e)||ir(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Ka&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}var QR={root:Bt,shadowRoot:Ot};function Ir(e){return ZR[e]}function Ag(e,n="root"){return e===null||QR[n](e)?null:Jt(e)===null?e:null}class Cs extends tl{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:yt(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return j(this.origin)?ir(this.origin,this.direction):null}getParentCaret(e="root"){return yt(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ir(this.direction);return yt(this.getNodeAtCaret(),e)||ir(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 tl{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:$r(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return yt(Ag(this.getParentAtCaret(),e),this.direction)}getFlipped(){return $r(this.origin,Ir(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 yt(this.origin,this.direction)}}function po(e){return e instanceof ys}function eM(e){return e instanceof tl}function Dr(e){return e instanceof Cs}function jn(e){return e instanceof Ka}var tM={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}}},nM={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}}},oM={next:class extends Ka{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Ka{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function yt(e,n){return e?new nM[n](e):null}function $r(e,n,r){return e?new tM[n](e,ho(e,r)):null}function ho(e,n,r="error"){let s=e.getTextContentSize(),i=n==="next"?s:n==="previous"?0:n;return(i<0||i>s)&&(r!=="clamp"&&ax(284,String(n),String(s),e.getKey()),i=i<0?0:s),i}function If(e,n){return new Mg(e,n)}function ir(e,n){return j(e)?new oM[n](e):null}function Cy(e){return e&&e.getChildCaret()||e}function fi(e){return e&&Cy(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 po(i)?function(a,l){let{direction:c,origin:d}=a,f=ho(d,l==="focus"?Ir(c):c);return If(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[If(s,i.offset-s.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=po(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=po(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 $r(e.setTextContent(i.slice(0,r)+i.slice(s)),n,r)}}function rM(e){return e instanceof Mg}function Dg(e){return wr(e,yt(An(),e.direction))}function yy(e){return wr(e,e)}function wr(e,n){return e.direction!==n.direction&&X(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=kc(e.origin,n.origin);switch(r===null&&X(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 sc(e,n){return n.is(e)}function sx(e){return j(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function kc(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};let r=new Map;for(let[s,i]=sx(e);s;i=s,s=s.getParent())r.set(s,i);for(let[s,i]=sx(n);s;i=s,s=s.getParent()){let a=r.get(s);if(a!==void 0)return a===null?(sc(e,s)||X(276),{commonAncestor:s,type:"ancestor"}):i===null?(sc(n,s)||X(277),{commonAncestor:s,type:"descendant"}):((j(a)||sc(e,a))&&(j(i)||sc(n,i))&&s.is(a.getParent())&&s.is(i.getParent())||X(278),{a,b:i,commonAncestor:s,type:"branch"})}return null}function kr(e,n){let{type:r,key:s,offset:i}=e,a=VC(e.key);return r==="text"?(ee(a)||X(266,a.getType(),s),$r(a,n,i)):(j(a)||X(267,a.getType(),s),Ty(a,e.offset,n))}function za(e,n){let{origin:r,direction:s}=n,i=s==="next";po(n)?e.set(r.getKey(),n.offset,"text"):Dr(n)?ee(r)?e.set(r.getKey(),ho(r,s),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(jn(n)&&j(r)||X(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function Sy(e){let n=ze(),r=fe(n)?n:yC();return ya(r,e),tn(r),r}function ya(e,n){za(e.anchor,n.anchor),za(e.focus,n.focus)}function Lf(e){let{anchor:n,focus:r}=e,s=kr(n,"next"),i=kr(r,"next"),a=wg(s,i)<=0?"next":"previous";return wr(Lo(s,a),Lo(i,a))}function bs(e){let{direction:n,origin:r}=e,s=yt(r,Ir(n)).getNodeAtCaret();return s?yt(s,n):ir(r.getParentOrThrow(),n)}function ix(e,n="root"){let r=[e];for(let s=jn(e)?e.getParentCaret(n):e.getSiblingCaret();s!==null;s=s.getParentCaret(n))r.push(bs(s));return r}function cf(e){return!!e&&e.origin.isAttached()}function Ny(e,n="removeEmptySlices"){if(e.isCollapsed())return e;let r="root",s="next",i=n,a=Ig(e,s),l=ix(a.anchor,r),c=ix(a.focus.getFlipped(),r),d=new Set,f=[];for(let x of a.iterNodeCarets(r))if(jn(x))d.add(x.origin.getKey());else if(Dr(x)){let{origin:E}=x;j(E)&&!d.has(E.getKey())||f.push(E)}let g=new Set;for(let x of f){let E=x.getParent();E===null||d.has(E.getKey())||g.add(E),zn(x)}for(let x of g)!x.canBeEmpty()&&!Ot(x)&&x.isEmpty()&&x.isAttached()&&x.remove();for(let x of a.getTextSlices()){if(!x)continue;let{origin:E}=x.caret,b=E.getTextContentSize(),R=bs(yt(E,s)),M=E.getMode();if(Math.abs(x.distance)===b&&i==="removeEmptySlices"||M==="token"&&x.distance!==0)R.remove();else if(x.distance!==0){i="removeEmptySlices";let k=x.removeTextSlice(),P=x.caret.origin;if(M==="segmented"){let F=k.origin,z=_n(F.getTextContent()).setStyle(F.getStyle()).setFormat(F.getFormat());R.replaceOrInsert(z),k=$r(z,s,k.offset)}P.is(l[0].origin)&&(l[0]=k),P.is(c[0].origin)&&(c[0]=k.getFlipped())}}let p,m;for(let x of l)if(cf(x)){p=Do(x);break}for(let x of c)if(cf(x)){m=Do(x);break}let _=function(x,E,b){if(!x||!E)return null;let R=x.getParentAtCaret(),M=E.getParentAtCaret();if(!R||!M)return null;let k=R.getParents().reverse();k.push(R);let P=M.getParents().reverse();P.push(M);let F=Math.min(k.length,P.length),z;for(z=0;z<F&&k[z]===P[z];z++);let K=(W,te)=>{let Z;for(let re=z;re<W.length;re++){let Y=W[re];if(Ot(Y))return;!Z&&te(Y)&&(Z=Y)}return Z},H=K(k,mn),q=H&&K(P,(W)=>b.has(W.getKey())&&mn(W));if(q&&Gn(q).length>0)return null;return H&&q?[H,q]:null}(p,m,d);if(_){let[x,E]=_;ir(x,"previous").splice(0,E.getChildren());let b=E.getParent();for(E.remove(!0);b&&b.isEmpty();){let R=b;b=b.getParent(),R.remove(!0)}}else if(m){let x=function(R){if(jn(R)){let M=R.origin;if(mn(M))return M}else{let M=R.getParentAtCaret();if(M&&mn(M))return M}return null}(m),E=x&&x.getParent(),b=x&&x.getParents().findLast(yg);if(x&&E&&!Bt(E)&&x.isEmpty()&&d.has(x.getKey())&&Gn(x).length===0&&(!b||d.has(b.getKey()))){x.remove(!0);let R=E;for(;R&&!Bt(R)&&R.isEmpty();){let M=R.getParent();if(M&&Bt(M)&&M.getChildrenSize()<=1)break;let k=R;R=M,k.remove(!0)}}}let y=[p,m,...l,...c].find(cf);if(y)return yy(Lo(Do(y),e.direction));X(269,JSON.stringify(l.map((x)=>x.origin.__key)))}function Do(e){let n=function(i){let a=i;for(;jn(a);){let l=fi(a);if(!jn(l))break;a=l}return a}(e.getLatest()),{direction:r}=n;if(ee(n.origin))return po(n)?n:$r(n.origin,r,r);let s=n.getAdjacentCaret();return Dr(s)&&ee(s.origin)?$r(s.origin,r,Ir(r)):n}function Ey(e){return po(e)&&e.offset!==ho(e.origin,e.direction)}function Lo(e,n){return e.direction===n?e:e.getFlipped()}function Ig(e,n){return e.direction===n?e:wr(Lo(e.focus,n),Lo(e.anchor,n))}function Ty(e,n,r){let s=ir(e,"next");for(let i=0;i<n;i++){let a=s.getAdjacentCaret();if(a===null)break;s=a}return Lo(s,r)}function sM(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 iM(e){let{origin:n,offset:r,direction:s}=e;if(r===ho(n,s))return e.getSiblingCaret();if(r===ho(n,Ir(s)))return bs(e.getSiblingCaret());let[i]=n.splitText(r);return ee(i)||X(281),Lo(yt(i,"next"),s)}function aM(e,n){return!0}function by(e,{$copyElementNode:n=Sg,$splitTextPointCaretNext:r=iM,rootMode:s="shadowRoot",$shouldSplit:i=aM,removeEmptyDestination:a=!1}={}){if(po(e))return r(e);let l=e.getParentCaret(s);if(l){let{origin:c}=l;if(jn(e)){let f=bs(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 vy(e,n,r){let s=Lo(n,"next");po(s)&&(s.offset===0?s=yt(s.origin,"previous").getFlipped():s.offset===s.origin.getTextContentSize()&&(s=yt(s.origin,"next"))),s.origin.is(e)&&(Dr(s)||X(342,e.getKey(),e.getType()),s=bs(s)),(e.is(s.getNodeAtCaret())||e.is(s.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=s;i;i=by(i,r))s=i;return po(s)&&X(283),s.insert(e.isInline()?On().append(e):e),Lo(yt(e.getLatest(),"next"),n.direction)}function lM(e){return e}function cM(...e){return e}function uM(e,n){return[e,n]}function dM(e){return e}function fM(e,n){if(!n||e===n)return e;for(let r in n)if(e[r]!==n[r])return{...e,...n};return e}function nl(...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 gM(e,...n){let r=nl(...n);r.length>0&&e.classList.add(...r)}function pM(e,...n){let r=nl(...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 hM(e,n,r){return Lg(...Object.entries(n).map(([s,i])=>ng(e,s,i,r)))}var I=Fg,{$addUpdateTag:ol,$applyNodeReplacement:ln,$assumeActiveEditor:Oy,$caretFromPoint:cn,$caretRangeFromSelection:ar,$cloneWithProperties:Wc,$cloneWithPropertiesEphemeral:Ay,$comparePointCaretNext:Lr,$copyNode:jt,$create:Gc,$createChildrenArray:Y1,$createLineBreakNode:un,$createNodeSelection:jc,$createParagraphNode:ye,$createPoint:qn,$createRangeSelection:Fr,$createRangeSelectionFromDom:Ry,$createTabNode:dn,$createTextNode:Ct,$extendCaretToRange:vs,$findMatchingParent:pe,$formatText:My,$fullReconcile:Ci,$generateNodesFromRawText:rl,$getAdjacentChildCaret:sl,$getAdjacentNode:V1,$getAdjacentSiblingOrParentSiblingCaret:Os,$getCaretInDirection:Dy,$getCaretRange:Jn,$getCaretRangeInDirection:lr,$getCharacterOffsets:$y,$getChildCaret:Tt,$getChildCaretAtIndex:Pg,$getChildCaretOrSelf:Bg,$getCollapsedCaretRange:As,$getCommonAncestor:X1,$getCommonAncestorResultBranchOrder:q1,$getDOMSlot:wy,$getDOMTextNode:ky,$getDocument:Xe,$getEditor:Ge,$getEditorDOMRenderConfig:Kg,$getNearestNodeFromDOMNode:bt,$getNearestRootOrShadowRoot:J1,$getNodeByKey:At,$getNodeByKeyOrThrow:Iy,$getNodeFromDOMNode:Ly,$getPreviousSelection:Sn,$getRoot:Je,$getSelection:V,$getSiblingCaret:it,$getSlot:yi,$getSlotFrame:Zn,$getSlotHost:Yc,$getSlotNameWithinHost:Z1,$getSlotNames:Rs,$getState:Po,$getStateChange:Q1,$getTextContent:eL,$getTextNodeOffset:tL,$getTextPointCaret:Vc,$getTextPointCaretSlice:nL,$getWritableNodeState:oL,$hasAncestor:il,$hasUpdateTag:rL,$insertNodeToNearestRootAtCaret:Pr,$insertNodes:Xc,$isBlockElementNode:Br,$isChildCaret:Bo,$isDecoratorNode:$t,$isEditorState:Fy,$isElementDOMSlot:sL,$isElementNode:J,$isExtendableTextPointCaret:al,$isInlineElementOrDecoratorNode:zg,$isInlineFormattable:iL,$isLeafNode:ll,$isLexicalNode:Ug,$isLineBreakNode:Ue,$isNodeCaret:aL,$isNodeSelection:Ze,$isParagraphNode:Dn,$isRangeSelection:G,$isRootNode:Co,$isRootOrShadowRoot:Mt,$isSelectionCapturedInDecoratorInput:Py,$isShadowRootNode:qc,$isSiblingCaret:yo,$isSlotChild:lL,$isSlotHost:cl,$isTabNode:Yt,$isTextNode:oe,$isTextPointCaret:zr,$isTextPointCaretSlice:cL,$isTokenOrSegmented:Hg,$isTokenOrTab:uL,$markSlotEditable:dL,$needsBlockCursorBeside:By,$nodesOfType:fL,$normalizeCaret:kt,$normalizeSelection__EXPERIMENTAL:Ko,$onUpdate:Ky,$parseSerializedNode:zy,$removeFromParent:gL,$removeSlot:pL,$removeTextFromCaretRange:Uy,$rewindSiblingCaret:zo,$selectAll:Ur,$setCompositionKey:hL,$setDirectionFromDOM:Nn,$setFormatFromDOM:Qn,$setPointFromCaret:Uo,$setSelection:pt,$setSelectionFromCaretRange:$n,$setSlot:mL,$setState:eo,$setTextFormat:Hy,$splitAtPointCaretNext:Jc,$splitNode:Wy,$updateDOMSelection:Gy,$updateRangeSelectionFromCaretRange:_L,ArtificialNode__DO_NOT_USE:ul,BEFORE_INPUT_COMMAND:xL,BLUR_COMMAND:CL,CAN_REDO_COMMAND:Ms,CAN_UNDO_COMMAND:Ds,CAN_USE_BEFORE_INPUT:dl,CAN_USE_DOM:fn,CLEAR_EDITOR_COMMAND:Zc,CLEAR_HISTORY_COMMAND:jy,CLICK_COMMAND:Si,COLLABORATION_TAG:Yy,COMMAND_PRIORITY_BEFORE_CRITICAL:Vy,COMMAND_PRIORITY_BEFORE_EDITOR:Qc,COMMAND_PRIORITY_BEFORE_HIGH:yL,COMMAND_PRIORITY_BEFORE_LOW:SL,COMMAND_PRIORITY_BEFORE_NORMAL:NL,COMMAND_PRIORITY_CRITICAL:Ni,COMMAND_PRIORITY_EDITOR:be,COMMAND_PRIORITY_HIGH:wn,COMMAND_PRIORITY_LOW:Fe,COMMAND_PRIORITY_NORMAL:EL,COMPOSITION_END_COMMAND:TL,COMPOSITION_END_TAG:eu,COMPOSITION_START_COMMAND:Xy,COMPOSITION_START_TAG:tu,CONTROLLED_TEXT_INSERTION_COMMAND:nu,COPY_COMMAND:Ei,CUT_COMMAND:ou,CUT_TAG:ru,DEFAULT_EDITOR_DOM_CONFIG:Wg,DELETE_CHARACTER_COMMAND:Ti,DELETE_LINE_COMMAND:su,DELETE_WORD_COMMAND:iu,DRAGEND_COMMAND:bL,DRAGOVER_COMMAND:qy,DRAGSTART_COMMAND:Jy,DROP_COMMAND:Zy,DecoratorNode:au,ElementNode:lt,FOCUS_COMMAND:Qy,FORMAT_ELEMENT_COMMAND:lu,FORMAT_TEXT_COMMAND:Ho,HISTORIC_TAG:vi,HISTORY_MERGE_TAG:Hr,HISTORY_PUSH_TAG:cu,INDENT_CONTENT_COMMAND:to,INPUT_COMMAND:vL,INSERT_LINE_BREAK_COMMAND:Gg,INSERT_PARAGRAPH_COMMAND:Wr,INSERT_TAB_COMMAND:$s,INTERNAL_$isBlock:fl,IS_ALL_FORMATTING:OL,IS_ANDROID:eS,IS_ANDROID_CHROME:tS,IS_APPLE:gl,IS_APPLE_WEBKIT:uu,IS_BOLD:pl,IS_CHROME:nS,IS_CODE:oS,IS_FIREFOX:ws,IS_HIGHLIGHT:rS,IS_IOS:hl,IS_ITALIC:ml,IS_SAFARI:du,IS_STRIKETHROUGH:xl,IS_SUBSCRIPT:fu,IS_SUPERSCRIPT:gu,IS_UNDERLINE:Cl,KEY_ARROW_DOWN_COMMAND:Wo,KEY_ARROW_LEFT_COMMAND:Gr,KEY_ARROW_RIGHT_COMMAND:Oi,KEY_ARROW_UP_COMMAND:no,KEY_BACKSPACE_COMMAND:Ai,KEY_DELETE_COMMAND:pu,KEY_DOWN_COMMAND:AL,KEY_ENTER_COMMAND:Ri,KEY_ESCAPE_COMMAND:Mi,KEY_MODIFIER_COMMAND:RL,KEY_SPACE_COMMAND:hu,KEY_TAB_COMMAND:jr,LineBreakNode:sS,MOVE_TO_END:yl,MOVE_TO_START:Di,NODE_STATE_DIRECT:ML,NODE_STATE_KEY:DL,NODE_STATE_LATEST:$L,OUTDENT_CONTENT_COMMAND:Go,PASTE_COMMAND:$i,PASTE_TAG:mu,ParagraphNode:iS,REDO_COMMAND:_u,REMOVE_TEXT_COMMAND:aS,RootNode:xu,SELECTION_CHANGE_COMMAND:oo,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:Cu,SELECT_ALL_COMMAND:ki,SET_TEXT_FORMAT_COMMAND:lS,SKIP_COLLAB_TAG:wL,SKIP_DOM_SELECTION_TAG:cS,SKIP_SCROLL_INTO_VIEW_TAG:uS,SKIP_SELECTION_FOCUS_TAG:yu,TEXT_TYPE_TO_FORMAT:Ii,TabNode:Su,TextNode:kn,UNDO_COMMAND:Nu,addClassNamesToElement:et,buildImportMap:jg,configExtension:nn,createCommand:En,createEditor:Eu,createRefCountedRegistry:kL,createSharedNodeState:IL,createState:jo,declarePeerDependency:dS,defineExtension:me,findAllLexicalElementsDeep:fS,flipDirection:gS,getActiveElement:So,getActiveElementDeep:pS,getComposedEventTarget:Sl,getComposedStaticRange:LL,getDOMOwnerDocument:FL,getDOMSelection:In,getDOMSelectionFromTarget:PL,getDOMSelectionPoints:ks,getDOMSelectionRange:hS,getDOMSelectionRangeAndPoints:BL,getDOMShadowRoots:mS,getDOMTextNode:_S,getDeclaredSlots:KL,getEditorPropertyFromDOMNode:Tu,getNearestEditorFromDOMNode:bu,getParentElement:Nl,getRegisteredNode:zL,getRegisteredNodeOrThrow:UL,getRegisteredSubtypeMap:vu,getRootOwnerDocument:Is,getStaticNodeConfig:xS,getStyleObjectFromCSS:Yr,getTextDirection:CS,getTransformSetFromKlass:HL,isBlockDomNode:Ls,isCurrentlyReadOnlyMode:yS,isDOMCapturingSelection:WL,isDOMDocumentNode:Xr,isDOMNode:ro,isDOMShadowRoot:Ou,isDOMTextNode:Fs,isDOMUnmanaged:GL,isDocumentFragment:Yg,isExactShortcutMatch:SS,isHTMLAnchorElement:Li,isHTMLElement:Ce,isHTMLTableCellElement:jL,isHTMLTableRowElement:NS,isInlineDomNode:Fi,isLastChildInBlockNode:ES,isLexicalEditor:Au,isModifierMatch:YL,isOnlyChildInBlockNode:TS,isSelectionCapturedInDecoratorInput:VL,isSelectionWithinEditor:bS,iterStaticNodeConfigChain:vS,makeStepwiseIterator:Vg,mergeRegister:De,mountSlotContainer:XL,normalizeClassNames:Pi,registerEventListener:so,registerEventListeners:qr,removeClassNamesFromElement:on,removeFromParent:qL,resetRandomKey:JL,safeCast:We,setDOMStyleFromCSS:cr,setDOMStyleObject:ZL,setDOMUnmanaged:Ru,setNodeIndentFromDOM:Jr,shallowMergeConfig:Kt,stopLexicalPropagation:Xg,toggleTextFormatType:qg,tokenizeRawText:Bi,unmountSlotContainer:QL}=I;var Jg={};Ne(Jg,{LexicalComposer:()=>_M});C();var mM=fn?He:h,Mu={tag:Hr};function _M({initialConfig:e,children:n}){let r=O(()=>{let{theme:s,namespace:i,nodes:a,onError:l,onWarn:c,editorState:d,html:f}=e,g=Zm(null,s),p=Eu({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 y=Je();if(y.isEmpty()){let x=ye();y.append(x);let E=m.getRootElement(),b=fn&&E!==null?So(E):null;(V()!==null||b!==null&&b===E)&&x.select()}},Mu);else if(_!==null)switch(typeof _){case"string":{let y=m.parseEditorState(_);m.setEditorState(y,Mu);break}case"object":m.setEditorState(_,Mu);break;case"function":m.update(()=>{Je().isEmpty()&&_(m)},Mu)}}(p,d),[p,g]},[]);return mM(()=>{let s=e.editable,[i]=r;i.setEditable(s===void 0||s)},[]),t(Jm.Provider,{value:r,children:n})}var xM=Jg,OS=xM.LexicalComposer;var Zg={};Ne(Zg,{useLexicalEditable:()=>SM});C();var CM=fn?He:h;function yM(e){return{initialValueFn:()=>e.isEditable(),subscribe:(n)=>e.registerEditableListener(n)}}function SM(){return function(e){let[n]=st(),r=O(()=>e(n),[n,e]),[s,i]=u(()=>r.initialValueFn()),a=v(s);return CM(()=>{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}(yM)}var NM=Zg,AS=NM.useLexicalEditable;var rp={};Ne(rp,{$addNodeStyle:()=>AM,$cloneWithProperties:()=>Wc,$copyBlockFormatIndent:()=>LS,$ensureForwardRangeSelection:()=>IS,$forEachSelectedTextNode:()=>kS,$getComputedStyleForElement:()=>tp,$getComputedStyleForParent:()=>np,$getSelectionStyleValueForProperty:()=>LM,$isAtEdgeOfElement:()=>FS,$isAtNodeEnd:()=>OM,$isParentElementRTL:()=>op,$isParentRTL:()=>bM,$moveCaretSelection:()=>KS,$moveCharacter:()=>kM,$patchStyleText:()=>RM,$selectAll:()=>Ur,$setBlocksType:()=>MM,$shouldOverrideDefaultCharacterSelection:()=>wM,$sliceSelectedTextNodeContent:()=>vM,$trimTextContentFromAnchor:()=>wS,$wrapNodes:()=>$M,createDOMRange:()=>EM,createRectsFromDOMRange:()=>TM,getCSSFromStyleObject:()=>$S,getStyleObjectFromCSS:()=>FM,trimTextContentFromAnchor:()=>PM});function ep(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 RS(e){let n=e;for(;n!=null;){if(n.nodeType===Node.TEXT_NODE)return n;n=n.firstChild}return null}function MS(e){let n=e.parentNode;if(n==null)throw Error("Should never happen");return[n,Array.from(n.childNodes).indexOf(e)]}function EM(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(oe(n)&&(d=RS(d)),oe(s)&&(f=RS(f)),n===void 0||s===void 0||d===null||f===null)return null;d.nodeName==="BR"&&([d,g]=MS(d)),f.nodeName==="BR"&&([f,p]=MS(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 TM(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 $S(e){let n="";for(let r in e)r&&(n+=`${r}: ${e[r]};`);return n}function tp(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 np(e){return tp(Co(e)?e:e.getParentOrThrow())}function bM(e){let n=np(e);return n!==null&&n.direction==="rtl"}function vM(e,n,r="self"){let s=e.getStartEndPoints();if(n.isSelected(e)&&!Hg(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]=$y(e),_=c.is(d),y=n.is(l?d:c),x=n.is(l?c:d),E,b=0;if(_)b=p>m?m:p,E=p>m?p:m;else if(y)b=l?m:p,E=void 0;else if(x)b=0,E=l?p:m;let R=n.__text.slice(b,E);R!==n.__text&&(r==="clone"&&(n=Ay(n)),n.__text=R)}}return n}function OM(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let n=e.getNode();return J(n)||ep(177),e.offset===n.getChildrenSize()}function wS(e,n,r){let s=n.getNode(),i=r;if(J(s)){let a=s.getDescendantByIndex(n.offset);a!==null&&(s=a)}for(;i>0&&s!==null;){if(J(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===""&&J(s)&&!s.isInline()&&(c=`
13
-
14
- `);let d=c.length;if(!oe(s)||i>=d){let f=s.getParent();s.remove(),f==null||f.getChildrenSize()!==0||Co(f)||f.remove(),i-=d+l,s=a}else{let f=s.getKey(),g=e.read("latest",()=>{let _=At(f);return oe(_)&&_.isSimpleText()?_.getTextContent():null}),p=d-i,m=c.slice(0,p);if(g!==null&&g!==c){let _=Sn(),y=s;if(s.isSimpleText())s.setTextContent(g);else{let x=Ct(g);s.replace(x),y=x}if(G(_)&&_.isCollapsed()){let x=_.anchor.offset;y.select(x,x)}}else if(s.isSimpleText()){let _=n.key===f,y=n.offset;y<i&&(y=d);let x=_?y-i:0,E=_?y:p;if(_&&x===0){let[b]=s.splitText(x,E);b.remove()}else{let[,b]=s.splitText(x,E);b.remove()}}else{let _=Ct(m);s.replace(_)}i=0}}}var AM=()=>{};function Du(e,n){(G(e)?e.isCollapsed():oe(e)||J(e))||ep(280);let r=Yr(G(e)?e.style:oe(e)?e.getStyle():e.getTextStyle()),s=$S(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}));G(e)||oe(e)?e.setStyle(s):e.setTextStyle(s)}function RM(e,n){if(G(e)&&e.isCollapsed()){Du(e,n);let s=e.anchor.getNode();J(s)&&s.isEmpty()&&Du(s,n)}kS((s)=>{Du(s,n)});let r=e.getNodes();if(r.length>0){let s=new Set;for(let i of r){if(!J(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;let a=i.getKey();s.has(a)||(s.add(a),Du(i,n))}}}function kS(e){let n=V();if(!n)return;let r=new Map,s=(a)=>r.get(a.getKey())||[0,a.getTextContentSize()];if(G(n))for(let a of ar(n).getTextSlices())a&&r.set(a.caret.origin.getKey(),a.getSliceIndices());let i=n.getNodes();for(let a of i){if(!oe(a)||!a.canHaveFormat())continue;let[l,c]=s(a);if(c!==l)if(Hg(a)||l===0&&c===a.getTextContentSize())e(a);else e(a.splitText(l,c)[l===0?0:1])}G(n)&&n.anchor.type==="text"&&n.focus.type==="text"&&n.anchor.key===n.focus.key&&IS(n)}function IS(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 LS(e,n){let r=e.getFormatType(),s=e.getIndent();r!==n.getFormatType()&&n.setFormat(r),s!==n.getIndent()&&n.setIndent(s)}function FS(e,n,r){let s=cn(e,r);if(al(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 MM(e,n,r=LS){if(!e)return;let s=e.getStartEndPoints(),i=!1,a=null,l=new Map;if(s){let[c,d]=s,f=pe(c.getNode(),fl);a=pe(d.getNode(),fl);let g=e.isBackward()?"previous":"next";i=J(a)&&!a.is(f)&&function(p,m,_){let y=p.getNode();return(!J(y)||!y.isEmpty())&&FS(p,m,_)}(d,a,gS(g)),J(f)&&l.set(f.getKey(),f),J(a)&&!i&&l.set(a.getKey(),a)}for(let c of e.getNodes())if(J(c)&&fl(c)){if(i&&c.is(a))continue;l.set(c.getKey(),c)}else if(!s){let d=pe(c,fl);J(d)&&l.set(d.getKey(),d)}for(let c of l.values()){let d=n();r(c,d),c.replace(d,!0)}}function DS(e){return e.getNode().isAttached()}function DM(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 $M(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)?(Qg(e,d,d.length,n,r),d=[],c=g):c===null||c!==null&&il(g,c)?d.push(g):(Qg(e,d,d.length,n,r),d=[g])}Qg(e,d,d.length,n,r)}function Qg(e,n,r,s,i=null){if(n.length===0)return;let a=n[0],l=new Map,c=[],d=J(a)?a:a.getParentOrThrow(),f=d.isInline()?d.getParentOrThrow():d,g=!1;for(;f!==null;){let x=f.getPreviousSibling();if(x!==null){f=x,g=!0;break}if(f=f.getParentOrThrow(),Mt(f))break}let p=new Set;for(let x=0;x<r;x++){let E=n[x];J(E)&&E.getChildrenSize()===0&&p.add(E.getKey())}let m=new Set;for(let x=0;x<r;x++){let E=n[x],b=E.getParent();if(b!==null&&b.isInline()&&(b=b.getParent()),b!==null&&ll(E)&&!m.has(E.getKey())){let R=b.getKey();if(l.get(R)===void 0){let M=s();M.setFormat(b.getFormatType()),M.setIndent(b.getIndent()),c.push(M),l.set(R,M);let k=b.getChildren();M.splice(M.getChildrenSize(),0,k);for(let P of k)if(m.add(P.getKey()),J(P))for(let F of P.getChildrenKeys())m.add(F);DM(b)}}else if(p.has(E.getKey())){J(E)||ep(179);let R=s();R.setFormat(E.getFormatType()),R.setIndent(E.getIndent()),c.push(R),E.remove(!0)}}if(i!==null)for(let x=0;x<c.length;x++){let E=c[x];i.append(E)}let _=null;if(Mt(f))if(g)if(i!==null)f.insertAfter(i);else for(let x=c.length-1;x>=0;x--){let E=c[x];f.insertAfter(E)}else{let x=f,E=x.getFirstChild();if(J(E)&&(f=E),E===null)if(i)x.append(i);else for(let b=0;b<c.length;b++){let R=c[b];x.append(R),_=R}else if(i!==null)E.insertBefore(i);else for(let b=0;b<c.length;b++){let R=c[b];E.insertBefore(R),_=R}}else if(i)f.insertAfter(i);else for(let x=c.length-1;x>=0;x--){let E=c[x];f.insertAfter(E),_=E}let y=Sn();G(y)&&DS(y.anchor)&&DS(y.focus)?pt(y.clone()):_!==null?_.selectEnd():e.dirty=!0}function PS(e){let n=BS(e);return n!==null&&n.writingMode==="vertical-rl"}function BS(e){let n=e.anchor.getNode();return J(n)?tp(n):np(n)}function wM(e,n){let r=PS(e)?!n:n;op(e)&&(r=!r);let s=cn(e.focus,r?"previous":"next");if(al(s))return!1;if(zr(s)&&!Yt(s.origin)&&s.origin.isUnmergeable()){let i=s.getNodeAtCaret();if(oe(i)&&!Yt(i))return!0}for(let i of vs(s)){if(Bo(i))return!i.origin.isInline();if(!J(i.origin)){if($t(i.origin))return!0;break}}return!1}function KS(e,n,r,s){e.modify(n?"extend":"move",r,s)}function op(e){let n=BS(e);return n!==null&&n.direction==="rtl"}function kM(e,n,r){let s=op(e),i;i=PS(e)||s?!r:r,KS(e,n,i,"character")}function IM(e,n,r){let s=e.getStyle(),i=Yr(s);return i!==null&&i[n]||r}function LM(e,n,r=""){let s=null,i=e.getNodes(),a,l;if(G(e)){if(e.isCollapsed()&&e.style!==""){let y=Yr(e.style);if(y!==null&&n in y)return y[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;oe(g)&&m===g.getTextContentSize()&&(a=g),_===0&&(l=p)}for(let c=0;c<i.length;c++){let d=i[c];if(oe(d)&&!d.is(c===0?a:l)){let f=IM(d,n,r);if(s===null)s=f;else if(s!==f){s="";break}}}return s===null?r:s}var FM=Yr,PM=wS;var ct=rp,{$addNodeStyle:fF,$cloneWithProperties:gF,$copyBlockFormatIndent:pF,$ensureForwardRangeSelection:hF,$forEachSelectedTextNode:mF,$getComputedStyleForElement:_F,$getComputedStyleForParent:xF,$getSelectionStyleValueForProperty:CF,$isAtEdgeOfElement:sp,$isAtNodeEnd:ip,$isParentElementRTL:yF,$isParentRTL:El,$moveCaretSelection:SF,$moveCharacter:ap,$patchStyleText:NF,$selectAll:EF,$setBlocksType:Ki,$shouldOverrideDefaultCharacterSelection:lp,$sliceSelectedTextNodeContent:Ps,$trimTextContentFromAnchor:TF,$wrapNodes:bF,createDOMRange:vF,createRectsFromDOMRange:zS,getCSSFromStyleObject:OF,getStyleObjectFromCSS:AF,trimTextContentFromAnchor:RF}=ct;var hp={};Ne(hp,{$descendantsMatching:()=>fD,$dfs:()=>WM,$dfsIterator:()=>VS,$dfsWithSlots:()=>YM,$dfsWithSlotsIterator:()=>XS,$filter:()=>iD,$findMatchingParent:()=>pe,$firstToLastIterator:()=>gD,$getAdjacentCaret:()=>GM,$getAdjacentSiblingOrParentSiblingCaret:()=>Os,$getDepth:()=>qS,$getNearestBlockElementAncestorOrThrow:()=>ZM,$getNearestNodeOfType:()=>JM,$getNextRightPreorderNode:()=>XM,$getNextSiblingOrParentSibling:()=>VM,$handleIndentAndOutdent:()=>aD,$insertFirst:()=>lD,$insertNodeIntoLeaf:()=>oD,$insertNodeToNearestRoot:()=>nD,$insertNodeToNearestRootAtCaret:()=>Pr,$isAtEndOfNode:()=>oN,$isAtStartOfNode:()=>nN,$isBlockFullySelected:()=>QM,$isEditorIsNestedEditor:()=>uD,$lastToFirstIterator:()=>pp,$onEscapeDown:()=>_D,$onEscapeUp:()=>mD,$restoreEditorState:()=>tD,$reverseDfs:()=>jM,$reverseDfsIterator:()=>JS,$reverseDfsWithSlots:()=>qM,$reverseDfsWithSlotsIterator:()=>ZS,$splitNode:()=>Wy,$unwrapAndFilterDescendants:()=>dD,$unwrapNode:()=>pD,$wrapNodeInElement:()=>rD,CAN_USE_BEFORE_INPUT:()=>dl,CAN_USE_DOM:()=>fn,IS_ANDROID:()=>eS,IS_ANDROID_CHROME:()=>tS,IS_APPLE:()=>gl,IS_APPLE_WEBKIT:()=>uu,IS_CHROME:()=>nS,IS_FIREFOX:()=>ws,IS_IOS:()=>hl,IS_SAFARI:()=>du,addClassNamesToElement:()=>et,calculateZoomLevel:()=>cD,dedupeSelectionRects:()=>WS,eventFiles:()=>sD,getScrollParent:()=>UM,isBlockDomNode:()=>Ls,isHTMLAnchorElement:()=>Li,isHTMLElement:()=>Ce,isInlineDomNode:()=>Fi,isMimeType:()=>YS,makeStateWrapper:()=>hD,markSelection:()=>jS,mediaFileReader:()=>HM,mergeRegister:()=>De,objectKlassEquals:()=>gp,positionNodeOnRange:()=>GS,registerNestedElementResolver:()=>eD,removeClassNamesFromElement:()=>on,selectionAlwaysOnDisplay:()=>zM});function up(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 WS(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 Yo(e){return`${e}px`}var BM={attributes:!0,characterData:!0,childList:!0,subtree:!0};function GS(e,n,r){let s=null,i=null,a=null,l=[],c=Is(e.getRootElement()).createElement("div");function d(){s===null&&up(182),i===null&&up(183);let{left:p,top:m}=i.getBoundingClientRect(),_=WS(zS(e,n));var y,x;c.isConnected||(x=c,(y=i).insertBefore(x,y.firstChild));let E=!1;for(let b=0;b<_.length;b++){let R=_[b],M=l[b]||Is(s).createElement("div"),k=M.style;k.position!=="absolute"&&(k.position="absolute",E=!0);let P=Yo(R.left-p);k.left!==P&&(k.left=P,E=!0);let F=Yo(R.top-m);k.top!==F&&(M.style.top=F,E=!0);let z=Yo(R.width);k.width!==z&&(M.style.width=z,E=!0);let K=Yo(R.height);k.height!==K&&(M.style.height=K,E=!0),M.parentNode!==c&&(c.append(M),E=!0),l[b]=M}for(;l.length>_.length;){let b=l.pop();b!=null&&b.remove()}E&&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(!Ce(_))return f();f(),s=m,i=_,a=new MutationObserver((y)=>{let x=e.getRootElement(),E=x&&x.parentElement;if(x!==s||E!==i)return p();for(let b of y)if(!c.contains(b.target))return d()}),a.observe(_,BM),d()});return()=>{g(),f()}}function US(e,n,r,s){if(n.type!=="text"&&J(r)){let i=wy(r,s,e);return[i.element,i.getFirstChildOffset()+n.offset]}return[(oe(r)?ky(r,s,e):_S(s))||s,n.offset]}function KM(e){for(let n of e){let r=n.style;r.background!=="Highlight"&&(r.background="Highlight"),r.color!=="HighlightText"&&(r.color="HighlightText"),r.marginTop!==Yo(-1.5)&&(r.marginTop=Yo(-1.5)),r.paddingTop!==Yo(4)&&(r.paddingTop=Yo(4)),r.paddingBottom!==Yo(0)&&(r.paddingBottom=Yo(0))}}function jS(e,n=KM){let r=null,s=null,i=null,a=null,l=null,c=null,d=()=>{};function f(g){g.read(()=>{let p=V();if(!G(p))return r=null,i=null,a=null,c=null,d(),void(d=()=>{});let[m,_]=function(K){let H=K.getStartEndPoints();return K.isBackward()?[H[1],H[0]]:H}(p),y=m.getNode(),x=y.getKey(),E=m.offset,b=_.getNode(),R=b.getKey(),M=_.offset,k=e.getElementByKey(x),P=e.getElementByKey(R),F=r===null||k!==s||E!==i||x!==r.getKey(),z=a===null||P!==l||M!==c||R!==a.getKey();if((F||z)&&k!==null&&P!==null){let K=function(H,q,W,te,Z,re,Y){let de=(H._window?H._window.document:document).createRange();return de.setStart(...US(H,q,W,te)),de.setEnd(...US(H,Z,re,Y)),de}(e,m,y,k,_,b,P);d(),d=GS(e,K,n)}r=y,s=k,i=E,a=b,l=P,c=M},{editor:e})}return f(e.getEditorState()),De(e.registerUpdateListener(({editorState:g})=>f(g)),()=>{d()})}function zM(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=jS(e,n))};return e.registerRootListener((i)=>{if(i){let a=i.ownerDocument,l=De(so(a,"selectionchange",s),()=>{r!==null&&r()});return s(),l}})}function UM(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 YS(e,n){for(let r of n)if(e.type.startsWith(r))return!0;return!1}function HM(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()}),YS(d,n)?f.readAsDataURL(d):l()};l()})}function WM(e,n){return Array.from(VS(e,n))}function GM(e){return e?e.getAdjacentCaret():null}function jM(e,n){return Array.from(JS(e,n))}function VS(e,n){return $u("next",e,n)}function YM(e,n){return Array.from(XS(e,n))}function*XS(e,n){for(let r of $u("next",e,n)){yield r;let{node:s,depth:i}=r;if(cl(s)&&!s.is(n))for(let a of Rs(s)){let l=yi(s,a);l!==null&&(yield*dp(l,i+1))}}}function*dp(e,n){yield{depth:n,node:e};let r=n+1;if(cl(e))for(let s of Rs(e)){let i=yi(e,s);i!==null&&(yield*dp(i,r))}if(J(e))for(let s of e.getChildren())yield*dp(s,r)}function HS(e,n){let r=Os(it(e,n));return r&&r[0]}function $u(e,n,r){let s=Je(),i=n||s,a=J(i)?Tt(i,e):it(i,e),l=qS(i),c=r?sl(Bg(it(r,e)))||HS(r,e):HS(i,e),d=l;return Vg({hasNext:(f)=>f!==null,initial:a,map:(f)=>({depth:d,node:f.origin}),step:(f)=>{if(f.isSameNodeCaret(c))return null;Bo(f)&&d++;let g=Os(f);return!g||g[0].isSameNodeCaret(c)?null:(d+=g[1],g[0])}})}function VM(e){let n=Os(it(e,"next"));return n&&[n[0].origin,n[1]]}function qS(e){let n=-1;for(let r=e;r!==null;r=r.getParent()??Yc(r))n++;return n}function XM(e){let n=Bg(it(e,"previous")),r=Os(n,"root");return r&&r[0].origin}function JS(e,n){return $u("previous",e,n)}function qM(e,n){return Array.from(ZS(e,n))}function*ZS(e,n){let r=[];for(let s of $u("previous",e,n)){for(;r.length>0&&s.depth<=r[r.length-1].depth;){let l=r.pop();yield*fp(l.node,l.depth+1)}yield s;let{node:i,depth:a}=s;cl(i)&&Rs(i).length>0&&!i.is(n)&&r.push({depth:a,node:i})}for(;r.length>0;){let s=r.pop();yield*fp(s.node,s.depth+1)}}function*fp(e,n){let r=Rs(e);for(let s=r.length-1;s>=0;s--){let i=yi(e,r[s]);i!==null&&(yield*QS(i,n))}}function*QS(e,n){yield{depth:n,node:e};let r=n+1;if(J(e)){let s=e.getChildren();for(let i=s.length-1;i>=0;i--)yield*QS(s[i],r)}cl(e)&&(yield*fp(e,r))}function JM(e,n){let r=e;for(;r!=null;){if(r instanceof n)return r;r=r.getParent()}return null}function ZM(e){let n=pe(e,(r)=>J(r)&&!r.isInline());return J(n)||up(4,e.__key),n}function QM(e,n){let r=lr(G(n)?ar(n):n,"next"),s=Zn(r.anchor.origin),i=Zn(e.getLatest());if(s===null?i!==null:!s.is(i))return!1;let a=kt(Tt(e,"next")),l=Dy(kt(Tt(e,"previous")),"next");return Lr(r.anchor,a)<=0&&Lr(r.focus,l)>=0}function eD(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 tD(e,n){let r=new Map,s=e._pendingEditorState;for(let[a,l]of n._nodeMap)r.set(a,Wc(l));s&&(s._nodeMap=r),Ci();let i=n._selection;pt(i===null?null:i.clone())}function nD(e){let n=V()||Sn(),r;if(G(n))r=cn(n.focus,"next");else{if(n!=null){let l=n.getNodes(),c=l[l.length-1];c&&(r=it(c,"next"))}r=r||Tt(Je(),"previous").getFlipped().insert(ye())}let s=Pr(e,r),i=sl(s),a=Bo(i)?kt(i):s;return $n(As(a)),e.getLatest()}function oD(e){let n=V();if(!G(n))return void(n&&n.insertNodes([e]));let r=ar(n),s=lr(Uy(r),"next").anchor;if(zr(s)){let a=Jc(s);if(!a)return;s=a}let i=s.getFlipped();i.insert(e),$n(Jn(i,i))}function rD(e,n){let r=n();return e.replace(r),r.append(e),r}function gp(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function sD(e){let n=null;if(gp(e,DragEvent)?n=e.dataTransfer:gp(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 iD(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 aD(e){let n=V();if(!G(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=pe(a,(f)=>J(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 lD(e,n){Tt(e,"next").insert(n)}var cp=!(ws||!fn)&&void 0;function cD(e,n=!1){let r=1;if(function(){if(cp===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"),cp=s.getBoundingClientRect().width===i.width,document.body.removeChild(s)}return cp}()||n){let s=e&&e.ownerDocument.defaultView||window;for(;e;)r*=Number(s.getComputedStyle(e).getPropertyValue("zoom")),e=Nl(e)}return r}function uD(e){return e._parentEditor!==null}function dD(e,n){return eN(e,n,null)}function eN(e,n,r){let s=!1;for(let i of pp(e))n(i)?r!==null&&r(i):(s=!0,J(i)&&eN(i,n,r||((a)=>i.insertAfter(a))),i.remove());return s}function fD(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(J(i))for(let a of pp(i))s.push(a);return r}function gD(e){return tN(Tt(e,"next"))}function pp(e){return tN(Tt(e,"previous"))}function tN(e){return Vg({hasNext:yo,initial:e.getAdjacentCaret(),map:(n)=>n.origin.getLatest(),step:(n)=>n.getAdjacentCaret()})}function pD(e){zo(it(e,"next")).splice(1,e.getChildren())}function hD(e){let n=(s)=>Po(s,e),r=(s,i)=>eo(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 mD(e,n){let r=V();if(G(r)&&r.isCollapsed()){let s=pe(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getFirstChild()===s&&nN(r.anchor,s))return s.insertBefore(ye()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function _D(e,n){let r=V();if(G(r)&&r.isCollapsed()){let s=pe(r.anchor.getNode(),e);if(s){let i=s.getParent();if(i!==null&&i.getLastChild()===s&&oN(r.anchor,s))return s.insertAfter(ye()).selectEnd(),n&&n.preventDefault(),!0}}return!1}function nN(e,n){return sp(e,n,"previous")}function oN(e,n){return sp(e,n,"next")}var ue=hp,{$descendantsMatching:Tl,$dfs:rN,$dfsIterator:kF,$dfsWithSlots:IF,$dfsWithSlotsIterator:LF,$filter:FF,$findMatchingParent:PF,$firstToLastIterator:BF,$getAdjacentCaret:KF,$getAdjacentSiblingOrParentSiblingCaret:zF,$getDepth:UF,$getNearestBlockElementAncestorOrThrow:wu,$getNearestNodeOfType:ku,$getNextRightPreorderNode:HF,$getNextSiblingOrParentSibling:WF,$handleIndentAndOutdent:bl,$insertFirst:sN,$insertNodeIntoLeaf:GF,$insertNodeToNearestRoot:Iu,$insertNodeToNearestRootAtCaret:jF,$isAtEndOfNode:YF,$isAtStartOfNode:VF,$isBlockFullySelected:vl,$isEditorIsNestedEditor:XF,$lastToFirstIterator:qF,$onEscapeDown:mp,$onEscapeUp:_p,$restoreEditorState:JF,$reverseDfs:ZF,$reverseDfsIterator:QF,$reverseDfsWithSlots:eP,$reverseDfsWithSlotsIterator:tP,$splitNode:nP,$unwrapAndFilterDescendants:xp,$unwrapNode:oP,$wrapNodeInElement:rP,CAN_USE_BEFORE_INPUT:sP,CAN_USE_DOM:iP,IS_ANDROID:aP,IS_ANDROID_CHROME:lP,IS_APPLE:cP,IS_APPLE_WEBKIT:uP,IS_CHROME:dP,IS_FIREFOX:fP,IS_IOS:gP,IS_SAFARI:pP,addClassNamesToElement:hP,calculateZoomLevel:iN,dedupeSelectionRects:mP,eventFiles:Bs,getScrollParent:_P,isBlockDomNode:xP,isHTMLAnchorElement:CP,isHTMLElement:yP,isInlineDomNode:SP,isMimeType:NP,makeStateWrapper:EP,markSelection:TP,mediaFileReader:bP,mergeRegister:vP,objectKlassEquals:Ln,positionNodeOnRange:OP,registerNestedElementResolver:AP,removeClassNamesFromElement:RP,selectionAlwaysOnDisplay:aN}=ue;var wp={};Ne(wp,{$applyFormatToDom:()=>vD,$createHorizontalRuleNode:()=>$p,$defaultShouldInsertAfter:()=>NN,$getExtensionDependency:()=>wN,$getExtensionOutput:()=>PD,$getPeerDependency:()=>BD,$isDecoratorTextNode:()=>TD,$isHorizontalRuleNode:()=>IN,AutoFocusExtension:()=>SD,ClearEditorExtension:()=>ND,ClickAfterLastBlockExtension:()=>ED,DecoratorTextExtension:()=>RD,DecoratorTextNode:()=>Hu,EditorStateExtension:()=>zu,HorizontalRuleExtension:()=>UD,HorizontalRuleNode:()=>Hi,IMEExtension:()=>HD,INSERT_HORIZONTAL_RULE_COMMAND:()=>kN,InitialStateExtension:()=>DN,LexicalBuilder:()=>dr,NestedEditorExtension:()=>WD,NodeSelectionDataSelectedExtension:()=>GD,NodeSelectionExtension:()=>Op,NormalizeInlineElementsExtension:()=>jD,NormalizeTripleClickSelectionExtension:()=>VD,PreventSelectAllExtension:()=>Ap,RootElementExtension:()=>qD,SelectBlockExtension:()=>JD,SelectionAlwaysOnDisplayExtension:()=>ZD,TabIndentationExtension:()=>QD,WatchEditableExtension:()=>e$,applyFormatFromStyle:()=>bD,applyFormatToDom:()=>bN,batch:()=>hN,buildEditorFromExtensions:()=>ID,computed:()=>xN,configExtension:()=>nn,declarePeerDependency:()=>dS,defineExtension:()=>me,effect:()=>Zt,getExtensionDependencyFromEditor:()=>$N,getKnownTypesAndNodes:()=>EN,getPeerDependencyFromEditor:()=>Dp,getPeerDependencyFromEditorOrThrow:()=>FD,namedSignals:()=>No,registerClearEditor:()=>SN,registerTabIndentation:()=>FN,safeCast:()=>We,shallowMergeConfig:()=>Kt,signal:()=>Zr,untracked:()=>Tp,watchedSignal:()=>Rl});var xD=Symbol.for("preact-signals");function Uu(){if(ur>1)return void ur--;let e,n=!1;for(!function(){let r=Bu;for(Bu=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,Ku++;r!==void 0;){let s=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&mN(r))try{r.c()}catch(i){n||(e=i,n=!0)}r=s}}if(Ku=0,ur--,n)throw e}function hN(e){if(ur>0)return e();bp=++CD,ur++;try{return e()}finally{Uu()}}var nt,Al;function Tp(e){let n=nt;nt=void 0;try{return e()}finally{nt=n}}var Bu,ur=0,Ku=0,CD=0,bp=0,Pu=0;function lN(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 gn(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 Zr(e,n){return new gn(e,n)}function mN(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 cN(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 _N(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){gn.call(this,void 0),this.x=e,this.s=void 0,this.g=Pu-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 xN(e,n){return new Ks(e,n)}function CN(e){let n=e.m;if(e.m=void 0,typeof n=="function"){ur++;let r=nt;nt=void 0;try{n()}catch(s){throw e.f&=-2,e.f|=8,Rp(e),s}finally{nt=r,Uu()}}}function Rp(e){for(let n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,CN(e)}function yD(e){if(nt!==this)throw Error("Out-of-order effect");_N(this),nt=e,this.f&=-2,8&this.f&&Rp(this),Uu()}function Ui(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 Ui(e,n);try{r.c()}catch(i){throw r.d(),i}let s=r.d.bind(r);return s[Symbol.dispose]=s,s}function No(e,n={}){let r={};for(let s in e){let i=n[s],a=Zr(i===void 0?e[s]:i);r[s]=a}return r}gn.prototype.brand=xD,gn.prototype.h=function(){return!0},gn.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:Tp(()=>{var r;(r=this.W)==null||r.call(this)}))},gn.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&&Tp(()=>{var s;(s=this.Z)==null||s.call(this)}))}},gn.prototype.subscribe=function(e){return Zt(()=>{let n=this.value,r=nt;nt=void 0;try{e(n)}finally{nt=r}},{name:"sub"})},gn.prototype.valueOf=function(){return this.value},gn.prototype.toString=function(){return this.value+""},gn.prototype.toJSON=function(){return this.value},gn.prototype.peek=function(){let e=nt;nt=void 0;try{return this.value}finally{nt=e}},Object.defineProperty(gn.prototype,"value",{get(){let e=lN(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Ku>100)throw Error("Cycle detected");(function(n){ur!==0&&Ku===0&&n.l!==bp&&(n.l=bp,Bu={S:n,v:n.v,i:n.i,o:Bu})})(this),this.v=e,this.i++,Pu++,ur++;try{for(let n=this.t;n!==void 0;n=n.x)n.t.N()}finally{Uu()}}}}),Ks.prototype=new gn,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===Pu)return!0;if(this.g=Pu,this.f|=1,this.i>0&&!mN(this))return this.f&=-2,!0;let e=nt;try{cN(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,_N(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)}gn.prototype.S.call(this,e)},Ks.prototype.U=function(e){if(this.t!==void 0&&(gn.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=lN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ui.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()}},Ui.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,CN(this),cN(this),ur++;let e=nt;return nt=this,yD.bind(this,e)},Ui.prototype.N=function(){2&this.f||(this.f|=2,this.u=Al,Al=this)},Ui.prototype.d=function(){this.f|=8,1&this.f||Rp(this)},Ui.prototype.dispose=function(){this.d()};var SD=me({build:(e,n,r)=>No(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?So(i):null;i===null||a!==null&&i.contains(a)||i.focus({preventScroll:!0})},{defaultSelection:s.defaultSelection.peek()})}))}});function yN(){let e=Je(),n=V(),r=ye();e.clear(),e.append(r),n!==null&&r.select(),G(n)&&(n.format=0)}function SN(e,n=yN){return e.registerCommand(Zc,()=>(n(),!0),be)}var ND=me({build:(e,n,r)=>No(n),config:We({$onClear:yN}),name:"@lexical/extension/ClearEditor",register(e,n,r){let{$onClear:s}=r.getOutput();return Zt(()=>SN(e,s.value))}});function NN(e){return!!$t(e)||!(!J(e)||!e.isShadowRoot())}function uN(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 ED=me({build:(e,n)=>No(n),config:We({$shouldInsertAfter:NN,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 qr(i,{click:(a)=>{uN(e,i,a,s.$shouldInsertAfter.peek())&&(a.preventDefault(),Xg(a),e.update(()=>{let l=Je().getLastChild();if(l===null)return;if(!s.$shouldInsertAfter.peek()(l))return;let c=ye();l.insertAfter(c),c.select()}))},mousedown:(a)=>{uN(e,i,a,s.$shouldInsertAfter.peek())&&a.preventDefault()}},!0)})})});function EN(e){let n=new Set,r=new Set;for(let s of TN(e)){let i=typeof s=="function"?s:s.replace;xS(i),n.add(i.getType()),r.add(i)}return{nodes:r,types:n}}function TN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Cp=jo("format",{parse:(e)=>typeof e=="number"?e:0});class Hu extends au{get __isInlineFormattable(){return!0}$config(){return this.config("decorator-text",{extends:au,stateConfigs:[{flat:!0,stateConfig:Cp}]})}getFormat(e){return Po(this,Cp,e)}getFormatFlags(e,n){return qg(this.getFormat(),e,n)}hasFormat(e){let n=Ii[e];return(this.getFormat()&n)!==0}setFormat(e){return eo(this,Cp,e)}toggleFormat(e){let n=this.getFormat(),r=qg(n,e,null);return this.setFormat(r)}isInline(){return!0}createDOM(e,n){return Xe().createElement("span")}}function TD(e){return e instanceof Hu}function bD(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 bN(e,n,r=AD){let s=n;for(let[i,a]of Object.entries(r))e.hasFormat(a)&&(s=OD(s,i));return s}var vD=bN;function OD(e,n){let r=e.ownerDocument.createElement(n);return r.appendChild(e),r}var AD={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},RD=me({name:"@lexical/extension/DecoratorText",nodes:()=>[Hu]});function Rl(e,n){let r;return Zr(e(),{unwatched(){r&&(r(),r=void 0)},watched(){this.value=e(),r=n(this)}})}var zu=me({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 vN;try{vN="0.49.0+prod.esm"}catch(e){}var MD=vN??'"<unknown>+source"',DD=new Set(["__proto__","constructor","prototype"]);function ON(e,n){if(e&&n&&!Array.isArray(n)&&typeof e=="object"&&typeof n=="object"){let r=e,s=n;for(let i in s)!DD.has(i)&&Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=ON(r[i],s[i]));return e}return n}var Mp=0,vp=1,AN=2,yp=3,Lu=4,zi=5,Sp=6,Ol=7;function Np(e){return e.id===Mp}function RN(e){return e.id===AN}function $D(e){return function(n){return n.id===vp}(e)||tt(305,String(e.id),String(vp)),Object.assign(e,{id:AN})}var wD=new Set;class MN{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,n){this.builder=e,this.extension=n,this.configs=new Set,this.state={id:Mp}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Kt;for(let r of this.configs)e=n(e,r);return e}init(e){let n=this.state;RN(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:yp,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:Lu,initResult:c,registerState:d})}(i,a,s)}build(e){let n=this.state,r;n.id!==Lu&&tt(307,String(n.id),String(zi)),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:zi,output:a,registerState:l})}(n,r,s)}register(e,n){this._signal=n;let r=this.state;r.id!==zi&&tt(308,String(r.id),String(zi));let s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=function(i){return Object.assign(i,{id:Sp})}(r),()=>{let i=this.state;i.id!==Ol&&tt(309,String(r.id),String(Ol)),this.state=function(a){return Object.assign(a,{id:zi})}(i),s&&s()}}afterRegistration(e){let n=this.state,r;return n.id!==Sp&&tt(310,String(n.id),String(Sp)),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>=Lu}(e)||tt(313,String(e.id),String(Lu)),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>=yp}(e)||tt(314,String(e.id),String(yp)),{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)||wD}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>=zi})(e)||tt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}var dN={tag:Hr};function kD(){let e=Je();e.isEmpty()&&e.append(ye())}var DN=me({config:We({setOptions:dN,updateOptions:dN}),init:({$initialEditorState:e=kD})=>({$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(Fy(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:[xu,kn,sS,Su,iS]}),fN=Symbol.for("@lexical/extension/LexicalBuilder");function ID(...e){return dr.fromExtensions(e).buildEditor()}function gN(){}function LD(e){throw e}function Fu(e){return Array.isArray(e)?e:[e]}var Ep=MD;class dr{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=Ep,this.roots=e;for(let n of e)this.addExtension(n)}static fromExtensions(e){let n=[Fu(DN)];for(let r of e)n.push(Fu(r));return new dr(n)}static maybeFromEditor(e){let n=e[fN];return n&&(n.PACKAGE_VERSION!==Ep&&tt(292,n.PACKAGE_VERSION,Ep),n instanceof dr||tt(293)),n}static fromEditor(e){let n=dr.maybeFromEditor(e);return n===void 0&&tt(294),n}constructEditor(){let{$initialEditorState:e,onError:n,onWarn:r,...s}=this.buildCreateEditorArgs(),i=Object.assign(Eu({...s,...n?{onError:(a)=>{n(a,i)}}:{},...r?{onWarn:(a)=>{r(a,i)}}:{}}),{[fN]:this});for(let a of this.sortedExtensionReps())a.build(i);return i}buildEditor(){let e=gN;function n(){try{e()}finally{e=gN}}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=Fu(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 MN(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=Fu(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(RN(i))return;let a=r.extension.name;var l;Np(i)||tt(300,a,s||"[unknown]"),Np(l=i)||tt(304,String(l.id),String(Mp)),i=Object.assign(l,{id:vp}),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=$D(i),r.state=i,e.push(r)};for(let r of this.extensionNameMap.values())Np(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 TN(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&&ON(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=LD),e}}function $N(e,n){let r=dr.fromEditor(e).getExtensionRep(n);return r===void 0&&tt(303,n.name),r.getExtensionDependency()}function Dp(e,n){let r=dr.maybeFromEditor(e);if(!r)return;let s=r.extensionNameMap.get(n);return s?s.getExtensionDependency():void 0}function FD(e,n){let r=Dp(e,n);return r===void 0&&tt(291,n),r}function wN(e){return $N(Ge(),e)}function PD(e){return wN(e).output}function BD(e){return Dp(Ge(),e)}var KD=new Set,Op=me({build(e,n,r){let s=r.getDependency(zu).output,i=Zr({watchedNodeKeys:new Map}),a=Rl(()=>{},()=>Zt(()=>{let l=a.peek(),{watchedNodeKeys:c}=i.value,d,f=!1;s.value.read(()=>{if(V())for(let[g,p]of c.entries()){if(p.size===0){c.delete(g);continue}let m=At(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=xN(()=>(a.value||KD).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:[zu],name:"@lexical/extension/NodeSelection"}),kN=En("INSERT_HORIZONTAL_RULE_COMMAND");class Hi extends au{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:zD,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 zD(){return{node:$p()}}function $p(){return Gc(Hi)}function IN(e){return e instanceof Hi}var UD=me({dependencies:[zu,Op],name:"@lexical/extension/HorizontalRule",nodes:()=>[Hi],register(e,n,r){let{watchNodeKey:s}=r.getDependency(Op).output,i=Zr({nodeSelections:new Map}),a=e._config.theme.hrSelected??"selected";return De(e.registerCommand(kN,(l)=>{let c=V();if(!G(c))return!1;if(c.focus.getNode()!==null){let d=$p();Iu(d)}return!0},be),e.registerCommand(Si,(l)=>{if(ro(l.target)){let c=Ly(l.target);if(IN(c))return function(d,f=!1){let g=V(),p=d.isSelected(),m=d.getKey(),_;f&&Ze(g)?_=g:(_=jc(),pt(_)),p?_.delete(m):_.add(m)}(c,l.shiftKey),!0}return!1},Fe),e.registerMutationListener(Hi,(l,c)=>{hN(()=>{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:Zr(_),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):on(f,a)}));return De(...l)}))}}),HD=me({build:(e)=>({composingTextNode:Zr(null),compositionKey:Zr(null)}),name:"@lexical/extension/IME",register(e,n,r){let{compositionKey:s,composingTextNode:i}=r.getOutput(),a=e.registerCommand(Xy,()=>{let f=V();return G(f)&&(s.value=f.anchor.key),!1},Qc),l=Zt(()=>{let f=s.value;i.value=f!==null?e.read("latest",()=>{let g=At(f);return oe(g)?g:null}):null}),c=e.registerUpdateListener(({tags:f,editorState:g})=>{f.has(tu)&&g.read(()=>{let p=V();if(!G(p))return;let m=p.anchor.getNode();oe(m)&&(i.value=m)})}),d=e.registerRootListener((f)=>{if(f===null)return void(s.value=null);return so(f,"compositionend",()=>{s.value=null})});return De(a,l,c,d)}}),WD=me({build:(e,n)=>No({inheritEditableFromParent:n.inheritEditableFromParent}),config:We({$getParentEditor:function(){let e=Ge();return dr.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))})}),GD=me({config:We({attribute:"data-selected",nodes:[]}),init(e,n){let r=new Set,s=vu(EN(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)=>Kt(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=V();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 pN(e){J(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var jD=me({build:(e,n,r)=>No(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 lt&&a.prototype.isInline!==lt.prototype.isInline&&(l.add(pN),i.push(()=>l.delete(pN)));return()=>i.forEach((a)=>a())}})}}),YD=new Set([yu,uS]),VD=me({build:(e,n,r)=>No(n),config:We({$fixFocusOverselection:function(){let e=V();if(G(e)&&!e.isCollapsed()){let n=lr(ar(e),"next"),r=n.focus;for(zr(r)&&n.anchor.origin!==r.origin&&r.offset===0&&(r=zo(r.getSiblingCaret())),yo(r)&&n.anchor.origin!==r.origin&&Ue(r.origin)&&(r=zo(r));Bo(r)&&n.anchor.origin!==r.origin;)r=zo(it(r.origin,"next"));if(yo(r)&&J(r.origin)&&(r=kt(Tt(r.origin,"previous")).getFlipped()),r=kt(r),!r.isSamePointCaret(n.focus)){let s=$n(Jn(n.anchor,r)),i=Ge().getRootElement(),a=i&&In(i.ownerDocument.defaultView);a&&Gy(Sn(),s,Ge(),a,YD,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(oo,()=>(l(null)&&(a=0,s.$fixFocusOverselection.peek()()),!1),Vy),qr(i,{mousedown:l,mouseup:l},!0))})})});function XD(e){let n=e.target;SS(e,"a",{ctrlKey:!gl,metaKey:gl})&&Ce(n)&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA")&&n.addEventListener("keydown",Xg,{once:!0})}var Ap=me({build:(e,n,r)=>No(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 so(i,"keydown",XD,!0)})})}}),qD=me({build:(e)=>Rl(()=>e.getRootElement(),(n)=>e.registerRootListener((r)=>{n.value=r})),name:"@lexical/extension/RootElement"}),JD=me({build:(e,n,r)=>No(n),config:We({cascadeSelection:!1,disabled:!1}),dependencies:[Ap],name:"@lexical/extension/SelectBlock",register:(e,n,r)=>{let s=r.getOutput(),i=r.getDependency(Ap).output;return De(Zt(()=>{i.disabled.value=s.disabled.value}),Zt(()=>{if(!s.disabled.value)return e.registerCommand(ki,(a,l)=>{if(l!==e){if(!s.cascadeSelection.peek())return!1;return!!l.read("pending",()=>{let m=V();return G(m)&&vl(Je(),m)})&&(Ur(),!0)}let c=V();if(Ze(c)){let m=c.getNodes(),_=m[0];if(!_)return!1;let y=_.getTopLevelElement();return!y||Co(y)||y.is(_)||m.length>1&&(d=y,!m.every((x)=>d.is(x.getTopLevelElement())))?Ur():J(y)&&y.select(0,y.getChildrenSize()),!0}var d;if(!G(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=Zn(f);for(;p!==null;){if(J(p)&&!vl(p,c))return p.select(0,p.getChildrenSize()),!0;let m=Yc(p);p=m===null?null:Zn(m)}return vl(Je(),c)||Ur(),!0},Fe)}))}}),ZD=me({build:(e,n,r)=>No(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 aN(e,s.onReposition.value)})}});function LN(e){return e.canIndent()}function FN(e,n,r=LN){return De(e.registerCommand(jr,(s)=>{let i=V();if(!G(i))return!1;s.preventDefault();let a=function(l){if(l.getNodes().filter((m)=>Br(m)&&m.canIndent()).length>0)return!0;let{anchor:c,focus:d}=l,f=d.isBefore(c)?d:c,g=f.getNode(),p=wu(g);if(p.canIndent()){let m=p.getKey(),_=Fr();if(_.anchor.set(m,0,"element"),_.focus.set(m,0,"element"),_=Ko(_),_.anchor.is(f))return!0}return!1}(i)?s.shiftKey?Go:to:$s;return e.dispatchCommand(a)},be),e.registerCommand(to,()=>{let s=typeof n=="number"?n:n?n.peek():null,i=V();if(!G(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)}})},Ni))}var QD=me({build:(e,n,r)=>No(n),config:We({$canIndent:LN,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 FN(e,i,a)})}}),e$=me({build:(e)=>Rl(()=>e.isEditable(),(n)=>e.registerEditableListener((r)=>{n.value=r})),name:"@lexical/extension/WatchEditable"});var Se=wp,{$applyFormatToDom:kP,$createHorizontalRuleNode:Wu,$defaultShouldInsertAfter:IP,$getExtensionDependency:LP,$getExtensionOutput:PN,$getPeerDependency:BN,$isDecoratorTextNode:FP,$isHorizontalRuleNode:KN,AutoFocusExtension:PP,ClearEditorExtension:BP,ClickAfterLastBlockExtension:KP,DecoratorTextExtension:zP,DecoratorTextNode:UP,EditorStateExtension:HP,HorizontalRuleExtension:zN,HorizontalRuleNode:Gu,IMEExtension:WP,INSERT_HORIZONTAL_RULE_COMMAND:GP,InitialStateExtension:jP,LexicalBuilder:UN,NestedEditorExtension:YP,NodeSelectionDataSelectedExtension:VP,NodeSelectionExtension:XP,NormalizeInlineElementsExtension:HN,NormalizeTripleClickSelectionExtension:WN,PreventSelectAllExtension:qP,RootElementExtension:JP,SelectBlockExtension:ZP,SelectionAlwaysOnDisplayExtension:QP,TabIndentationExtension:eB,WatchEditableExtension:tB,applyFormatFromStyle:nB,applyFormatToDom:oB,batch:kp,buildEditorFromExtensions:rB,computed:sB,configExtension:GN,declarePeerDependency:iB,defineExtension:aB,effect:St,getExtensionDependencyFromEditor:lB,getKnownTypesAndNodes:jN,getPeerDependencyFromEditor:io,getPeerDependencyFromEditorOrThrow:cB,namedSignals:Dt,registerClearEditor:uB,registerTabIndentation:ju,safeCast:dB,shallowMergeConfig:fB,signal:zs,untracked:gB,watchedSignal:YN}=Se;var Ip={};Ne(Ip,{ReactProviderExtension:()=>t$});var t$=me({name:"@lexical/react/ReactProvider"});var n$=Ip,VN=n$.ReactProviderExtension;var Fp={};Ne(Fp,{$canShowPlaceholder:()=>qN,$canShowPlaceholderCurry:()=>r$,$findTextIntersectionFromCharacters:()=>s$,$isRootTextContentEmpty:()=>Lp,$isRootTextContentEmptyCurry:()=>o$,$rootTextContent:()=>XN,registerLexicalTextEntity:()=>a$});function XN(){return Je().getTextContent()}function Lp(e,n=!0){if(e)return!1;let r=XN();return n&&(r=r.trim()),r===""}function o$(e,n){return()=>Lp(e,n)}function qN(e){if(!Lp(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($t(i))return!1;if(J(i)){if(!Dn(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(!oe(d))return!1}}}return!0}function r$(e){return()=>qN(e)}function s$(e,n){let r=e.getFirstChild(),s=0;e:for(;r!==null;){if(J(r)){let l=r.getFirstChild();if(l!==null){r=l;continue}}else if(oe(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 i$(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 a$(e,n,r,s){let i=(l)=>l instanceof r,a=(l)=>{let c=Ct(l.getTextContent());c.setFormat(l.getFormat()),l.replace(c)};return[e.registerNodeTransform(kn,(l)=>{if(!l.isSimpleText())return;let c,d=l.getPreviousSibling(),f=l.getTextContent(),g=l;if(oe(d)){let m=d.getTextContent(),_=n(m+f);if(i(d)){if(_===null||((y)=>y.getLatest().__mode)(d)!==0)return void a(d);{let y=_.end-m.length;if(y>0){let x=m+f.slice(0,y);if(d.select(),d.setTextContent(x),y===f.length)l.remove();else{let E=f.slice(y);l.setTextContent(E)}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 x=g.getNextSibling();if(oe(x)){_=g.getTextContent()+x.getTextContent();let E=n(_);if(E===null)return void(i(x)?a(x):x.markDirty());if(E.start!==0)return}}if(c===null)return;if(c.start===0&&oe(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&&i$(165,"nodeToReplace");let y=s(m);if(y.setFormat(m.getFormat()),m.replace(y),g==null)return;p=0,d=y}}),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();oe(f)&&f.isTextEntity()&&(a(f),a(l));let g=l.getNextSibling();oe(g)&&g.isTextEntity()&&(a(g),i(l)&&a(l))})]}var Us=Fp,{$canShowPlaceholder:xB,$canShowPlaceholderCurry:Yu,$findTextIntersectionFromCharacters:CB,$isRootTextContentEmpty:yB,$isRootTextContentEmptyCurry:SB,$rootTextContent:NB,registerLexicalTextEntity:EB}=Us;var Pp={};Ne(Pp,{DragonExtension:()=>f$,installDragonSupport:()=>c$,registerDragonSupport:()=>QN});var l$={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Vu=Symbol.for("@lexical/dragon/WindowState");function c$(e=function(){return typeof window<"u"?window:void 0}()){return e?ZN(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function ZN(e,n,r){let s=function(i){let a=i[Vu];return a===void 0&&(a={dispose:()=>{},editors:new Map,installs:new Set},i[Vu]=a),a}(e);if(s.installs.size===0){let i=d$.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 u$.bind(null,e,s,n,r)}function u$(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[Vu])}function JN(e){return e&&e.ownerDocument.defaultView}function QN(e){let n=YN(()=>JN(e.getRootElement()),(r)=>e.registerRootListener((s)=>{r.value=JN(s)}));return St(()=>{let r=n.value;if(r)return ZN(r,Symbol("@lexical/dragon/editorInstall"),e)})}function d$(e){if(e.origin!==this.location.origin)return;let n=function(s){let i=s[Vu];if(i===void 0)return null;let a=Tu(pS(s.document));return Au(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=V();if(G(m)){let _=m.anchor,y=_.getNode(),x=0,E=0;if(oe(y)&&l>=0&&c>=0&&(x=l,E=l+c,m.setTextNodeRange(y,x,y,E)),typeof d!="string"||x===E&&d===""||(m.insertRawText(d),y=_.getNode()),oe(y)){let b=y.getTextContentSize();x=Math.min(Math.max(f,0),b),E=f<0||g<0?x:Math.min(f+g,b),m.setTextNodeRange(y,x,y,E)}if(typeof p=="string"&&g>0&&!m.isCollapsed()){let b=l$[p];b!==void 0&&m.formatText(b)}e.stopImmediatePropagation()}})}}}}}var f$=me({build:(e,n,r)=>Dt(n),config:We({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(e,n,r)=>St(()=>r.getOutput().disabled.value?void 0:QN(e))});var Bp=Pp,{DragonExtension:eE,installDragonSupport:OB,registerDragonSupport:tE}=Bp;var th={};Ne(th,{$appendNodeToHTML:()=>gw,$distributeInlineWrapper:()=>IE,$generateDOMFromNodes:()=>YE,$generateDOMFromRoot:()=>dw,$generateHtmlFromNodes:()=>fw,$generateNodesFromDOM:()=>uw,$generateNodesFromDOMViaExtension:()=>iw,$getImportContextValue:()=>kE,$getRenderContextValue:()=>_$,$getSessionDOMRenderConfig:()=>Qu,$inlineStylesFromStyleSheets:()=>hE,$isBlockLevel:()=>ji,$propagateTextAlignToBlockChildren:()=>LE,$setRenderContextValue:()=>x$,$updateRenderContextValue:()=>C$,$withImportContext:()=>Jp,$withRenderContext:()=>qp,BlockSchema:()=>PE,CoreImportExtension:()=>GE,CoreImportRules:()=>zE,DOMImportExtension:()=>eh,DOMRenderExtension:()=>w$,HorizontalRuleImportExtension:()=>lw,HorizontalRuleImportRules:()=>aw,ImportOverlays:()=>DE,ImportSource:()=>K$,ImportSourceDataTransfer:()=>z$,ImportTextFormat:()=>qu,ImportTextStyle:()=>OE,ImportWhitespaceConfig:()=>ME,InlineSchema:()=>U$,NestedBlockSchema:()=>H$,RenderContextExport:()=>Vp,RenderContextRoot:()=>xE,RootSchema:()=>BE,contextUpdater:()=>h$,contextValue:()=>Ml,createImportState:()=>Ws,createRenderState:()=>Yp,defaultIsInline:()=>RE,defaultPreservesWhitespace:()=>AE,defineImportRule:()=>hr,defineOverlayRules:()=>nw,domOverride:()=>y$,isElementOfTag:()=>P$,parseSelector:()=>vE,sel:()=>cw});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 Gi;function Qr(e,n){let{key:r}=n;return e&&r in e?e[r]:n.defaultValue}function Gp(e){return Gi&&Gi.editor===e?Gi:void 0}function Ju(e,n){let r=Gp(n);return r&&r[e]}function g$(e,n){if("cfg"in n){let{cfg:r,updater:s}=n;return[r,s(Qr(e,r))]}return n}function Xu(e,n){let r=n;for(let s of e){let[i,a]=g$(r,s),l=i.key;if(r===n&&Qr(r,i)===a)continue;let c=r===n||r===void 0?p$(n):r;c[l]=a,r=c}return r}function p$(e){return Object.create(e||null)}function Ml(e,n){return[e,n]}function h$(e,n){return{cfg:e,updater:n}}function fE(e,n,r,s=Ge()){let i=Gi,a=Gp(s);try{return Gi={...a,editor:s,[e]:n},r()}finally{Gi=i}}function gE(e,n=()=>{}){return(r,s=Ge())=>(i)=>{let a=Gp(s),l=a&&a[e],c=Xu(r,l||n(s));return c&&c!==l?fE(e,c,i,s):i()}}function pE(e,n,r,s){return Object.assign(jo(Symbol(n),{isEqual:s,parse:r}),{[e]:!0})}var hE=(e,n,r)=>{mE(e),r()};function mE(e){if(!Xr(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(!Ln(l,CSSStyleRule))continue;let c;try{c=n.querySelectorAll(l.selectorText)}catch(d){continue}for(let d of Array.from(c)){if(!Ce(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 jp="@lexical/html/DOM",Zu=Symbol.for("@lexical/html/DOMExportContext"),_E="@lexical/html/DOMImport",Dl=Symbol.for("@lexical/html/DOMImportContext"),m$=()=>!0;function Yp(e,n,r){return pE(Zu,e,n,r)}var xE=Yp("root",Boolean),Vp=Yp("isExport",Boolean);function CE(e){let n=io(e,jp);return n?n.output.defaults:void 0}function _$(e,n=Ge()){return Qr(function(r){return Ju(Zu,r)||CE(r)}(n),e)}function Xp(e){let n=io(e,jp);return n?n.output.runtime:void 0}function x$(e,n,r=Ge()){let s=Xp(r);s&&s.setContextValue(e,n)}function C$(e,n,r=Ge()){let s=Xp(r);s&&s.setContextValue(e,n(Qr(s.editorContext,e)))}function Qu(e=Ge()){let n=Xp(e);return n?n.getSessionConfig():Kg(e)}var qp=gE(Zu,CE);function y$(e,n,r){return{...n,...r,nodes:e}}function S$(e){return(n)=>n instanceof e}function N$(e,{nodes:n}){if(n==="*")return m$;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(S$(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 nE(e){return(n,r,s)=>e(n,s)}function Kp(e){return(n,r,s,i)=>e(n,r,i)}function oE(e){return(n,r,s,i,a)=>e(n,r,s,a)}function E$(e){return(n,r,s,i,a,l)=>e(n,r,s,i,l)}function rE(e,n){return(r,s)=>{let i=()=>e(r,s),a=n(r);return a?a(r,i,s):i()}}function zp(e,n){return(r,s,i)=>{let a=()=>e(r,s,i),l=n(r);return l?l(r,s,a,i):a()}}var T$=zp,b$=Kp;function sE(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 v$(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 O$(e,n){return(r,s,i,a)=>{e(r,s,i,a);let l=n(r);l&&l(r,s,i,a)}}function gr(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 A$(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 R$(e){return e.nodes==="*"}function M$(e,n){let r=vu(jN(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(R$(p))l.push(p);else if(Array.isArray(p.nodes))for(let m of p.nodes)Ug(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 vS(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=N$(r,i);for(let l in s)A$(s,l,a,i[l])}return s}function D$(e){return e}function Up(e,{overrides:n}){let r=M$(e,n),s={...Wg,...e.dom};return gr(r,"$createDOM",s,rE,nE),gr(r,"$exportDOM",s,rE,nE),gr(r,"$extractWithChild",s,v$,E$),gr(r,"$getDOMSlot",s,T$,b$),gr(r,"$shouldExclude",s,zp,Kp),gr(r,"$shouldInclude",s,zp,Kp),gr(r,"$getSlotTargetElement",s,sE,oE),gr(r,"$updateDOM",s,sE,oE),gr(r,"$decorateDOM",s,O$,D$),s}function yE(e){return{get:(n)=>Qr(e,n)}}function iE(e){let n=Object.create(null);return Xu(e,n)||n}function Hp(e,n){let r=yE(n);return e.filter((s)=>!(s.disabledForEditor&&s.disabledForEditor(r)))}function $$(e){if(e.nodes==="*")return()=>!0;let n=e.nodes.map((r)=>{let s=r;return Ug(s.prototype)?(i)=>i instanceof s:r});return(r)=>n.some((s)=>s(r))}class SE{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=Hp(r,s),this.hasSessionGates=r.some((i)=>i.disabledForSession)}setContextValue(e,n){let r=this.installed;this.editorContext[e.key]=n;let s=Hp(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=Up(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($$(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(Ci,{discrete:!0}),a.$updateDOM=c}getSessionConfig(){let e=this.editor._config.dom||Wg;if(!this.hasSessionGates)return e;let n=yE(Ju(Zu,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=Up(this.initialEditorConfig,{overrides:s}),this.sessionCache.set(i,a)),a}}var w$=me({build(e,n,r){let{initialEditorConfig:s}=r.getInitResult(),i=iE(n.contextDefaults);return{defaults:i,runtime:new SE(e,s,n.overrides,i)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[xu,()=>{let e=Xe().createElement("div");return e.role="textbox",{element:e}}]])},init(e,n){let r={dom:e.dom,nodes:e.nodes},s=iE(n.contextDefaults),i=Hp(n.overrides,s);return e.dom=Up(e,{overrides:i}),{initialEditorConfig:r}},mergeConfig(e,n){let r=Kt(e,n);for(let s of["overrides","contextDefaults"])n[s]&&(r[s]=[...e[s],...n[s]]);return r},name:jp}),ed=Symbol.for("@lexical/html/SelectorImpl");function $l(e,n){let r={kind:"element",predicate:(s=n,s.length===0?Ce: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{[ed]:r,attr:(a,l,c)=>i(Wp(a,l,c)),classAll:(...a)=>i(EE(a)),classAny:(...a)=>i(function(l){let c=NE(l);if(c.length===0)return()=>!1;return(d)=>{if(!Ce(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)=>Ce(p)&&p.style.getPropertyValue(d)===f;if(f instanceof RegExp){let p=g&&g.capture,m=f;return(_,y)=>{if(!Ce(_))return!1;let x=_.style.getPropertyValue(d);if(!x)return!1;let E=x.match(m);return E!==null&&(p!==void 0&&(y[p]=E),!0)}}Hs(362,JSON.stringify(d))}(a,l,c))}}function NE(e){let n=[];for(let r of e)r&&n.push(r);return n}function EE(e){let n=NE(e);return n.length===0?()=>!0:(r)=>{if(!Ce(r))return!1;let s=r.classList;for(let i of n)if(!s.contains(i))return!1;return!0}}function Wp(e,n,r){if(n===!0)return(s)=>Ce(s)&&s.hasAttribute(e);if(typeof n=="string")return(s)=>Ce(s)&&s.getAttribute(e)===n;if(n instanceof RegExp){let s=r&&r.capture,i=n;return(a,l)=>{if(!Ce(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 k$={kind:"text",predicate:Fs,tags:new Set},I$={[ed]:k$},L$={kind:"comment",predicate:(e)=>e.nodeType===8,tags:new Set},F$={[ed]:L$},Wi={any:()=>$l(new Set,[]),comment:()=>F$,tag(...e){e.length>0||Hs(363);let n=new Set;for(let r of e)n.add(r.toUpperCase());return $l(n,[])},text:()=>I$};function P$(e,n){return Ce(e)&&e.nodeName===n.toUpperCase()}var TE=/[A-Za-z0-9_-]/;class bE{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()&&TE.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 B$(e){let n=new Set,r=[],s=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(TE.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(Wp("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(Wp(a,l))}}}return s.length>0&&r.push(EE(s)),{predicates:r,tags:n}}function vE(e){let n=new bE(e,0),r=[];for(;;){let i=B$(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 hr(e){return e}function Ws(e,n,r){return pE(Dl,e,n,r)}var K$=Ws("importSource",()=>"unknown"),z$=Ws("importSourceDataTransfer",()=>null),qu=Ws("textFormat",()=>0),OE=Ws("textStyle",()=>({}));function AE(e){if(!Ce(e))return!1;if(e.nodeName==="PRE")return!0;let n=e.style.whiteSpace;return typeof n=="string"&&n.startsWith("pre")}function RE(e){if(Fs(e))return!0;if(!Ce(e))return!1;let n=e.style.display;return n?n.startsWith("inline"):!Ls(e)&&Fi(e)}var ME=Ws("whitespaceConfig",()=>({isInline:RE,preservesWhitespace:AE})),DE=Ws("importOverlays",()=>[]);class $E{constructor(e){this.record=e}get(e){return Qr(this.record,e)}set(e,n){this.record[e.key]=n}update(e,n){this.record[e.key]=n(Qr(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}}function wE(e){let n=io(e,_E);return n?n.output.defaults:void 0}function kE(e,n=Ge()){return Qr(function(r){return Ju(Dl,r)||wE(r)}(n),e)}var Jp=gE(Dl,wE);function ji(e){return Br(e)||$t(e)&&!e.isInline()}function IE(e,n){let r=[],s=[],i=()=>{s.length!==0&&(r.push(n().splice(0,0,s)),s=[])};for(let a of e)if(ji(a)){if(i(),J(a)){let l=IE(a.getChildren(),n);a.splice(0,a.getChildrenSize(),l)}r.push(a)}else s.push(a);return i(),r}function LE(e,n){if(!Ce(n))return e;let r=n.style.textAlign;if(!Zp(r))return e;for(let s of e)Br(s)&&s.getFormatType()===""&&s.setFormat(r);return e}function FE(e,n,r){e.length===1&&Ue(e[0])&&(e=[]);let s=ye();if(Ce(r)){let i=r.style.textAlign;Zp(i)&&s.setFormat(i)}return[s.splice(0,0,e)]}var PE={$accepts:ji,$packageRun:FE,name:"BlockSchema"},U$={$accepts:(e)=>!ji(e),name:"InlineSchema"},H$={$accepts:ji,$packageRun:(e)=>e,name:"NestedBlockSchema"},BE={$accepts:ji,$packageRun:FE,name:"RootSchema"},Gs=Wi,W$=new Set(["center","end","justify","left","right","start"]);function Zp(e){return W$.has(e)}var G$={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"}},j$={CODE:oS,MARK:rS},Y$=new Set(["font-weight","font-style","text-decoration","vertical-align"]),V$=hr({$import:(e,n)=>{let r=e.get(qu),s=G$[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,y=0,{fontWeight:x,fontStyle:E,textDecoration:b,verticalAlign:R}=m;if(x==="700"||x==="bold"?_|=pl:x!=="normal"&&x!=="400"||(y|=pl),E==="italic"?_|=ml:E==="normal"&&(y|=ml),b){let M=b.split(" ");M.includes("underline")&&(_|=Cl),M.includes("line-through")&&(_|=xl),M.includes("none")&&(y|=Cl|xl)}return R==="sub"?(_|=fu,y|=gu):R==="super"?(_|=gu,y|=fu):R==="baseline"&&(y|=fu|gu),{clear:y,set:_}}(a),f&~g.clear|g.set);var f,g;let p=j$[n.nodeName];return p&&(d|=p),d===r?e.$importChildren(n):e.$importChildren(n,{context:[Ml(qu,d)]})},match:Gs.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"});function aE(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 lE(e,n){return n!==0&&oe(e)?e.setFormat(n):e}function cE(e,n){if(oe(e)){let r=function(s){let i="";for(let a in s)Y$.has(a)||(i+=`${a}: ${s[a]}; `);return i.trimEnd()}(n);r!==""&&e.setStyle(r)}return e}var X$=hr({$import:(e,n)=>{let r=e.get(qu),s=e.get(OE),i=e.get(ME);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=rl(n.textContent||"");for(let d of c)lE(d,r),cE(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=aE(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=aE(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=Ct(a);return lE(l,r),cE(l,s),[l]},match:Gs.text(),name:"@lexical/html/#text"}),q$=hr({$import:()=>[],match:Gs.tag("script","style"),name:"@lexical/html/script-style-ignore"}),J$=hr({$import:(e,n)=>TS(n)||ES(n)?[]:[un()],match:Gs.tag("br"),name:"@lexical/html/br"}),Z$=hr({$import:(e,n)=>{let r=ye();if(Qn(r,n),Jr(n,r),r.getFormatType()===""){let s=n.getAttribute("align");s&&Zp(s)&&r.setFormat(s)}return Nn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:Gs.tag("p"),name:"@lexical/html/p"}),KE=hr({$import:(e,n,r)=>Ge().hasNode(Gu)?[Wu()]:r(),match:Gs.tag("hr"),name:"@lexical/html/hr"}),zE=[q$,Z$,KE,hr({$import:(e,n,r)=>Ls(n)?LE(e.$importChildren(n,{schema:PE}),n):r(),match:Gs.any(),name:"@lexical/html/transparent-block"}),X$,J$,V$];function Q$(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 UE(e){let n=[],r=new Map,s=[],i=[],a=[],l=new Set;e.forEach((d,f)=>{let g=function(m){let _=m[ed];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,Q$(f,s));return{byTag:c,commentIndices:a,rules:n,textIndices:i,wildcardIndices:s}}function uE(e,n){return Fs(n)?e.textIndices:n.nodeType===8?e.commentIndices:Ce(n)?e.byTag.get(n.nodeName)||e.wildcardIndices:ew}var ew=Object.freeze([]);function HE(e){let n=[];for(let r of e)if(tw(r))for(let s of r.rules)n.push(s);else n.push(r);return n}function tw(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function nw(e){let n=HE(e);return{__type:"CompiledOverlayRules",dispatch:UE(n),rules:n}}var ow=Object.freeze({});function rw(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=()=>WE(a,l,c);return c&&c.context?Jp(c.context,a.editor)(f):f()}finally{d&&a.overlays.pop()}}(e,s,i),$importOne:(s,i)=>Qp(e,s,i),captures:n,get:(s)=>kE(s,e.editor),session:e.session}}function WE(e,n,r){let s=r&&r.$onChild,i=[];for(let c of Array.from(n.childNodes)){let d=Qp(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 y=m;if(m=null,c.$packageRun){let x=c.$packageRun(y,f,g);if(x.length>0){for(let E of x)p.push(E);return}}if(c.onReject==="hoist")for(let x of y)p.push(x)};for(let y of d)c.$accepts(y,f)?(_(),p.push(y)):(m===null&&(m=[]),m.push(y));return _(),c.$finalize?c.$finalize(p,f):p}(l,a,null,n):a}function Qp(e,n,r){let s=()=>function(i,a){let l=function(g,p){let m=[];for(let y=g.overlays.length-1;y>=0;y--){let x=g.overlays[y],E=uE(x,p);E.length>0&&m.push({dispatch:x,indices:E})}let _=uE(g.dispatch,p);return _.length>0&&m.push({dispatch:g.dispatch,indices:_}),m}(i,a);if(l.length===0)return dE(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],y={};if(_.predicate(a,y)){let x=rw(i,Object.keys(y).length===0?ow:y);try{return _.$import(x,a,f)}catch(E){throw E}}}c++,d=0}return dE(i,a)};return f()}(e,n);return r&&r.context?Jp(r.context,e.editor)(s):s()}function dE(e,n){if(n.childNodes.length===0)return[];let r=[];for(let s of Array.from(n.childNodes)){let i=Qp(e,s,void 0);for(let a of i)r.push(a)}return r}var sw=hr({$import:(e,n)=>e.$importChildren(n),match:Wi.any(),name:"@lexical/html/default-hoist"}),eh=me({build(e,n){let r=UE(HE(n.rules)),s=Xu(n.contextDefaults,void 0),i=n.preprocess;return{$generateNodesFromDOM:(a,l)=>{let c=Ju(Dl,e)||s,d=l&&l.context?Xu(l.context,c):c,f=d!==void 0&&d!==c?d:Object.create(c||null),g=new $E(f),p={session:g};return function(m,_,y){let x=m.length-1,E=()=>{for(;x>=0;)return void(0,m[x--])(_,y,E)};E()}(l&&l.preprocess?[...i,...l.preprocess]:i,a,p),fE(Dl,f,()=>function(m,_,y,x){return WE({dispatch:m,editor:_,overlays:x.get(DE).map((E)=>E.dispatch),session:x},Xr(y)?y.body:y,{schema:BE})}(r,e,a,g),e)},defaults:s}},config:{contextDefaults:[],preprocess:[hE],rules:[sw]},mergeConfig:(e,n)=>Kt(e,{...n,...n.contextDefaults&&{contextDefaults:[...e.contextDefaults,...n.contextDefaults]},...n.preprocess&&{preprocess:[...e.preprocess,...n.preprocess]},...n.rules&&{rules:[...n.rules,...e.rules]}}),name:_E});function iw(e,n){return PN(eh).$generateNodesFromDOM(e,n)}var GE=me({dependencies:[nn(eh,{rules:zE})],name:"@lexical/html/CoreImport"}),aw=[KE],lw=me({dependencies:[zN,GE],name:"@lexical/html/HorizontalRuleImport"}),cw={any:Wi.any,comment:Wi.comment,css:vE,tag:Wi.tag,text:Wi.text},jE=new Set(["STYLE","SCRIPT"]);function uw(e,n){mE(n);let r=Xr(n)?n.body.childNodes:n.childNodes,s=[],i=[];for(let a of r)if(!jE.has(a.nodeName)){let l=VE(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 ul&&l.insertAfter(un());for(let l of a){let c=l.getParent();c&&c.splice(l.getIndexWithinParent(),1,l.getChildren())}}(i),s}function YE(e,n=null,r=Ge()){return qp([Ml(Vp,!0)],r)(()=>{let s=Je(),i=Qu(r),a=G(n)?Zn(n.anchor.getNode()):null,l=e.append.bind(e);for(let c of(J(a)?a:s).getChildren())td(r,c,l,n,i);return e})}function dw(e,n=Je()){let r=Ge();return qp([Ml(Vp,!0),Ml(xE,!0)],r)(()=>{let s=Qu(r),i=e.append.bind(e);return td(r,n,i,null,s),e})}function fw(e,n=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Hs(338),Oy(e),YE(Xe().createElement("div"),n,e).innerHTML}function td(e,n,r,s=null,i=Kg(e)){let a=i.$shouldInclude(n,s,e),l=i.$shouldExclude(n,s,e),c=n;s!==null&&oe(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(),y=m?m():J(c)?c.getChildren():[],x=a&&Ze(s)&&J(n)?null:s,E=_.append.bind(_);for(let b of y){let R=td(e,b,E,x,i);!a&&R&&i.$extractWithChild(n,b,s,"html",e)&&(a=!0)}if(a&&!l){if((Ce(f)||Yg(f))&&(p?p(_):f.append(_)),r(f),g){let b=g.call(c,f);b&&(Yg(f)?f.replaceChildren(b):f.replaceWith(b))}}else r(_);return a}function gw(e,n,r,s=null){return td(e,n,r.append.bind(r),s,Qu(e))}function VE(e,n,r,s,i=new Map,a){let l=[];if(jE.has(e.nodeName))return l;let c=null,d=function(y,x){let{nodeName:E}=y,b=x._htmlConversions.get(E.toLowerCase()),R=null;if(b!==void 0)for(let M of b){let k=M(y);k!==null&&(R===null||(R.priority||0)<=(k.priority||0))&&(R=k)}return R!==null?R.conversion:null}(e,n),f=d?d(e):null,g=null;if(f!==null){g=f.after;let y=f.node;if(c=Array.isArray(y)?y[y.length-1]:y,c!==null){for(let[,x]of i)if(c=x(c,a),!c)break;c&&l.push(...Array.isArray(y)?y:[c])}f.forChild!=null&&i.set(e.nodeName,f.forChild)}let p=e.childNodes,m=[],_=(c==null||!Mt(c))&&(c!=null&&Br(c)||s);for(let y=0;y<p.length;y++)m.push(...VE(p[y],n,r,_,new Map(i),c));if(g!=null&&(m=g(m)),Ls(e)&&(m=pw(e,m,_?()=>{let y=new ul;return r.push(y),y}:ye)),c==null)if(m.length>0)for(let y of m)l.push(y);else Ls(e)&&function(y){if(y.nextSibling==null||y.previousSibling==null)return!1;return Fi(y.nextSibling)&&Fi(y.previousSibling)}(e)&&l.push(un());else J(c)&&c.append(...m);return l}function pw(e,n,r){let s=e.style.textAlign,i=[],a=[];for(let l=0;l<n.length;l++){let c=n[l];if(Br(c))s&&!c.getFormat()&&c.setFormat(s),i.push(c);else if(a.push(c),l===n.length-1||l<n.length-1&&Br(n[l+1])){let d=r();d.setFormat(s),d.append(...a),i.push(d),a=[]}}return i}var ve=th,{$appendNodeToHTML:wB,$distributeInlineWrapper:XE,$generateDOMFromNodes:kB,$generateDOMFromRoot:IB,$generateHtmlFromNodes:qE,$generateNodesFromDOM:JE,$generateNodesFromDOMViaExtension:ZE,$getImportContextValue:LB,$getRenderContextValue:FB,$getSessionDOMRenderConfig:PB,$inlineStylesFromStyleSheets:BB,$isBlockLevel:QE,$propagateTextAlignToBlockChildren:nd,$setRenderContextValue:KB,$updateRenderContextValue:zB,$withImportContext:UB,$withRenderContext:HB,BlockSchema:eT,CoreImportExtension:ao,CoreImportRules:WB,DOMImportExtension:Vo,DOMRenderExtension:GB,HorizontalRuleImportExtension:jB,HorizontalRuleImportRules:YB,ImportOverlays:tT,ImportSource:nT,ImportSourceDataTransfer:oT,ImportTextFormat:nh,ImportTextStyle:oh,ImportWhitespaceConfig:VB,InlineSchema:XB,NestedBlockSchema:qB,RenderContextExport:JB,RenderContextRoot:ZB,RootSchema:QB,contextUpdater:eK,contextValue:Yi,createImportState:tK,createRenderState:nK,defaultIsInline:oK,defaultPreservesWhitespace:rK,defineImportRule:ut,defineOverlayRules:rh,domOverride:sK,isElementOfTag:sh,parseSelector:iK,sel:dt}=ve;var uh={};Ne(uh,{$exportMimeTypeFromSelection:()=>Ew,$generateJSONFromSelectedNodes:()=>gT,$generateNodesFromSerializedNodes:()=>pT,$getClipboardDataFromSelection:()=>hT,$getHtmlContent:()=>lh,$getLexicalContent:()=>ch,$handlePlainTextDrop:()=>yw,$handleRichTextDrop:()=>Cw,$insertDataTransferForPlainText:()=>cT,$insertDataTransferForRichText:()=>uT,$insertGeneratedNodes:()=>sd,$writeDragSourceToDataTransfer:()=>xw,ClipboardDOMImportExtension:()=>_w,ClipboardImportExtension:()=>ah,DEFAULT_IMPORT_MIME_TYPE:()=>rd,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>od,GetClipboardDataExtension:()=>yT,caretFromPoint:()=>iT,copyToClipboard:()=>Sw,setLexicalClipboardDataTransfer:()=>mT});function iT(e,n,r=null){let s=Is(r),i=r?mS(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(Ou(l)){let c=l.elementFromPoint(e,n);if(c!==null&&r.contains(c)){let d=function(f,g,p,m){let _=m.createRange(),y=(z)=>g<z.top?z.top-g:g>z.bottom?g-z.bottom:0,x=(z)=>f<z.left?z.left-f:f>z.right?f-z.right:0,E=m.createTreeWalker(p,NodeFilter.SHOW_TEXT),b=null,R=1/0,M=1/0;for(let z=E.nextNode();z;z=E.nextNode()){_.selectNodeContents(z);for(let K of _.getClientRects()){let H=y(K),q=x(K);(H<R||H===R&&q<M)&&(R=H,M=q,b=z)}}if(b===null)return null;let k=0,P=1/0,F=1/0;for(let z=0;z<=b.length;z++){_.setStart(b,z),_.collapse(!0);let K=_.getBoundingClientRect(),H=y(K),q=Math.abs(f-K.left);(H<P||H===P&&q<F)&&(P=H,F=q,k=z)}return{node:b,offset:k}}(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 Xi(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 od={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function aT(e){if(window.trustedTypes&&window.trustedTypes.createPolicy)return window.trustedTypes.createPolicy("lexical",{createHTML:(n)=>n}).createHTML(e);return e}var rT=(e,n)=>{if(!G(n))return n.insertRawText(e),!0;let r=(s)=>{let i=V();G(i)&&s(i)};return Bi(e,{linebreak:()=>r((s)=>s.insertParagraph()),tab:()=>r((s)=>s.insertNodes([dn()])),text:(s)=>r((i)=>i.insertText(s))}),!0},rd={"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 sd(s,pT(i.nodes),n),!0}catch(s){console.error(s)}return r()}],"text/html":[(e,n,r)=>{try{let s=Ge(),i=new DOMParser().parseFromString(aT(e),"text/html");return sd(s,JE(s,i),n),!0}catch(s){return console.error(s),r()}}],"text/plain":[rT],"text/uri-list":[rT]};function hw(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 lT(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)&&hw(e.$importMimeType[i],a,r,n)))return!0}return!1}var mw={$importMimeType:rd,$insertDataTransfer:(e,n)=>lT({$importMimeType:rd,priority:od},e,n),priority:od},ah=me({build:(e,n)=>({$importMimeType:n.$importMimeType,$insertDataTransfer:(r,s)=>lT(n,r,s),priority:n.priority}),config:We({$importMimeType:rd,priority:od}),mergeConfig(e,n){let r=Kt(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"}),_w=me({dependencies:[ao,GN(ah,{$importMimeType:{"text/html":[(e,n,r,s)=>{let i=new DOMParser().parseFromString(aT(e),"text/html"),a=ZE(i,{context:[Yi(nT,"paste"),Yi(oT,s)]});return sd(Ge(),a,n),!0}]}})],name:"@lexical/clipboard/DOMImport"});function lh(e,n=V()){return n==null&&Xi(166),G(n)&&n.isCollapsed()||n.getNodes().length===0?"":qE(e,n)}function ch(e,n=V()){return n==null&&Xi(166),G(n)&&n.isCollapsed()||n.getNodes().length===0?null:JSON.stringify(gT(e,n))}function cT(e,n){let r=e.getData("text/plain")||e.getData("text/uri-list");r!=null&&n.insertRawText(r)}function uT(e,n,r){(function(){let s=BN(ah.name);return s?s.output:mw})().$insertDataTransfer(e,n)}var dT="application/x-lexical-drag";function xw(e,n){let r={editorKey:n.getKey()};e.setData(dT,JSON.stringify(r))}function fT(e,n,r){let s=e.dataTransfer;if(s===null)return!1;let i=function(f){let g=f.getData(dT);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=iT(f.clientX,f.clientY,g.getRootElement());if(p===null)return null;let m=bt(p.node);if(m===null)return null;if(oe(m))return Vc(m,"next",p.offset);if(J(m))return Pg(m,p.offset,"next");let _=m.getParent();return _===null?null:Pg(_,m.getIndexWithinParent()+1,"next")}(e,n);if(a===null)return!1;let l=Jc(a);if(l===null)return!1;let c=i.editorKey===n.getKey(),d=V();if(c){if(!G(d)||d.isCollapsed())return!1;if(function(f,g){let{anchor:p,focus:m}=lr(ar(g),"next");return Lr(p,f)<0&&Lr(f,m)<0}(a,d))return e.preventDefault(),!0;d.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(r(s,$n(As(l)),n),!c){let f=n.getRootElement(),g=f?f.ownerDocument:null,p=g?function(m,_){for(let y of fS(_)){let x=Tu(y);if(Au(x)&&x.getKey()===m&&Ce(y))return y}return null}(i.editorKey,g):null;p!==null&&p.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function Cw(e,n){return fT(e,n,uT)}function yw(e,n){return fT(e,n,(r,s)=>cT(r,s))}function sd(e,n,r){e.dispatchCommand(Cu,{nodes:n,selection:r})||(r.insertNodes(n),function(s){if(G(s)&&s.isCollapsed()){let i=s.anchor,a=null,l=cn(i,"previous");if(l)if(zr(l))a=l.origin;else{let c=Jn(l,Tt(Je(),"next").getFlipped());for(let d of c){if(oe(d.origin)){a=d.origin;break}if(J(d.origin)&&!d.origin.isInline())break}}if(a&&oe(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 ih(e,n,r,s=[]){let i=n===null||r.isSelected(n),a=J(r)&&r.excludeFromCopy("html"),l=r;n!==null&&oe(l)&&(l=Ps(n,l,"clone"));let c=J(l)?l.getChildren():[],d=function(g){let p=g.exportJSON(),m=g.constructor;if(p.type!==m.getType()&&Xi(58,m.name),J(g)){let _=p.children;Array.isArray(_)||Xi(59,m.name)}return p}(l);oe(l)&&l.getTextContentSize()===0&&(i=!1);let f=i&&Ze(n)&&J(r)?null:n;for(let g=0;g<c.length;g++){let p=c[g],m=ih(e,f,p,d.children);!i&&J(r)&&m&&r.extractWithChild(p,n,"clone")&&(i=!0)}if(i&&!a){let g=Rs(l);if(g.length>0){let p={};for(let m of g){let _=yi(l,m);_===null&&Xi(366,l.constructor.name,m);let y=[];ih(e,null,_,y),y.length===1&&y[0].type===_.getType()||Xi(385,m,l.constructor.name,String(y.length),String(y.length>0?y[0].type:"none")),p[m]=y[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 gT(e,n){let r=[],s=Je(),i=G(n)?n.anchor.getNode():Ze(n)?n.getNodes()[0]??null:null,a=i!==null?Zn(i):null,l=(J(a)?a:s).getChildren();for(let c=0;c<l.length;c++)ih(e,n,l[c],r);return{namespace:e._config.namespace,nodes:r}}function pT(e){let n=[];for(let r of e)n.push(zy(r));return n}var Vi=null;async function Sw(e,n,r){if(Vi!==null)return!1;if(n!==null)return new Promise((f,g)=>{e.update(()=>{f(sT(e,n,r))})});let s=e.getRootElement(),i=e._window||window,a=i.document,l=In(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(Ei,(m)=>(Ln(m,ClipboardEvent)&&(p(),Vi!==null&&(i.clearTimeout(Vi),Vi=null),f(sT(e,m,r))),!0),Ni);Vi=i.setTimeout(()=>{p(),Vi=null,f(!1)},50),a.execCommand("copy"),c.remove()})}function sT(e,n,r){if(r===void 0){let i=In(e._window),a=V();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&&!bS(e,c,d))return!1;r=hT(a)}n.preventDefault();let s=n.clipboardData;return s!==null&&(mT(s,r),!0)}var Nw=[["text/html",lh],["application/x-lexical-editor",ch]];function hT(e=V()){return function(n,r){let s={"text/plain":""};for(let[i,a]of Object.entries(n))if(a){let l=CT(a,r);l!==null&&(s[i]=l)}return s}(_T(),e)}function mT(e,n){for(let[r]of Nw)n[r]===void 0&&e.setData(r,"");for(let r in n){let s=n[r];s!==void 0&&e.setData(r,s)}}function _T(e=Ge()){let n=io(e,yT.name);return n?n.output:xT}var xT={"application/x-lexical-editor":[(e,n)=>e?ch(Ge(),e):n()],"text/html":[(e,n)=>e?lh(Ge(),e):n()],"text/plain":[(e,n)=>e?e.getTextContent():n()]};function CT(e,n){let r=(s)=>e[s]?e[s](n,r.bind(null,s-1)):null;return r(e.length-1)}function Ew(e,n=V()){return CT(_T()[e]||[],n)}var yT=me({build:(e,n,r)=>n.$exportMimeType,config:We({$exportMimeType:xT}),mergeConfig(e,n){let r=Kt(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=uh,{$exportMimeTypeFromSelection:gK,$generateJSONFromSelectedNodes:pK,$generateNodesFromSerializedNodes:hK,$getClipboardDataFromSelection:id,$getHtmlContent:mK,$getLexicalContent:_K,$handlePlainTextDrop:xK,$handleRichTextDrop:ST,$insertDataTransferForPlainText:CK,$insertDataTransferForRichText:dh,$insertGeneratedNodes:yK,$writeDragSourceToDataTransfer:NT,ClipboardDOMImportExtension:SK,ClipboardImportExtension:NK,DEFAULT_IMPORT_MIME_TYPE:EK,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:TK,GetClipboardDataExtension:bK,caretFromPoint:ad,copyToClipboard:wl,setLexicalClipboardDataTransfer:ET}=It;var gh={};Ne(gh,{$createHeadingNode:()=>Zi,$createQuoteNode:()=>Il,$isHeadingNode:()=>Dw,$isQuoteNode:()=>Rw,DRAG_DROP_PASTE:()=>fh,HeadingNode:()=>Ll,QuoteNode:()=>kl,RichTextExtension:()=>$T,RichTextImportExtension:()=>Aw,RichTextImportRules:()=>DT,ShadowRootQuoteRule:()=>vw,eventFiles:()=>Bs,quoteShadowRootState:()=>dd,registerRichText:()=>wT});var Tw=ut({$import:(e,n)=>{let r=Zi(n.nodeName.toLowerCase());return Jr(n,r),Qn(r,n),Nn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:dt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"}),bw=ut({$import:(e,n)=>{let r=Il();return Qn(r,n),Jr(n,r),Nn(r,n),[r.splice(0,0,e.$importChildren(n))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote"}),vw=ut({$import:(e,n)=>{let r=Il({shadowRoot:!0});return Qn(r,n),Jr(n,r),Nn(r,n),[r.splice(0,0,e.$importChildren(n,{schema:eT}))]},match:dt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"}),DT=[Tw,bw,ut({$import:(e,n,r)=>{let s=n.firstChild;return s&&(Ce(i=s)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt")?e.$importChildren(n):r();var i},match:dt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"}),ut({$import:(e,n,r)=>n.style.fontSize!=="26pt"?r():[Zi("h1").splice(0,0,e.$importChildren(n))],match:dt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"})];function Ow(e,n){return e&&n!==null?Kt(e,n):n}var $T=me({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:[eE,HN,WN,ao,nn(Vo,{rules:DT})],mergeConfig:function(e,n){let r=Kt(e,n);return n.escapeFormatTriggers&&(r.escapeFormatTriggers=function(s,i){let a=Kt(s,i);for(let l of Object.keys(i))a[l]=Ow(s[l],i[l]);return a}(e.escapeFormatTriggers,n.escapeFormatTriggers)),r},name:"@lexical/rich-text",nodes:()=>[Ll,kl],register:(e,n,r)=>St(()=>wT(e,r.getOutput().escapeFormatTriggers))}),Aw=me({dependencies:[$T],name:"@lexical/rich-text/Import"}),fh=En("DRAG_DROP_PASTE_FILE"),dd=jo("shadowRoot",{parse:Boolean});class kl extends lt{$config(){return this.config("quote",{extends:lt,importDOM:{blockquote:()=>({conversion:Mw,priority:0})},stateConfigs:[{flat:!0,stateConfig:dd}]})}isShadowRoot(){return Po(this,dd)}setIsShadowRoot(e){return eo(this,dd,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(Ce(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=ye(),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=ye();return this.getChildren().forEach((n)=>e.append(n)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Il(e){let n=ln(new kl);return e&&e.shadowRoot?n.setIsShadowRoot(!0):n}function Rw(e){return e instanceof kl}class Ll extends lt{__tag;$config(){return this.config("heading",{extends:lt,importDOM:{h1:()=>({conversion:qi,priority:0}),h2:()=>({conversion:qi,priority:0}),h3:()=>({conversion:qi,priority:0}),h4:()=>({conversion:qi,priority:0}),h5:()=>({conversion:qi,priority:0}),h6:()=>({conversion:qi,priority:0}),p:(e)=>{let n=e.firstChild;return n!==null&&TT(n)?{conversion:()=>({node:null}),priority:3}:null},span:(e)=>TT(e)?{conversion:()=>({node:Zi("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(Ce(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?ye():Zi(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,n),r===0&&!this.isEmpty()&&e){let l=ye();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=ye();this.getChildren().forEach((n)=>e.append(n)),this.replace(e)}return!0}extractWithChild(){return!0}}function TT(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function qi(e){let n=e.nodeName.toLowerCase(),r=null;return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6"||(r=Zi(n),Jr(e,r),Qn(r,e),Nn(r,e)),{node:r}}function Mw(e){let n=Il();return Qn(n,e),Jr(e,n),Nn(n,e),{node:n}}function Zi(e="h1"){return ln(new Ll(e))}function Dw(e){return e instanceof Ll}function bT(e){let n=bt(e);return $t(n)}function Ji(e,n,r,s){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type==="text"){let c=e.anchor.getNode();if(oe(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&&oe(a)&&a.hasFormat(f)))continue;l=!0}e.hasFormat(f)&&e.toggleFormat(f)}l&&e.setStyle("")}var $w={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function ld(e,n){return function(r,s){if(!r.isCollapsed())return!1;let i=cn(r.focus,s),a=pe(i.origin,qc);if(!a)return!1;let l=r.focus.getNode();if(!a.is(l)&&!il(l,a))return!1;let c=Jn(i,it(a,s));if(c.getTextSlices().some((p)=>p&&p.getTextContentSize()>0))return!1;let d=Jn(c.anchor.getSiblingCaret(),c.focus),f=d.anchor.origin;for(let p of d){if(!yo(p)||!p.origin.is(f.getParent()))return!1;f=p.origin}let g=a;for(let p of vs(it(a,s))){if(!p.origin.is(g.getParent())){if(By(p.origin)){let m=it(g,s);return $n(Jn(m,m)),!0}break}if(!qc(p.origin))break;g=p.origin}return!1}(e,n)||function(r,s){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;let i=cn(r.anchor,s).getNodeAtCaret();return!(!qc(i)||i.isInline()||($n(As(kt(Tt(i,s)))),0))}(e,n)}function vT(e){return $t(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function cd(e){let n=jc();n.add(e),pt(n)}function OT(e,n){if(!e.isCollapsed())return!1;let r=e.focus,s=r.getNode(),i=n?"previous":"next",a=cn(r,i);if(r.type==="element"&&J(s)&&Mt(s)){let b=a.getNodeAtCaret();return!(b===null||!vT(b))&&(cd(b.__key),!0)}let l=pe(J(s)?s:s.getParentOrThrow(),(b)=>J(b)&&!b.isInline()&&Mt(b.getParent()));if(l===null)return!1;let c=it(l,i).getNodeAtCaret();if(c===null||!vT(c))return!1;if(l.getTextContentSize()===0)return cd(c.__key),!0;let d=Ge().getRootElement();if(d===null)return!1;let f=In(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:y,anchorOffset:x}=f;if(y===null)return AT(f,g,p,m,_),!1;let E=bt(y);if(AT(f,g,p,m,_),E===null)return!1;if(y===g&&x===p)return cd(c.__key),!0;return!E.is(l)&&!il(E,l)&&(cd(c.__key),!0)}function AT(e,n,r,s,i){n!==null&&s!==null&&e.setBaseAndExtent(n,r,s,i)}function RT(e,n){if(!e.isCollapsed())return!1;let r=e.focus.getNode(),s=pe(J(r)?r:r.getParentOrThrow(),(E)=>J(E)&&!E.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 E of s.getChildren())if(J(E)&&E.isInline()){let b=i.getElementByKey(E.getKey());if(b!==null){let R=l.getComputedStyle(b).display;if(R==="inline-grid"||R==="inline-flex"){c=!0;break}}}if(!c)return!1;let d=it(s,n?"previous":"next").getNodeAtCaret();if(d===null||!J(d)){if(n){let E=s.getFirstDescendant();oe(E)?E.select(0,0):s.select(0,0)}else{let E=s.getLastDescendant();if(oe(E)){let b=E.getTextContentSize();E.select(b,b)}else{let b=s.getChildrenSize();s.select(b,b)}}return!0}let f=i.getElementByKey(d.getKey());if(f===null)return!1;let g=In(l);if(g===null||g.rangeCount===0)return!1;let p=g.getRangeAt(0).cloneRange();p.collapse(!0);let m=p.getBoundingClientRect(),_=f.getBoundingClientRect(),y=_.top+_.height/2;if(m.height>0){let E=ad(m.left,y,a);if(E!==null&&f.contains(E.node)){let b=a.ownerDocument.createRange();return b.setStart(E.node,E.offset),b.collapse(!0),e.applyDOMRange(b),e.dirty=!0,!0}}let x=n?d.getLastDescendant():d.getFirstDescendant();if(oe(x)){let E=n?x.getTextContentSize():0;x.select(E,E)}else{let E=d.getChildrenSize();d.select(n?E:0,n?E:0)}return!0}function ud(e,n){let r=it(e,n),s=r.getAdjacentCaret();s!==null&&J(s.origin)&&!s.origin.isInline()&&s.origin.isShadowRoot()?$n(As(r)):n==="next"?e.selectNext(0,0):e.selectPrevious()}function MT(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(Lr),a=(n?i[0]:i[i.length-1]).origin,l=pe(a,(d)=>d!==a&&J(d)&&!d.isInline())??Je(),c=n?0:l.getChildrenSize();return l.select(c,c),!0}function wT(e,n=zs($w)){return De(e.registerCommand(Si,()=>{let r=V();return Ze(r)?(r.clear(),!0):(G(r)&&Ji(r,"click","both",n.peek()),!1)},be),e.registerCommand(Ti,(r)=>{let s=V();return G(s)?(s.deleteCharacter(r),!0):!!Ze(s)&&(s.deleteNodes(),!0)},be),e.registerCommand(iu,(r)=>{let s=V();return!!G(s)&&(s.deleteWord(r),!0)},be),e.registerCommand(su,(r)=>{let s=V();return!!G(s)&&(s.deleteLine(r),!0)},be),e.registerCommand(nu,(r)=>{let s=V();if(typeof r=="string")s!==null&&s.insertText(r);else{if(s===null)return!1;let i=r.dataTransfer;if(i!=null)dh(i,s,e);else if(G(s)){let a=r.data;return a&&s.insertText(a),!0}}return!0},be),e.registerCommand(aS,()=>{let r=V();return!!G(r)&&(r.removeText(),!0)},be),e.registerCommand(Ho,(r)=>{let s=V();return!(!G(s)&&!Ze(s))&&(My(s,r),!0)},be),e.registerCommand(lS,(r)=>{let s=V();return!(!G(s)&&!Ze(s))&&(Hy(s,r),!0)},be),e.registerCommand(lu,(r)=>{let s=V();if(!G(s)&&!Ze(s))return!1;let i=s.getNodes();for(let a of i){let l=pe(a,(c)=>J(c)&&!c.isInline());l!==null&&l.setFormat(r)}return!0},be),e.registerCommand(Gg,(r)=>{let s=V();return!!G(s)&&(s.insertLineBreak(r),!0)},be),e.registerCommand(Wr,()=>{let r=V();return!!G(r)&&(r.insertParagraph(),!0)},be),e.registerCommand($s,()=>{let r=dn(),s=V();return G(s)&&(r.setFormat(s.format),r.setStyle(s.style)),Xc([r]),!0},be),e.registerCommand(to,()=>bl((r)=>{let s=r.getIndent();r.setIndent(s+1)}),be),e.registerCommand(Go,()=>bl((r)=>{let s=r.getIndent();s>0&&r.setIndent(Math.max(0,s-1))}),be),e.registerCommand(no,(r)=>{let s=V();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),ud(i[0],"previous"),!0}else if(G(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===0}(s))return r.preventDefault(),!0;if(!r.shiftKey&&ld(s,"previous"))return r.preventDefault(),!0;if(!r.shiftKey&&OT(s,!0))return r.preventDefault(),!0;if(!r.shiftKey&&RT(s,!0))return r.preventDefault(),!0}return!1},be),e.registerCommand(Wo,(r)=>{let s=V();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),ud(i[0],"next"),!0}else if(G(s)){if(function(i){let a=i.focus;return a.key==="root"&&a.offset===Je().getChildrenSize()}(s))return r.preventDefault(),!0;if(!r.shiftKey&&ld(s,"next"))return r.preventDefault(),!0;if(!r.shiftKey&&OT(s,!1))return r.preventDefault(),!0;if(!r.shiftKey&&RT(s,!1))return r.preventDefault(),!0}return!1},be),e.registerCommand(Gr,(r)=>{let s=V();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),ud(i[0],El(i[0])?"next":"previous"),!0}if(!G(s))return!1;if(!r.shiftKey&&ld(s,El(s.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Ji(s,"arrow","start",n.peek()),lp(s,!0)){let i=r.shiftKey;return r.preventDefault(),ap(s,i,!0),!0}return!1},be),e.registerCommand(Oi,(r)=>{let s=V();if(Ze(s)){let i=s.getNodes();if(i.length>0)return r.preventDefault(),ud(i[0],El(i[0])?"previous":"next"),!0}if(!G(s))return!1;if(!r.shiftKey&&ld(s,El(s.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Ji(s,"arrow","end",n.peek()),lp(s,!1)){let i=r.shiftKey;return r.preventDefault(),ap(s,i,!1),!0}return!1},be),e.registerCommand(Ai,(r)=>{let s=V();if(!Ze(s)&&bT(r.target))return!1;if(G(s)){if(function(i){if(!i.isCollapsed())return!1;let{anchor:a}=i;if(a.offset!==0)return!1;let l=a.getNode();if(Co(l))return!1;let c=wu(l);return c.getIndent()>0&&(c.is(l)||l.is(c.getFirstDescendant()))}(s))return r.preventDefault(),e.dispatchCommand(Go);if(hl&&dl)return!1}else if(!Ze(s))return!1;return r.preventDefault(),e.dispatchCommand(Ti,!0)},be),e.registerCommand(pu,(r)=>{let s=V();return!(!Ze(s)&&bT(r.target))&&(!(!G(s)&&!Ze(s))&&(r.preventDefault(),e.dispatchCommand(Ti,!1)))},be),e.registerCommand(Ri,(r)=>{let s=V();if(Ze(s)){let i=s.getNodes();i.length===1&&$t(i[0])&&!i[0].isInline()&&(s=i[0].selectNext())}if(!G(s))return!1;if(Ji(s,"enter","both",n.peek()),r!==null){if((hl||du||uu)&&dl)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(Gg,!1)}return e.dispatchCommand(Wr)},be),e.registerCommand(Mi,()=>{let r=V();return!!G(r)&&(e.blur(),!0)},be),e.registerCommand(Zy,(r)=>{let[,s]=Bs(r);if(s.length>0){let{clientX:i,clientY:a}=r,l=ad(i,a,e.getRootElement());if(l!==null){let{offset:c,node:d}=l,f=bt(d);if(f!==null){let g=Fr();if(oe(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=Ko(g);pt(p)}e.dispatchCommand(fh,s)}return r.preventDefault(),!0}return ST(r,e)},be),e.registerCommand(Jy,(r)=>{let[s]=Bs(r),i=V();return!(s&&!G(i))&&(G(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(ET(r.dataTransfer,id(i)),NT(r.dataTransfer,e)),!0)},be),e.registerCommand(qy,(r)=>{let[s]=Bs(r),i=V();if(s&&!G(i))return!1;let{clientX:a,clientY:l}=r,c=ad(a,l,e.getRootElement());if(c!==null){let d=bt(c.node);$t(d)&&r.preventDefault()}return!0},be),e.registerCommand(ki,()=>{let r=V();return Ur(G(r)&&Zn(r.anchor.getNode())!==null?r:null),!0},be),e.registerCommand(Ei,(r)=>(wl(e,Ln(r,ClipboardEvent)?r:null),!0),be),e.registerCommand(ou,(r)=>(async function(s,i){await wl(i,Ln(s,ClipboardEvent)?s:null),i.update(()=>{let a=V();G(a)?a.removeText():Ze(a)&&a.getNodes().forEach((l)=>l.remove())},{tag:ru})}(r,e),!0),be),e.registerCommand($i,(r)=>{let[,s,i]=Bs(r);if(s.length>0&&!i)return e.dispatchCommand(fh,s),!0;if(ro(r.target)&&Py(r.target))return!1;return V()!==null&&(function(a,l){a.preventDefault(),l.update(()=>{let c=V(),d=Ln(a,InputEvent)||Ln(a,KeyboardEvent)?null:a.clipboardData;d!=null&&c!==null&&dh(d,c,l)},{tag:mu})}(r,e),!0)},be),e.registerCommand(hu,()=>{let r=V();return G(r)&&Ji(r,"space","both",n.peek()),!1},be),e.registerCommand(jr,()=>{let r=V();return G(r)&&Ji(r,"tab","both",n.peek()),!1},be),e.registerCommand(yl,(r)=>{let s=V();if(Ze(s))return MT(s,!1,r);if(!G(s))return!1;let{anchor:i}=s;if(i.type!=="element"||i.offset!==0)return!1;let a=i.getNode();if(!J(a))return!1;let l=a.getFirstChild();if(!$t(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},be),e.registerCommand(Di,(r)=>{let s=V();if(Ze(s))return MT(s,!0,r);if(!G(s))return!1;let{anchor:i,focus:a}=s,l=pe(a.getNode(),(f)=>J(f)&&!f.isInline());if(l===null)return!1;let c=l.getFirstChild();if(!$t(c)||!c.isInline())return!1;if(pe(i.getNode(),(f)=>J(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)},be))}var Tn=gh,{$createHeadingNode:fd,$createQuoteNode:gd,$isHeadingNode:Fl,$isQuoteNode:pd,DRAG_DROP_PASTE:IK,HeadingNode:hd,QuoteNode:md,RichTextExtension:LK,RichTextImportExtension:FK,RichTextImportRules:PK,ShadowRootQuoteRule:BK,eventFiles:KK,quoteShadowRootState:zK,registerRichText:kT}=Tn;var hh={};Ne(hh,{RichTextPlugin:()=>Lw});C();function ww(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 ph=fn?He:h;function kw({editor:e,ErrorBoundary:n}){return function(r,s){let[i,a]=u(()=>r.getDecorators());return ph(()=>r.registerDecoratorListener((l)=>{Mn(()=>{a(l)})}),[r]),h(()=>{a(r.getDecorators())},[r]),O(()=>{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(ja,{fallback:null,children:i[f]})}),p=r.getElementByKey(f);p!==null&&l.push(Ts(g,p,f))}return l},[s,i,r])}(e,n)}function Iw({editor:e,ErrorBoundary:n}){return function(r){let s=UN.maybeFromEditor(r);if(s&&s.hasExtensionByName(VN.name)){for(let i of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(i)&&ww(320,i);return!0}return!1}(e)?null:t(kw,{editor:e,ErrorBoundary:n})}function IT(e){return e.read("latest",Yu(e.isComposing()))}function Lw({contentEditable:e,placeholder:n=null,ErrorBoundary:r}){let[s]=st();return function(i){ph(()=>De(kT(i),tE(i)),[i])}(s),o(B,{children:[e,t(Fw,{content:n}),t(Iw,{editor:s,ErrorBoundary:r})]})}function Fw({content:e}){let[n]=st(),r=function(i){let[a,l]=u(()=>IT(i));return ph(()=>{function c(){let d=IT(i);l(d)}return c(),De(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a}(n),s=AS();return r?typeof e=="function"?e(s):e:null}var Pw=hh,LT=Pw.RichTextPlugin;var mh={};Ne(mh,{ContentEditable:()=>Kw,ContentEditableElement:()=>BT});C();var PT=fn?He:h;function Bw({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:y,id:x,role:E="textbox",spellCheck:b=!0,style:R,tabIndex:M,"data-testid":k,...P},F){let[z,K]=u(e.isEditable()),H=N((W)=>{W&&W.ownerDocument&&W.ownerDocument.defaultView?e.setRootElement(W):e.setRootElement(null)},[e]),q=O(()=>function(...W){return(te)=>{for(let Z of W)typeof Z=="function"?Z(te):Z!=null&&(Z.current=te)}}(F,H),[H,F]);return PT(()=>(K(e.isEditable()),e.registerEditableListener((W)=>{K(W)})),[e]),t("div",{"aria-activedescendant":z?n:void 0,"aria-autocomplete":z?r:"none","aria-controls":z?s:void 0,"aria-describedby":i,...a!=null?{"aria-errormessage":a}:{},"aria-expanded":z&&E==="combobox"?!!l:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":g,"aria-owns":z?p:void 0,"aria-readonly":!z||void 0,"aria-required":m,autoCapitalize:_,className:y,contentEditable:z,"data-testid":k,id:x,ref:q,role:E,spellCheck:b,style:R,tabIndex:M??(z?void 0:-1),...P})}var BT=D(Bw);function FT(e){return e.read("latest",Yu(e.isComposing()))}var Kw=D(zw);function zw(e,n){let{placeholder:r,...s}=e,[i]=st();return o(B,{children:[t(BT,{editor:i,...s,ref:n}),r!=null&&t(Uw,{editor:i,content:r})]})}function Uw({content:e,editor:n}){let r=function(l){let[c,d]=u(()=>FT(l));return PT(()=>{function f(){let g=FT(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 KT=mh,{ContentEditable:zT,ContentEditableElement:iz}=KT;var _h={};Ne(_h,{HistoryExtension:()=>_d,SharedHistoryExtension:()=>Gw,createEmptyHistoryState:()=>WT,registerHistory:()=>HT});function Hw(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(!(G(a)&&G(l)&&l.isCollapsed()&&a.isCollapsed()))return 0;let c=function(b,R,M){let k=b._nodeMap,P=[];for(let F of R){let z=k.get(F);z!==void 0&&P.push(z)}for(let[F,z]of M){if(!z)continue;let K=k.get(F);K===void 0||Co(K)||P.push(K)}return P}(n,r,s);if(c.length===0)return 0;if(c.length>1){let b=n._nodeMap,R=b.get(a.anchor.key),M=b.get(l.anchor.key);return R&&M&&!e._nodeMap.has(R.__key)&&oe(R)&&R.__text.length===1&&a.anchor.offset===1?2:0}let d=c[0],f=e._nodeMap.get(d.__key);if(!oe(f)||!oe(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 y=m.offset,x=_.offset,E=p.length-g.length;return E===1&&x===y-1?2:E===-1&&x===y+1?3:E===-1&&x===y?4:0}function Ww(e,n,r){let s=r(),i=0,a=s,l=0,c=null;return(d,f,g,p,m,_)=>{let y=r();if(_.has(tu)&&(a=s,l=i,c=d),_.has(vi))return i=0,s=y,2;_.has(eu)&&c&&(s=a,i=l,d=c);let x=_.has(mu)||_.has(ru)?0:Hw(d,f,p,m,e.isComposing()),E=(()=>{let b=g===null||g.editor===e,R=_.has(cu);if(!R&&b&&_.has(Hr))return 0;if(x===1)return 2;if(d===null)return 1;let M=f._selection;if(!(p.size>0||m.size>0))return M!==null?0:2;let k=typeof n=="number"?n:n.peek();if(R===!1&&x!==0&&x===i&&y<s+k&&b)return 0;if(p.size===1){if(function(P,F,z){let K=F._nodeMap.get(P),H=z._nodeMap.get(P),q=F._selection,W=z._selection;return!(G(q)&&G(W)&&q.anchor.type==="element"&&q.focus.type==="element"&&W.anchor.type==="text"&&W.focus.type==="text"||!oe(K)||!oe(H)||K.__parent!==H.__parent)&&JSON.stringify(F.read(()=>K.exportJSON()))===JSON.stringify(z.read(()=>H.exportJSON()))}(Array.from(p)[0],d,f))return 0}return 1})();return s=y,i=x,E}}function UT(e,n){e.undoStack=[],e.redoStack=[],e.current=null,n&&n(e)}function HT(e,n,r,s=Date.now,i,a=null){let l=Ww(e,r,s),c=()=>{i&&i(n)};return c(),De(e.registerCommand(Nu,()=>(function(d,f,g){let{redoStack:p,undoStack:m}=f;if(m.length!==0){let _=f.current,y=m.pop();_!==null&&(p.push(_),d.dispatchCommand(Ms,!0)),m.length===0&&d.dispatchCommand(Ds,!1),f.current=y||null,g&&g(f),y&&y.editor.setEditorState(y.editorState,{tag:vi})}}(e,n,i),!0),be),e.registerCommand(_u,()=>(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 y=p.pop();p.length===0&&d.dispatchCommand(Ms,!1),f.current=y||null,g&&g(f),y&&y.editor.setEditorState(y.editorState,{tag:vi})}}(e,n,i),!0),be),e.registerCommand(Zc,()=>(UT(n,i),!1),be),e.registerCommand(jy,()=>(UT(n,i),e.dispatchCommand(Ms,!1),e.dispatchCommand(Ds,!1),!0),be),e.registerUpdateListener(({editorState:d,prevEditorState:f,dirtyLeaves:g,dirtyElements:p,tags:m})=>{let{current:_,redoStack:y,undoStack:x}=n,E=_===null?null:_.editorState;if(_!==null&&d===E)return;let b=l(f,d,_,g,p,m);if(b===1){if(y.length!==0&&(n.redoStack=[],e.dispatchCommand(Ms,!1)),_!==null){x.push({..._});let R=typeof a=="number"||a===null?a:a.peek();R!==null&&x.length>R&&x.splice(0,x.length-R),e.dispatchCommand(Ds,!0)}}else if(b===2)return;n.current={editor:e,editorState:d},c()}))}function WT(){return{current:null,redoStack:[],undoStack:[]}}var _d=me({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:WT,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)=>kp(()=>{s.value=c!=null&&c.undoStack.length>0,i.value=c!=null&&c.redoStack.length>0});return St(()=>{if(!a.disabled.value)return HT(e,a.historyState.value,a.delay,()=>a.now.peek()(),l,a.maxDepth);l(null)})}}),Gw=me({build:(e,{disabled:n,parentEditor:r})=>Dt({disabled:n,parentEditor:r||e._parentEditor}),config:We({disabled:!1,parentEditor:null}),dependencies:[nn(_d,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,n,r)=>St(()=>{let{disabled:s,parentEditor:i}=r.getOutput();if(!s.value){let{output:a}=r.getDependency(_d),l=function(d){return d?io(d,_d.name):null}(i.value);if(!l)return;let c=l.output;kp(()=>{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 xd=_h,{HistoryExtension:uz,SharedHistoryExtension:dz,createEmptyHistoryState:Cd,registerHistory:GT}=xd;var xh={};Ne(xh,{HistoryPlugin:()=>jw,createEmptyHistoryState:()=>Cd});C();function jw({delay:e,externalHistoryState:n}){let[r]=st();return function(s,i,a=1000){let l=O(()=>i||Cd(),[i]);h(()=>GT(s,l,a),[a,s,l])}(r,n,e),null}var jT=xh,{HistoryPlugin:YT,createEmptyHistoryState:_z}=jT;var Eh={};Ne(Eh,{$createListItemNode:()=>To,$createListNode:()=>Eo,$getListDepth:()=>yd,$handleListInsertParagraph:()=>i0,$insertList:()=>Sd,$isListItemNode:()=>Ie,$isListNode:()=>$e,$removeList:()=>r0,CheckListExtension:()=>ek,INSERT_CHECK_LIST_COMMAND:()=>l0,INSERT_ORDERED_LIST_COMMAND:()=>m0,INSERT_UNORDERED_LIST_COMMAND:()=>h0,ListExtension:()=>Nh,ListImportExtension:()=>tk,ListImportRules:()=>g0,ListItemNode:()=>Vs,ListNode:()=>Qi,ListSchema:()=>Qw,REMOVE_LIST_COMMAND:()=>_0,UPDATE_LIST_START_COMMAND:()=>p0,registerCheckList:()=>c0,registerList:()=>x0,registerListStrictIndentTransform:()=>C0});function es(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 yd(e){let n=1,r=e.getParent();for(;r!=null;){if(Ie(r)){let s=r.getParent();if($e(s)){n++,r=s.getParent();continue}es(40)}return n}return n}function Ch(e){let n=e.getParent();$e(n)||es(40);let r=n,s=n;for(;s!==null;)s=s.getParent(),$e(s)&&(r=s);return r}function n0(e){let n=[],r=e.getChildren().filter(Ie);for(let s=0;s<r.length;s++){let i=r[s],a=i.getFirstChild();$e(a)?n=n.concat(n0(a)):n.push(i)}return n}function lo(e){return Ie(e)&&$e(e.getFirstChild())}function o0(e,n){return Ie(e)&&(n.length===0||n.length===1&&e.is(n[0])&&e.getChildrenSize()===0)}function Sd(e){let n=V();if(n!==null){let r=n.getNodes();if(G(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=ye();a.append(d),r=d.select().getNodes()}}else if(o0(a,r)){let c=Eo(e);if(Mt(l)){a.replace(c);let d=To();J(a)&&(d.setFormat(a.getFormatType()),d.setIndent(a.getIndent())),c.append(d)}else if(Ie(a)){let d=a.getParentOrThrow();Ys(c,d.getChildren()),d.replace(c)}return}}let s=new Set;for(let i=0;i<r.length;i++){let a=r[i];if(J(a)&&a.isEmpty()&&!Ie(a)&&!s.has(a.getKey())){VT(a,e);continue}let l=ll(a)?a.getParent():Ie(a)&&a.isEmpty()?a:null;for(;l!=null;){let c=l.getKey();if($e(l)){if(!s.has(c)){let d=Eo(e);Ys(d,l.getChildren()),l.replace(d),s.add(c)}break}{let d=l.getParent();if(Mt(d)&&!s.has(c)){s.add(c),VT(l,e);break}l=d}}}}}function Ys(e,n){e.splice(e.getChildrenSize(),0,n)}function VT(e,n){if($e(e))return e;let r=e.getPreviousSibling(),s=e.getNextSibling(),i=To(),a;if(Ys(i,e.getChildren()),$e(r)&&n===r.getListType())r.append(i),$e(s)&&n===s.getListType()&&(Ys(r,s.getChildren()),s.remove()),a=r;else if($e(s)&&n===s.getListType())s.getFirstChildOrThrow().insertBefore(i),a=s;else{let c=Eo(n);c.append(i),e.replace(c),a=c}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let l=V();return G(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 Sh(e,n){let r=e.getLastChild(),s=n.getFirstChild();r&&s&&lo(r)&&lo(s)&&(Sh(r.getFirstChild(),s.getFirstChild()),s.remove());let i=n.getChildren();i.length>0&&e.append(...i),n.remove()}function r0(){let e=V();if(G(e)){let n=new Set,r=e.getNodes(),s=e.anchor.getNode();if(o0(s,r))n.add(Ch(s));else for(let i=0;i<r.length;i++){let a=r[i];if(ll(a)){let l=ku(a,Vs);l!=null&&n.add(Ch(l))}}for(let i of n){let a=i,l=n0(i);for(let c of l){let d=ye().setTextStyle(e.style).setTextFormat(e.format);Ys(d,c.getChildren()),a.insertAfter(d),a=d,c.__key===e.anchor.key&&Uo(e.anchor,kt(Tt(d,"next"))),c.__key===e.focus.key&&Uo(e.focus,kt(Tt(d,"next"))),c.remove()}i.remove()}}}function s0(e){let n=e.getListType()!=="check",r=e.getStart();for(let s of e.getChildren())Ie(s)&&(s.getValue()!==r&&s.setValue(r),n&&s.getLatest().__checked!=null&&s.setChecked(void 0),$e(s.getFirstChild())||r++)}function Yw(e){let n=new Set;if(lo(e)||n.has(e.getKey()))return;let r=e.getParent(),s=e.getNextSibling(),i=e.getPreviousSibling();if(lo(s)&&lo(i)){let a=i.getFirstChild();if($e(a)){a.append(e);let l=s.getFirstChild();if($e(l))Ys(a,l.getChildren()),s.remove(),n.add(s.getKey())}}else if(lo(s)){let a=s.getFirstChild();if($e(a)){let l=a.getFirstChild();l!==null&&l.insertBefore(e)}}else if(lo(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 XT(e){if(lo(e))return;let n=e.getParent(),r=n?n.getParent():void 0;if($e(r?r.getParent():void 0)&&Ie(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),Ys(d,e.getNextSiblings()),r.insertBefore(a),r.insertAfter(c),r.replace(e)}}}function i0(e=!1){let n=V();if(!G(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),s=null;if(Ie(r)&&r.getChildrenSize()===0)s=r;else if(oe(r)){let f=r.getParent();Ie(f)&&f.getChildren().every((g)=>oe(g)&&g.getTextContent().trim()==="")&&(s=f)}if(s===null)return!1;let i=Ch(s),a=s.getParent();$e(a)||es(40);let l=a.getParent(),c;if(Mt(l))c=ye(),i.insertAfter(c);else{if(!Ie(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(Ie(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||!Ie(p)&&!$e(p))break;g=p}g.remove()}(s),!0}class Vs extends lt{__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)||es(340);let s=[e];for(let i of["previous","next"]){s.reverse();for(let{origin:a}of it(e,i)){if(!Ie(a))break;s.push(a)}}e.insertBefore(r),r.splice(0,0,s),Mt(n)||(Pr(r,zo(it(r,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),n.isEmpty()&&n.isAttached()&&n.remove())}},extends:lt,importDOM:jg({li:()=>({conversion:Vw,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(),y=c.getChildren().some((b)=>$e(b)),x=[];d.listitemChecked!==void 0&&x.push(d.listitemChecked),d.listitemUnchecked!==void 0&&x.push(d.listitemUnchecked),g!==void 0&&x.push(...Pi(g)),x.length>0&&on(a,...x);let E=[];if(f!==void 0&&E.push(...Pi(f)),m){let b=_?d.listitemChecked:d.listitemUnchecked;b!==void 0&&E.push(b)}g!==void 0&&y&&E.push(...Pi(g)),E.length>0&&et(a,...E)}(n,r.theme,this);let s=e?e.__style:"",i=this.__style;s!==i&&cr(n.style,i,s),function(a,l,c){let d=l.__textStyle,f=c?c.__textStyle:"";if(c!==null&&f===d)return;let g=Yr(d);for(let p in g)a.style.setProperty(`--listitem-marker-${p}`,g[p]);if(f!=="")for(let p in Yr(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),lo(this)?{after(i){if(Ce(i)){let a=i.previousElementSibling;if(Ce(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(J(r)&&this.canMergeWith(r)){let s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,n){if(Ie(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&&(J(e)||es(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),n&&J(e)){let a=V();if(G(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)||es(39),Ie(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&&lo(n)&&lo(r)&&(Sh(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(lo(this))return!1;let n=this.getParentOrThrow();if(Ie(n.getParentOrThrow()))return XT(this),!0;let r=ye().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(;Ie(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&es(117),(e=Math.floor(e))>=0||es(199);let n=this.getIndent();for(;n!==e;)n<e?(Yw(this),n++):(XT(this),n--);return this}canInsertAfter(e){return Ie(e)}canReplaceWith(e){return Ie(e)}canMergeWith(e){return Ie(e)||Dn(e)}extractWithChild(e,n){if(!G(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 Eo("bullet")}canMergeWhenEmpty(){return!0}}function Vw(e){if(e.classList.contains("task-list-item")){for(let s of e.children)if(s.tagName==="INPUT")return qT(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 qT(s.children[0])}let n=e.getAttribute("aria-checked"),r=To(n==="true"||n!=="false"&&void 0);return Qn(r,e),{after:a0.bind(null,r),node:Nn(r,e)}}function qT(e){if(e.getAttribute("type")!=="checkbox")return{node:null};let n=To(e.hasAttribute("checked"));return{after:a0.bind(null,n),node:n}}function a0(e,n){let r=n[0];return n.length===1&&Dn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function To(e){return ln(new Vs(void 0,e))}function Ie(e){return e instanceof Vs}class Qi extends lt{__tag;__start;__listType;$config(){return this.config("list",{$transform:(e)=>{(function(n){let r=n.getNextSibling();$e(r)&&n.getListType()===r.getListType()&&Sh(n,r)})(e),s0(e)},extends:lt,importDOM:jg({ol:()=>({conversion:ZT,priority:0}),ul:()=>({conversion:ZT,priority:0})})})}constructor(e="number",n=1,r){super(r);let s=Xw[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,JT(s,e.theme,this),s}updateDOM(e,n,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(JT(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 Ce(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];Ie(a)||(s===r&&(s=[...r]),s[i]=this.createListItemNode().append(!J(a)||$e(a)||a.isInline()?a:Ct(a.getTextContent())))}return super.splice(e,n,s)}extractWithChild(e){return Ie(e)}createListItemNode(){return To()}}function JT(e,n,r){let s=[],i=[],a=n.list;if(a!==void 0){let l=a[`${r.__tag}Depth`]||[],c=yd(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(...Pi(f));for(let y=0;y<l.length;y++)y!==d&&i.push(r.__tag+y)}if(p!==void 0){let y=Pi(p);c>1?s.push(...y):i.push(...y)}}i.length>0&&on(e,...i),s.length>0&&et(e,...s)}function ZT(e){let n;if(function(r){return Ce(r)&&r.nodeName.toLowerCase()==="ol"}(e)){let r=e.start;n=Eo("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(Ce(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(e)?Eo("check"):Eo("bullet");return Nn(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(Ie(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 Xw={ol:"number",ul:"bullet"};function Eo(e="number",n=1){return ln(new Qi(e,n))}function $e(e){return e instanceof Qi}var l0=En("INSERT_CHECK_LIST_COMMAND");function c0(e,n){let r=n&&n.disableTakeFocusOnClick||!1,s=typeof r=="boolean"?()=>r:r.peek.bind(r),i=(f)=>{let g=f.target;if(!Ce(g))return!1;let p=g.__lexicalCheckListLastHandled;return p!==void 0&&f.timeStamp-p<500},a=(f)=>{let g=f.target;Ce(g)&&(g.__lexicalCheckListLastHandled=f.timeStamp)},l=(f)=>{i(f)||(a(f),QT(f,s()))},c=(f)=>{f.pointerType==="touch"&&(i(f)||(a(f),QT(f,s())))},d=(f)=>{(function(g,p){u0(g,()=>{g.preventDefault(),p&&g.stopPropagation()})})(f,s())};return De(e.registerCommand(l0,()=>(Sd("check"),!0),Fe),e.registerCommand(Wo,(f)=>e0(f,e,!1),Fe),e.registerCommand(no,(f)=>e0(f,e,!0),Fe),e.registerCommand(Mi,()=>{if(yh(e)!=null){let f=e.getRootElement();return f!=null&&f.focus(),!0}return!1},Fe),e.registerCommand(hu,(f)=>{let g=yh(e);return!(g==null||!e.isEditable())&&(e.update(()=>{let p=bt(g);Ie(p)&&(f.preventDefault(),p.toggleChecked())}),!0)},Fe),e.registerCommand(Gr,(f)=>e.read("latest",()=>{let g=V();if(G(g)&&g.isCollapsed()){let{anchor:p}=g,m=p.type==="element";if(m||p.offset===0){let _=p.getNode(),y=pe(_,(x)=>J(x)&&!x.isInline());if(Ie(y)){let x=y.getParent();if($e(x)&&x.getListType()==="check"&&(m||y.getFirstDescendant()===_)){let E=e.getElementByKey(y.__key);if(E!=null&&So(E)!==E)return E.focus(),f.preventDefault(),!0}}}}return!1}),Fe),e.registerRootListener((f)=>{if(f!==null)return De(qr(f,{click:l,pointerup:c}),qr(f,{mousedown:d,pointerdown:d},{capture:!0}),so(f,"touchstart",d,{capture:!0,passive:!1}))}))}function u0(e,n){let r=e.target;if(!Ce(r))return;let s=r.firstChild;if(Ce(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/iN(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 QT(e,n){u0(e,()=>{if(Ce(e.target)){let r=e.target,s=bu(r);s!=null&&s.isEditable()&&s.update(()=>{let i=bt(r);Ie(i)&&(n?(ol(yu),ol(cS)):r.focus(),i.toggleChecked())})}})}function yh(e){let n=e.getRootElement(),r=n?So(n):null;return Ce(r)&&r.tagName==="LI"&&r.parentNode!=null&&r.parentNode.__lexicalListType==="check"?r:null}function e0(e,n,r){let s=yh(n);return s!=null&&n.update(()=>{let i=bt(s);if(!Ie(i))return;let a=function(l,c){let d=c?l.getPreviousSibling():l.getNextSibling(),f=l;for(;d==null&&Ie(f);)f=f.getParentOrThrow().getParent(),f!=null&&(d=c?f.getPreviousSibling():f.getNextSibling());for(;Ie(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 qw(e){let n=[];for(let r of e)if(Ie(r)){n.push(r);let s=r.getChildren();if(s.length>1)for(let i of s)$e(i)&&n.push(To().append(i))}else n.push(To().append(r));return n}var Jw=ut({$import:(e,n)=>{let r;var s;return sh(n,"ol")?r=Eo("number",n.start):r=(s=n).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||s.querySelector(":scope > [aria-checked]")!==null?Eo("check"):Eo("bullet"),Nn(r,n),[r.splice(0,0,nd(qw(e.$importChildren(n)),n))]},match:dt.tag("ol","ul"),name:"@lexical/list/list"});function d0(e,n){if(n.length!==1)return n;let r=n[0];return Dn(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):n}function f0(e){let n=(l)=>QE(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(J(l)?l.getChildren():[l])):s.push(l);i();let a=[];for(let l of r)a.length>0&&a.push(un()),a.push(...l);return a}var Zw=ut({$import:(e,n)=>{let r=n.getAttribute("aria-checked"),s=To(r==="true"||r!=="false"&&void 0);return Qn(s,n),Nn(s,n),[s.splice(0,0,f0(d0(s,e.$importChildren(n))))]},match:dt.tag("li"),name:"@lexical/list/li"});function t0(e,n,r){let s=sh(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!s||s.getAttribute("type")!=="checkbox")return[];let i=To(s.hasAttribute("checked"));return Qn(i,n),Nn(i,n),[i.splice(0,0,f0(d0(i,e.$importChildren(n))))]}var Qw={$accepts:(e)=>Ie(e)||$e(e),$packageRun:(e)=>[To().splice(0,0,e)],name:"ListSchema"},g0=[ut({$import:(e,n,r)=>{let s=n.querySelector(':scope > input[type="checkbox"]');return s?t0(e,n,s):r()},match:dt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"}),ut({$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?t0(e,n,i):r()},match:dt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"}),Jw,Zw],p0=En("UPDATE_LIST_START_COMMAND"),h0=En("INSERT_UNORDERED_LIST_COMMAND"),m0=En("INSERT_ORDERED_LIST_COMMAND"),_0=En("REMOVE_LIST_COMMAND");function x0(e,n){return De(e.registerCommand(m0,()=>(Sd("number"),!0),Fe),e.registerCommand(p0,(r)=>{let{listNodeKey:s,newStart:i}=r,a=At(s);return!!$e(a)&&(a.getListType()==="number"&&(a.setStart(i),s0(a)),!0)},Fe),e.registerCommand(h0,()=>(Sd("bullet"),!0),Fe),e.registerCommand(_0,()=>(r0(),!0),Fe),e.registerCommand(Wr,()=>i0(!!(n&&n.restoreNumbering)),Fe),e.registerCommand(Ai,(r)=>{let s=V();if(!G(s)||!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();for(;!Ie(a);){if(a.getPreviousSibling()!==null)return!1;let l=a.getParent();if(l===null)return!1;a=l}return!(!Ie(a)||!a.collapseAtStart(s))&&(r.preventDefault(),!0)},Qc),e.registerNodeTransform(Vs,(r)=>{let s=r.getFirstChild();if(s){if(oe(s)){let i=s.getStyle(),a=s.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==a&&r.setTextFormat(a)}}else{let i=V();G(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(kn,(r)=>{let s=r.getParent();if(Ie(s)&&r.is(s.getFirstChild())){let i=r.getStyle(),a=r.getFormat();i===s.getTextStyle()&&a===s.getTextFormat()||s.setTextStyle(i).setTextFormat(a)}}))}function C0(e){let n=(r)=>{let s=r.getParent();if($e(r.getFirstChild())||!$e(s))return;let i=pe(r,(a)=>Ie(a)&&$e(a.getParent())&&Ie(a.getPreviousSibling()));if(i===null&&r.getIndent()>0)r.setIndent(0);else if(Ie(i)){let a=i.getPreviousSibling();if(Ie(a)){let l=function(d){let f=d,g=f.getFirstChild();for(;$e(g);){let p=g.getLastChild();if(!Ie(p))break;f=p,g=f.getFirstChild()}return f}(a),c=l.getParent();if($e(c)){let d=yd(c);d+1<yd(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(Ie(a)){n(a);let l=a.getFirstChild();$e(l)&&s.push(l)}}}})}var Nh=me({build:(e,n,r)=>Dt(n),config:We({hasStrictIndent:!1,shouldPreserveNumbering:!1}),dependencies:[ao,nn(Vo,{rules:g0})],name:"@lexical/list/List",nodes:()=>[Qi,Vs],register(e,n,r){let s=r.getOutput();return De(St(()=>x0(e,{restoreNumbering:s.shouldPreserveNumbering.value})),St(()=>s.hasStrictIndent.value?C0(e):void 0))}}),ek=me({build:(e,n)=>Dt(n),config:We({disableTakeFocusOnClick:!1}),dependencies:[Nh],name:"@lexical/list/CheckList",register:(e,n,r)=>c0(e,r.getOutput())}),tk=me({dependencies:[Nh],name:"@lexical/list/Import"});var Nt=Eh,{$createListItemNode:y0,$createListNode:S0,$getListDepth:Ez,$handleListInsertParagraph:Tz,$insertList:bz,$isListItemNode:Th,$isListNode:bo,$removeList:vz,CheckListExtension:Oz,INSERT_CHECK_LIST_COMMAND:N0,INSERT_ORDERED_LIST_COMMAND:E0,INSERT_UNORDERED_LIST_COMMAND:T0,ListExtension:Az,ListImportExtension:Rz,ListImportRules:Mz,ListItemNode:ts,ListNode:Xo,ListSchema:Dz,REMOVE_LIST_COMMAND:Nd,UPDATE_LIST_START_COMMAND:$z,registerCheckList:b0,registerList:bh,registerListStrictIndentTransform:v0}=Nt;var vh={};Ne(vh,{ListPlugin:()=>nk});C();function nk({hasStrictIndent:e=!1,shouldPreserveNumbering:n=!1}){let[r]=st();return h(()=>{if(!r.hasNodes([Xo,ts]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),h(()=>De(bh(r,{restoreNumbering:n}),e?v0(r):()=>{}),[r,e,n]),function(s){h(()=>bh(s),[s])}(r),null}var ok=vh,O0=ok.ListPlugin;var Oh={};Ne(Oh,{CheckListPlugin:()=>rk});C();function rk({disableTakeFocusOnClick:e=!1}){let[n]=st();return h(()=>b0(n,{disableTakeFocusOnClick:e}),[n,e]),null}var sk=Oh,A0=sk.CheckListPlugin;var Ah={};Ne(Ah,{TabIndentationPlugin:()=>ik,registerTabIndentation:()=>ju});C();function ik({maxIndent:e,$canIndent:n}){let[r]=st();return h(()=>ju(r,e,n),[r,e,n]),null}var R0=Ah,{TabIndentationPlugin:M0,registerTabIndentation:Yz}=R0;var wh={};Ne(wh,{$createAutoLinkNode:()=>$h,$createLinkNode:()=>Bl,$isAutoLinkNode:()=>pn,$isLinkNode:()=>Fn,$toggleLink:()=>Ed,AutoLinkExtension:()=>xk,AutoLinkNode:()=>Kl,ClickableLinkExtension:()=>dk,LinkExtension:()=>vd,LinkImportExtension:()=>uk,LinkImportRules:()=>L0,LinkNode:()=>os,TOGGLE_LINK_COMMAND:()=>Td,autoLinkEmailMatcher:()=>pk,autoLinkUrlMatcher:()=>gk,createLinkMatcherWithRegExp:()=>B0,formatUrl:()=>Rh,registerAutoLink:()=>G0,registerClickableLink:()=>P0,registerLink:()=>F0});var D0=new Set(["http:","https:","mailto:","sms:","tel:"]);class os extends lt{__url;__target;__rel;__title;$config(){return this.config("link",{extends:lt,importDOM:{a:()=>({conversion:lk,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(Li(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=Rh(e);try{let r=new URL(Rh(e));if(!D0.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&&!D0.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(!G(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 $0(e){let n=cn(e,"next");return[n,n.getFlipped()]}function w0(e,n){for(let r of n)if(r.origin.isAttached()){let s=kt(r);return void Uo(e,s)}}function ak(e){let n=V(),r=null,s=null;function i(){G(n)&&(w0(n.anchor,r),w0(n.focus,s),Ko(n))}G(n)&&(r=$0(n.anchor),s=$0(n.focus));let a=!1;for(let c of Tt(e,"next")){let d=c.origin;if(J(d)&&!d.isInline()){let f=d.getChildren();if(f.length>0){let g=jt(e);g.append(...f),d.append(g),a=!0}Pr(d,zo(c),{$shouldSplit:()=>!1})}}function l(c,d,f){let[g,p]=c,m=(y)=>yo(y)&&y.origin.is(d);if(!m(g)&&!m(p))return c;let _=kt(Tt(f,"next"));return[_,_.getFlipped()]}if(e.isAttached()){let c=e.getPreviousSibling();if(Fn(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();Fn(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 lk(e){let n=null;if(Li(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 ln(new os(e,n))}function Fn(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=$h(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}}function $h(e="",n){return ln(new Kl(e,n))}function pn(e){return e instanceof Kl}var Td=En("TOGGLE_LINK_COMMAND");function k0(e,n){if(e.type==="element"){let r=e.getNode();return J(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 Ed(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=V();if(l===null||!G(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=pe(p,(_)=>!pn(_)&&Fn(_));m&&(m.insertBefore(p),m.getChildren().length===0&&m.remove())}else{let m=pe(p,(_)=>!pn(_)&&Fn(_));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=pe(g,(m)=>!pn(m)&&Fn(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=pe(p,(_)=>!pn(_)&&Fn(_));if(m!==null){let _=m.getKey();if(g.has(_))return;(function(y,x){let E=new Set(x.filter((K)=>y.isParentOf(K)).map((K)=>K.getKey())),b=y.getChildren(),R=(K)=>E.has(K.getKey())||J(K)&&x.some((H)=>y.isParentOf(H)&&K.isParentOf(H)),M=b.filter(R);if(M.length===b.length)return b.forEach((K)=>y.insertBefore(K)),void y.remove();let k=b.findIndex(R),P=b.findLastIndex(R),F=k===0,z=P===b.length-1;if(F)M.forEach((K)=>y.insertBefore(K));else if(z)for(let K=M.length-1;K>=0;K--)y.insertAfter(M[K]);else{for(let H=M.length-1;H>=0;H--)y.insertAfter(M[H]);let K=b.slice(P+1);if(K.length>0){let H=jt(y);M[M.length-1].insertAfter(H),K.forEach((q)=>H.append(q))}}})(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=pe(g,Fn);if(p!==null)return f(p)}(function(g){let p=V();if(!G(p))return g();let m=Ko(p),_=m.isBackward(),y=k0(m.anchor,_?-1:0),x=k0(m.focus,_?0:-1),E=g();if(y||x){let b=V();if(G(b)){let R=b.clone();if(y){let M=y.getParent();M&&R.anchor.set(M.getKey(),y.getIndexWithinParent()+(_?1:0),"element")}if(x){let M=x.getParent();M&&R.focus.set(M.getKey(),x.getIndexWithinParent()+(_?0:1),"element")}pt(Ko(R))}}})(()=>{let g=null;for(let p of c){if(!p.isAttached())continue;let m=pe(p,Fn);if(m){f(m);continue}if(J(p)){if(!p.isInline())continue;if(Fn(p)){if(!(pn(p)||g!==null&&g.getParentOrThrow().isParentOf(p))){f(p),g=p;continue}for(let y of p.getChildren())p.insertBefore(y);p.remove();continue}}let _=p.getPreviousSibling();Fn(_)&&_.is(g)?_.append(p):(g=Bl(r,{rel:a,target:s,title:i}),p.insertAfter(g),g.append(p))}})}var ck=/^\+?[0-9\s()-]{5,}$/;function Rh(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:ck.test(e)?`tel:${e}`:`https://${e}`}var L0=[ut({$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 XE(e.$importChildren(n),()=>Bl(r,s))},match:dt.tag("a"),name:"@lexical/link/a"})];function F0(e,n){return De(e.registerNodeTransform(os,ak),e.registerCommand(Td,(r)=>{let s=n.validateUrl.peek(),i=n.attributes.peek();if(r===null)return Ed(null),!0;if(typeof r=="string")return!(s!==void 0&&!s(r))&&(Ed(r,i),!0);{let{url:a,target:l,rel:c,title:d}=r;return Ed(a,{...i,rel:c,target:l,title:d}),!0}},be),St(()=>{let r=n.validateUrl.value;if(!r)return;let s=n.attributes.value;return e.registerCommand($i,(i)=>{let a=V();if(!G(a)||a.isCollapsed()||!Ln(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)=>J(c)||oe(c)&&!c.isSimpleText())&&(e.dispatchCommand(Td,{...s,url:l}),i.preventDefault(),!0)},Fe)}))}var vd=me({build:(e,n,r)=>Dt(n),config:{attributes:void 0,validateUrl:void 0},dependencies:[ao,nn(Vo,{rules:L0})],mergeConfig(e,n){let r=Kt(e,n);return e.attributes&&(r.attributes=Kt(e.attributes,r.attributes)),r},name:"@lexical/link/Link",nodes:()=>[os],register:(e,n,r)=>F0(e,r.getOutput())}),uk=me({dependencies:[vd],name:"@lexical/link/Import"});function P0(e,n,r={}){let s=(a)=>{let l=a.target;if(!ro(l))return;let c=bu(l);if(c===null)return;let d=null,f=null,g=!1;if(c.update(()=>{let _=bt(l);if(_!==null){let y=pe(_,J);if(!n.disabled.peek())if(Fn(y))g=pn(y)&&y.getIsUnlinked(),d=y.sanitizeUrl(y.getURL()),f=y.getTarget();else{let x=function(E,b){let R=E;for(;R!=null;){if(b(R))return R;R=R.parentNode}return null}(l,Li);x!==null&&(d=x.href,f=x.target)}}}),d===null||d===""||g)return;let p=e.read("latest",V);if(G(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 qr(a,{click:s,mouseup:i},r)})}var dk=me({build:(e,n,r)=>Dt(n),config:We({disabled:!1,newTab:!1}),dependencies:[vd],name:"@lexical/link/ClickableLink",register:(e,n,r)=>P0(e,r.getOutput())});function B0(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 fk=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,gk=(e)=>{let n=fk.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}`}},pk=B0(/(([^<>()[\]\\.,;:\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 Mh(e,n){for(let r=0;r<n.length;r++){let s=n[r](e);if(s)return s}return null}var K0=/[.,;\s]/;function bd(e,n){return n.test(e)}function z0(e,n){return bd(e[e.length-1],n)}function Dh(e,n){return bd(e[0],n)}function U0(e,n){let r=e.getPreviousSibling();return J(r)&&(r=r.getLastDescendant()),r===null||Ue(r)||oe(r)&&z0(r.getTextContent(),n)}function H0(e,n){let r=e.getNextSibling();return J(r)&&(r=r.getFirstDescendant()),r===null||Ue(r)||oe(r)&&Dh(r.getTextContent(),n)}function hk(e,n,r,s,i){if(!(e>0?bd(s[e-1],r):U0(i[0],r)))return!1;return n<s.length?bd(s[n],r):H0(i[i.length-1],r)}function mk(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 _k(e,n,r,s){let i=$h(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=Ct(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 y=e[_],x=y.getTextContent().length,E=c;if(E<r)if(c+x<=r)d.push(y);else{let[b,R]=y.splitText(r-E);d.push(b),f=R}c+=x}let g=V(),p=g?g.getNodes().find(oe):void 0,m=Ct(l.getTextContent());return m.setFormat(l.getFormat()),m.setDetail(l.getDetail()),m.setStyle(l.getStyle()),i.append(m,...d),p&&p===l&&(G(g)?m.select(g.anchor.offset,g.focus.offset):Ze(g)&&m.select(0,m.getTextContent().length)),l.replace(i),f}}function I0(e,n,r,s){let i=e.getChildren(),a=i.length;for(let f=0;f<a;f++){let g=i[f];if(!oe(g)||!g.isSimpleText())return Pl(e),void r(null,e.getURL())}let l=e.getTextContent(),c=Mh(l,n);if(c===null||c.text!==l)return Pl(e),void r(null,e.getURL());if(!U0(e,s)||!H0(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 W0={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:K0};function G0(e,n=W0){let{matchers:r,changeHandlers:s,excludeParents:i,separatorRegex:a=K0}=n,l=(c,d)=>{for(let f of s)f(c,d)};return De(e.registerNodeTransform(kn,(c)=>{let d=c.getParentOrThrow(),f=c.getPreviousSibling();if(pn(d))I0(d,r,l,a);else if(!Fn(d)&&!i.some((g)=>g(d))){if(c.isSimpleText()&&(Dh(c.getTextContent(),a)||!pn(f))){let g=function(p){let m=[p],_=p.getNextSibling();for(;_!==null&&oe(_)&&_.isSimpleText()&&(m.push(_),!/[\s]/.test(_.getTextContent()));)_=_.getNextSibling();return m}(c);(function(p,m,_,y){for(let k of p){let P=k.getParent();if(pn(P)&&!P.getIsUnlinked())return}let x=[...p],E=x.map((k)=>k.getTextContent()).join(""),b,R=E,M=0;for(;(b=Mh(R,m))&&b!==null;){let k=b.index,P=k+b.length;if(hk(M+k,M+P,y,E,x)){let[F,,z,K]=mk(x,M+k,M+P),H=!1;for(let W of z){let te=W.getParent();if(pn(te)&&!te.getIsUnlinked()){H=!0;break}}if(H){M+=P,R=R.substring(P);continue}let q=_k(z,M+k-F,M+P-F,b);x=q?[q,...K]:K,_(b.url,null),M=0}else M+=P;R=R.substring(P)}})(g,r,l,a)}(function(g,p,m,_){let y=g.getParent(),x=g.getPreviousSibling(),E=g.getNextSibling(),b=g.getTextContent();if(!pn(y)||y.getIsUnlinked()){if(pn(x)&&!x.getIsUnlinked()&&x.is(g.getPreviousSibling())&&g.getParent()===x.getParent()){if(!Dh(b,_))return Pl(x),void m(null,x.getURL());if(R=b,x.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(R):/^\.[a-zA-Z0-9]{1,}/.test(R)){let M=x.getTextContent()+b,k=Mh(M,p);k!==null&&k.text===M&&(x.append(g),I0(x,p,m,_),m(null,x.getURL()))}}var R;!pn(E)||E.getIsUnlinked()||z0(b,_)||E.is(g.getNextSibling())&&g.getParent()===E.getParent()&&(Pl(E),m(null,E.getURL()))}})(c,r,l,a)}}),e.registerCommand(Td,(c)=>{let d=V();if(c!==null||!G(d))return!1;return d.extract().forEach((f)=>{let g=f.getParent();pn(g)&&(g.setIsUnlinked(!g.getIsUnlinked()),g.markDirty())}),!1},Fe))}var xk=me({config:W0,dependencies:[vd],mergeConfig(e,n){let r=Kt(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:G0});var Lt=wh,{$createAutoLinkNode:Qz,$createLinkNode:j0,$isAutoLinkNode:Y0,$isLinkNode:ea,$toggleLink:eU,AutoLinkExtension:tU,AutoLinkNode:V0,ClickableLinkExtension:nU,LinkExtension:oU,LinkImportExtension:rU,LinkImportRules:sU,LinkNode:ta,TOGGLE_LINK_COMMAND:kh,autoLinkEmailMatcher:iU,autoLinkUrlMatcher:aU,createLinkMatcherWithRegExp:lU,formatUrl:cU,registerAutoLink:uU,registerClickableLink:dU,registerLink:X0}=Lt;var Ih={};Ne(Ih,{LinkPlugin:()=>Ck});C();function Ck({validateUrl:e,attributes:n}){let[r]=st();return h(()=>{if(!r.hasNodes([ta]))throw Error("LinkPlugin: LinkNode not registered on editor")}),h(()=>X0(r,Dt({attributes:n,validateUrl:e})),[r,e,n]),null}var yk=Ih,q0=yk.LinkPlugin;var Lh={};Ne(Lh,{AutoFocusPlugin:()=>Sk});C();function Sk({defaultSelection:e}){let[n]=st();return h(()=>{n.focus(()=>{let r=n.getRootElement(),s=r!==null?So(r):null;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,n]),null}var Nk=Lh,J0=Nk.AutoFocusPlugin;var Uh={};Ne(Uh,{$createCodeHighlightNode:()=>Kh,$createCodeNode:()=>vo,$getCodeLineDirection:()=>sb,$getEndOfCodeInLine:()=>ab,$getFirstCodeNodeOfLine:()=>rs,$getLastCodeNodeOfLine:()=>qs,$getStartOfCodeInLine:()=>ib,$isCodeHighlightNode:()=>zt,$isCodeNode:()=>bn,$outdentLeadingSpaces:()=>lb,$plainifyCodeContent:()=>Ek,CodeExtension:()=>zh,CodeHighlightNode:()=>Wl,CodeImportExtension:()=>wk,CodeImportRules:()=>mb,CodeIndentExtension:()=>kk,CodeNode:()=>Hl,DEFAULT_CODE_LANGUAGE:()=>cb,getDefaultCodeLanguage:()=>Tk,registerCodeIndentation:()=>xb});function Ad(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 rb(e,n){let r=e;for(let s=it(e,n);s&&(zt(s.origin)||Yt(s.origin));s=s.getAdjacentCaret())r=s.origin;return r}function rs(e){return rb(e,"previous")}function qs(e){return rb(e,"next")}function sb(e){let n=rs(e),r=qs(e),s=n;for(;s!==null;){if(zt(s)){let a=CS(s.getTextContent());if(a!==null)return a}if(s===r)break;s=s.getNextSibling()}let i=n.getParent();if(J(i)){let a=i.getDirection();if(a==="ltr"||a==="rtl")return a}return null}function ib(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(zt(f)||Yt(f)||Ue(f)||Ad(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];zt(i)&&d!==" "&&(s={node:i,offset:a})}if(s!==null)return s;let c=null;if(n<e.getTextContentSize())zt(e)&&(c=e.getTextContent()[n]);else{let d=e.getNextSibling();zt(d)&&(c=d.getTextContent()[0])}if(c!==null&&c!==" ")return r;{let d=function(f,g){let p=f,m=g,_=f.getTextContent(),y=f.getTextContentSize();for(;;){if(!zt(p)||m===y){if(p=p.getNextSibling(),p===null||Ue(p))return null;zt(p)&&(m=0,_=p.getTextContent(),y=p.getTextContentSize())}if(zt(p)){if(_[m]!==" ")return{node:p,offset:m};m++}}}(e,n);return d!==null?d:r}}function ab(e){let n=qs(e);return Ue(n)&&Ad(168),n}function Ek(e){let n=[];return Bi(e,{linebreak:()=>n.push(un()),tab:()=>n.push(dn()),text:(r)=>n.push(Kh(r))}),n}function lb(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 cb="javascript",Tk=()=>cb;function ub(e,n){for(let r of e.childNodes){if(Ce(r)&&r.tagName===n)return!0;if(ub(r,n))return!0}return!1}var Ul="data-language",zl="data-highlight-language",Od="data-theme",bk=()=>{};class Hl extends lt{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config("code",{extends:lt,importDOM:{code:(e)=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||ub(e,"BR"))?{conversion:Z0,priority:1}:null,div:()=>({conversion:vk,priority:1}),pre:()=>({conversion:Z0,priority:0}),table:(e)=>Fh(e)?{conversion:Ok,priority:3}:null,td:(e)=>{let n=e,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Fh(r)?{conversion:Q0,priority:3}:null},tr:(e)=>{let n=e.closest("table");return n&&Fh(n)?{conversion:Q0,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(Od,s);let i=this.getStyle();return i&&cr(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(Od,l):c&&n.removeAttribute(Od);let d=this.__style,f=e.__style;return d!==f&&cr(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(Od,s);let i=this.getStyle();return i&&cr(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(!io(Ge(),"@lexical/code")){bk();let a=db(e);if(a)return a}let{anchor:r,focus:s}=e,i=(r.isBefore(s)?r:s).getNode();if(oe(i)){let a=rs(i),l=[];for(;;)if(Yt(a))l.push(dn()),a=a.getNextSibling();else{if(!zt(a))break;{let _=0,y=a.getTextContent(),x=a.getTextContentSize();for(;_<x&&y[_]===" ";)_++;if(_!==0&&l.push(Kh(" ".repeat(_))),_!==x)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=[un(),...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(bn(i)){let{offset:a}=e.anchor;i.splice(a,0,[un()]),i.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){let e=ye();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 vo(e,n){return Gc(Hl).setLanguage(e).setTheme(n)}function bn(e){return e instanceof Hl}function Z0(e){return{node:vo(e.getAttribute(Ul))}}function vk(e){let n=e,r=eb(n);return r||function(s){let i=s.parentElement;for(;i!==null;){if(eb(i))return!0;i=i.parentElement}return!1}(n)?{node:r?vo():null}:{node:null}}function Ok(){return{node:vo()}}function Q0(){return{node:null}}function eb(e){return e.style.fontFamily.match("monospace")!==null}function Fh(e){return e.classList.contains("js-file-line-container")}function db(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type==="element"){let r=n.getNode();if(bn(r)){let s=r.getChildrenSize();if(s>=2&&n.offset===s){let i=r.getLastChild();if(Ue(i)&&Ue(i.getPreviousSibling())){let a=ye();return r.splice(s-2,2,[]).insertAfter(a,!1),a.select(),a}}}}return null}class Wl extends kn{__highlightType;constructor(e="",n,r){super(e,r),this.__highlightType=n}$config(){return this.config("code-highlight",{extends:kn})}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=Ph(e.theme,this.__highlightType);return et(n,r),n}updateDOM(e,n,r){let s=super.updateDOM(e,n,r),i=Ph(r.theme,e.__highlightType),a=Ph(r.theme,this.__highlightType);return i!==a&&(i&&on(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 vo()}}function Ph(e,n){return n&&e&&e.codeHighlight&&e.codeHighlight[n]}function Kh(e="",n){return ln(new Wl(e,n))}function zt(e){return e instanceof Wl}var fb="data-language";function gb(e){return e.style.fontFamily.match("monospace")!==null}function Bh(e){let n=e.parentElement;for(;n!==null;){if(gb(n))return!0;n=n.parentElement}return!1}var Ak=rh([ut({$import:(e,n)=>e.$importChildren(n),match:dt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"})]),Rk=ut({$import:(e,n)=>[vo(n.getAttribute(fb)).splice(0,0,e.$importChildren(n))],match:dt.tag("pre"),name:"@lexical/code/pre"}),Mk=ut({$import:(e,n,r)=>{let s=n.textContent||"";return/\r?\n/.test(s)||n.querySelector("br")!==null?[vo(n.getAttribute(fb)).splice(0,0,e.$importChildren(n))]:r()},match:dt.tag("code"),name:"@lexical/code/code-multiline"});function na(e){if(!Ce(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 pb(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(Ce(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 hb(e){for(let n of Array.from(e.children)){if(Ce(n)&&na(n)){if(pb(n)!==null)return!0;let r=n.nextElementSibling;if(r&&na(r))return!0;continue}if(hb(n))return!0}return!1}var Dk=rh([ut({$import:(e,n,r)=>{if(!na(n)||Bh(n))return r();let s=pb(n);return s===null||s.length===0?r():[vo().splice(0,0,rl(s.join(`
16
- `)))]},match:dt.tag("div"),name:"@lexical/code/vscode-wrapper"}),ut({$import:(e,n,r)=>{if(!na(n)||Bh(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():[vo().splice(0,0,rl(i.join(`
17
- `)))]},match:dt.tag("div","br"),name:"@lexical/code/vscode-line-run"})]),$k=ut({$import:(e,n,r)=>gb(n)?[vo().splice(0,0,e.$importChildren(n))]:Bh(n)?e.$importChildren(n):r(),match:dt.tag("div"),name:"@lexical/code/div"}),mb=[ut({$import:(e,n)=>[vo().splice(0,0,e.$importChildren(n,{rules:Ak}))],match:dt.tag("table").classAll("js-file-line-container"),name:"@lexical/code/github-code-table"}),ut({$import:(e,n)=>e.$importChildren(n),match:dt.tag("td").classAll("js-file-line"),name:"@lexical/code/github-code-cell-by-class"}),Mk,Rk,$k],zh=me({dependencies:[ao,nn(Vo,{preprocess:[(e,n,r)=>{hb(Xr(e)?e.body:e)&&n.session.update(tT,(s)=>[...s,Dk]),r()}],rules:mb})],name:"@lexical/code",nodes:()=>[Hl,Wl],register:(e)=>De(e.registerCommand(Ri,(n)=>{let r=V();return!(!G(r)||!db(r))&&(n!==null&&n.preventDefault(),!0)},Fe),e.registerNodeTransform(Su,(n)=>{n.getFormat()!==0&&bn(n.getParent())&&n.setFormat(0)}))}),wk=me({dependencies:[zh],name:"@lexical/code/Import"});function Xs(e){if(!G(e))return!1;let n=e.anchor.getNode(),r=bn(n)?n:n.getParent(),s=e.focus.getNode(),i=bn(s)?s:s.getParent();return bn(r)&&r.is(i)}function _b(e){let n=e.getNodes(),r=[];if(n.length===1&&bn(n[0]))return r;let s=[];for(let i=0;i<n.length;i++){let a=n[i];zt(a)||Yt(a)||Ue(a)||Ad(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=qn(s[0].getKey(),0,"text");i.is(a)||r.push(s)}return r}function tb(e,n){let r=V();if(!G(r)||!Xs(r))return!1;let s=_b(r),i=s.length;if(i===0&&r.isCollapsed())return e===to&&r.insertNodes([dn()]),!0;if(i===0&&e===to&&r.getTextContent()===`
18
- `){let a=dn(),l=un(),c=r.isBackward()?"previous":"next";return r.insertNodes([a,l]),$n(lr(Jn(Vc(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===to){let d=dn();if(c.insertBefore(d),a===0){let f=r.isBackward()?"focus":"anchor",g=qn(c.getKey(),0,"text");r[f].is(g)&&r[f].set(d.getKey(),0,"text")}}else Yt(c)?c.remove():n!==void 0&&zt(c)&&lb(c,n,r)}}return!0}function nb(e,n){let r=V();if(!G(r))return!1;let{anchor:s,focus:i}=r,a=s.offset,l=i.offset,c=s.getNode(),d=i.getNode(),f=e===no;if(!Xs(r)||!zt(c)&&!Yt(c)||!zt(d)&&!Yt(d))return!1;if(!n.altKey){if(r.isCollapsed()){let b=c.getParentOrThrow();if(f&&a===0&&c.getPreviousSibling()===null){if(b.getPreviousSibling()===null)return b.selectPrevious(),n.preventDefault(),!1}else if(!f&&a===c.getTextContentSize()&&c.getNextSibling()===null){if(b.getNextSibling()===null)return b.selectNext(),n.preventDefault(),!1}}return!1}let g,p;if(c.isBefore(d)?(g=rs(c),p=qs(d)):(g=rs(d),p=qs(c)),g==null||p==null)return!1;let m=g.getNodesBetween(p);for(let b=0;b<m.length;b++){let R=m[b];if(!zt(R)&&!Yt(R)&&!Ue(R))return!1}n.preventDefault(),n.stopPropagation();let _=f?g.getPreviousSibling():p.getNextSibling();if(!Ue(_))return!0;let y=f?_.getPreviousSibling():_.getNextSibling();if(y==null)return!0;let x=zt(y)||Yt(y)||Ue(y)?f?rs(y):qs(y):null,E=x!=null?x:y;return _.remove(),m.forEach((b)=>b.remove()),e===no?(m.forEach((b)=>E.insertBefore(b)),E.insertBefore(_)):(E.insertAfter(_),E=_,m.forEach((b)=>{E.insertAfter(b),E=b})),r.setTextNodeRange(c,a,d,l),!0}function ob(e,n){let r=V();if(!G(r))return!1;let{anchor:s,focus:i}=r,a=s.getNode(),l=i.getNode(),c=e===Di;if(!Xs(r)||!zt(a)&&!Yt(a)||!zt(l)&&!Yt(l))return!1;let d=l,f=sb(d)==="rtl"?!c:c,{key:g,offset:p,type:m}=s;if(f){let _=ib(d,i.offset);if(_!==null){let{node:y,offset:x}=_;Ue(y)?y.selectNext(0,0):r.setTextNodeRange(y,x,y,x)}else d.getParentOrThrow().selectStart()}else ab(d).select();return n.shiftKey&&r.anchor.set(g,p,m),n.preventDefault(),n.stopPropagation(),!0}function xb(e,n,r){return De(...r?[e.registerCommand(Wo,(s)=>!s.altKey&&mp(bn,s),Fe),e.registerCommand(Oi,(s)=>mp(bn,s),Fe),e.registerCommand(no,(s)=>!s.altKey&&_p(bn,s),Fe),e.registerCommand(Gr,(s)=>_p(bn,s),Fe)]:[],e.registerCommand(jr,(s)=>{let i=function(a){let l=V();if(!G(l)||!Xs(l))return null;let c=a?Go:to,d=a?Go:$s,{anchor:f,focus:g}=l;if(f.is(g))return d;let p=_b(l);if(p.length!==1)return c;let m=p[0],_,y;m.length===0&&Ad(285),l.isBackward()?(_=g,y=f):(_=f,y=g);let x=rs(m[0]),E=qs(m[0]),b=qn(x.getKey(),0,"text"),R=qn(E.getKey(),E.getTextContentSize(),"text");return _.isBefore(b)||R.isBefore(y)?c:b.isBefore(_)||y.isBefore(R)?d:c}(s.shiftKey);return i!==null&&(s.preventDefault(),e.dispatchCommand(i),!0)},Fe),e.registerCommand($s,()=>!!Xs(V())&&(Xc([dn()]),!0),Fe),e.registerCommand(to,()=>tb(to),Fe),e.registerCommand(Go,()=>tb(Go,n),Fe),e.registerCommand(no,(s)=>{let i=V();if(!G(i))return!1;let{anchor:a}=i,l=a.getNode();if(!Xs(i))return!1;let c=l.getParent();return i.isCollapsed()&&a.offset===0&&l.getPreviousSibling()===null&&bn(c)&&c.getPreviousSibling()===null?(s.preventDefault(),!0):nb(no,s)},Fe),e.registerCommand(Wo,(s)=>{let i=V();if(!G(i))return!1;let{anchor:a}=i,l=a.getNode();return!!Xs(i)&&(i.isCollapsed()&&a.offset===l.getTextContentSize()&&l.getNextSibling()===null&&bn(l.getParentOrThrow())&&l.getParentOrThrow().getNextSibling()===null?(s.preventDefault(),!0):nb(Wo,s))},Fe),e.registerCommand(Di,(s)=>ob(Di,s),Fe),e.registerCommand(yl,(s)=>ob(yl,s),Fe))}var kk=me({build:(e,n)=>Dt(n),config:We({disabled:!1,escapeWithArrows:!1,tabSize:void 0}),dependencies:[zh],name:"@lexical/code-indent",register:(e,n,r)=>{let s=r.getOutput();return St(()=>{if(!s.disabled.value)return xb(e,s.tabSize.value,s.escapeWithArrows.value)})}});var Ft=Uh,{$createCodeHighlightNode:Rd,$createCodeNode:Js,$getCodeLineDirection:Cb,$getEndOfCodeInLine:yb,$getFirstCodeNodeOfLine:Sb,$getLastCodeNodeOfLine:Nb,$getStartOfCodeInLine:Eb,$isCodeHighlightNode:oa,$isCodeNode:qo,$outdentLeadingSpaces:Tb,$plainifyCodeContent:bb,CodeExtension:Md,CodeHighlightNode:Gl,CodeImportExtension:vU,CodeImportRules:OU,CodeIndentExtension:Dd,CodeNode:ss,DEFAULT_CODE_LANGUAGE:$d,getDefaultCodeLanguage:vb,registerCodeIndentation:Ob}=Ft;var Zh={};Ne(Zh,{$convertFromMarkdownString:()=>Xk,$convertSelectionToMarkdownString:()=>Zk,$convertToMarkdownString:()=>Jk,$generateNodesFromMarkdownString:()=>qk,BOLD_ITALIC_STAR:()=>nv,BOLD_ITALIC_UNDERSCORE:()=>ov,BOLD_STAR:()=>rv,BOLD_UNDERSCORE:()=>sv,CHECK_LIST:()=>Bk,CODE:()=>Yl,ELEMENT_TRANSFORMERS:()=>uv,HEADING:()=>qb,HIGHLIGHT:()=>tv,INLINE_CODE:()=>ev,ITALIC_STAR:()=>av,ITALIC_UNDERSCORE:()=>lv,LINK:()=>cv,MULTILINE_ELEMENT_TRANSFORMERS:()=>dv,ORDERED_LIST:()=>Qb,QUOTE:()=>Jb,STRIKETHROUGH:()=>iv,TEXT_FORMAT_TRANSFORMERS:()=>fv,TEXT_MATCH_TRANSFORMERS:()=>gv,TRANSFORMERS:()=>ra,UNORDERED_LIST:()=>Zb,isTableRowDivider:()=>jb,registerMarkdownShortcuts:()=>Vk});function Hh(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 Id(e){let n=Hh(e,(r)=>r.type);return{element:n.element||[],multilineElement:n["multiline-element"]||[],textFormat:n["text-format"]||[],textMatch:n["text-match"]||[]}}var Ab=/[!-/:-@[-`{-~\s]/,Rb=/\s/,Wh=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Ik=/^\s{0,3}$/;function Xl(e){if(!Dn(e))return!1;let n=e.getFirstChild();return n==null||e.getChildrenSize()===1&&oe(n)&&Ik.test(n.getTextContent())}function Gh(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(n,r)=>String.fromCodePoint(Number(r)))}var zb=/^(\s*)(\d{1,})\.\s/,Ub=/^(\s*)[-*+]\s/,Hb=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,jh=/^(#{1,6})\s/,Wb=/^>\s/,Gb=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Vh=/^[ \t]*`{3,}$/,Lk=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Fk=/^(?:\|)(.+)(?:\|)\s?$/;function jb(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 Mb=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Db=/^<\/[a-z_][\w-]*\s*>/i,$b=(e)=>new RegExp(`(?:${e.source})$`,e.flags),jl=jo("mdListMarker",{parse:(e)=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),wb=jo("mdCodeFence",{parse:(e)=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Yb=jo("mdHardLineBreak",{parse:(e)=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function Xh(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let n=e.match(/^(.*?\S)( {2,})$/);return n?[n[1],n[2]]:null}function Pk(e){let n=e.getChildren(),r=n.length-1,s=n[r];if(!oe(s))return null;let i=s.getTextContent(),a=Xh(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 Vb(e){let n=un(),r=Pk(e);return r!==null&&eo(n,Yb,r),n}var Xb=(e)=>(n,r,s,i)=>{let a=e(s);a.append(...r),n.replace(a),i||a.select(0,0)},Jh=(e)=>(n,r,s,i)=>{if(Fl(n))return!1;let a=n.getPreviousSibling(),l=n.getNextSibling(),c=y0(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(bo(l)&&l.getListType()===e){f&&eo(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(bo(a)&&a.getListType()===e)f&&eo(a,jl,f),a.append(c),n.remove();else{let p=S0(e,e==="number"?Number(s[2]):void 0);f&&eo(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),y=0;return m&&(y+=m.length),_&&(y+=Math.floor(_.length/4)),y}(s[1]);g&&c.setIndent(g)},Ld=(e,n,r,s)=>{let i=[],a=e.getChildren(),l=0;for(let c of a)if(Th(c)){if(c.getChildrenSize()===1){let _=c.getFirstChild();if(bo(_)){let y=Ld(_,n,r+1,s);y&&i.push(y);continue}}if(s&&!c.getChildren().some((_)=>_.isSelected(s)))continue;let d=" ".repeat(4*r),f=e.getListType(),g=Po(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
- `)},qb={dependencies:[hd],export:(e,n)=>{if(!Fl(e))return null;let r=Number(e.getTag().slice(1));return"#".repeat(r)+" "+n(e)},regExp:jh,replace:Xb((e)=>{let n="h"+e[1].length;return fd(n)}),triggerOnEnter:!0,type:"element"},Jb={dependencies:[md],export:(e,n)=>{if(!pd(e))return null;let r=n(e).split(`
20
- `),s=[];for(let i of r)s.push("> "+i);return s.join(`
21
- `)},regExp:Wb,replace:(e,n,r,s)=>{if(s){let a=e.getPreviousSibling();if(pd(a))return a.splice(a.getChildrenSize(),0,[Vb(a),...n]),void e.remove()}let i=gd();i.append(...n),e.replace(i),s||i.select(0,0)},triggerOnEnter:!0,type:"element"},Yl={dependencies:[ss],export:(e)=>{if(!qo(e))return null;let n=e.getTextContent(),r=Po(e,wb);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?`
22
- `+n:"")+`
23
- `+r},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r,startMatch:s})=>{let i=s[1],a=i.trim().length,l=e[r],c=s.index+i.length,d=l.slice(c),f=new RegExp(`\`{${a},}$`);if(f.test(d)){let _=d.match(f),y=d.slice(0,d.lastIndexOf(_[0])),x=[...s];return x[2]="",Yl.replace(n,null,x,_,[y],!0),[!0,r]}let g=new RegExp(`^[ \\t]*\`{${a},}$`);for(let _=r+1;_<e.length;_++){let y=e[_];if(g.test(y)){let x=y.match(g),E=e.slice(r+1,_),b=l.slice(s[0].length);return b.length>0&&E.unshift(b),Yl.replace(n,null,s,x,E,!0),[!0,_]}}let p=e.slice(r+1),m=l.slice(s[0].length);return m.length>0&&p.unshift(m),Yl.replace(n,null,s,null,p,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:Vh},regExpStart:Gb,replace:(e,n,r,s,i,a)=>{let l,c,d=r[1]?r[1].trim():"```",f=r[2]||void 0;if(!n&&i){if(i.length===1)s?(l=Js(f),c=i[0]):(l=Js(f),c=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(l=Js(f),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();c=i.join(`
24
- `)}eo(l,wb,d);let g=Ct(c);l.append(g),e.append(l)}else n&&Xb((g)=>Js(g?g[2]:void 0))(e,n,r,a)},type:"multiline-element"},Zb={dependencies:[Xo,ts],export:(e,n,r)=>bo(e)?Ld(e,n,0,r):null,regExp:Ub,replace:Jh("bullet"),triggerOnEnter:!0,type:"element"},Bk={dependencies:[Xo,ts],export:(e,n,r)=>bo(e)?Ld(e,n,0,r):null,regExp:Hb,replace:Jh("check"),triggerOnEnter:!0,type:"element"},Qb={dependencies:[Xo,ts],export:(e,n,r)=>bo(e)?Ld(e,n,0,r):null,regExp:zb,replace:Jh("number"),triggerOnEnter:!0,type:"element"},ev={format:["code"],tag:"`",type:"text-format"},tv={format:["highlight"],tag:"==",type:"text-format"},nv={format:["bold","italic"],tag:"***",type:"text-format"},ov={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},rv={format:["bold"],tag:"**",type:"text-format"},sv={format:["bold"],intraword:!1,tag:"__",type:"text-format"},iv={format:["strikethrough"],tag:"~~",type:"text-format"},av={format:["italic"],tag:"*",type:"text-format"},lv={format:["italic"],intraword:!1,tag:"_",type:"text-format"},cv={dependencies:[ta],export:(e,n,r)=>{if(!ea(e)||Y0(e))return null;let s=n(e),i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${s}](${e.getURL()} "${i}")`:`[${s}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,n)=>{if(pe(e,ea))return;let[,r,s,i]=n,a=s!=null?Gh(s):void 0,l=i!=null?Gh(i):void 0,c=j0(a,{title:l}),d=r.split("[").length-1,f=r.split("]").length-1,g=r,p="";if(d<f)return;if(d>f){let _=r.split("[");p="["+_[0],g=_.slice(1).join("[")}let m=Ct(g);return m.setFormat(e.getFormat()),c.append(m),e.replace(c),p&&c.insertBefore(Ct(p)),m},trigger:")",type:"text-match"},uv=[qb,Jb,Zb,Qb],dv=[Yl],fv=[ev,nv,ov,rv,sv,tv,av,lv,iv],gv=[cv],ra=[...uv,...dv,...fv,...gv];function pv(e,n=!1){let r=e.split(`
25
- `),s=0,i=[];for(let a=0;a<r.length;a++){let l=r[a],c=l.trimEnd(),d=i[i.length-1],f=a<r.length-1?Xh(l):null,g=d!==void 0&&Xh(d)!==null;if(Lk.test(c))i.push(c);else if(s===0){{let p=c.match(Gb);if(p){s=p[1].trim().length,i.push(c);continue}}c===""||d===""||!d||jh.test(d)||jh.test(c)||Wb.test(c)||zb.test(c)||Ub.test(c)||Hb.test(c)||Fk.test(c)||jb(c)||g||!n||Mb.test(c)||Db.test(c)||$b(Db).test(d)||$b(Mb).test(d)||Vh.test(d)?i.push(!n&&c!==""||f!==null?l:c):i[i.length-1]=d+" "+(f===null?c:l).trimStart()}else{if(Vh.test(c)&&c.trim().length>=s){s=0,i.push(c);continue}i.push(l)}}return i.join(`
26
- `)}function Kk(e,n,r,s,i,a){let l=e.isSelected(n);for(let c of r){if(!c.export)continue;let d=c.export(e,(f)=>Vl(f,n,s,i,a).markdown,n);if(d!=null){if(!l&&J(e))Vl(e,n,s,i,a).shouldInclude&&(l=!0);return{markdown:d,shouldInclude:l}}}if(J(e)){let c=Vl(e,n,s,i,a);return{markdown:c.markdown,shouldInclude:l||c.shouldInclude}}return $t(e)?{markdown:e.getTextContent(),shouldInclude:l}:{markdown:null,shouldInclude:l}}function Vl(e,n,r,s,i,a,l){let c=[],d=e.getChildren(),f=!1;a||(a=[]),l||(l=[]);e:for(let g of d){let p=g.isSelected(n);for(let m of s){if(!m.export)continue;let _=m.export(g,(y)=>Vl(y,n,r,s,i,a,[...l,...a]).markdown,(y,x)=>kd(y,Ps(n,y,"clone").getTextContent(),r,a,l,i));if(_!=null){!p&&J(g)&&g.getChildren().some((y)=>y.isSelected(n))&&g.extractWithChild(g,n,"html")&&(p=!0),p&&(c.push(_),f=!0);continue e}}if(Ue(g))p&&(c.push(hv(g)),f=!0);else if(oe(g)){if(p){let m=Ps(n,g,"clone");c.push(kd(g,m.getTextContent(),r,a,l,i)),f=!0}}else if(J(g)){let m=Vl(g,n,r,s,i,a,l);!p&&m.shouldInclude&&g.extractWithChild(g,n,"html")&&(p=!0),(p||m.shouldInclude)&&(c.push(m.markdown),f=!0)}else $t(g)&&p&&(c.push(g.getTextContent()),f=!0)}return{markdown:c.join(""),shouldInclude:f}}function zk(e,n,r,s,i){for(let a of n){if(!a.export)continue;let l=a.export(e,(c)=>wd(c,r,s,void 0,void 0,i));if(l!=null)return l}return J(e)?wd(e,r,s,void 0,void 0,i):$t(e)?e.getTextContent():null}function wd(e,n,r,s,i,a=!1){let l=[],c=e.getChildren();s||(s=[]),i||(i=[]);e:for(let d of c){for(let f of r){if(!f.export)continue;let g=f.export(d,(p)=>wd(p,n,r,s,[...i,...s],a),(p,m)=>kd(p,m,n,s,i,a));if(g!=null){l.push(g);continue e}}Ue(d)?l.push(hv(d)):oe(d)?l.push(kd(d,d.getTextContent(),n,s,i,a)):J(d)?l.push(wd(d,n,r,s,i,a)):$t(d)&&l.push(d.getTextContent())}return l.join("")}function hv(e){return Po(e,Yb)+`
27
- `}function kd(e,n,r,s,i,a=!1){let l=e.hasFormat("code"),c,d,f,g,p=n;if(l||(p=a?p.replace(/([*_`~])/g,"\\$1"):p.replace(/([*_`~\\])/g,"\\$1")),l){let{fence:R,padded:M}=function(k){let P=k.match(/`+/g),F=P?Math.max(...P.map((z)=>z.length)):0;return{fence:"`".repeat(F+1),padded:k.length===0||k.includes("`")||/^\s/.test(k)&&/\s$/.test(k)?` ${k} `:k}}(n);c="",f="",d=R+M+R,g=!1}else{let R=p.match(/^(\s*)(.*?)(\s*)$/s)||["","",p,""];c=R[1],d=R[2],f=R[3],g=d===""}let m="",_="",y="",x=kb(e,!0),E=kb(e,!1),b=new Set;for(let R of r){let M=R.format[0],k=R.tag;M!=="code"&&(Ib(e,M)&&!b.has(M)&&(b.add(M),Ib(x,M)&&s.find((P)=>P.tag===k)||(s.push({format:M,tag:k}),m+=k)))}for(let R=0;R<s.length;R++){let M=qh(e,s[R].format),k=qh(E,s[R].format);if(M&&k)continue;let P=[...s];for(;P.length>R;){let F=P.pop();i&&F&&i.find((z)=>z.tag===F.tag)||(F&&typeof F.tag=="string"&&(M?k||(y+=F.tag):_+=F.tag),s.pop())}break}return g&&!e.hasFormat("code")?_+p:_+c+m+d+y+f}function kb(e,n){let r=n?e.getPreviousSibling():e.getNextSibling();return oe(r)?r:null}function qh(e,n){return oe(e)&&e.hasFormat(n)}function Ib(e,n){return!!qh(e,n)&&(n==="code"||(!e||!/^\s*$/.test(e.getTextContent())))}function Uk(e,n){let r=e.getTextContent(),s=n.transformersByTag["`"],i=[],a=null;if(s){let p=function(m){let _=(R)=>{let M=0;for(let k=R-1;k>=0&&m[k]==="\\";k--)M++;return M%2==1},y=[],x=0;for(;x<m.length;)if(m[x]==="`"){let R=1;for(;x+R<m.length&&m[x+R]==="`";)R++;y.push({index:x,length:R}),x+=R}else x++;let E=[],b=0;for(;b<y.length;){let R=y[b];if(_(R.index)){b++;continue}let M=-1;for(let F=b+1;F<y.length;F++)if(y[F].length===R.length){M=F;break}if(M===-1){b++;continue}let k=y[M],P=m.slice(R.index+R.length,k.index);P.length>=2&&P.startsWith(" ")&&P.endsWith(" ")&&/[^ ]/.test(P)&&(P=P.slice(1,-1)),E.push({content:P,endIndex:k.index+k.length,startIndex:R.index}),b=M+1}return E}(r);for(let m of p)a||(a={content:m.content,endIndex:m.endIndex,startIndex:m.startIndex,tag:"`"}),i.push({end:m.endIndex,start:m.startIndex})}let l=function(p,m,_=[]){let y=[],x=new Set(Object.keys(m.transformersByTag).filter((M)=>M[0]!=="`").map((M)=>M[0])),E=(M)=>{let k=0;for(let P=M-1;P>=0&&p[P]==="\\";P--)k++;return k%2==1},b=(M)=>_.some((k)=>M>=k.start&&M<k.end),R=0;for(;R<p.length;){let M=p[R];if(!x.has(M)||E(R)||b(R)){R++;continue}let k=1;for(;R+k<p.length&&p[R+k]===M;)k++;let P=Lb(M,p,R,k,!0),F=Lb(M,p,R,k,!1);(P||F)&&y.push({active:!0,canClose:F,canOpen:P,char:M,index:R,length:k}),R+=k}return y}(r,n,i),c=l.length>0?function(p,m,_){let y={},x=0,E=null;for(;x<m.length;){let b=m[x];if(!b.active||!b.canClose||b.length===0){x++;continue}let R=`${b.char}${b.canOpen}${b.length%3}`,M=y[R]??-1,k=!1;for(let P=x-1;P>M;P--){let F=m[P];if(!F.active||!F.canOpen||F.length===0||F.char!==b.char)continue;if(F.canClose||b.canOpen){if((F.length+b.length)%3==0&&F.length%3!=0&&b.length%3!=0)continue}let z=Math.min(F.length,b.length),K=Object.keys(_.transformersByTag).filter((W)=>W[0]===F.char&&W.length<=z).sort((W,te)=>te.length-W.length)[0];if(!K)continue;k=!0;let H=K.length,q={content:p.slice(F.index+F.length,b.index),endIndex:b.index+H,startIndex:F.index+(F.length-H),tag:K};(!E||q.startIndex<E.startIndex||q.startIndex===E.startIndex&&q.endIndex>E.endIndex)&&(E=q);for(let W=P+1;W<x;W++)m[W].active=!1;F.length-=H,b.length-=H,F.active=F.length>0,b.length>0?b.index+=H:(b.active=!1,x++);break}k||(y[R]=x-1,b.canOpen||(b.active=!1),x++)}return E}(r,l,n):null,d=null,f=null;if(a&&c?c.startIndex<=a.startIndex&&c.endIndex>=a.endIndex?(d=c,f=n.transformersByTag[c.tag]):(d=a,f=s):a?(d=a,f=s):c&&(d=c,f=n.transformersByTag[c.tag]),!d||!f)return null;let g=[r.slice(d.startIndex,d.endIndex),d.tag,d.content];return g.index=d.startIndex,g.input=r,{endIndex:d.endIndex,isCodeSpan:f===s,match:g,startIndex:d.startIndex,transformer:f}}function Lb(e,n,r,s,i){if(!Fb(n,r,s,i))return!1;if(e==="*")return!0;if(e==="_"){if(!Fb(n,r,s,!i))return!0;let a=i?n[r-1]:n[r+s];return a!==void 0&&Wh.test(a)}return!0}function Fb(e,n,r,s){let i=e[n-1],a=e[n+r],[l,c]=s?[a,i]:[i,a];return l!==void 0&&!Rb.test(l)&&(!Wh.test(l)||(c===void 0||Rb.test(c)||Wh.test(c)))}function is(e){return oe(e)&&!e.hasFormat("code")}function Zs(e,n,r){let s=Uk(e,n),i=function(l,c){let d=l,f,g,p,m;for(let _ of c){if(!_.replace||!_.importRegExp)continue;let y=d.getTextContent().match(_.importRegExp);if(!y)continue;let x=y.index||0,E=_.getEndIndex?_.getEndIndex(d,y):x+y[0].length;E!==!1&&(f===void 0||g===void 0||x<f&&(E>g||E<=f))&&(f=x,g=E,p=_,m=y)}return f===void 0||g===void 0||p===void 0||m===void 0?null:{endIndex:g,match:m,startIndex:f,transformer:p}}(e,r);if(s&&i&&(s.isCodeSpan?i.startIndex<=s.startIndex&&i.endIndex>=s.endIndex?s=null:i=null:s.startIndex<=i.startIndex&&s.endIndex>=i.endIndex||i.startIndex>s.endIndex?i=null:s=null),s){let l=function(c,d,f,g,p){let m=c.getTextContent(),_,y,x;if(p[0]===m?_=c:d===0?[_,y]=c.splitText(f):[x,_,y]=c.splitText(d,f),_.setTextContent(p[2]),g)for(let E of g.format)_.hasFormat(E)||_.toggleFormat(E);return{nodeAfter:y,nodeBefore:x,transformedNode:_}}(e,s.startIndex,s.endIndex,s.transformer,s.match);is(l.nodeAfter)&&Zs(l.nodeAfter,n,r),is(l.nodeBefore)&&Zs(l.nodeBefore,n,r),is(l.transformedNode)&&Zs(l.transformedNode,n,r)}else if(i){let l=function(c,d,f,g,p){let m,_,y;return d===0?[m,_]=c.splitText(f):[y,m,_]=c.splitText(d,f),g.replace?{nodeAfter:_,nodeBefore:y,transformedNode:g.replace(m,p)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!l)return;is(l.nodeAfter)&&Zs(l.nodeAfter,n,r),is(l.nodeBefore)&&Zs(l.nodeBefore,n,r),is(l.transformedNode)&&Zs(l.transformedNode,n,r)}let a=Gh(e.getTextContent());e.setTextContent(a)}function mv(e,n,r,s=!1){let i=Id(r),a=function(f){let g={},p={},m=[];for(let _ of f){let{tag:y}=_;g[y]=_;let x=y.replace(/(\*|\^|\+)/g,"\\$1");m.push(x),y.length===1?p[y]=y==="`"?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${x}])(${x})((\\\\${x})?.*?[^${x}\\s](\\\\${x})?)(${x})(?![\\\\${x}])`):p[y]=new RegExp(`(^|[^\\\\])(${x})((\\\\${x})?.*?[^\\s](\\\\${x})?)(${x})(?!\\\\)`)}return{fullMatchRegExpByTag:p,openTagsRegExp:new RegExp(`(${m.join("|")})`,"g"),transformersByTag:g}}(i.textFormat),l=e.split(`
28
- `),c=l.length;for(let f=0;f<c;f++){let g=l[f],[p,m]=Hk(l,f,i.multilineElement,n);p?f=m:Wk(g,n,i.element,a,i.textMatch,s)}let d=n.getChildren();for(let f of d)if(!s&&Xl(f)&&n.getChildrenSize()>1)f.remove();else if(J(f))for(let g of f.getAllTextNodes())Gk(g)}function Hk(e,n,r,s){for(let i of r){let{handleImportAfterStartMatch:a,regExpEnd:l,regExpStart:c,replace:d}=i,f=e[n].match(c);if(!f)continue;if(a){let y=a({lines:e,rootNode:s,startLineIndex:n,startMatch:f,transformer:i});if(y===null)continue;if(y)return y}let g=typeof l=="object"&&"regExp"in l?l.regExp:l,p=l&&typeof l=="object"&&"optional"in l?l.optional:!l,m=n,_=e.length;for(;m<_;){let y=g?e[m].match(g):null;if(!y&&(!p||p&&m<_-1)){m++;continue}if(y&&n===m&&y.index===f.index){m++;continue}let x=[];if(y&&n===m)x.push(e[n].slice(f[0].length,-y[0].length));else for(let E=n;E<=m;E++)if(E===n){let b=e[E].slice(f[0].length);x.push(b)}else if(E===m&&y){let b=e[E].slice(0,-y[0].length);x.push(b)}else x.push(e[E]);if(d(s,null,f,y,x,!0)!==!1)return[!0,m];break}}return[!1,n]}function Wk(e,n,r,s,i,a){let l=Ct(e),c=ye();c.append(l),n.append(c);for(let{regExp:d,replace:f}of r){let g=e.match(d);if(g&&(l.setTextContent(e.slice(g[0].length)),f(c,[l],g,!0)!==!1))break}if(Zs(l,s,i),c.getParent()!==null&&e.length>0){let d=c.getPreviousSibling();if(!a&&(Dn(d)||pd(d)||bo(d))){let f=d;if(bo(d)){let g=d.getLastDescendant();f=g==null?null:pe(g,Th)}f!=null&&f.getTextContentSize()>0&&(f.splice(f.getChildrenSize(),0,[Vb(f),...c.getChildren()]),c.remove())}}}function Gk(e){let n=new Set,r=e.getTextContent(),s=r.indexOf("\t");for(;s!==-1;)n.add(s),n.add(s+1),s=r.indexOf("\t",s+1);e.splitText(...n).forEach((i)=>{i.getTextContent()==="\t"&&i.replace(dn())})}function jk(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 Pb(e,n,r,s,i){let a=e.getParent();if(!Mt(a)||e.getFirstChild()!==n)return!1;let l=n.getTextContent();if(!i&&l[r-1]!==" ")return!1;for(let{regExp:c,replace:d}of s){let f=l.match(c),g=i||f&&f[0].endsWith(" ")?r:r-1;if(f&&f[0].length===g){let p=n.getNextSiblings(),[m,_]=n.splitText(r);if(d(e,_?[_,...p]:p,f,!1)!==!1)return m.remove(),!0}}return!1}function Bb(e,n,r,s,i){let a=e.getParent();if(!Mt(a)||e.getFirstChild()!==n)return!1;let l=n.getTextContent();if(!i&&l[r-1]!==" ")return!1;for(let{regExpStart:c,replace:d,regExpEnd:f}of s){if(f&&!("optional"in f)||f&&"optional"in f&&!f.optional)continue;let g=l.match(c);if(g){let p=i||g[0].endsWith(" ")?r:r-1;if(g[0].length!==p)continue;let m=n.getNextSiblings(),[_,y]=n.splitText(r);if(d(e,y?[y,...m]:m,g,null,null,!1)!==!1)return _.remove(),!0}}return!1}function Yk(e,n){let r=0,s=e.getTextContent();for(let i=0;i<n;i++)s[i]==="`"&&r++;return r%2!=0}function Kb(e,n,r){let s=r.length;for(let i=n;i>=s;i--){let a=i-s;if(_v(e,a,r,0,s)&&e[a+s]!==" ")return a}return-1}function _v(e,n,r,s,i){for(let a=0;a<i;a++)if(e[n+a]!==r[s+a])return!1;return!0}function Vk(e,n=ra){let r=Id(n),s=r.element.filter((d)=>d.triggerOnEnter),i=Hh(r.textFormat,({tag:d})=>d[d.length-1]),a=Hh(r.textMatch,({trigger:d})=>d),l=new Set([" "]);for(let d of r.textFormat)l.add(d.tag.slice(-1));for(let d of r.textMatch)d.trigger!==void 0&&l.add(d.trigger);for(let d of n){let f=d.type;if(f==="element"||f==="text-match"||f==="multiline-element"){let g=d.dependencies;for(let p of g)e.hasNode(p)||jk(173,p.getType())}}let c=(d,f,g)=>!!Pb(d,f,g,r.element)||(!!Bb(d,f,g,r.multilineElement)||(!!function(p,m,_){let y=p.getTextContent(),x=_[y[m-1]];if(x==null)return!1;m<y.length&&(y=y.slice(0,m));for(let E of x){if(!E.replace||!E.regExp)continue;let b=y.match(E.regExp);if(b===null)continue;let R=b.index||0,M=R+b[0].length,k;return R===0?[k]=p.splitText(M):[,k]=p.splitText(R,M),k.selectNext(0,0),E.replace(k,b),!0}return!1}(f,g,a)||!!function(p,m,_){let y=p.getTextContent(),x=m-1,E=y[x],b=_[E];if(!b)return!1;for(let R of b){let{tag:M}=R,k=M.length,P=x-k+1;if(k>1&&!_v(y,P,M,0,k))continue;if(y[P-1]===" ")continue;let F=y[x+1];if(R.intraword===!1&&F&&!Ab.test(F))continue;let z=p,K=z,H=Kb(y,P,M),q=K;for(;H<0&&(q=q.getPreviousSibling())&&!Ue(q);)if(oe(q)){if(q.hasFormat("code"))continue;let ne=q.getTextContent();K=q,H=Kb(ne,ne.length,M)}if(H<0)continue;if(K===z&&H+k===P)continue;let W=K.getTextContent();if(H>0&&W[H-1]===E)continue;let te=W[H-1];if(R.intraword===!1&&te&&!Ab.test(te))continue;if(!R.format.includes("code")&&Yk(K,H))continue;let Z=z.getTextContent(),re=Z.slice(0,P)+Z.slice(x+1);z.setTextContent(re);let Y=K===z?re:W;K.setTextContent(Y.slice(0,H)+Y.slice(H+k));let de=V(),xe=Fr();pt(xe);let Re=x-k*(K===z?2:1)+1;xe.anchor.set(K.__key,H,"text"),xe.focus.set(z.__key,Re,"text");for(let ne of R.format)xe.formatText(ne,Ii[ne]);xe.anchor.set(xe.focus.key,xe.focus.offset,xe.focus.type);for(let ne of R.format)xe.hasFormat(ne)&&xe.toggleFormat(ne);return G(de)&&(xe.format=de.format),!0}return!1}(f,g,i)));return De(e.registerUpdateListener(({tags:d,dirtyLeaves:f,editorState:g,prevEditorState:p})=>{if(d.has(Yy)||d.has(vi))return;if(e.isComposing())return;let m=d.has(eu),_=g.read(V),y=p.read(V);if(!G(y)||!G(_)||!_.isCollapsed()||_.is(y)&&!m)return;let x=_.anchor.key,E=_.anchor.offset,b=g._nodeMap.get(x);if(oe(b)&&f.has(x)&&(m||E===1||!(E>y.anchor.offset+1))){if(m){let R=g.read(()=>b.getTextContent())[E-1];if(!l.has(R))return}e.update(()=>{if(!is(b))return;let R=b.getParent();R===null||qo(R)||c(R,b,_.anchor.offset)&&ol(cu)})}}),e.registerCommand(Ri,(d)=>{if(d!==null&&d.shiftKey)return!1;let f=V();if(!G(f)||!f.isCollapsed())return!1;let g=f.anchor.offset,p=f.anchor.getNode();if(!oe(p)||!is(p))return!1;let m=p.getParent();if(m===null||qo(m))return!1;return g===p.getTextContent().length&&(!(!Bb(m,p,g,r.multilineElement,!0)&&!Pb(m,p,g,s,!0))&&(d!==null&&d.preventDefault(),!0))},Fe))}function Xk(e,n=ra,r,s=!1,i=!1){let a=s?e:pv(e,i),l=r||Je();l.clear(),mv(a,l,n,s),V()!==null&&l.selectStart()}function qk(e,n=ra,r=!1,s=!1){let i=r?e:pv(e,s),a=new ul;return mv(i,a,n,r),a.getChildren()}function Jk(e=ra,n,r=!1){return function(i,a=!1){let l=Id(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=(g||Je()).getChildren();for(let _=0;_<m.length;_++){let y=m[_],x=zk(y,c,f,l.textMatch,a);x!=null&&p.push(d&&_>0&&!Xl(y)&&!Xl(m[_-1])?`
29
- `.concat(x):x)}return p.join(`
30
- `)}}(e,r)(n)}function Zk(e=ra,n,r=!1){if(!n||G(n)&&n.isCollapsed())return"";return function(i,a=!1){let l=Id(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 y=m[_],{shouldInclude:x,markdown:E}=Kk(y,g,c,f,l.textMatch,a);x&&E!=null&&p.push(d&&_>0&&!Xl(y)&&!Xl(m[_-1])?`
31
- `.concat(E):E)}return p.join(`
32
- `)}}(e,r)(n)}var at=Zh,{$convertFromMarkdownString:Qh,$convertSelectionToMarkdownString:IU,$convertToMarkdownString:xv,$generateNodesFromMarkdownString:LU,BOLD_ITALIC_STAR:FU,BOLD_ITALIC_UNDERSCORE:PU,BOLD_STAR:BU,BOLD_UNDERSCORE:KU,CHECK_LIST:Cv,CODE:zU,ELEMENT_TRANSFORMERS:yv,HEADING:UU,HIGHLIGHT:HU,INLINE_CODE:WU,ITALIC_STAR:GU,ITALIC_UNDERSCORE:jU,LINK:YU,MULTILINE_ELEMENT_TRANSFORMERS:Sv,ORDERED_LIST:VU,QUOTE:XU,STRIKETHROUGH:qU,TEXT_FORMAT_TRANSFORMERS:Nv,TEXT_MATCH_TRANSFORMERS:Ev,TRANSFORMERS:Tv,UNORDERED_LIST:JU,isTableRowDivider:ZU,registerMarkdownShortcuts:bv}=at;var em={};Ne(em,{DEFAULT_TRANSFORMERS:()=>vv,MarkdownShortcutPlugin:()=>Qk});C();var vv=[{dependencies:[Gu],export:(e)=>KN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,n,r,s)=>{let i=Wu();s||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:"element"},...Tv];function Qk({transformers:e=vv}){let[n]=st();return h(()=>bv(n,e),[n,e]),null}var Ov=em,{DEFAULT_TRANSFORMERS:rH,MarkdownShortcutPlugin:Av}=Ov;var tm={};Ne(tm,{OnChangePlugin:()=>tI});C();var eI=fn?He:h;function tI({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:n=!1,onChange:r}){let[s]=st();return eI(()=>{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(Hr)||c.isEmpty()||r(i,s,d)})},[s,e,n,r]),null}var nI=tm,Rv=nI.OnChangePlugin;C();var nm={};Ne(nm,{LexicalErrorBoundary:()=>oI});class Mv extends da{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 oI({children:e,fallback:n,onError:r}){return t(Mv,{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 rI=nm,Dv=rI.LexicalErrorBoundary;var pH=Ke(om(),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,y=m.length;_<y;_++){var x=m[_];if(x.type!=="code"){p(x.content);continue}var E=x.content[1],b=x.content[3];if(E&&b&&E.type==="code-language"&&b.type==="code-block"&&typeof E.content==="string"){var R=E.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");R=(/[a-z][\w-]*/i.exec(R)||[""])[0].toLowerCase();var M="language-"+R;if(!b.alias)b.alias=[M];else if(typeof b.alias==="string")b.alias=[b.alias,M];else b.alias.push(M)}}}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 y=g.classes[m],x=/language-(.+)/.exec(y);if(x){p=x[1];break}}var E=e.languages[p];if(!E){if(p&&p!=="none"&&e.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*10000000000000000);g.attributes.id=b,e.plugins.autoloader.loadLanguages(p,function(){var R=document.getElementById(b);if(R)R.innerHTML=e.highlight(R.textContent,e.languages[p],p)})}}else g.content=e.highlight(f(g.content),E,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 y;if(_[1]==="x")y=parseInt(_.slice(2),16);else y=Number(_.slice(1));return d(y)}else{var x=c[_];if(x)return x;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
- ?|
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 MH=globalThis.Prism||window.Prism;var lm={};Ne(lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>im,CODE_LANGUAGE_MAP:()=>kv,CodePrismExtension:()=>pI,PrismTokenizer:()=>am,getCodeLanguageOptions:()=>cI,getCodeLanguages:()=>lI,getCodeThemeOptions:()=>uI,getLanguageFriendlyName:()=>aI,isCodeLanguageLoaded:()=>Lv,loadCodeLanguage:()=>Fv,normalizeCodeLanguage:()=>Iv,registerCodeHighlighting:()=>gI});var kH=Ke(om(),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
- ?|
36
- |(?![\\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 co=globalThis.Prism||window.Prism,im={c:"C",clike:"C-like",cpp:"C++",css:"CSS",go:"Go",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},kv={cpp:"cpp",golang:"go",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Iv(e){return kv[e]||e}function aI(e){let n=Iv(e);return im[n]||n}var lI=()=>Object.keys(co.languages).filter((e)=>typeof co.languages[e]!="function").sort();function cI(){let e=[];for(let[n,r]of Object.entries(im))e.push([n,r]);return e}function uI(){return[]}function Lv(e){let n=function(s){let i=/^diff-([\w-]+)/i.exec(s);return i?i[1]:null}(e),r=n||e;try{return!!r&&co.languages.hasOwnProperty(r)}catch(s){return!1}}async function Fv(e,n,r){}function rm(e){return typeof e=="string"?e:Array.isArray(e)?e.map(rm).join(""):rm(e.content)}function dI(e,n){let r=/^diff-([\w-]+)/i.exec(n),s=e.getTextContent(),i=co.tokenize(s,co.languages[r?"diff":n]);return r&&(i=function(a,l){let c=l,d=co.languages[c],f={tokens:a},g=co.languages.diff.PREFIXES;for(let p of f.tokens){if(typeof p=="string"||!(p.type in g)||!Array.isArray(p.content))continue;let m=p.type,_=0,y=()=>(_++,new co.Token("prefix",g[m],m.replace(/^(\w+).*/,"$1"))),x=p.content.filter((P)=>typeof P=="string"||P.type!=="prefix"),E=p.content.length-x.length,b=co.tokenize(rm(x),d);b.unshift(y());let R=/\r\n|\n/g,M=(P)=>{let F=[];R.lastIndex=0;let z,K=0;for(;_<E&&(z=R.exec(P));){let H=z.index+z[0].length;F.push(P.slice(K,H)),K=H,F.push(y())}if(F.length!==0)return K<P.length&&F.push(P.slice(K)),F},k=(P)=>{for(let F=0;F<P.length&&_<E;F++){let z=P[F];if(typeof z=="string"){let K=M(z);K&&(P.splice(F,1,...K),F+=K.length-1)}else if(typeof z.content=="string"){let K=M(z.content);K&&(z.content=K)}else Array.isArray(z.content)?k(z.content):k([z.content])}};k(b),_<E&&b.push(y()),p.content=b}return f.tokens}(i,r[1])),sm(i)}function sm(e,n){let r=[];for(let s of e)if(typeof s=="string")Bi(s,{linebreak:()=>r.push(un()),tab:()=>r.push(dn()),text:(i)=>r.push(Rd(i,n))});else{let{content:i,alias:a}=s;typeof i=="string"?r.push(...sm([i],s.type==="prefix"&&typeof a=="string"?a:s.type)):Array.isArray(i)&&r.push(...sm(i,s.type==="unchanged"?void 0:s.type))}return r}var am={$tokenize(e,n){let r=n||this.defaultLanguage;return r===null?bb(e.getTextContent()):dI(e,r)},defaultLanguage:$d,tokenize(e,n){let r=this.defaultLanguage;return co.tokenize(e,co.languages[n||""]||(r===null?void 0:co.languages[r]))}};function $v(e,n,r,s){let i=s.getParent();qo(i)?Pv(e,n,r,i):oa(s)&&s.replace(Ct(s.__text))}function fI(e,n){let r=n.getElementByKey(e.getKey());if(r===null)return;let s=e.getChildren(),i=s.length;if(i===r.__cachedChildrenLength)return;r.__cachedChildrenLength=i;let a="1",l=1;for(let c=0;c<i;c++)Ue(s[c])&&(a+=`
37
- `+ ++l);r.setAttribute("data-gutter",a)}function Pv(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(!Lv(l))return s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1),void Fv();s.getIsSyntaxHighlightSupported()||s.setIsSyntaxHighlightSupported(!0)}else s.getIsSyntaxHighlightSupported()&&s.setIsSyntaxHighlightSupported(!1);i.has(a)||(i.add(a),r.didTransform||(r.didTransform=!0,Ky(()=>{r.didTransform=!1,i.clear()})),function(c,d){let f=At(c);if(!qo(f)||!f.isAttached())return;let g=V();if(!G(g))return void d();let p=g.anchor,m=p.offset,_=p.type==="element"&&Ue(f.getChildAtIndex(p.offset-1)),y=0;if(!_){let x=p.getNode();y=m+x.getPreviousSiblings().reduce((E,b)=>E+b.getTextContentSize(),0)}if(!d())return;if(_)return void p.getNode().select(m,m);f.getChildren().some((x)=>{let E=oe(x);if(E||Ue(x)){let b=x.getTextContentSize();if(E&&b>=y)return x.select(y,y),!0;y-=b}return!1})}(a,()=>{let c=At(a);if(!qo(c)||!c.isAttached())return!1;let d=c.getLanguage()||n.defaultLanguage,f=n.$tokenize(c,d??void 0),g=function(y,x){let E=0;for(;E<y.length&&wv(y[E],x[E]);)E++;let b=y.length,R=x.length,M=Math.min(b,R)-E,k=0;for(;k<M;)if(k++,!wv(y[b-k],x[R-k])){k--;break}let P=E,F=b-k,z=x.slice(E,R-k);return{from:P,nodesForReplacement:z,to:F}}(c.getChildren(),f),{from:p,to:m,nodesForReplacement:_}=g;return!(p===m&&!_.length)&&(s.splice(p,m-p,_),!0)}))}function wv(e,n){return oa(e)&&oa(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||Yt(e)&&Yt(n)||Ue(e)&&Ue(n)}function Bv(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=At(a);c!==null&&fI(c,e)}})},{skipInitialization:!1}));let s={didTransform:!1,nodesCurrentlyHighlighting:new Set};return r.push(e.registerNodeTransform(ss,Pv.bind(null,e,n,s)),e.registerNodeTransform(kn,$v.bind(null,e,n,s)),e.registerNodeTransform(Gl,$v.bind(null,e,n,s))),De(...r)}function gI(e,n=am){if(!e.hasNodes([ss,Gl]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return De(Bv(e,n),Ob(e))}var pI=me({build:(e,n)=>Dt(n),config:We({disabled:!1,tokenizer:am}),dependencies:[Md,Dd],name:"@lexical/code-prism",register:(e,n,r)=>{let s=r.getOutput();return St(()=>{if(!s.disabled.value)return Bv(e,s.tokenizer.value)})}});var uo=lm,{CODE_LANGUAGE_FRIENDLY_NAME_MAP:cm,CODE_LANGUAGE_MAP:um,CodePrismExtension:qH,PrismTokenizer:fm,getCodeLanguageOptions:gm,getCodeLanguages:pm,getCodeThemeOptions:hm,getLanguageFriendlyName:mm,isCodeLanguageLoaded:JH,loadCodeLanguage:ZH,normalizeCodeLanguage:Pd,registerCodeHighlighting:_m}=uo;var xm={};Ne(xm,{$createCodeHighlightNode:()=>Rd,$createCodeNode:()=>Js,$getCodeLineDirection:()=>Cb,$getEndOfCodeInLine:()=>yb,$getFirstCodeNodeOfLine:()=>Sb,$getLastCodeNodeOfLine:()=>Nb,$getStartOfCodeInLine:()=>Eb,$isCodeHighlightNode:()=>oa,$isCodeNode:()=>qo,$outdentLeadingSpaces:()=>Tb,CODE_LANGUAGE_FRIENDLY_NAME_MAP:()=>mI,CODE_LANGUAGE_MAP:()=>_I,CodeExtension:()=>Md,CodeHighlightNode:()=>Gl,CodeIndentExtension:()=>Dd,CodeNode:()=>ss,DEFAULT_CODE_LANGUAGE:()=>$d,PrismTokenizer:()=>TI,getCodeLanguageOptions:()=>xI,getCodeLanguages:()=>CI,getCodeThemeOptions:()=>yI,getDefaultCodeLanguage:()=>vb,getLanguageFriendlyName:()=>SI,normalizeCodeLang:()=>NI,normalizeCodeLanguage:()=>EI,registerCodeHighlighting:()=>bI});var mI=cm,_I=um,xI=gm,CI=pm,yI=hm,SI=mm,NI=Pd,EI=Pd,TI=fm,bI=_m;var ft=xm,{$createCodeHighlightNode:eW,$createCodeNode:zv,$getCodeLineDirection:tW,$getEndOfCodeInLine:nW,$getFirstCodeNodeOfLine:oW,$getLastCodeNodeOfLine:rW,$getStartOfCodeInLine:sW,$isCodeHighlightNode:iW,$isCodeNode:aW,$outdentLeadingSpaces:lW,CODE_LANGUAGE_FRIENDLY_NAME_MAP:cW,CODE_LANGUAGE_MAP:uW,CodeExtension:dW,CodeHighlightNode:fW,CodeIndentExtension:gW,CodeNode:Uv,DEFAULT_CODE_LANGUAGE:pW,PrismTokenizer:hW,getCodeLanguageOptions:mW,getCodeLanguages:_W,getCodeThemeOptions:xW,getDefaultCodeLanguage:CW,getLanguageFriendlyName:yW,normalizeCodeLang:SW,normalizeCodeLanguage:NW,registerCodeHighlighting:EW}=ft;var Fm={};Ne(Fm,{$computeTableCellRectBoundary:()=>Jl,$computeTableMap:()=>rn,$computeTableMapSkipCellCheck:()=>fo,$createTableCellNode:()=>hn,$createTableNode:()=>tc,$createTableNodeWithDimensions:()=>qv,$createTableRowNode:()=>xr,$createTableSelection:()=>WI,$createTableSelectionFrom:()=>Wd,$deleteTableColumn:()=>II,$deleteTableColumnAtSelection:()=>tO,$deleteTableColumn__EXPERIMENTAL:()=>FI,$deleteTableRowAtSelection:()=>eO,$deleteTableRow__EXPERIMENTAL:()=>LI,$findCellNode:()=>aa,$findTableNode:()=>ei,$getElementForTableNode:()=>fO,$getNodeTriplet:()=>Ut,$getTableAndElementByKey:()=>Im,$getTableCellNodeFromLexicalNode:()=>OI,$getTableCellNodeRect:()=>Tm,$getTableColumnIndexFromTableCellNode:()=>RI,$getTableNodeFromLexicalNodeOrThrow:()=>jd,$getTableRowIndexFromTableCellNode:()=>AI,$getTableRowNodeFromTableCellNodeOrThrow:()=>Dm,$insertTableColumn:()=>wI,$insertTableColumnAtNode:()=>Hd,$insertTableColumnAtSelection:()=>Qv,$insertTableColumn__EXPERIMENTAL:()=>kI,$insertTableRow:()=>DI,$insertTableRowAtNode:()=>Ud,$insertTableRowAtSelection:()=>Zv,$insertTableRow__EXPERIMENTAL:()=>$I,$isScrollableTablesActive:()=>Ql,$isSimpleTable:()=>km,$isStickyScrollbarActive:()=>Mm,$isTableCellNode:()=>_e,$isTableNode:()=>rt,$isTableRowNode:()=>Be,$isTableSelection:()=>je,$mergeCells:()=>nO,$moveTableColumn:()=>KI,$moveTableRow:()=>zI,$removeTableRowAtIndex:()=>MI,$setTableColumnIsHeader:()=>HI,$setTableRowIsHeader:()=>UI,$unmergeCell:()=>BI,$unmergeCellNode:()=>wm,INSERT_TABLE_COMMAND:()=>Xv,TableCellHeaderStates:()=>Ae,TableCellNode:()=>_r,TableExtension:()=>_O,TableImportExtension:()=>d1,TableImportRules:()=>mO,TableNode:()=>Cr,TableObserver:()=>Lm,TableRowNode:()=>fa,TableRowSchema:()=>u1,TableSchema:()=>c1,applyTableHandlers:()=>iO,getDOMCellFromTarget:()=>Zl,getTableElement:()=>Jo,getTableObserverFromTableElement:()=>bm,registerTableCellUnmergeTransform:()=>gO,registerTablePlugin:()=>hO,registerTableSelectionObserver:()=>pO,setScrollableTablesActive:()=>dO});var la=/^(\d+(?:\.\d+)?)px$/,Ae={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _r extends lt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config("tablecell",{extends:lt,importDOM:{td:()=>({conversion:Hv,priority:0}),th:()=>({conversion:Hv,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=Ae.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(Ce(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=Ae.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!==Ae.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 Hv(e){let n=e,r=e.nodeName.toLowerCase(),s;la.test(n.style.width)&&(s=parseFloat(n.style.width));let i=Ae.NO_STATUS;if(r==="th"){let x=n.getAttribute("scope");if(x==="col")i=Ae.COLUMN;else if(x==="row")i=Ae.ROW;else{let E=n.parentElement,b=Ce(E)&&E.nodeName.toLowerCase()==="tr"&&Ce(E.parentElement)&&(E.parentElement.nodeName.toLowerCase()==="thead"||E.rowIndex===0),R=n.cellIndex===0;b&&(i|=Ae.ROW),R&&(i|=Ae.COLUMN),i===Ae.NO_STATUS&&(i=Ae.ROW)}}let a=hn(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"),y=d.color;return{after:(x)=>{let E=[],b=null,R=()=>{if(b){let M=b.getFirstChild();Ue(M)&&b.getChildrenSize()===1&&M.remove()}};for(let M of x)if(zg(M)||oe(M)||Ue(M)){if(oe(M)&&(g&&M.toggleFormat("bold"),p&&M.toggleFormat("strikethrough"),m&&M.toggleFormat("italic"),_&&M.toggleFormat("underline"),y)){let k=M.getStyle();k.includes("color:")||M.setStyle(k+`color: ${y};`)}b?b.append(M):(b=ye().append(M),E.push(b))}else E.push(M),R(),b=null;return R(),E.length===0&&E.push(ye()),E},node:a}}function hn(e=Ae.NO_STATUS,n=1,r){return ln(new _r(e,n,r))}function _e(e){return e instanceof _r}var Xv=En("INSERT_TABLE_COMMAND");function ge(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 lt{__height;$config(){return this.config("tablerow",{extends:lt,importDOM:{tr:()=>({conversion:vI,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 vI(e){let n=e,r;return la.test(n.style.height)&&(r=parseFloat(n.style.height)),{after:(s)=>Tl(s,_e),node:xr(r)}}function xr(e){return ln(new fa(e))}function Be(e){return e instanceof fa}function qv(e,n,r=!0){let s=tc();for(let i=0;i<e;i++){let a=xr();for(let l=0;l<n;l++){let c=Ae.NO_STATUS;typeof r=="object"?(i===0&&r.rows&&(c|=Ae.ROW),l===0&&r.columns&&(c|=Ae.COLUMN)):r&&(i===0&&(c|=Ae.ROW),l===0&&(c|=Ae.COLUMN));let d=hn(c),f=ye();f.append(Ct()),d.append(f),a.append(d)}s.append(a)}return s}function OI(e){let n=pe(e,(r)=>_e(r));return _e(n)?n:null}function Dm(e){let n=pe(e,(r)=>Be(r));if(Be(n))return n;throw Error("Expected table cell to be inside of table row.")}function jd(e){let n=pe(e,(r)=>rt(r));if(rt(n))return n;throw Error("Expected table cell to be inside of table.")}function AI(e){let n=Dm(e);return jd(n).getChildren().findIndex((r)=>r.is(n))}function RI(e){return Dm(e).getChildren().findIndex((n)=>n.is(e))}function Jv(e,n){let r=jd(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 MI(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 DI(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(!Be(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=xr();for(let p=0;p<f;p++){let m=d[p];_e(m)||ge(12);let{above:_,below:y}=Jv(m,i),x=Ae.NO_STATUS,E=_&&_.getWidth()||y&&y.getWidth()||void 0;(_&&_.hasHeaderState(Ae.COLUMN)||y&&y.hasHeaderState(Ae.COLUMN))&&(x|=Ae.COLUMN);let b=hn(x,1,E);b.append(ye()),g.append(b)}r?l.insertAfter(g):l.insertBefore(g)}return e}var Em=(e,n)=>e===Ae.BOTH||e===n?n:Ae.NO_STATUS;function Zv(e=!0){let n=V();G(n)||je(n)||ge(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ut(r),[a,,l]=Ut(s),[,c,d]=rn(l,a,i),{startRow:f}=d,{startRow:g}=c;return e?Ud(f+i.__rowSpan>g+a.__rowSpan?i:a,!0):Ud(g<f?a:i,!1)}var $I=Zv;function Ud(e,n=!0){let[,,r]=Ut(e),[s,i]=rn(r,e,e),a=s[0].length,{startRow:l}=i,c=null;if(n){let d=l+e.__rowSpan-1,f=s[d],g=xr();for(let m=0;m<a;m++){let{cell:_,startRow:y}=f[m];if(y+_.__rowSpan-1<=d){let x=f[m].cell.__headerState,E=Em(x,Ae.COLUMN);g.append(hn(E).append(ye()))}else _.setRowSpan(_.__rowSpan+1)}let p=r.getChildAtIndex(d);Be(p)||ge(256),p.insertAfter(g),c=g}else{let d=l,f=s[d],g=xr();for(let m=0;m<a;m++){let{cell:_,startRow:y}=f[m];if(y===d){let x=f[m].cell.__headerState,E=Em(x,Ae.COLUMN);g.append(hn(E).append(ye()))}else _.setRowSpan(_.__rowSpan+1)}let p=r.getChildAtIndex(d);Be(p)||ge(257),p.insertBefore(g),c=g}return c}function wI(e,n,r=!0,s,i){let a=e.getChildren(),l=[];for(let c=0;c<a.length;c++){let d=a[c];if(Be(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];_e(p)||ge(12);let{left:m,right:_}=Jv(p,i),y=Ae.NO_STATUS;(m&&m.hasHeaderState(Ae.ROW)||_&&_.hasHeaderState(Ae.ROW))&&(y|=Ae.ROW);let x=hn(y);x.append(ye()),l.push({newTableCell:x,targetCell:p})}}return l.forEach(({newTableCell:c,targetCell:d})=>{r?d.insertAfter(c):d.insertBefore(c)}),e}function Qv(e=!0){let n=V();G(n)||je(n)||ge(188);let r=n.anchor.getNode(),s=n.focus.getNode(),[i]=Ut(r),[a,,l]=Ut(s),[,c,d]=rn(l,a,i),{startColumn:f}=d,{startColumn:g}=c;return e?Hd(f+i.__colSpan>g+a.__colSpan?i:a,!0):Hd(g<f?a:i,!1)}var kI=Qv;function Hd(e,n=!0,r=!0){let[,,s]=Ut(e),[i,a]=rn(s,e,e),l=i.length,{startColumn:c}=a,d=n?c+e.__colSpan-1:c-1,f=s.getFirstChild();Be(f)||ge(120);let g=null;function p(y=Ae.NO_STATUS){let x=hn(y).append(ye());return g===null&&(g=x),x}let m=f;e:for(let y=0;y<l;y++){if(y!==0){let P=m.getNextSibling();Be(P)||ge(121),m=P}let x=i[y],E=x[d<0?0:d].cell.__headerState,b=Em(E,Ae.ROW);if(d<0){$m(m,p(b));continue}let{cell:R,startColumn:M,startRow:k}=x[d];if(M+R.__colSpan-1<=d){let P=R,F=k,z=d;for(;F!==y&&P.__rowSpan>1;){if(z-=R.__colSpan,!(z>=0)){m.append(p(b));continue e}{let{cell:K,startRow:H}=x[z];P=K,F=H}}P.insertAfter(p(b))}else R.setColSpan(R.__colSpan+1)}g!==null&&r&&ql(g);let _=s.getColWidths();if(_){let y=[..._],x=d<0?0:d,E=y[x];y.splice(x,0,E),s.setColWidths(y)}return g}function II(e,n){let r=e.getChildren();for(let s=0;s<r.length;s++){let i=r[s];if(Be(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 eO(){let e=V();G(e)||je(e)||ge(188);let[n,r]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[s,,i]=Ut(n),[a]=Ut(r),[l,c,d]=rn(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],y=i.getChildAtIndex(p+1);for(let x=p;x>=f;x--){for(let b=m-1;b>=0;b--){let{cell:R,startRow:M,startColumn:k}=l[x][b];if(k===b){if(M<f||M+R.__rowSpan-1>p){let P=Math.max(M,f),F=Math.min(R.__rowSpan+M-1,p),z=P<=F?F-P+1:0;R.setRowSpan(R.__rowSpan-z)}if(M>=f&&M+R.__rowSpan-1>p&&x===p){Be(y)||ge(387);let P=null;for(let F=0;F<b;F++){let z=_[F],K=z.cell;z.startRow===x+1&&(P=K),K.__colSpan>1&&(F+=K.__colSpan-1)}P===null?$m(y,R):P.insertAfter(R)}}}let E=i.getChildAtIndex(x);Be(E)||ge(206,String(x)),E.remove()}if(_!==void 0){let{cell:x}=_[0];ql(x)}else{let x=l[f-1],{cell:E}=x[0];ql(E)}}var LI=eO;function tO(){let e=V();G(e)||je(e)||ge(188);let n=e.anchor.getNode(),r=e.focus.getNode(),[s,,i]=Ut(n),[a]=Ut(r),[l,c,d]=rn(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),y=_-m+1;if(l[0].length===_-m+1)return i.selectPrevious(),void i.remove();let x=l.length;for(let M=0;M<x;M++)for(let k=m;k<=_;k++){let{cell:P,startColumn:F}=l[M][k];if(F<m){if(k===m){let z=m-F;P.setColSpan(P.__colSpan-Math.min(y,P.__colSpan-z))}}else if(F+P.__colSpan-1>_){if(k===_){let z=_-F+1;P.setColSpan(P.__colSpan-z)}}else P.remove()}let E=l[g],b=f>p?E[f+s.__colSpan]:E[p+a.__colSpan];if(b!==void 0){let{cell:M}=b;ql(M)}else{let M=p<f?E[p-1]:E[f-1],{cell:k}=M;ql(k)}let R=i.getColWidths();if(R){let M=[...R];M.splice(m,y),i.setColWidths(M)}}var FI=tO;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 nO(e){if(e.length===0)return null;let n=jd(e[0]),[r]=fo(n,null,null),s=1/0,i=-1/0,a=1/0,l=-1/0,c=new Set;for(let _ of r)for(let y of _){if(!y||!y.cell)continue;let x=y.cell.getKey();if(!c.has(x)&&e.some((E)=>E.is(y.cell))){c.add(x);let{startRow:E,startColumn:b}=y,R=y.cell.__rowSpan||1,M=y.cell.__colSpan||1;s=Math.min(s,E),i=Math.max(i,E+R-1),a=Math.min(a,b),l=Math.max(l,b+M-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 y=a;y<=l;y++){let x=r[_][y];if(!x.cell)continue;let E=x.cell,b=E.getKey();if(!m.has(b))m.add(b),PI(E)||p.append(...E.getChildren()),E.remove()}return p.getChildrenSize()===0&&p.append(ye()),p}function PI(e){if(e.getChildrenSize()!==1)return!1;let n=e.getFirstChildOrThrow();return!(!Dn(n)||!n.isEmpty())}function BI(){let e=V();G(e)||je(e)||ge(188);let n=e.anchor.getNode(),r=pe(n,_e);return _e(r)||ge(148),wm(r)}function wm(e){let[n,r,s]=Ut(e),{__colSpan:i,__rowSpan:a}=n;if(i===1&&a===1)return;let[l,c]=rn(s,n,n),{startColumn:d,startRow:f}=c,g=n.__headerState&Ae.COLUMN,p=Array.from({length:i},(y,x)=>{let E=g;for(let b=0;E!==0&&b<l.length;b++)E&=l[b][x+d].cell.__headerState;return E}),m=n.__headerState&Ae.ROW,_=Array.from({length:a},(y,x)=>{let E=m;for(let b=0;E!==0&&b<l[0].length;b++)E&=l[x+f][b].cell.__headerState;return E});if(i>1){for(let y=1;y<i;y++)n.insertAfter(hn(p[y]|_[0]).append(ye()));n.setColSpan(1)}if(a>1){let y;for(let x=1;x<a;x++){let E=f+x,b=l[E];y=(y||r).getNextSibling(),Be(y)||ge(125);let R=null;for(let M=0;M<d;M++){let k=b[M],P=k.cell;k.startRow===E&&(R=P),P.__colSpan>1&&(M+=P.__colSpan-1)}if(R===null)for(let M=i-1;M>=0;M--)$m(y,hn(p[M]|_[x]).append(ye()));else for(let M=i-1;M>=0;M--)R.insertAfter(hn(p[M]|_[x]).append(ye()))}n.setRowSpan(1)}}function rn(e,n,r){let[s,i,a]=fo(e,n,r);return i===null&&ge(207),a===null&&ge(208),[s,i,a]}function fo(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];Be(f)||ge(209);let g=l(d);for(let p=f.getFirstChild(),m=0;p!=null;p=p.getNextSibling()){for(_e(p)||ge(147);g[m]!==void 0;)m++;let _={cell:p,startColumn:m,startRow:d},{__rowSpan:y,__colSpan:x}=p;for(let E=0;E<y&&!(d+E>=c.length);E++){let b=l(d+E);for(let R=0;R<x;R++)b[m+R]=_}n!==null&&i===null&&n.is(p)&&(i=_),r!==null&&a===null&&r.is(p)&&(a=_)}}return[s,i,a]}function Ut(e){let n;if(e instanceof _r)n=e;else if("__type"in e){let i=pe(e,_e);_e(i)||ge(148),n=i}else{let i=pe(e.getNode(),_e);_e(i)||ge(148),n=i}let r=n.getParent();Be(r)||ge(149);let s=r.getParent();return rt(s)||ge(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,y=g.startRow<=c&&m>=a;if(_&&y){let x=Math.min(i,g.startColumn),E=Math.max(l,p),b=Math.min(a,g.startRow),R=Math.max(c,m);x===i&&E===l&&b===a&&R===c||(i=x,l=E,a=b,c=R,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(!Be(s))return!1;if(r===null&&(r=s.getChildrenSize()),s.getChildrenSize()!==r)return!1;let i=s.getChildren();for(let a of i)if(!_e(a)||a.getRowSpan()!==1||a.getColSpan()!==1)return!1}return(r||0)>0}function KI(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(Be).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 zI(e,n,r){if(n===r)return;let s=e.getChildren().filter(Be),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]=Ut(e),s=r.getChildren().filter(Be),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(_e),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 y=0;y<m;y++)for(let x=0;x<_;x++)l[c+y][f+x]=p;if(n===p)return{colSpan:_,columnIndex:f,rowIndex:c,rowSpan:m};f+=_}}return null}function oO(e,n){let r=n.getStartEndPoints(),s=je(n);if(r===null)return!1;let[i,a]=r,[l,c,d]=Ut(i),f=pe(a.getNode(),(W)=>_e(W));if(!(_e(l)&&_e(f)&&Be(c)&&rt(d)))return!1;let[g,p,m]=rn(d,l,f),[_]=fo(e,null,null),y=g.length,x=y>0?g[0].length:0,{startRow:E,startColumn:b}=p,R=_.length,M=R>0?_[0].length:0;if(s){let W=Jl(g,p,m),te=W.maxRow-W.minRow+1,Z=W.maxColumn-W.minColumn+1;E=W.minRow,b=W.minColumn,R=Math.min(R,te),M=Math.min(M,Z)}let k=!1,P=Math.min(y,E+R)-1,F=Math.min(x,b+M)-1,z=new Set;for(let W=E;W<=P;W++)for(let te=b;te<=F;te++){let Z=g[W][te];z.has(Z.cell.getKey())||(Z.cell.__rowSpan===1&&Z.cell.__colSpan===1||(wm(Z.cell),z.add(Z.cell.getKey()),k=!0))}let[K]=fo(d.getWritable(),null,null),H=R-y+E;for(let W=0;W<H;W++)Ud(K[y-1][0].cell);let q=M-x+b;for(let W=0;W<q;W++)Hd(K[0][x-1].cell,!0,!1);[K]=fo(d.getWritable(),null,null);for(let W=E;W<E+R;W++)for(let te=b;te<b+M;te++){let Z=W-E,re=te-b,Y=_[Z][re];if(Y.startRow!==Z||Y.startColumn!==re)continue;let de=Y.cell;if(de.__rowSpan!==1||de.__colSpan!==1){let ae=[],ce=Math.min(W+de.__rowSpan,E+R)-1,we=Math.min(te+de.__colSpan,b+M)-1;for(let ke=W;ke<=ce;ke++)for(let gt=te;gt<=we;gt++){let Qt=K[ke][gt];ae.push(Qt.cell)}nO(ae),k=!0}let{cell:xe}=K[W][te],Re=de.getBackgroundColor();Re!=null&&xe.setBackgroundColor(Re);let ne=xe.getChildren();de.getChildren().forEach((ae)=>{if(oe(ae))ye().append(ae),xe.append(ae);else xe.append(ae)}),ne.forEach((ae)=>ae.remove())}if(s&&k){let[W]=fo(d.getWritable(),null,null);W[p.startRow][p.startColumn].cell.selectEnd()}return!0}function UI(e,n,r){let[s]=fo(e,null,null);n>=0&&n<s.length||ge(396,String(n));let i=s[n],a=r?Ae.ROW:Ae.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,Ae.ROW)))}}function HI(e,n,r){let[s]=fo(e,null,null);s.length>0&&n>=0&&n<s[0].length||ge(397,String(n));let i=r?Ae.COLUMN:Ae.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,Ae.COLUMN)))}}function Cm(e){let[[n,r,s,i],[a,l,c,d]]=["anchor","focus"].map((f)=>{let g=e[f].getNode(),p=pe(g,_e);_e(p)||ge(238,f,g.getKey(),g.getType());let m=p.getParent();Be(m)||ge(239,f);let _=m.getParent();return rt(_)||ge(240,f),[g,p,m,_]});return i.is(d)||ge(241),{anchorCell:r,anchorNode:n,anchorRow:s,anchorTable:i,focusCell:l,focusNode:a,focusRow:c,focusTable:d}}class ec{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=At(this.tableKey),n=At(this.anchor.key),r=At(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 ec(this.tableKey,qn(this.anchor.key,this.anchor.offset,this.anchor.type),qn(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
- `)?e.slice(0,-1):e).split(`
39
- `).map((i)=>i.split("\t")),r=tc();for(let i of n){let a=xr();for(let l of i){let c=hn(Ae.NO_STATUS),d=ye();l&&d.append(Ct(l)),c.append(d),a.append(c)}r.append(a)}let{anchorCell:s}=Cm(this);oO(r,s.select(0,s.getChildrenSize()))}insertText(){}hasFormat(e){let n=0;this.getNodes().filter(_e).forEach((s)=>{let i=s.getFirstChild();Dn(i)&&(n|=i.getTextFormat())});let r=Ii[e];return(n&r)!==0}insertNodes(e){let n=this.focus.getNode();J(n)||ge(151),Ko(n.select(0,n.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:n}=Cm(this),r=Tm(e);r===null&&ge(153);let s=Tm(n);s===null&&ge(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 x=i.getParent();x==null&&ge(159),this.set(this.tableKey,s.getKey(),x.getKey())}else{let x=n.getParent();x==null&&ge(158),this.set(this.tableKey,x.getKey(),s.getKey())}return this.getNodes()}let[a,l,c]=rn(n,r,s),{minColumn:d,maxColumn:f,minRow:g,maxRow:p}=Jl(a,l,c),m=new Map([[n.getKey(),n]]),_=null;for(let x=g;x<=p;x++)for(let E=d;E<=f;E++){let{cell:b}=a[x][E],R=b.getParent();Be(R)||ge(160),R!==_&&(m.set(R.getKey(),R),_=R),m.has(b.getKey())||GI(b,(M)=>{m.set(M.getKey(),M)})}let y=Array.from(m.values());return yS()||(this._cachedNodes=y),y}getTextContent(){let e=this.getNodes().filter((r)=>_e(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 ec}function WI(){let e=qn("root",0,"element"),n=qn("root",0,"element");return new ec("root",e,n)}function Wd(e,n,r){e.getKey(),n.getKey(),r.getKey();let s=V(),i=je(s)?s.clone():new ec("root",qn("root",0,"element"),qn("root",0,"element"));return i.set(e.getKey(),n.getKey(),r.getKey()),i}function GI(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&&J(i)&&r.push(i.getChildren())}}function Im(e,n=Ge()){let r=At(e);rt(r)||ge(231,e);let s=Jo(r,n.getElementByKey(e));return s===null&&ge(232,e),{tableElement:s,tableNode:r}}class rO{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=At(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=ua(s,i)})});this.editor.read("latest",()=>{let{tableNode:n,tableElement:r}=this.$lookup();this.table=ua(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();Bd(n,ua(r,s),null),e&&V()!==null&&(pt(null),n.dispatchCommand(oo))}$enableHighlightStyle(){let e=this.editor,{tableElement:n}=this.$lookup();on(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&&ge(233,e.tableKey,this.tableNodeKey);let n=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Bd(n,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=In(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=Wd(s,d,c),pt(this.tableSelection),r.dispatchCommand(oo),Bd(r,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?At(this.anchorCellNodeKey):null;return _e(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&ge(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?At(this.focusCellNodeKey):null;return _e(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&ge(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=Wd(n,r,r),this.anchorCellNodeKey=s}}$formatCells(e){let n=V();je(n)||ge(236);let r=Fr(),{anchor:s,focus:i}=r,a=n.getNodes().filter(_e);a.length>0||ge(237);let l=a[0].getFirstChild(),c=Dn(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)}),pt(n),this.editor.dispatchCommand(oo)}$clearText(){let{editor:e}=this,n=At(this.tableNodeKey);if(!rt(n))throw Error("Expected TableNode.");let r=V();je(r)||ge(253);let s=r.getNodes().filter(_e),i=n.getFirstChild(),a=n.getLastChild();if(s.length>0&&i!==null&&a!==null&&Be(i)&&Be(a)&&s[0]===i.getFirstChild()&&s[s.length-1]===a.getLastChild()){n.selectPrevious();let l=n.getParent();return n.remove(),void(Co(l)&&l.isEmpty()&&e.dispatchCommand(Wr))}s.forEach((l)=>{if(J(l)){let c=ye(),d=Ct();c.append(d),l.append(c),l.getChildren().forEach((f)=>{f!==c&&f.remove()})}}),Bd(e,this.table,null),pt(null),e.dispatchCommand(oo)}}var ca="__lexicalTableSelection";function sO(e){let n=Iy(e);return rt(n)||ge(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 Ce(e)&&e.nodeName==="TABLE"}function Jo(e,n){if(!n)return n;let r=as(n)?n:n.querySelector("table");return as(r)||ge(341,e.constructor.name,e.getType(),e.getKey(),n.nodeName),r}function Yd(e){return e._window}function Vd(e,n){for(let r=n,s=null;r!==null;r=r.getParent()){if(e.is(r))return s;_e(r)&&(s=r)}return null}var jI=[[Wo,"down"],[no,"up"],[Gr,"backward"],[Oi,"forward"]],YI=[iu,su,Ti],VI=[Ai,pu];function XI(e,n){return e.registerRootListener((r)=>{if(r===null)return;let s=e._window;if(s===null)return;return so(s,"pointerdown",(i)=>{let a=Sl(i);if(i.button!==0||!ro(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"&&ca in f&&f[ca])return{cellElement:d,tableElement:f,tableObserver:f[ca]};f=f.parentNode}return null}(a);e.update(()=>{if(je(V())){for(let[g]of n.observers.values())g.$clearHighlight(!1);pt(null),e.dispatchCommand(oo)}if(!l)return;let{tableObserver:c,tableElement:d,cellElement:f}=l;(function(g,p,m,_,y,x){let E=g._window;if(!E)return;let b=(k)=>{if(y.isSelecting)return;y.isSelecting=!0,k!==null&&y.anchorCell===null&&g.update(()=>{y.$setAnchorCellForSelection(k)});let{clientX:P,clientY:F}=p,z=null,K=()=>{y.isSelecting=!1,z!==null&&(E.cancelAnimationFrame(z),z=null),E.removeEventListener("pointerup",xe),E.removeEventListener("pointermove",Re)},H=(ne,ae)=>{let ce=_.getRootNode();if(!Xr(ce)&&!Ou(ce))return null;for(let we of ce.elementsFromPoint(ne,ae)){let ke=Wv(_,we);if(ke)return ke}return null},q=(ne,ae)=>{y.anchorCell===null&&g.update(()=>{y.$setAnchorCellForSelection(ne)}),y.focusCell!==null&&ne.elem===y.focusCell.elem||(x.setNextFocus({focusCell:ne,override:ae,tableKey:y.tableNodeKey}),g.dispatchCommand(oo))},W=(ne)=>{for(let ae=_.parentElement;ae;ae=ae.parentElement)if(ne==="x"?ae.scrollWidth>ae.clientWidth:ae.scrollHeight>ae.clientHeight){let ce=E.getComputedStyle(ae),we=ne==="x"?ce.overflowX:ce.overflowY;if(we==="auto"||we==="scroll")return ae}return null},te=(ne,ae,ce)=>{let we,ke;if(ne===null)we=0,ke=ce==="x"?E.innerWidth:E.innerHeight;else{let Pe=ne.getBoundingClientRect();we=ce==="x"?Pe.left:Pe.top,ke=ce==="x"?Pe.right:Pe.bottom}let gt=ym(ae,we,ke);if(gt===0)return!1;if(ne===null){let Pe=ce==="x"?E.scrollX:E.scrollY;return E.scrollBy(ce==="x"?gt:0,ce==="x"?0:gt),(ce==="x"?E.scrollX:E.scrollY)!==Pe}if(ce==="x"){let Pe=ne.scrollLeft;return ne.scrollLeft+=gt,ne.scrollLeft!==Pe}let Qt=ne.scrollTop;return ne.scrollTop+=gt,ne.scrollTop!==Qt},Z=(ne,ae)=>{let ce=P,we=F;if(ne===null)ce=Math.min(Math.max(ce,1),E.innerWidth-1);else{let ke=ne.getBoundingClientRect();ce=Math.min(Math.max(ce,ke.left+1),ke.right-1)}if(ae===null)we=Math.min(Math.max(we,1),E.innerHeight-1);else{let ke=ae.getBoundingClientRect();we=Math.min(Math.max(we,ke.top+1),ke.bottom-1)}return[ce,we]},re=()=>{let ne=W("x");if(ne!==null){let ke=ne.getBoundingClientRect();if(ym(P,ke.left,ke.right)!==0)return!0}let ae=W("y"),ce=ae===null?0:ae.getBoundingClientRect().top,we=ae===null?E.innerHeight:ae.getBoundingClientRect().bottom;return ym(F,ce,we)!==0},Y=()=>{if(z=null,!y.isSelecting)return;let ne=W("x"),ae=W("y"),ce=ne!==null&&te(ne,P,"x"),we=te(ae,F,"y");if(ce||we){let[ke,gt]=Z(ne,ae),Qt=H(ke,gt);Qt&&q(Qt,!1),z=E.requestAnimationFrame(Y)}},de=()=>{z===null&&y.pointerType!=="touch"&&re()&&(z=E.requestAnimationFrame(Y))},xe=()=>{K()},Re=(ne)=>{if(!((ke)=>!(1&~ke.buttons))(ne)&&y.isSelecting)return void K();let ae=Sl(ne);if(!ro(ae))return;P=ne.clientX,F=ne.clientY;let ce=null,we=!(ws||_.contains(ae));ce=we?Wv(_,ae):H(ne.clientX,ne.clientY),ce&&q(ce,we),de()};E.addEventListener("pointerup",xe,y.listenerOptions),E.addEventListener("pointermove",Re,y.listenerOptions)};y.pointerType=p.pointerType;let R=sO(y.tableNodeKey),M=Sn();if(ws&&p.shiftKey&&Oo(M,R)&&(G(M)||je(M))){let k=M.anchor.getNode(),P=Vd(R,M.anchor.getNode());if(P)y.$setAnchorCellForSelection(Qs(y,P)),y.$setFocusCellForSelection(m),mr(p);else(R.isBefore(k)?R.selectStart():R.selectEnd()).anchor.set(M.anchor.key,M.anchor.offset,M.anchor.type)}else p.pointerType!=="touch"&&y.$setAnchorCellForSelection(m);b(m)})(e,i,f,d,c,n)})})})}function iO(e,n,r,s,i){let a=r.getRootElement(),l=Yd(r);a!==null&&l!==null||ge(246);let c=new Lm(r,e.getKey()),d=Jo(e,n);(function(m,_){bm(m)!==null&&ge(205),m[ca]=_})(d,c),c.listenersToRemove.add(()=>function(m,_){bm(m)===_&&delete m[ca]}(d,c)),c.listenersToRemove.add(so(d,"mousedown",(m)=>{let _=Sl(m);if(m.detail>=3&&ro(_))Zl(_)!==null&&m.preventDefault()},c.listenerOptions));for(let[m,_]of jI)c.listenersToRemove.add(r.registerCommand(m,(y)=>cO(r,y,_,e,c,i),wn));c.listenersToRemove.add(r.registerCommand(Mi,(m)=>{let _=V();if(je(_)){let y=Vd(e,_.focus.getNode());if(y!==null)return mr(m),y.selectEnd(),!0}return!1},wn));let f=()=>{let m=V();return!!Oo(m,e)&&(!!je(m)&&(c.$clearText(),!0))};for(let m of YI)c.listenersToRemove.add(r.registerCommand(m,f,wn));let g=(m)=>{let _=V();if(!je(_)&&!G(_))return!1;let y=e.isParentOf(_.anchor.getNode());if(y!==e.isParentOf(_.focus.getNode())){let x=y?"anchor":"focus",E=y?"focus":"anchor",{key:b,offset:R,type:M}=_[E];return e[_[x].isBefore(_[E])?"selectPrevious":"selectNext"]()[E].set(b,R,M),!1}return!!Oo(_,e)&&(!!je(_)&&(m&&(m.preventDefault(),m.stopPropagation()),c.$clearText(),!0))};for(let m of VI)c.listenersToRemove.add(r.registerCommand(m,g,wn));c.listenersToRemove.add(r.registerCommand(ou,(m)=>{let _=V();if(_){if(!je(_)&&!G(_))return!1;wl(r,Ln(m,ClipboardEvent)?m:null,id(_));let y=g(m);return G(_)?(_.removeText(),!0):y}return!1},wn));let p=a.ownerDocument;return c.listenersToRemove.add(so(p,"paste",(m)=>{if(m.defaultPrevented)return;r.read("latest",()=>{let _=V();return a.contains(p.activeElement)&&je(_)&&Oo(_,e)})&&(m.preventDefault(),r.dispatchCommand($i,m))})),c.listenersToRemove.add(so(p,"copy",(m)=>{if(m.defaultPrevented)return;let _=Sl(m);if(_===a||ro(_)&&a.contains(_))return;r.read("latest",()=>{let y=V();return a.contains(So(a))&&je(y)&&Oo(y,e)})&&(m.preventDefault(),r.dispatchCommand(Ei,m))})),c.listenersToRemove.add(r.registerCommand(Ho,(m)=>{let _=V();return!!Oo(_,e)&&(!!je(_)&&(c.$formatCells(m),!0))},wn)),c.listenersToRemove.add(r.registerCommand(lu,(m)=>{let _=V();if(!je(_)||!Oo(_,e))return!1;let y=_.anchor.getNode(),x=_.focus.getNode();if(!_e(y)||!_e(x))return!1;let[E,b,R]=rn(e,y,x),M=Math.max(b.startRow+b.cell.__rowSpan-1,R.startRow+R.cell.__rowSpan-1),k=Math.max(b.startColumn+b.cell.__colSpan-1,R.startColumn+R.cell.__colSpan-1),P=Math.min(b.startRow,R.startRow),F=Math.min(b.startColumn,R.startColumn);if(P===0&&F===0&&M===E.length-1&&k===E[0].length-1)return e.setFormat(m),!0;let z=new Set;for(let K=P;K<=M;K++)for(let H=F;H<=k;H++){let q=E[K][H].cell;if(z.has(q))continue;z.add(q),q.setFormat(m);let W=q.getChildren();for(let te=0;te<W.length;te++){let Z=W[te];J(Z)&&!Z.isInline()&&Z.setFormat(m)}}return!0},wn)),c.listenersToRemove.add(r.registerCommand(nu,(m)=>{let _=V();if(!Oo(_,e))return!1;if(je(_))return c.$clearHighlight(),!1;if(G(_)){let y=pe(_.anchor.getNode(),(x)=>_e(x));if(!_e(y))return!1;if(typeof m=="string"){let x=jv(r,_,e);if(x)return Gv(x,e,[Ct(m)]),!0}}return!1},wn)),s&&c.listenersToRemove.add(r.registerCommand(jr,(m)=>{let _=V();if(!G(_)||!_.isCollapsed()||!Oo(_,e))return!1;let y=aa(_.anchor.getNode());return!(y===null||!e.is(ei(y)))&&(mr(m),function(x,E){let b=E==="next"?"getNextSibling":"getPreviousSibling",R=E==="next"?"getFirstChild":"getLastChild",M=x[b]();if(J(M))return M.selectEnd();let k=pe(x,Be);k===null&&ge(247);for(let F=k[b]();Be(F);F=F[b]()){let z=F[R]();if(J(z))return z.selectEnd()}let P=pe(k,rt);P===null&&ge(248),E==="next"?P.selectNext():P.selectPrevious()}(y,m.shiftKey?"previous":"next"),!0)},wn)),c.listenersToRemove.add(r.registerCommand(Qy,(m)=>e.isSelected(),wn)),c.listenersToRemove.add(r.registerCommand(Wr,()=>{let m=V();if(!G(m)||!m.isCollapsed()||!Oo(m,e))return!1;let _=jv(r,m,e);return!!_&&(Gv(_,e),!0)},wn)),c}function qI(e,n){let r=V(),s=Sn(),i=e.getAndClearNextFocus();if(i!==null){let{tableKey:l,focusCell:c}=i,d=e.observers.get(l);d||ge(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&&G(s)&&G(r)&&r.isCollapsed()){let l=At(a);if(rt(l)){let c=r.anchor.getNode(),d=l.getFirstChild(),f=aa(c);if(f!==null&&Be(d)){let g=d.getFirstChild();if(_e(g)&&l.is(pe(f,(p)=>p.is(l)||p.is(g))))return g.selectStart(),!0}}}je(r)&&function(l,c){let d=Yd(l),f=Sn();if(!c.is(f))return;let g=sO(c.tableKey),p=In(d),m=p&&ks(p,l.getRootElement());if(p&&m&&m.anchorNode&&m.focusNode){let _=bt(m.focusNode),y=_&&!g.isParentOf(_),x=bt(m.anchorNode),E=x&&g.isParentOf(x);if(y&&E&&p.rangeCount>0){let b=Ry(p,l);b&&(b.anchor.set(g.getKey(),c.isBackward()?g.getChildrenSize():0,"element"),p.removeAllRanges(),pt(b))}}}(n,r),G(r)&&function(l,c){let d=Sn(),{anchor:f,focus:g}=l,p=f.getNode(),m=g.getNode(),_=aa(p),y=aa(m),x=_?ei(_):null,E=y?ei(y):null,b=l.isBackward(),R=_&&y&&x&&E&&x.is(E),M=E&&(!x||x.isParentOf(E)),k=x&&(!E||E.isParentOf(x));if(M){let P=l.clone(),[F]=rn(E,y,y),z=F[0][0].cell,K=F[F.length-1].at(-1).cell;P.focus.set(b?z.getKey():K.getKey(),b?0:K.getChildrenSize(),"element"),pt(P)}else if(k){let P=l.clone(),[F]=rn(x,_,_),z=F[0][0].cell,K=F[F.length-1].at(-1).cell;P.anchor.set(b?K.getKey():z.getKey(),b?K.getChildrenSize():0,"element"),pt(P)}else if(R){let P=c.observers.get(x.getKey());P||ge(335,x.getKey());let[F]=P;if(_.is(y)||(F.$setAnchorCellForSelection(Qs(F,_)),F.$setFocusCellForSelection(Qs(F,y),!0)),F.pointerType==="touch"&&F.isSelecting&&l.isCollapsed()&&G(d)&&d.isCollapsed()){let z=aa(d.anchor.getNode());z&&!z.is(y)&&(F.$setAnchorCellForSelection(Qs(F,z)),F.$setFocusCellForSelection(Qs(F,y),!0),F.pointerType=null)}}}(r,e);for(let[l,c]of e.$getTableNodesAndObservers())JI(n,l,c);return!1}function JI(e,n,r){let s=V(),i=Sn();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,lO(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,aO(a,c)})}(e,r)}function bm(e){return e[ca]||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 Wv(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 ua(e,n){let r=[],s={columns:0,domRows:r,rows:0},i=Jo(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 Bd(e,n,r){let s=new Set(r?r.getNodes():[]);vm(n,(i,a)=>{let l=i.elem;s.has(a)?(i.highlighted=!0,aO(e,i)):(i.highlighted=!1,lO(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=bt(l.elem);c!==null&&n(l,c,{x:a,y:s})}}}var ZI=(e,n,r,s,i)=>{let a=i==="forward";switch(i){case"backward":case"forward":return r!==(a?e.table.columns-1:0)?zd(n.getCellNodeFromCordsOrThrow(r+(a?1:-1),s,e.table),a):s!==(a?e.table.rows-1:0)?zd(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?zd(n.getCellNodeFromCordsOrThrow(r,s-1,e.table),!1):n.selectPrevious(),!0;case"down":return s!==e.table.rows-1?zd(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 Kd([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&&ge(250,s,String(i));let l=n[r],c=a[l];return c===void 0&&ge(250,r,String(l)),c}function QI(e,n,r,s,i){let a=Jl(n,r,s),l=function(F,z){let{minColumn:K,maxColumn:H,minRow:q,maxRow:W}=z,te=1,Z=1,re=1,Y=1,de=F[q],xe=F[W];for(let Re=K;Re<=H;Re++)te=Math.max(te,de[Re].cell.__rowSpan),Y=Math.max(Y,xe[Re].cell.__rowSpan);for(let Re=q;Re<=W;Re++)Z=Math.max(Z,F[Re][K].cell.__colSpan),re=Math.max(re,F[Re][H].cell.__colSpan);return{bottomSpan:Y,leftSpan:Z,rightSpan:re,topSpan:te}}(n,a),{topSpan:c,leftSpan:d,bottomSpan:f,rightSpan:g}=l,p=function(F,z){let K=Sm(F,z);return K===null&&ge(249,z.cell.getKey()),K}(a,r),[m,_]=Kd(p),y=a[m],x=a[_];i==="forward"?y+=m==="maxColumn"?1:d:i==="backward"?y-=m==="minColumn"?1:g:i==="down"?x+=_==="maxRow"?1:c:i==="up"&&(x-=_==="minRow"?1:f);let E=n[x];if(E===void 0)return!1;let b=E[y];if(b===void 0)return!1;let[R,M]=function(F,z,K){let H=Jl(F,z,K),q=Sm(H,z);if(q)return[ia(F,H,q),ia(F,H,Kd(q))];let W=Sm(H,K);if(W)return[ia(F,H,Kd(W)),ia(F,H,W)];let te=["minColumn","minRow"];return[ia(F,H,te),ia(F,H,Kd(te))]}(n,r,b),k=Qs(e,R.cell),P=Qs(e,M.cell);return e.$setAnchorCellForSelection(k),e.$setFocusCellForSelection(P,!0),!0}function Oo(e,n){if(G(e)||je(e)){let r=n.isParentOf(e.anchor.getNode()),s=n.isParentOf(e.focus.getNode());return r&&s}return!1}function zd(e,n){n?e.selectStart():e.selectEnd()}function aO(e,n){let r=n.elem,s=e._config.theme;_e(bt(r))||ge(131),et(r,s.tableCellSelected)}function lO(e,n){let r=n.elem;_e(bt(r))||ge(131);let s=e._config.theme;on(r,s.tableCellSelected)}function aa(e){let n=pe(e,_e);return _e(n)?n:null}function ei(e){let n=pe(e,rt);return rt(n)?n:null}function e1(e,n,r,s,i,a,l){let c=cn(r.focus,i?"previous":"next");if(al(c))return!1;let d=c;for(let E of vs(c).iterNodeCarets("shadowRoot")){if(!yo(E)||!J(E.origin))return!1;d=E}let f=d.getParentAtCaret();if(!_e(f))return!1;let g=f,p=function(E){for(let b of vs(E).iterNodeCarets("root")){let{origin:R}=b;if(_e(R)){if(Bo(b))return Tt(R,E.direction)}else if(!Be(R))break}return null}(it(g,d.direction)),m=pe(g,rt);if(!m||!m.is(a))return!1;let _=e.getElementByKey(g.getKey()),y=Zl(_);if(!_||!y)return!1;let x=fO(e,m);if(l.table=x,p)if(s==="extend"){let E=Zl(e.getElementByKey(p.origin.getKey()));if(!E)return!1;l.$setAnchorCellForSelection(y),l.$setFocusCellForSelection(E,!0)}else{let E=kt(p);Uo(r.anchor,E),Uo(r.focus,E)}else if(s==="extend")l.$setAnchorCellForSelection(y),l.$setFocusCellForSelection(y,!0);else{let E=function(b){let R=sl(b);return Bo(R)?kt(R):b}(it(m,c.direction));Uo(r.anchor,E),Uo(r.focus,E)}return mr(n),!0}function cO(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=V();if(!Oo(l,s)){if(G(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(J(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)&&(mr(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=pe(c,(_)=>rt(_));if(_e(d)&&(d=pe(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"&&J(f)&&(g=f.getChildrenSize());let p=f;if(r==="up"&&J(f))p=f.getLastChild()||f,g=oe(p)?p.getTextContentSize():0;let m=l.clone();return m.focus.set(p.getKey(),g,oe(p)?"text":"element"),pt(m),mr(n),!0}if(Mt(c)){let d=r==="up"?l.getNodes()[l.getNodes().length-1]:l.getNodes()[0];if(d){if(Vd(s,d)!==null){let f=s.getFirstDescendant(),g=s.getLastDescendant();if(!f||!g)return!1;let[p]=Ut(f),[m]=Ut(g),_=s.getCordsFromCellNode(p,i.table),y=s.getCordsFromCellNode(m,i.table),x=s.getDOMCellFromCordsOrThrow(_.x,_.y,i.table),E=s.getDOMCellFromCordsOrThrow(y.x,y.y,i.table);return i.$setAnchorCellForSelection(x),i.$setFocusCellForSelection(E,!0),!0}}return!1}{let d=pe(c,(g)=>J(g)&&!g.isInline());if(_e(d)&&(d=pe(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]=Ut(g),[_]=Ut(p),y=l.clone();return y.focus.set((r==="up"?m:_).getKey(),r==="up"?0:_.getChildrenSize(),"element"),mr(n),pt(y),!0}}}}return r==="down"&&Ql(e)&&a.setShouldCheckSelectionForTable(s.getKey()),!1}if(G(l)){if(r==="backward"||r==="forward")return e1(e,n,l,n.shiftKey?"extend":"move",r==="backward",s,i);if(l.isCollapsed()){let{anchor:c,focus:d}=l,f=pe(c.getNode(),_e),g=pe(d.getNode(),_e);if(!_e(f)||!f.is(g))return!1;let p=ei(f);if(p!==s&&p!=null){let R=Jo(p,e.getElementByKey(p.getKey()));if(R!=null)return i.table=ua(p,R),cO(e,n,r,p,i,a)}let m=e.getElementByKey(f.__key),_=e.getElementByKey(c.key);if(_==null||m==null)return!1;let y;if(c.type==="element")y=_.getBoundingClientRect();else{let R=In(Yd(e));if(R===null||R.rangeCount===0)return!1;let M=hS(R,e.getRootElement());if(M===null)return!1;y=M.getBoundingClientRect()}let x=r==="up"?f.getFirstChild():f.getLastChild();if(x==null)return!1;let E=e.getElementByKey(x.__key);if(E==null)return!1;let b=E.getBoundingClientRect();if(r==="up"?b.top>y.top-y.height:y.bottom+y.height>b.bottom){mr(n);let R=s.getCordsFromCellNode(f,i.table);if(!n.shiftKey)return ZI(i,s,R.x,R.y,r);{let M=s.getDOMCellFromCordsOrThrow(R.x,R.y,i.table);i.$setAnchorCellForSelection(M),i.$setFocusCellForSelection(M,!0)}return!0}}}else if(je(l)){let{anchor:c,focus:d,tableKey:f}=l;if(f!==s.getKey())return!1;let g=pe(c.getNode(),_e),p=pe(d.getNode(),_e),[m]=l.getNodes();rt(m)||ge(251);let _=Jo(m,e.getElementByKey(m.getKey()));if(!_e(g)||!_e(p)||!rt(m)||_==null)return!1;i.$updateTableTableSelection(l);let y=ua(m,_),x=s.getCordsFromCellNode(g,y),E=s.getDOMCellFromCordsOrThrow(x.x,x.y,y);if(i.$setAnchorCellForSelection(E),mr(n),n.shiftKey){let[b,R,M]=rn(s,g,p);return QI(i,b,R,M,r)}return p.selectEnd(),!0}return!1}function mr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Gv(e,n,r){let s=ye();e==="first"?n.insertBefore(s):n.insertAfter(s),s.append(...r||[]),s.selectEnd()}function jv(e,n,r){let s=r.getParent();if(!s)return;let i=In(Yd(e));if(!i)return;let a=ks(i,e.getRootElement()).anchorNode,l=e.getElementByKey(s.getKey()),c=Jo(r,e.getElementByKey(r.getKey()));if(!a||!l||!c||!l.contains(a)||c.contains(a))return;let d=pe(n.anchor.getNode(),(R)=>_e(R));if(!d)return;let f=pe(d,(R)=>rt(R));if(!rt(f)||!f.is(r))return;let[g,p]=rn(r,d,d),m=g[0][0],_=g[g.length-1][g[0].length-1],{startRow:y,startColumn:x}=p,E=y===m.startRow&&x===m.startColumn,b=y===_.startRow&&x===_.startColumn;return E?"first":b?"last":void 0}function Qs(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 Vd(e,bt(n,r))}function Gd(e){return Ce(e)&&e.nodeName==="DIV"}function Yv(e,n,r){let s=e.querySelector(":scope > colgroup");if(!r)return void(s&&s.remove());s||(s=Xe().createElement("colgroup"),Ru(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 Vv(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)}on(e,...s),et(e,...i)}var uO=new WeakSet;function t1(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 uO.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(uO.has(n))return;let r=n.firstElementChild;if(!r||!Ce(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 n1(e){if(!e.hasAttribute("data-lexical-sticky-scrollbar"))return null;let n=e.firstElementChild;if(!Gd(n))return null;let r=n.querySelector(":scope > table");if(!as(r))return null;let s=n.nextElementSibling;return Gd(s)?{scrollable:n,scrollbar:s,tableElement:r}:null}var Rm=new WeakSet;function Ql(e=Ge()){return Rm.has(e)}function Mm(e=Ge()){let n=io(e,"@lexical/table/Table");return!!n&&(n.output.hasStickyScrollbar.peek()&&n.output.hasHorizontalScroll.peek())}function dO(e,n){n?Rm.add(e):Rm.delete(e)}class Cr extends lt{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config("table",{extends:lt,importDOM:{table:()=>({conversion:o1,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)||ge(229),super.getDOMSlot(e).withElement(n).withAfter(n.querySelector(":scope > colgroup"))}createDOM(e,n){let r=Xe().createElement("table");if(this.__style&&cr(r.style,this.__style),this.getColWidths()){let s=Xe().createElement("colgroup");r.appendChild(s),Ru(s)}if(et(r,e.theme.table),this.updateTableElement(null,r,e),Ql(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),Ru(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")):(on(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")):(on(i,l.theme.tableFrozenRow),a.removeAttribute("data-lexical-frozen-row"))}(n,r,s,this.__frozenRowCount)}updateTableElement(e,n,r){this.__style!==(e?e.__style:"")&&cr(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")):(on(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||Yv(n,this.getColumnCount(),this.getColWidths()),Vv(n,r,this.getFormatType())}updateDOM(e,n,r){let s=Jo(this,n);if(n===s===Ql())return!0;if(Gd(n)){if(n.hasAttribute("data-lexical-sticky-scrollbar")!==Mm())return!0;let i=s.parentElement;Gd(i)&&this.updateTableWrapper(e,i,s,r)}return this.updateTableElement(e,s,r),!1}scaleDOMColWidths(e,n){let r=this.getColWidths();if(!r)return;Yv(Jo(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)&&Ce(s)&&(s=s.querySelector("table")),!as(s))return null;Vv(s,e._config,this.getFormatType());let[i]=fo(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)&&Ce(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=bt(s.elem);return _e(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(!Be(e))return 0;let n=0;return e.getChildren().forEach((r)=>{_e(r)&&(n+=r.getColSpan())}),n}}function fO(e,n){let r=e.getElementByKey(n.getKey());return r===null&&ge(230),ua(n,r)}function o1(e){let n=tc();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(!la.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,Be),node:n}}function tc(){return ln(new Cr)}function rt(e){return e instanceof Cr}function r1(e){Be(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function s1(e){rt(e.getParent())?xp(e,_e):e.remove()}function i1(e){xp(e,Be);let[n]=fo(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;Be(c)||ge(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=hn();g.append(ye()),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 a1(e){if(e.detail<3||!ro(e.target))return!1;let n=bt(e.target);if(n===null)return!1;let r=pe(n,(s)=>J(s)&&!s.isInline());if(r===null)return!1;return!!_e(r.getParent())&&(r.select(0),!0)}function l1(){let e=V();if(!G(e))return!1;let n=ei(e.anchor.getNode());if(n===null)return!1;let r=Je();if(!r.is(n.getParent())||r.getChildrenSize()!==1)return!1;let[s]=fo(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=Wd(n,i.cell,l.cell);return pt(c),!0}function gO(e){return e.registerNodeTransform(_r,(n)=>{if(n.getColSpan()>1||n.getRowSpan()>1){let[,,r]=Ut(n),[s]=rn(r,n,n),i=s.length,a=s[0].length,l=r.getFirstChild();Be(l)||ge(175);let c=[];for(let d=0;d<i;d++){d!==0&&(l=l.getNextSibling(),Be(l)||ge(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){_e(m)||ge(176);let _=hn(m.__headerState);f!==null?f.insertAfter(_):sN(l,_)}}}for(let d of c)d.setColSpan(1),d.setRowSpan(1)}})}function pO(e,n=!0){let r=new rO,s=(i,a,l)=>{let c=Jo(i,l),d=iO(i,c,e,n,r);r.observers.set(a,[d,c])};return De(XI(e,r),e.registerCommand(oo,()=>qI(r,e),wn),e.registerMutationListener(Cr,(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 hO(e,n){e.hasNodes([Cr])||ge(255);let{hasNestedTables:r=zs(!1)}=n??{};return De(e.registerCommand(Xv,(s)=>function({rows:i,columns:a,includeHeaders:l},c){let d=V()||Sn();if(!d||!G(d))return!1;if(!c&&ei(d.anchor.getNode()))return!1;let f=qv(Number(i),Number(a),l);Iu(f);let g=f.getFirstDescendant();return oe(g)&&g.select(),!0}(s,r.peek()),be),e.registerCommand(Cu,(s,i)=>e===i&&function(a,l){let{nodes:c,selection:d}=a;if(!c.some((p)=>rt(p)||rN(p).some((m)=>rt(m.node)))){if(je(d)){let p="",m=!1;for(let _ of c){let y=J(_)&&!_.isInline();p.length>0&&(y||m)&&(p+=`
41
- `),p+=_.getTextContent(),m=y}return d.insertRawText(p),!0}return!1}let f=je(d),g=G(d);if(!(g&&pe(d.anchor.getNode(),(p)=>_e(p))!==null&&pe(d.focus.getNode(),(p)=>_e(p))!==null||f))return!1;if(c.length===1&&rt(c[0]))return oO(c[0],d);if(g&&l.peek()&&!function(p){if(je(p)&&!p.focus.getNode().is(p.anchor.getNode()))return!0;if(G(p)&&_e(p.anchor.getNode())&&!p.anchor.getNode().is(p.focus.getNode()))return!0;return!1}(d))return!1;return!0}(s,r),be),e.registerCommand(ki,l1,Fe),e.registerCommand(Si,a1,be),e.registerNodeTransform(Cr,i1),e.registerNodeTransform(fa,s1),e.registerNodeTransform(_r,r1))}var c1={$accepts:Be,$packageRun:(e)=>e.every(_e)?[xr().splice(0,0,e)]:[],name:"TableSchema"},u1={$accepts:_e,name:"TableRowSchema"},mO=[ut({$import:(e,n)=>{let r=tc();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(!la.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),Be))]},match:dt.tag("table"),name:"@lexical/table/table"}),ut({$import:(e,n)=>[xr(la.test(n.style.height)?parseFloat(n.style.height):void 0).splice(0,0,Tl(e.$importChildren(n),_e))],match:dt.tag("tr"),name:"@lexical/table/tr"}),ut({$import:(e,n)=>{let r=n.nodeName==="TH",s=la.test(n.style.width)?parseFloat(n.style.width):void 0,i=Ae.NO_STATUS;if(r){let E=n.getAttribute("scope");if(E==="col")i=Ae.COLUMN;else if(E==="row")i=Ae.ROW;else{let b=n.parentElement,R=NS(b)&&(b.parentElement&&b.parentElement.nodeName==="THEAD"||b.rowIndex===0),M=n.cellIndex===0;R&&(i|=Ae.ROW),M&&(i|=Ae.COLUMN),i===Ae.NO_STATUS&&(i=Ae.ROW)}}let a=hn(i,n.colSpan,s);a.__rowSpan=n.rowSpan;let l=n.style.backgroundColor;l!==""&&(a.__backgroundColor=l);let c=n.style.verticalAlign;(function(E){return E==="middle"||E==="bottom"})(c)&&(a.__verticalAlign=c);let d=e.get(nh),f=d|function(E){let b=0,R=E.fontWeight;R!=="700"&&R!=="bold"||(b|=pl),E.fontStyle==="italic"&&(b|=ml);let M=(E.textDecoration||"").split(" ");return M.includes("underline")&&(b|=Cl),M.includes("line-through")&&(b|=xl),b}(n.style),g=e.get(oh),p=n.style.color,m=p?{...g,color:p}:g,_=[];f!==d&&_.push(Yi(nh,f)),m!==g&&_.push(Yi(oh,m));let y=function(E){let b=[],R=null,M=()=>{if(R!==null){let k=R.getFirstChild();Ue(k)&&R.getChildrenSize()===1&&k.remove()}};for(let k of E)zg(k)||oe(k)||Ue(k)?R!==null?R.append(k):(R=ye().append(k),b.push(R)):(M(),R=null,b.push(k));return M(),b.length===0&&b.push(ye()),b}(e.$importChildren(n,{context:_})),x=r?y:nd(y,n);return[a.splice(0,0,x)]},match:dt.tag("td","th"),name:"@lexical/table/cell"})],_O=me({build:(e,n,r)=>Dt(n),config:We({hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0}),dependencies:[ao,nn(Vo,{rules:mO})],name:"@lexical/table/Table",nodes:()=>[Cr,fa,_r],register(e,n,r){let s=r.getOutput(),i=!1;return De(St(()=>{let a=s.hasHorizontalScroll.value,l=s.hasStickyScrollbar.value&&a,c=Ql(e);c!==a&&dO(e,a),c===a&&i===l||e.update(Ci),i=l}),hO(e,s),St(()=>pO(e,s.hasTabHandler.value)),St(()=>{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(Cr,(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&&Ce(m)?n1(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:t1(_),parts:_}))}},{skipInitialization:!1}))}(e)})}),St(()=>s.hasCellMerge.value?void 0:gO(e)),St(()=>s.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(_r,(a)=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})))}}),d1=me({dependencies:[_O],name:"@lexical/table/Import"});var le=Fm,{$computeTableCellRectBoundary:MW,$computeTableMap:DW,$computeTableMapSkipCellCheck:$W,$createTableCellNode:wW,$createTableNode:kW,$createTableNodeWithDimensions:IW,$createTableRowNode:LW,$createTableSelection:FW,$createTableSelectionFrom:PW,$deleteTableColumn:BW,$deleteTableColumnAtSelection:KW,$deleteTableColumn__EXPERIMENTAL:zW,$deleteTableRowAtSelection:UW,$deleteTableRow__EXPERIMENTAL:HW,$findCellNode:WW,$findTableNode:GW,$getElementForTableNode:jW,$getNodeTriplet:YW,$getTableAndElementByKey:VW,$getTableCellNodeFromLexicalNode:XW,$getTableCellNodeRect:qW,$getTableColumnIndexFromTableCellNode:JW,$getTableNodeFromLexicalNodeOrThrow:ZW,$getTableRowIndexFromTableCellNode:QW,$getTableRowNodeFromTableCellNodeOrThrow:e2,$insertTableColumn:t2,$insertTableColumnAtNode:n2,$insertTableColumnAtSelection:o2,$insertTableColumn__EXPERIMENTAL:r2,$insertTableRow:s2,$insertTableRowAtNode:i2,$insertTableRowAtSelection:a2,$insertTableRow__EXPERIMENTAL:l2,$isScrollableTablesActive:c2,$isSimpleTable:u2,$isStickyScrollbarActive:d2,$isTableCellNode:f2,$isTableNode:g2,$isTableRowNode:p2,$isTableSelection:h2,$mergeCells:m2,$moveTableColumn:_2,$moveTableRow:x2,$removeTableRowAtIndex:C2,$setTableColumnIsHeader:y2,$setTableRowIsHeader:S2,$unmergeCell:N2,$unmergeCellNode:E2,INSERT_TABLE_COMMAND:T2,TableCellHeaderStates:b2,TableCellNode:xO,TableExtension:v2,TableImportExtension:O2,TableImportRules:A2,TableNode:CO,TableObserver:R2,TableRowNode:yO,TableRowSchema:M2,TableSchema:D2,applyTableHandlers:$2,getDOMCellFromTarget:w2,getTableElement:k2,getTableObserverFromTableElement:I2,registerTableCellUnmergeTransform:L2,registerTablePlugin:F2,registerTableSelectionObserver:P2,setScrollableTablesActive:B2}=le;C();var f1={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 g1(e){let{anchor:n,focus:r}=e,s=e.anchor.getNode(),i=e.focus.getNode();if(s===i)return s;if(e.isBackward())return ip(r)?s:i;else return ip(n)?i:s}function SO({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),[y,x]=u(!1),[E,b]=u(!1),[R,M]=u(!1),k=N(()=>{let Y=V();if(G(Y)){f(Y.hasFormat("bold")),p(Y.hasFormat("italic")),_(Y.hasFormat("underline")),x(Y.hasFormat("strikethrough")),b(Y.hasFormat("code"));let de=g1(Y),xe=de.getParent();M(ea(xe)||ea(de));let Re=Y.anchor.getNode(),ne=Re.getKey()==="root"?Re:Re.getTopLevelElementOrThrow(),ae=ne.getKey();if(n.getElementByKey(ae)!==null)if(bo(ne)){let we=ku(Re,Xo),ke=we?we.getListType():ne.getListType();c(ke)}else if(Fl(ne))c(ne.getTag());else{let we=ne.getType();if(we in f1)c(we);else c("paragraph")}}},[n]);h(()=>n.registerCommand(oo,()=>(k(),!1),Ni),[n,k]),h(()=>n.registerUpdateListener(({editorState:Y})=>{Y.read(()=>{k()})}),[n,k]),h(()=>{let Y=n.registerCommand(Ds,(xe)=>(s(xe),!1),Fe),de=n.registerCommand(Ms,(xe)=>(a(xe),!1),Fe);return()=>{Y(),de()}},[n]);let P=()=>{n.update(()=>{let Y=V();if(G(Y))Ki(Y,()=>ye())})},F=(Y)=>{n.update(()=>{let de=V();if(G(de))Ki(de,()=>fd(Y))})},z=()=>{if(l!=="bullet")n.dispatchCommand(T0,void 0);else n.dispatchCommand(Nd,void 0)},K=()=>{if(l!=="number")n.dispatchCommand(E0,void 0);else n.dispatchCommand(Nd,void 0)},H=()=>{if(l!=="check")n.dispatchCommand(N0,void 0);else n.dispatchCommand(Nd,void 0)},q=()=>{if(l!=="quote")n.update(()=>{let Y=V();if(G(Y))Ki(Y,()=>gd())});else P()},W=()=>{if(l!=="code")n.update(()=>{let Y=V();if(G(Y))Ki(Y,()=>zv())});else P()},te=N(()=>{if(!R){let Y=prompt("Enter link URL (e.g., https://example.com):");if(Y)n.dispatchCommand(kh,Y)}else n.dispatchCommand(kh,null)},[n,R]),Z=N(()=>{n.update(()=>{let Y=V();if(G(Y))Y.setFormat(0),Ki(Y,()=>ye())})},[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:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Nu,void 0),title:"Undo","aria-label":"Undo",children:t(Xm,{className:"h-4 w-4"})}),t("button",{type:"button",disabled:!i,onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(_u,void 0),title:"Redo","aria-label":"Redo",children:t(Gm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),o("select",{value:l,onChange:(Y)=>{let de=Y.target.value;switch(de){case"paragraph":P();break;case"h1":case"h2":case"h3":F(de);break;case"bullet":z();break;case"number":K();break;case"check":H();break;case"quote":q();break;case"code":W();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:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Ho,"bold"),title:"Bold (Ctrl+B)","aria-label":"Bold",children:t(Pm,{className:"h-4 w-4"})}),t("button",{type:"button",className:g?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Ho,"italic"),title:"Italic (Ctrl+I)","aria-label":"Italic",children:t(Um,{className:"h-4 w-4"})}),t("button",{type:"button",className:m?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Ho,"underline"),title:"Underline (Ctrl+U)","aria-label":"Underline",children:t(Vm,{className:"h-4 w-4"})}),t("button",{type:"button",className:y?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Ho,"strikethrough"),title:"Strikethrough","aria-label":"Strikethrough",children:t(Ym,{className:"h-4 w-4"})}),t("button",{type:"button",className:E?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>n.dispatchCommand(Ho,"code"),title:"Inline Code","aria-label":"Inline Code",children:t(_l,{className:"h-4 w-4"})}),t("button",{type:"button",className:R?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:te,title:"Insert Link","aria-label":"Link",children:t(wi,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",className:l==="h1"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>F("h1"),title:"H1","aria-label":"Heading 1",children:t(Bm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h2"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>F("h2"),title:"H2","aria-label":"Heading 2",children:t(Km,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="h3"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:()=>F("h3"),title:"H3","aria-label":"Heading 3",children:t(zm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="bullet"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:z,title:"Bullet List","aria-label":"Bullet List",children:t(wo,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="number"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:K,title:"Numbered List","aria-label":"Numbered List",children:t(Hm,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="check"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:H,title:"Check List","aria-label":"Check List",children:t(bi,{className:"h-4 w-4"})}),t("button",{type:"button",className:l==="quote"?"active":"",onMouseDown:(Y)=>Y.preventDefault(),onClick:q,title:"Quote","aria-label":"Quote",children:t(Wm,{className:"h-4 w-4"})}),t("div",{className:"toolbar-divider"}),t("button",{type:"button",onMouseDown:(Y)=>Y.preventDefault(),onClick:Z,title:"Clear Formatting","aria-label":"Clear Formatting",children:t(jm,{className:"h-4 w-4"})})]}),e&&t("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})]})}var NO={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 nc=[Cv,...yv,...Sv,...Nv,...Ev];function p1({value:e,initialContent:n="",onChange:r}){let[s]=st(),i=v(!1),a=v("");return h(()=>{if(!i.current){i.current=!0;let l=e!==void 0?e:n;if(l)s.update(()=>{Qh(l,nc)}),a.current=l}},[s,n,e]),h(()=>{if(i.current&&e!==void 0&&e!==a.current)s.update(()=>{Qh(e,nc)}),a.current=e},[s,e]),t(Rv,{ignoreSelectionChange:!0,onChange:(l)=>{l.read(()=>{let c=xv(nc);if(c!==a.current)a.current=c,r?.(c)})}})}function EO({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:NO,editable:!i,onError:(g)=>{console.error("[MarkdownEditor] Error:",g)},nodes:[hd,md,Xo,ts,Uv,CO,xO,yO,V0,ta]};return t("div",{className:`shumai-editor-wrapper ${i?"read-only":""} ${l}`,children:o(OS,{initialConfig:f,children:[!i&&!c?t(SO,{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(se,{className:"shumai-editor-content-area flex-1 min-h-0 w-full",children:[t("div",{className:"relative min-h-full",children:t(LT,{contentEditable:t(zT,{className:"editor-input"}),placeholder:t("div",{className:"editor-placeholder",children:s}),ErrorBoundary:Dv})}),t(YT,{}),t(O0,{}),t(A0,{}),t(M0,{}),t(q0,{}),t(Av,{transformers:nc}),t(p1,{value:n,initialContent:e,onChange:r}),a&&t(J0,{})]})]})})}function TO({projectId:e,assetId:n,rootFolderId:r,isRoot:s}){let i=Me(),a=Q(),{canAdmin:l}=Rt(e),{data:c,isLoading:d}=L({queryKey:["folders",n,"agentsmd"],queryFn:async()=>{let Z=await A.api.folders[":folderId"].agentsmd.$get({param:{folderId:n}});if(!Z.ok)throw Error("Failed to fetch agents.md");return await Z.json()}}),[f,g]=u(""),[p,m]=u(!1),[_,y]=u("idle"),x=v(null),E=v(null),b=v(""),R=v(null),M=v(Promise.resolve());h(()=>{if(!p&&c!==void 0){let Z=c.content??"";g(Z),b.current=Z,R.current=Z,m(!0)}},[c,p]);let[k,P]=u(!1),F=U({mutationFn:async(Z)=>{let re=await A.api.folders[":folderId"].agentsmd.$patch({param:{folderId:n},json:{content:Z}});if(!re.ok)throw Error("Failed to save agents.md");return await re.json()},onSuccess:(Z,re)=>{if(y("saved"),R.current=re,a.setQueryData(["folders",n,"agentsmd"],{content:re}),a.invalidateQueries({queryKey:["folders",n]}),E.current)clearTimeout(E.current);E.current=setTimeout(()=>{y("idle")},2500)},onError:()=>{y("error")}}),z=v(F.mutateAsync);z.current=F.mutateAsync;let K=N((Z)=>{if(!l)return Promise.resolve();if(R.current===Z)return y("saved"),Promise.resolve();y("saving");let re=M.current.then(async()=>{await z.current(Z)}).catch(()=>{});return M.current=re,re},[l]),H=N((Z)=>{if(!l)return;if(g(Z),b.current=Z,x.current)clearTimeout(x.current);y("saving"),x.current=setTimeout(()=>{x.current=null,K(Z)},1000)},[l,K]),q=N(()=>{if(x.current)return clearTimeout(x.current),x.current=null,K(b.current);return M.current},[K]);h(()=>()=>{if(q(),E.current)clearTimeout(E.current)},[q]);let W=async()=>{P(!0);try{q(),await M.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}})}},te=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"||k)&&o("span",{className:"inline-flex items-center gap-1 text-muted-foreground animate-pulse whitespace-nowrap",children:[t(js,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Qf()})]}),_==="saved"&&!k&&o("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-medium whitespace-nowrap",children:[t(Te,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:Yh()})]}),_==="error"&&!k&&o("span",{className:"inline-flex items-center gap-1 text-destructive font-medium whitespace-nowrap",children:[t(an,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:LA()})]})]}):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:dm(),children:[t(Vr,{className:"h-3.5 w-3.5 shrink-0"}),t("span",{children:dm()})]}),o("div",{className:"flex items-center gap-2 shrink-0",children:[l&&t(Kn,{orientation:"vertical",className:"h-4 shrink-0"}),o(S,{variant:"ghost",size:"sm",onClick:W,disabled:k,className:"h-7 px-2.5 hover:bg-muted text-muted-foreground hover:text-foreground shrink-0",title:dc(),children:[t(Oe,{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(js,{className:"h-4 w-4 animate-pulse mr-2"}),t("span",{children:DA()})]});return t("div",{className:"flex-1 flex flex-col h-full min-h-0 overflow-hidden",children:t(EO,{value:f,onChange:H,placeholder:ZA(),readOnly:!l,rightToolbarContent:te,className:"flex-1 flex flex-col h-full min-h-0 border rounded-lg shadow-sm"})})}function _i({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}=Ht(),{isChatbotOpen:_,setIsChatbotOpen:y}=pr(),{data:x}=L({queryKey:["folders",s],queryFn:async()=>{let R=await A.api.folders[":folderId"].$get({param:{folderId:s}});if(!R.ok)throw Error("failed to fetch folder");return await R.json()},enabled:!!s}),{setProjectState:E,clearProjectState:b}=Kr();return h(()=>{let M=a||s===i?[]:x?.name?[{id:s,name:x.name},...x?.ancestorFolders??[]]:x?.ancestorFolders??[];return E({teamId:e,projectId:n,projectName:r,ancestorFolders:M,currentAsset:{name:x?.name,type:"folder"},isRootFolder:!0,customTerminalBreadcrumb:"AGENTS.md",onFolderClick:(k)=>{l({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:k}})}}),()=>b()},[e,n,r,x?.ancestorFolders,x?.name,a,s,i,E,b,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:()=>y(!1)}),!p&&o(B,{children:[t("div",{className:"bg-background flex-shrink-0",style:{width:c},children:t(fr,{teamId:e,projectId:n,projectName:r,rootFolderId:i,selectedFolderId:s,ancestorFolders:x?.ancestorFolders??[]})}),t(br,{onResize:(R)=>{d((M)=>Math.max(180,Math.min(400,M+R)))},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(TO,{projectId:n,assetId:s,rootFolderId:i,isRoot:a})}),_&&o(B,{children:[t(br,{onResize:(R)=>{g((M)=>Math.max(240,Math.min(600,M-R)))},className:"hidden md:block"}),t("div",{style:{width:f},className:"bg-background flex flex-col flex-shrink-0",children:t(ns,{projectId:n,contextAssetId:s})})]})]})})}
42
- export{_i};