sykpcomposer 0.0.2 → 0.0.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.
package/dist/index.umd.js CHANGED
@@ -1,40 +1,42 @@
1
- (function(Pt,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],V):(Pt=typeof globalThis<"u"?globalThis:Pt||self,V(Pt.ViteButton={},Pt.React,Pt.ReactDOM))})(this,function(Pt,V,ha){"use strict";function Jp(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Di=Jp(V),YS="";var U={exports:{}},On={};var Mi,ga;function pa(){if(ga)return Mi;ga=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(u){a[u]=u}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Mi=o()?Object.assign:function(s,i){for(var l,c=r(s),a,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var d in l)e.call(l,d)&&(c[d]=l[d]);if(n){a=n(l);for(var f=0;f<a.length;f++)t.call(l,a[f])&&(c[a[f]]=l[a[f]])}}return c},Mi}var _a;function Gp(){if(_a)return On;_a=1,pa();var n=V,e=60103;if(On.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),On.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,c,a){var u,d={},f=null,h=null;a!==void 0&&(f=""+a),c.key!==void 0&&(f=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)o.call(c,u)&&!s.hasOwnProperty(u)&&(d[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)d[u]===void 0&&(d[u]=c[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return On.jsx=i,On.jsxs=i,On}var Ai={};var ma;function qp(){return ma||(ma=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=V,t=pa(),r=60103,o=60106;n.Fragment=60107;var s=60108,i=60114,l=60109,c=60110,a=60112,u=60113,d=60120,f=60115,h=60116,g=60121,p=60122,_=60117,y=60129,m=60131;if(typeof Symbol=="function"&&Symbol.for){var N=Symbol.for;r=N("react.element"),o=N("react.portal"),n.Fragment=N("react.fragment"),s=N("react.strict_mode"),i=N("react.profiler"),l=N("react.provider"),c=N("react.context"),a=N("react.forward_ref"),u=N("react.suspense"),d=N("react.suspense_list"),f=N("react.memo"),h=N("react.lazy"),g=N("react.block"),p=N("react.server.block"),_=N("react.fundamental"),N("react.scope"),N("react.opaque.id"),y=N("react.debug_trace_mode"),N("react.offscreen"),m=N("react.legacy_hidden")}var x=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function E(C){if(C===null||typeof C!="object")return null;var D=x&&C[x]||C[T];return typeof D=="function"?D:null}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(C){{for(var D=arguments.length,R=new Array(D>1?D-1:0),G=1;G<D;G++)R[G-1]=arguments[G];v("error",C,R)}}function v(C,D,R){{var G=O.ReactDebugCurrentFrame,se=G.getStackAddendum();se!==""&&(D+="%s",R=R.concat([se]));var ie=R.map(function(ee){return""+ee});ie.unshift("Warning: "+D),Function.prototype.apply.call(console[C],console,ie)}}var M=!1;function B(C){return!!(typeof C=="string"||typeof C=="function"||C===n.Fragment||C===i||C===y||C===s||C===u||C===d||C===m||M||typeof C=="object"&&C!==null&&(C.$$typeof===h||C.$$typeof===f||C.$$typeof===l||C.$$typeof===c||C.$$typeof===a||C.$$typeof===_||C.$$typeof===g||C[0]===p))}function X(C,D,R){var G=D.displayName||D.name||"";return C.displayName||(G!==""?R+"("+G+")":R)}function te(C){return C.displayName||"Context"}function q(C){if(C==null)return null;if(typeof C.tag=="number"&&S("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case n.Fragment:return"Fragment";case o:return"Portal";case i:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case c:var D=C;return te(D)+".Consumer";case l:var R=C;return te(R._context)+".Provider";case a:return X(C,C.render,"ForwardRef");case f:return q(C.type);case g:return q(C._render);case h:{var G=C,se=G._payload,ie=G._init;try{return q(ie(se))}catch{return null}}}return null}var ne=0,me,Q,rn,Ao,ko,Po,Cr;function xr(){}xr.__reactDisabledLog=!0;function Tr(){{if(ne===0){me=console.log,Q=console.info,rn=console.warn,Ao=console.error,ko=console.group,Po=console.groupCollapsed,Cr=console.groupEnd;var C={configurable:!0,enumerable:!0,value:xr,writable:!0};Object.defineProperties(console,{info:C,log:C,warn:C,error:C,group:C,groupCollapsed:C,groupEnd:C})}ne++}}function Er(){{if(ne--,ne===0){var C={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},C,{value:me}),info:t({},C,{value:Q}),warn:t({},C,{value:rn}),error:t({},C,{value:Ao}),group:t({},C,{value:ko}),groupCollapsed:t({},C,{value:Po}),groupEnd:t({},C,{value:Cr})})}ne<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ve=O.ReactCurrentDispatcher,En;function Ct(C,D,R){{if(En===void 0)try{throw Error()}catch(se){var G=se.stack.trim().match(/\n( *(at )?)/);En=G&&G[1]||""}return`
2
- `+En+C}}var on=!1,Sn;{var bS=typeof WeakMap=="function"?WeakMap:Map;Sn=new bS}function $p(C,D){if(!C||on)return"";{var R=Sn.get(C);if(R!==void 0)return R}var G;on=!0;var se=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ie;ie=Ve.current,Ve.current=null,Tr();try{if(D){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(kt){G=kt}Reflect.construct(C,[],ee)}else{try{ee.call()}catch(kt){G=kt}C.call(ee.prototype)}}else{try{throw Error()}catch(kt){G=kt}C()}}catch(kt){if(kt&&G&&typeof kt.stack=="string"){for(var Z=kt.stack.split(`
3
- `),Re=G.stack.split(`
4
- `),fe=Z.length-1,he=Re.length-1;fe>=1&&he>=0&&Z[fe]!==Re[he];)he--;for(;fe>=1&&he>=0;fe--,he--)if(Z[fe]!==Re[he]){if(fe!==1||he!==1)do if(fe--,he--,he<0||Z[fe]!==Re[he]){var At=`
5
- `+Z[fe].replace(" at new "," at ");return typeof C=="function"&&Sn.set(C,At),At}while(fe>=1&&he>=0);break}}}finally{on=!1,Ve.current=ie,Er(),Error.prepareStackTrace=se}var Or=C?C.displayName||C.name:"",Vp=Or?Ct(Or):"";return typeof C=="function"&&Sn.set(C,Vp),Vp}function Ip(C,D,R){return $p(C,!1)}function wS(C){var D=C.prototype;return!!(D&&D.isReactComponent)}function bi(C,D,R){if(C==null)return"";if(typeof C=="function")return $p(C,wS(C));if(typeof C=="string")return Ct(C);switch(C){case u:return Ct("Suspense");case d:return Ct("SuspenseList")}if(typeof C=="object")switch(C.$$typeof){case a:return Ip(C.render);case f:return bi(C.type,D,R);case g:return Ip(C._render);case h:{var G=C,se=G._payload,ie=G._init;try{return bi(ie(se),D,R)}catch{}}}return""}var Lp={},Fp=O.ReactDebugCurrentFrame;function wi(C){if(C){var D=C._owner,R=bi(C.type,C._source,D?D.type:null);Fp.setExtraStackFrame(R)}else Fp.setExtraStackFrame(null)}function DS(C,D,R,G,se){{var ie=Function.call.bind(Object.prototype.hasOwnProperty);for(var ee in C)if(ie(C,ee)){var Z=void 0;try{if(typeof C[ee]!="function"){var Re=Error((G||"React class")+": "+R+" type `"+ee+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof C[ee]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Re.name="Invariant Violation",Re}Z=C[ee](D,ee,G,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){Z=fe}Z&&!(Z instanceof Error)&&(wi(se),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",G||"React class",R,ee,typeof Z),wi(null)),Z instanceof Error&&!(Z.message in Lp)&&(Lp[Z.message]=!0,wi(se),S("Failed %s type: %s",R,Z.message),wi(null))}}}var Ro=O.ReactCurrentOwner,ca=Object.prototype.hasOwnProperty,MS={key:!0,ref:!0,__self:!0,__source:!0},Bp,Kp,aa;aa={};function AS(C){if(ca.call(C,"ref")){var D=Object.getOwnPropertyDescriptor(C,"ref").get;if(D&&D.isReactWarning)return!1}return C.ref!==void 0}function kS(C){if(ca.call(C,"key")){var D=Object.getOwnPropertyDescriptor(C,"key").get;if(D&&D.isReactWarning)return!1}return C.key!==void 0}function PS(C,D){if(typeof C.ref=="string"&&Ro.current&&D&&Ro.current.stateNode!==D){var R=q(Ro.current.type);aa[R]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',q(Ro.current.type),C.ref),aa[R]=!0)}}function RS(C,D){{var R=function(){Bp||(Bp=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",D))};R.isReactWarning=!0,Object.defineProperty(C,"key",{get:R,configurable:!0})}}function $S(C,D){{var R=function(){Kp||(Kp=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",D))};R.isReactWarning=!0,Object.defineProperty(C,"ref",{get:R,configurable:!0})}}var IS=function(C,D,R,G,se,ie,ee){var Z={$$typeof:r,type:C,key:D,ref:R,props:ee,_owner:ie};return Z._store={},Object.defineProperty(Z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.defineProperty(Z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:se}),Object.freeze&&(Object.freeze(Z.props),Object.freeze(Z)),Z};function LS(C,D,R,G,se){{var ie,ee={},Z=null,Re=null;R!==void 0&&(Z=""+R),kS(D)&&(Z=""+D.key),AS(D)&&(Re=D.ref,PS(D,se));for(ie in D)ca.call(D,ie)&&!MS.hasOwnProperty(ie)&&(ee[ie]=D[ie]);if(C&&C.defaultProps){var fe=C.defaultProps;for(ie in fe)ee[ie]===void 0&&(ee[ie]=fe[ie])}if(Z||Re){var he=typeof C=="function"?C.displayName||C.name||"Unknown":C;Z&&RS(ee,he),Re&&$S(ee,he)}return IS(C,Z,Re,se,G,Ro.current,ee)}}var ua=O.ReactCurrentOwner,zp=O.ReactDebugCurrentFrame;function Sr(C){if(C){var D=C._owner,R=bi(C.type,C._source,D?D.type:null);zp.setExtraStackFrame(R)}else zp.setExtraStackFrame(null)}var fa;fa=!1;function da(C){return typeof C=="object"&&C!==null&&C.$$typeof===r}function Wp(){{if(ua.current){var C=q(ua.current.type);if(C)return`
1
+ (function(Ae,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],A):(Ae=typeof globalThis<"u"?globalThis:Ae||self,A(Ae.ViteButton={},Ae.React,Ae.ReactDOM))})(this,function(Ae,A,fi){"use strict";function As(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Yn=As(A);var qn={exports:{}},it={};/*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */var Hn,di;function hi(){if(di)return Hn;di=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Hn=i()?Object.assign:function(o,s){for(var l,a=r(o),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var d in l)e.call(l,d)&&(a[d]=l[d]);if(n){c=n(l);for(var f=0;f<c.length;f++)t.call(l,c[f])&&(a[c[f]]=l[c[f]])}}return a},Hn}/** @license React v17.0.2
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */var gi;function Ms(){if(gi)return it;gi=1,hi();var n=A,e=60103;if(it.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),it.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,d={},f=null,h=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return it.jsx=s,it.jsxs=s,it}var Gn={};/** @license React v17.0.2
13
+ * react-jsx-runtime.development.js
14
+ *
15
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */var pi;function js(){return pi||(pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=A,t=hi(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=60115,h=60116,g=60121,_=60122,m=60117,x=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var v=Symbol.for;r=v("react.element"),i=v("react.portal"),n.Fragment=v("react.fragment"),o=v("react.strict_mode"),s=v("react.profiler"),l=v("react.provider"),a=v("react.context"),c=v("react.forward_ref"),u=v("react.suspense"),d=v("react.suspense_list"),f=v("react.memo"),h=v("react.lazy"),g=v("react.block"),_=v("react.server.block"),m=v("react.fundamental"),v("react.scope"),v("react.opaque.id"),x=v("react.debug_trace_mode"),v("react.offscreen"),y=v("react.legacy_hidden")}var T=typeof Symbol=="function"&&Symbol.iterator,S="@@iterator";function b(p){if(p===null||typeof p!="object")return null;var k=T&&p[T]||p[S];return typeof k=="function"?k:null}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var k=arguments.length,R=new Array(k>1?k-1:0),M=1;M<k;M++)R[M-1]=arguments[M];E("error",p,R)}}function E(p,k,R){{var M=N.ReactDebugCurrentFrame,J=M.getStackAddendum();J!==""&&(k+="%s",R=R.concat([J]));var V=R.map(function($){return""+$});V.unshift("Warning: "+k),Function.prototype.apply.call(console[p],console,V)}}var j=!1;function z(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===x||p===o||p===u||p===d||p===y||j||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===f||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===m||p.$$typeof===g||p[0]===_))}function ee(p,k,R){var M=k.displayName||k.name||"";return p.displayName||(M!==""?R+"("+M+")":R)}function q(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&w("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var k=p;return q(k)+".Consumer";case l:var R=p;return q(R._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case f:return W(p.type);case g:return W(p._render);case h:{var M=p,J=M._payload,V=M._init;try{return W(V(J))}catch{return null}}}return null}var Y=0,ce,Fe,Je,Qt,Zt,en,vt;function xt(){}xt.__reactDisabledLog=!0;function Ct(){{if(Y===0){ce=console.log,Fe=console.info,Je=console.warn,Qt=console.error,Zt=console.group,en=console.groupCollapsed,vt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:xt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Y++}}function bt(){{if(Y--,Y===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Fe}),warn:t({},p,{value:Je}),error:t({},p,{value:Qt}),group:t({},p,{value:Zt}),groupCollapsed:t({},p,{value:en}),groupEnd:t({},p,{value:vt})})}Y<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=N.ReactCurrentDispatcher,nt;function Ee(p,k,R){{if(nt===void 0)try{throw Error()}catch(J){var M=J.stack.trim().match(/\n( *(at )?)/);nt=M&&M[1]||""}return`
20
+ `+nt+p}}var Ve=!1,rt;{var cc=typeof WeakMap=="function"?WeakMap:Map;rt=new cc}function Ss(p,k){if(!p||Ve)return"";{var R=rt.get(p);if(R!==void 0)return R}var M;Ve=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var V;V=pe.current,pe.current=null,Ct();try{if(k){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(Le){M=Le}Reflect.construct(p,[],$)}else{try{$.call()}catch(Le){M=Le}p.call($.prototype)}}else{try{throw Error()}catch(Le){M=Le}p()}}catch(Le){if(Le&&M&&typeof Le.stack=="string"){for(var B=Le.stack.split(`
21
+ `),ue=M.stack.split(`
22
+ `),G=B.length-1,Q=ue.length-1;G>=1&&Q>=0&&B[G]!==ue[Q];)Q--;for(;G>=1&&Q>=0;G--,Q--)if(B[G]!==ue[Q]){if(G!==1||Q!==1)do if(G--,Q--,Q<0||B[G]!==ue[Q]){var Ie=`
23
+ `+B[G].replace(" at new "," at ");return typeof p=="function"&&rt.set(p,Ie),Ie}while(G>=1&&Q>=0);break}}}finally{Ve=!1,pe.current=V,bt(),Error.prepareStackTrace=J}var wt=p?p.displayName||p.name:"",Ls=wt?Ee(wt):"";return typeof p=="function"&&rt.set(p,Ls),Ls}function ws(p,k,R){return Ss(p,!1)}function uc(p){var k=p.prototype;return!!(k&&k.isReactComponent)}function Jn(p,k,R){if(p==null)return"";if(typeof p=="function")return Ss(p,uc(p));if(typeof p=="string")return Ee(p);switch(p){case u:return Ee("Suspense");case d:return Ee("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return ws(p.render);case f:return Jn(p.type,k,R);case g:return ws(p._render);case h:{var M=p,J=M._payload,V=M._init;try{return Jn(V(J),k,R)}catch{}}}return""}var Ts={},ks=N.ReactDebugCurrentFrame;function Vn(p){if(p){var k=p._owner,R=Jn(p.type,p._source,k?k.type:null);ks.setExtraStackFrame(R)}else ks.setExtraStackFrame(null)}function fc(p,k,R,M,J){{var V=Function.call.bind(Object.prototype.hasOwnProperty);for(var $ in p)if(V(p,$)){var B=void 0;try{if(typeof p[$]!="function"){var ue=Error((M||"React class")+": "+R+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}B=p[$](k,$,M,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){B=G}B&&!(B instanceof Error)&&(Vn(J),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",R,$,typeof B),Vn(null)),B instanceof Error&&!(B.message in Ts)&&(Ts[B.message]=!0,Vn(J),w("Failed %s type: %s",R,B.message),Vn(null))}}}var tn=N.ReactCurrentOwner,si=Object.prototype.hasOwnProperty,dc={key:!0,ref:!0,__self:!0,__source:!0},Es,Ns,li;li={};function hc(p){if(si.call(p,"ref")){var k=Object.getOwnPropertyDescriptor(p,"ref").get;if(k&&k.isReactWarning)return!1}return p.ref!==void 0}function gc(p){if(si.call(p,"key")){var k=Object.getOwnPropertyDescriptor(p,"key").get;if(k&&k.isReactWarning)return!1}return p.key!==void 0}function pc(p,k){if(typeof p.ref=="string"&&tn.current&&k&&tn.current.stateNode!==k){var R=W(tn.current.type);li[R]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(tn.current.type),p.ref),li[R]=!0)}}function _c(p,k){{var R=function(){Es||(Es=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",k))};R.isReactWarning=!0,Object.defineProperty(p,"key",{get:R,configurable:!0})}}function mc(p,k){{var R=function(){Ns||(Ns=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",k))};R.isReactWarning=!0,Object.defineProperty(p,"ref",{get:R,configurable:!0})}}var yc=function(p,k,R,M,J,V,$){var B={$$typeof:r,type:p,key:k,ref:R,props:$,_owner:V};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:J}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function vc(p,k,R,M,J){{var V,$={},B=null,ue=null;R!==void 0&&(B=""+R),gc(k)&&(B=""+k.key),hc(k)&&(ue=k.ref,pc(k,J));for(V in k)si.call(k,V)&&!dc.hasOwnProperty(V)&&($[V]=k[V]);if(p&&p.defaultProps){var G=p.defaultProps;for(V in G)$[V]===void 0&&($[V]=G[V])}if(B||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;B&&_c($,Q),ue&&mc($,Q)}return yc(p,B,ue,J,M,tn.current,$)}}var ai=N.ReactCurrentOwner,Ps=N.ReactDebugCurrentFrame;function St(p){if(p){var k=p._owner,R=Jn(p.type,p._source,k?k.type:null);Ps.setExtraStackFrame(R)}else Ps.setExtraStackFrame(null)}var ci;ci=!1;function ui(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Os(){{if(ai.current){var p=W(ai.current.type);if(p)return`
6
24
 
7
- Check the render method of \``+C+"`."}return""}}function FS(C){{if(C!==void 0){var D=C.fileName.replace(/^.*[\\\/]/,""),R=C.lineNumber;return`
25
+ Check the render method of \``+p+"`."}return""}}function xc(p){{if(p!==void 0){var k=p.fileName.replace(/^.*[\\\/]/,""),R=p.lineNumber;return`
8
26
 
9
- Check your code at `+D+":"+R+"."}return""}}var jp={};function BS(C){{var D=Wp();if(!D){var R=typeof C=="string"?C:C.displayName||C.name;R&&(D=`
27
+ Check your code at `+k+":"+R+"."}return""}}var Ds={};function Cc(p){{var k=Os();if(!k){var R=typeof p=="string"?p:p.displayName||p.name;R&&(k=`
10
28
 
11
- Check the top-level render call using <`+R+">.")}return D}}function Up(C,D){{if(!C._store||C._store.validated||C.key!=null)return;C._store.validated=!0;var R=BS(D);if(jp[R])return;jp[R]=!0;var G="";C&&C._owner&&C._owner!==ua.current&&(G=" It was passed a child from "+q(C._owner.type)+"."),Sr(C),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,G),Sr(null)}}function Hp(C,D){{if(typeof C!="object")return;if(Array.isArray(C))for(var R=0;R<C.length;R++){var G=C[R];da(G)&&Up(G,D)}else if(da(C))C._store&&(C._store.validated=!0);else if(C){var se=E(C);if(typeof se=="function"&&se!==C.entries)for(var ie=se.call(C),ee;!(ee=ie.next()).done;)da(ee.value)&&Up(ee.value,D)}}}function KS(C){{var D=C.type;if(D==null||typeof D=="string")return;var R;if(typeof D=="function")R=D.propTypes;else if(typeof D=="object"&&(D.$$typeof===a||D.$$typeof===f))R=D.propTypes;else return;if(R){var G=q(D);DS(R,C.props,"prop",G,C)}else if(D.PropTypes!==void 0&&!fa){fa=!0;var se=q(D);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",se||"Unknown")}typeof D.getDefaultProps=="function"&&!D.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zS(C){{for(var D=Object.keys(C.props),R=0;R<D.length;R++){var G=D[R];if(G!=="children"&&G!=="key"){Sr(C),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",G),Sr(null);break}}C.ref!==null&&(Sr(C),S("Invalid attribute `ref` supplied to `React.Fragment`."),Sr(null))}}function Yp(C,D,R,G,se,ie){{var ee=B(C);if(!ee){var Z="";(C===void 0||typeof C=="object"&&C!==null&&Object.keys(C).length===0)&&(Z+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Re=FS(se);Re?Z+=Re:Z+=Wp();var fe;C===null?fe="null":Array.isArray(C)?fe="array":C!==void 0&&C.$$typeof===r?(fe="<"+(q(C.type)||"Unknown")+" />",Z=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof C,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,Z)}var he=LS(C,D,R,se,ie);if(he==null)return he;if(ee){var At=D.children;if(At!==void 0)if(G)if(Array.isArray(At)){for(var Or=0;Or<At.length;Or++)Hp(At[Or],C);Object.freeze&&Object.freeze(At)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Hp(At,C)}return C===n.Fragment?zS(he):KS(he),he}}function WS(C,D,R){return Yp(C,D,R,!0)}function jS(C,D,R){return Yp(C,D,R,!1)}var US=jS,HS=WS;n.jsx=US,n.jsxs=HS}()}(Ai)),Ai}(function(n){process.env.NODE_ENV==="production"?n.exports=Gp():n.exports=qp()})(U);function J(n){return{type:n}}const $o=J("SELECTION_CHANGE_COMMAND"),Xp=J("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ya=J("CLICK_COMMAND"),vr=J("DELETE_CHARACTER_COMMAND"),br=J("INSERT_LINE_BREAK_COMMAND"),ki=J("INSERT_PARAGRAPH_COMMAND"),vn=J("CONTROLLED_TEXT_INSERTION_COMMAND"),Pi=J("PASTE_COMMAND"),Ri=J("REMOVE_TEXT_COMMAND"),wr=J("DELETE_WORD_COMMAND"),Dr=J("DELETE_LINE_COMMAND"),Rt=J("FORMAT_TEXT_COMMAND"),$i=J("UNDO_COMMAND"),Ii=J("REDO_COMMAND"),Na=J("KEYDOWN_COMMAND"),Ca=J("KEY_ARROW_RIGHT_COMMAND"),xa=J("MOVE_TO_END"),Ta=J("KEY_ARROW_LEFT_COMMAND"),Ea=J("MOVE_TO_START"),Sa=J("KEY_ARROW_UP_COMMAND"),Oa=J("KEY_ARROW_DOWN_COMMAND"),Io=J("KEY_ENTER_COMMAND"),va=J("KEY_SPACE_COMMAND"),ba=J("KEY_BACKSPACE_COMMAND"),wa=J("KEY_ESCAPE_COMMAND"),Da=J("KEY_DELETE_COMMAND"),Ma=J("KEY_TAB_COMMAND"),Qp=J("INSERT_TAB_COMMAND"),Zp=J("INDENT_CONTENT_COMMAND"),e_=J("OUTDENT_CONTENT_COMMAND"),Aa=J("DROP_COMMAND"),t_=J("FORMAT_ELEMENT_COMMAND"),ka=J("DRAGSTART_COMMAND"),Pa=J("DRAGOVER_COMMAND"),Ra=J("DRAGEND_COMMAND"),Li=J("COPY_COMMAND"),Fi=J("CUT_COMMAND"),Bi=J("SELECT_ALL_COMMAND"),n_=J("CLEAR_EDITOR_COMMAND"),r_=J("CLEAR_HISTORY_COMMAND"),o_=J("CAN_REDO_COMMAND"),s_=J("CAN_UNDO_COMMAND"),$a=J("FOCUS_COMMAND"),Ia=J("BLUR_COMMAND"),La=J("KEY_MODIFIER_COMMAND"),Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",i_=Je&&"documentMode"in document?document.documentMode:null,Ge=Je&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$t=Je&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Lo=Je&&"InputEvent"in window&&!i_?"getTargetRanges"in new window.InputEvent("input"):!1,Ki=Je&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Fo=Je&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,l_=Je&&/Android/.test(navigator.userAgent),Fa=Je&&/^(?=.*Chrome).*/i.test(navigator.userAgent),c_=Je&&l_&&Fa,zi=Je&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Fa,Mr=1,It=3,sn=0,Ba=1,bn=2,Ka=0,Wi=1,ji=2,Bo=1,Ko=1<<1,Ar=1<<2,kr=1<<3,zo=1<<4,Wo=1<<5,jo=1<<6,Uo=1<<7,za=Bo|Ko|Ar|kr|zo|Wo|jo|Uo,Ui=1,Ho=1<<1,Hi=1,Yi=2,Vi=3,Ji=4,Gi=5,qi=6,Wa=" ",Yo=Ki||Fo||zi?Wa:"​",xt=`
29
+ Check the top-level render call using <`+R+">.")}return k}}function Rs(p,k){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var R=Cc(k);if(Ds[R])return;Ds[R]=!0;var M="";p&&p._owner&&p._owner!==ai.current&&(M=" It was passed a child from "+W(p._owner.type)+"."),St(p),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,M),St(null)}}function Fs(p,k){{if(typeof p!="object")return;if(Array.isArray(p))for(var R=0;R<p.length;R++){var M=p[R];ui(M)&&Rs(M,k)}else if(ui(p))p._store&&(p._store.validated=!0);else if(p){var J=b(p);if(typeof J=="function"&&J!==p.entries)for(var V=J.call(p),$;!($=V.next()).done;)ui($.value)&&Rs($.value,k)}}}function bc(p){{var k=p.type;if(k==null||typeof k=="string")return;var R;if(typeof k=="function")R=k.propTypes;else if(typeof k=="object"&&(k.$$typeof===c||k.$$typeof===f))R=k.propTypes;else return;if(R){var M=W(k);fc(R,p.props,"prop",M,p)}else if(k.PropTypes!==void 0&&!ci){ci=!0;var J=W(k);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",J||"Unknown")}typeof k.getDefaultProps=="function"&&!k.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Sc(p){{for(var k=Object.keys(p.props),R=0;R<k.length;R++){var M=k[R];if(M!=="children"&&M!=="key"){St(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),St(null);break}}p.ref!==null&&(St(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),St(null))}}function Is(p,k,R,M,J,V){{var $=z(p);if(!$){var B="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(B+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ue=xc(J);ue?B+=ue:B+=Os();var G;p===null?G="null":Array.isArray(p)?G="array":p!==void 0&&p.$$typeof===r?(G="<"+(W(p.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):G=typeof p,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,B)}var Q=vc(p,k,R,J,V);if(Q==null)return Q;if($){var Ie=k.children;if(Ie!==void 0)if(M)if(Array.isArray(Ie)){for(var wt=0;wt<Ie.length;wt++)Fs(Ie[wt],p);Object.freeze&&Object.freeze(Ie)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fs(Ie,p)}return p===n.Fragment?Sc(Q):bc(Q),Q}}function wc(p,k,R){return Is(p,k,R,!0)}function Tc(p,k,R){return Is(p,k,R,!1)}var kc=Tc,Ec=wc;n.jsx=kc,n.jsxs=Ec}()}(Gn)),Gn}process.env.NODE_ENV==="production"?qn.exports=Ms():qn.exports=js();var L=qn.exports;function Ws(n){return{}}const nn={},Bs={},_i={},Ye={},ot={},rn={},st={},Xn={},Qn={},Tt={},kt={},ge={},on={},sn={},zs={},mi={},$s={},yi={},Ks={},vi={},xi={},ln={},Us={},Ci={},bi={},Si={},Js={},Vs={},Ys={},wi={},Ti={},Et={},ki={},Ei={},qs={},an={},Zn={},er={},Hs={},Gs={},Nt={},Pt={},Xs={},Qs={},Zs={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,el=_e&&"documentMode"in document?document.documentMode:null,me=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Me=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cn=!(!_e||!("InputEvent"in window)||el)&&"getTargetRanges"in new window.InputEvent("input"),tr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tl=_e&&/Android/.test(navigator.userAgent),Ni=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),nl=_e&&tl&&Ni,nr=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ni,Ot=1,je=3,qe=0,Pi=1,lt=2,rl=0,il=1,ol=2,fn=4,dn=8,rr=128,sl=112|(3|fn|dn)|rr,ir=1,or=2,sr=3,lr=4,ar=5,cr=6,hn=tr||un||nr?" ":"​",Ne=`
12
30
 
13
- `,a_=$t?Wa:Yo,ja="֑-߿יִ-﷽ﹰ-ﻼ",Ua="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",u_=new RegExp("^[^"+Ua+"]*["+ja+"]"),f_=new RegExp("^[^"+ja+"]*["+Ua+"]"),ct={bold:Bo,code:zo,highlight:Uo,italic:Ko,strikethrough:Ar,subscript:Wo,superscript:jo,underline:kr},d_={directionless:Ui,unmergeable:Ho},Ha={center:Yi,end:qi,justify:Ji,left:Hi,right:Vi,start:Gi},h_={[Yi]:"center",[qi]:"end",[Ji]:"justify",[Hi]:"left",[Vi]:"right",[Gi]:"start"},g_={normal:Ka,segmented:ji,token:Wi},p_={[Ka]:"normal",[ji]:"segmented",[Wi]:"token"};function Vo(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const __=100;let Xi=!1,Qi=0;function m_(){return Xi}function y_(n){Qi=n.timeStamp}function N_(n){Qi===0&&ts(n).addEventListener("textInput",y_,!0)}function Zi(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function C_(n){return n.getEditorState().read(()=>{const e=re();return e!==null?e.clone():null})}function x_(n,e,t){const r=ut(t._window);let o=null,s=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,s=r.focusOffset);const i=n.nodeValue;i!==null&&sl(e,i,o,s,!1)}function T_(n,e,t){if(H(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===It&&t.isAttached()}function Ya(n,e,t){Xi=!0;const r=performance.now()-Qi>__;try{Ue(n,()=>{const o=re()||C_(n),s=new Map,i=n.getRootElement(),l=n._editorState,c=n._blockCursorElement;let a=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,p=h.target;let _=$r(p,l);if(!(_===null&&p!==i||ce(_))){if(g==="characterData")r&&W(_)&&T_(o,p,_)&&x_(p,_,n);else if(g==="childList"){a=!0;const y=h.addedNodes;for(let x=0;x<y.length;x++){const T=y[x],E=nu(T),O=T.parentNode;if(O!=null&&T!==c&&E===null&&(T.nodeName!=="BR"||!Zi(T,O,n))){if($t){const S=T.innerText||T.nodeValue;S&&(u+=S)}O.removeChild(T)}}const m=h.removedNodes,N=m.length;if(N>0){let x=0;for(let T=0;T<N;T++){const E=m[T];(E.nodeName==="BR"&&Zi(E,p,n)||c===E)&&(p.appendChild(E),x++)}N!==x&&(p===i&&(_=su(l)),s.set(p,_))}}}}if(s.size>0)for(const[f,h]of s)if(b(h)){const g=h.getChildrenKeys();let p=f.firstChild;for(let _=0;_<g.length;_++){const y=g[_],m=n.getElementByKey(y);m!==null&&(p==null?(f.appendChild(m),p=m):p!==m&&f.replaceChild(m,p),p=p.nextSibling)}}else W(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let _=0;_<g.length;_++){const y=g[_],m=y.parentNode;m!=null&&y.nodeName==="BR"&&!Zi(y,p,n)&&m.removeChild(y)}}t.takeRecords()}o!==null&&(a&&(o.dirty=!0,at(o)),$t&&pu(n)&&o.insertRawText(u))})}finally{Xi=!1}}function Va(n){const e=n._observer;if(e!==null){const t=e.takeRecords();Ya(n,t,e)}}function Ja(n){N_(n),n._observer=new MutationObserver((e,t)=>{Ya(n,e,t)})}function Ga(n,e){const t=n.__mode,r=n.__format,o=n.__style,s=e.__mode,i=e.__format,l=e.__style;return(t===null||t===s)&&(r===null||r===i)&&(o===null||o===l)}function qa(n,e){const t=n.mergeWithSibling(e),r=le()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Xa(n){let e=n;if(e.__text===""&&e.isSimpleText()&&!e.isUnmergeable()){e.remove();return}let t;for(;(t=e.getPreviousSibling())!==null&&W(t)&&t.isSimpleText()&&!t.isUnmergeable();)if(t.__text==="")t.remove();else if(Ga(t,e)){e=qa(t,e);break}else break;let r;for(;(r=e.getNextSibling())!==null&&W(r)&&r.isSimpleText()&&!r.isUnmergeable();)if(r.__text==="")r.remove();else if(Ga(e,r)){e=qa(e,r);break}else break}function Qa(n){return Za(n.anchor),Za(n.focus),n}function Za(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),W(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}else if(!b(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let eu=1;function E_(){eu=1}function S_(){return""+eu++}function O_(n,e){const t=n._nodes.get(e);if(t===void 0)throw Error(`registeredNode: Type ${e} not found`);return t}const v_=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function b_(n){return ce($r(n))}function el(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return ce($r(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Rr(e)==null)}function Pr(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!el(e)&&tl(e)===n}catch{return!1}}function Jo(n){return n instanceof Ns}function tl(n){let e=n;for(;e!=null;){const t=Rr(e);if(Jo(t))return t;e=Zo(e)}return null}function Rr(n){return n?n.__lexicalEditor:null}function w_(n){return u_.test(n)?"rtl":f_.test(n)?"ltr":null}function ln(n){return n.isToken()||n.isSegmented()}function D_(n){return n.nodeType===It}function Go(n){let e=n;for(;e!=null;){if(D_(e))return e;e=e.firstChild}return null}function nl(n,e,t){const r=ct[e];if(t!==null&&(n&r)===(t&r))return n;let o=n^r;return e==="subscript"?o&=~ct.superscript:e==="superscript"&&(o&=~ct.subscript),o}function M_(n){return W(n)||fn(n)||ce(n)}function tu(n,e){if(e!=null){A_(n,e),n.__key=e;return}be(),of();const t=le(),r=dt(),o=S_();r._nodeMap.set(o,n),b(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=Ba,n.__key=o}function A_(n,e){const t=Dy();if(!t)return;const r=t._nodeMap.get(e);if(r&&r.constructor!==n.constructor)throw n.constructor.name!==r.constructor.name?Error(`Lexical node with constructor ${n.constructor.name} attempted to re-use key from node in active editor state with constructor ${r.constructor.name}. Keys must not be re-used when the type is changed.`):Error(`Lexical node with constructor ${n.constructor.name} attempted to re-use key from node in active editor state with different constructor with the same name (possibly due to invalid Hot Module Replacement). Keys must not be re-used when the type is changed.`)}function k_(n,e,t){let r=n;for(;r!==null;){if(t.has(r))return;const o=e.get(r);if(o===void 0)break;t.set(r,!1),r=o.__parent}}function cn(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),s=n.getNextSibling();if(o===null)if(s!==null){const i=s.getWritable();r.__first=s.__key,i.__prev=null}else r.__first=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(s===null)if(o!==null){const i=o.getWritable();r.__last=o.__key,i.__next=null}else r.__last=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function qo(n){of();const e=n.getLatest(),t=e.__parent,r=dt(),o=le(),s=r._nodeMap,i=o._dirtyElements;t!==null&&k_(t,s,i);const l=e.__key;o._dirtyType=Ba,b(n)?i.set(l,!0):o._dirtyLeaves.add(l)}function P_(n){const e=n.getPreviousSibling(),t=n.getNextSibling();e!==null&&qo(e),t!==null&&qo(t)}function ye(n){be();const e=le(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Ee(t);r!==null&&r.getWritable()}if(n!==null){const r=Ee(n);r!==null&&r.getWritable()}}}function Lt(){return Ln()?null:le()._compositionKey}function Ee(n,e){const r=(e||dt())._nodeMap.get(n);return r===void 0?null:r}function nu(n,e){const t=le(),r=n[`__lexicalKey_${t._key}`];return r!==void 0?Ee(r,e):null}function $r(n,e){let t=n;for(;t!=null;){const r=nu(t,e);if(r!==null)return r;t=Zo(t)}return null}function ru(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function ou(n){return n.read(()=>je().getTextContent())}function R_(n,e){Ue(n,()=>{const t=dt();if(t.isEmpty())return;if(e==="root"){je().markDirty();return}const r=t._nodeMap;for(const[,o]of r)o.markDirty()},n._pendingEditorState===null?{tag:"history-merge"}:void 0)}function je(){return su(dt())}function su(n){return n._nodeMap.get("root")}function at(n){be();const e=dt();if(n!==null){if(Object.isFrozen(n))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");n.dirty=!0,n.setCachedNodes(null)}e._selection=n}function $_(){be();const n=le();Va(n)}function wn(n){const e=le(),t=I_(n,e);if(t===null){const r=e.getRootElement();return n===r?Ee("root"):null}return Ee(t)}function iu(n,e){return e?n.getTextContentSize():0}function I_(n,e){let t=n;for(;t!=null;){const r=t[`__lexicalKey_${e._key}`];if(r!==void 0)return r;t=Zo(t)}return null}function lu(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function rl(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function cu(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function au(n){return n.nodeType===It?n.nodeValue:null}function ol(n,e,t){const r=ut(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:s,focusOffset:i}=r;if(o!==null){let l=au(o);const c=$r(o);if(l!==null&&W(c)){if(l===Yo&&t){const a=t.length;l=t,s=a,i=a}l!==null&&sl(c,l,s,i,n)}}}function sl(n,e,t,r,o){let s=n;if(s.isAttached()&&(o||!s.isDirty())){const i=s.isComposing();let l=e;(i||o)&&e[e.length-1]===Yo&&(l=e.slice(0,-1));const c=s.getTextContent();if(o||l!==c){if(l===""){if(ye(null),!Ki&&!Fo&&!zi){const p=le();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}else s.remove();return}const a=s.getParent(),u=In(),d=s.getTextContentSize(),f=Lt(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!i||H(u)&&(a!==null&&!a.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i)){s.markDirty();return}const g=re();if(!H(g)||t===null||r===null){s.setTextContent(l);return}if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const p=s.getTextContent(),_=Se(p);s.replace(_),s=_}s.setTextContent(l)}}}function L_(n){const e=n.getPreviousSibling();return(W(e)||b(e)&&e.isInline())&&!e.canInsertTextAfter()}function F_(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),o=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||o||L_(e):t===e.getTextContentSize()?!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o:!1}function B_(n,e,t,r){return n==="Tab"&&!e&&!t&&!r}function K_(n,e,t,r){return n.toLowerCase()==="b"&&!e&&Ir(t,r)}function z_(n,e,t,r){return n.toLowerCase()==="i"&&!e&&Ir(t,r)}function W_(n,e,t,r){return n.toLowerCase()==="u"&&!e&&Ir(t,r)}function j_(n,e){return du(n)&&!e}function U_(n,e){return du(n)&&e}function H_(n,e){return Ge&&e&&n.toLowerCase()==="o"}function Y_(n,e,t){return Lr(n)&&(Ge?e:t)}function V_(n,e,t){return Fr(n)&&(Ge?e:t)}function J_(n,e){return Ge&&e&&Lr(n)}function G_(n,e){return Ge&&e&&Fr(n)}function q_(n,e,t,r){return Ge?e||t?!1:Lr(n)||n.toLowerCase()==="h"&&r:r||e||t?!1:Lr(n)}function X_(n,e,t,r,o){return Ge?t||r||o?!1:Fr(n)||n.toLowerCase()==="d"&&e:e||r||o?!1:Fr(n)}function Q_(n,e,t,r){return n.toLowerCase()==="z"&&!e&&Ir(t,r)}function Z_(n,e,t,r){return Ge?n.toLowerCase()==="z"&&t&&e:n.toLowerCase()==="y"&&r||n.toLowerCase()==="z"&&r&&e}function em(n,e,t,r){return e?!1:n.toLowerCase()==="c"?Ge?t:r:!1}function tm(n,e,t,r){return e?!1:n.toLowerCase()==="x"?Ge?t:r:!1}function uu(n){return n==="ArrowLeft"}function fu(n){return n==="ArrowRight"}function nm(n){return n==="ArrowUp"}function rm(n){return n==="ArrowDown"}function om(n,e,t,r){return uu(n)&&!e&&!r&&!t}function sm(n,e,t,r,o){return uu(n)&&!r&&!t&&(e||o)}function im(n,e,t,r){return fu(n)&&!e&&!r&&!t}function lm(n,e,t,r,o){return fu(n)&&!r&&!t&&(e||o)}function cm(n,e,t){return nm(n)&&!e&&!t}function am(n,e,t){return rm(n)&&!e&&!t}function um(n,e,t,r){return n||e||t||r}function fm(n){return n===" "}function Ir(n,e){return Ge?n:e}function du(n){return n==="Enter"}function Lr(n){return n==="Backspace"}function dm(n){return n==="Escape"}function Fr(n){return n==="Delete"}function hu(n,e,t){return n.toLowerCase()==="a"&&Ir(e,t)}function hm(){const n=je(),e=n.select(0,n.getChildrenSize());at(Qa(e))}function Br(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const o=n[e];if(typeof o=="string"){const s=Vo(o);return t[e]=s,s}return o}function il(n,e,t,r,o){if(t.size===0)return;const s=r.__type,i=r.__key,l=e.get(s);if(l===void 0)throw Error(`Type ${s} not in registeredNodes`);const c=l.klass;let a=n.get(c);a===void 0&&(a=new Map,n.set(c,a));const u=a.get(i),d=u==="destroyed"&&o==="created";(u===void 0||d)&&a.set(i,d?"updated":o)}function gm(n){const e=n.getType(),t=dt();if(t._readOnly){const s=Cu(t).get(e);return s?Array.from(s.values()):[]}const r=t._nodeMap,o=[];for(const[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&o.push(s);return o}function gu(n,e,t){const r=n.getParent();let o=t,s=n;return r!==null&&(e&&t===0?(o=s.getIndexWithinParent(),s=r):!e&&t===s.getChildrenSize()&&(o=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?o-1:o)}function ll(n,e){const t=n.offset;if(n.type==="element"){const r=n.getNode();return gu(r,e,t)}else{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const o=e?r.getPreviousSibling():r.getNextSibling();return o===null?gu(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function pu(n){const e=ts(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function $(n,e,t){return ff(n,e,t)}function Xo(n){return!Ie(n)&&!n.isLastChild()&&!n.isInline()}function Qo(n,e){const t=n._keyToDOMMap.get(e);if(t===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${e}`);return t}function Zo(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function pm(n,e,t){const r=t.ownerDocument,o=r.defaultView;if(o===null)return;let{top:s,bottom:i}=e,l=0,c=0,a=t;for(;a!==null;){const u=a===r.body;if(u)l=0,c=ts(n).innerHeight;else{const f=a.getBoundingClientRect();l=f.top,c=f.bottom}let d=0;if(s<l?d=-(l-s):i>c&&(d=i-c),d!==0)if(u)o.scrollBy(0,d);else{const f=a.scrollTop;a.scrollTop+=d;const h=a.scrollTop-f;s-=h,i-=h}if(u)break;a=Zo(a)}}function _m(n){return le()._updateTags.has(n)}function mm(n){be(),le()._updateTags.add(n)}function ym(n){const e=re();if(!H(e)||!b(n))return e;const{anchor:t,focus:r}=e,o=t.getNode(),s=r.getNode();return es(o,n)&&t.set(n.__key,0,"element"),es(s,n)&&r.set(n.__key,0,"element"),e}function es(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Nm(n){const e=n.ownerDocument;return e&&e.defaultView||null}function ts(n){const e=n._window;if(e===null)throw Error("window object not found");return e}function Cm(n){return b(n)&&n.isInline()||ce(n)&&n.isInline()}function _u(n){let e=n.getParentOrThrow();for(;e!==null;){if(Ft(e))return e;e=e.getParentOrThrow()}return e}function Ft(n){return Ie(n)||b(n)&&n.isShadowRoot()}function mu(n){const e=n.constructor.clone(n);return tu(e,null),e}function Kr(n){const e=le(),t=n.constructor.getType(),r=e._nodes.get(t);if(r===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const o=r.replace;if(o!==null){const s=o(n);if(!(s instanceof n.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return s}return n}function cl(n,e){const t=n.getParent();if(Ie(t)&&!b(e)&&!ce(e))throw Error("Only element or decorator nodes can be inserted in to the root node")}function xm(n){const e=Ee(n);if(e===null)throw Error(`Expected node with key ${n} to exist but it's not in the nodeMap.`);return e}function Tm(n){const e=n.theme,t=document.createElement("div");t.contentEditable="false",t.setAttribute("data-lexical-cursor","true");let r=e.blockCursor;if(r!==void 0){if(typeof r=="string"){const o=Vo(r);r=e.blockCursor=o}r!==void 0&&t.classList.add(...r)}return t}function al(n){return(ce(n)||b(n)&&!n.canBeEmpty())&&!n.isInline()}function ul(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Em(n,e,t){let r=n._blockCursorElement;if(H(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,s=o.getNode(),i=o.offset,l=s.getChildrenSize();let c=!1,a=null;if(i===l){const u=s.getChildAtIndex(i-1);al(u)&&(c=!0)}else{const u=s.getChildAtIndex(i);if(al(u)){const d=u.getPreviousSibling();(d===null||al(d))&&(c=!0,a=n.getElementByKey(u.__key))}}if(c){const u=n.getElementByKey(s.__key);r===null&&(n._blockCursorElement=r=Tm(n._config)),e.style.caretColor="transparent",a===null?u.appendChild(r):u.insertBefore(r,a);return}}r!==null&&ul(r,n,e)}function ut(n){return Je?(n||window).getSelection():null}function Sm(n,e){let t=n.getChildAtIndex(e);if(t==null&&(t=n),Ft(n))throw Error("Can not call $splitNode() on root element");const r=i=>{const l=i.getParentOrThrow(),c=Ft(l),a=i===t&&!c?i:mu(i);if(c){if(!(b(i)&&b(a)))throw Error("Children of a root must be ElementNode");return i.insertAfter(a),[i,a,a]}else{const[u,d,f]=r(l),h=i.getNextSiblings();return f.append(a,...h),[u,d,a]}},[o,s]=r(t);return[o,s]}function Om(n){return ns(n)&&n.tagName==="A"}function ns(n){return n.nodeType===1}function yu(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function fl(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function Dn(n){if(Ie(n)||ce(n)&&!n.isInline())return!0;if(!b(n)||Ft(n))return!1;const e=n.getFirstChild(),t=e===null||fn(e)||W(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function dl(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function vm(){return le()}const Nu=new WeakMap,bm=new Map;function Cu(n){if(!n._readOnly&&n.isEmpty())return bm;if(!n._readOnly)throw Error("getCachedTypeToNodeMap called with a writable EditorState");let e=Nu.get(n);if(!e){e=new Map,Nu.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let s=e.get(o);s||(s=new Map,e.set(o,s)),s.set(t,r)}}return e}function xu(n){const e=n.constructor,t=e.clone(n);t.afterCloneFrom(n);{if(t.__key!==n.__key)throw Error(`$cloneWithProperties: ${e.name}.clone(node) (with type '${e.getType()}') did not return a node with the same key, make sure to specify node.__key as the last argument to the constructor`);if(!(t.__parent===n.__parent&&t.__next===n.__next&&t.__prev===n.__prev))throw Error(`$cloneWithProperties: ${e.name}.clone(node) (with type '${e.getType()}') overrided afterCloneFrom but did not call super.afterCloneFrom(prevNode)`)}return t}function wm(n,e){const t=n._decorators;let o=n._pendingDecorators||t;const s=e._nodeMap;let i;for(i in o)s.has(i)||(o===t&&(o=ru(n)),delete o[i])}function Tu(n,e,t,r,o,s){let i=n.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(b(i)&&Tu(i,l,t,r,o,s),t.has(l)||s.delete(l),o.push(l)),i=i.getNextSibling()}}function Dm(n,e,t,r){const o=n._nodeMap,s=e._nodeMap,i=[];for(const[l]of r){const c=s.get(l);c!==void 0&&(c.isAttached()||(b(c)&&Tu(c,l,o,s,i,r),o.has(l)||r.delete(l),i.push(l)))}for(const l of i)s.delete(l);for(const l of t){const c=s.get(l);c!==void 0&&!c.isAttached()&&(o.has(l)||t.delete(l),s.delete(l))}}let ge="",we="",ft=null,qe="",Tt="",Bt,De,zr,Eu=!1,Wr=!1,rs,os=null,hl,gl,an,Xe,pl,jr;function ss(n,e){const t=an.get(n);if(e!==null){const r=Nl(n);r.parentNode===e&&e.removeChild(r)}if(Xe.has(n)||De._keyToDOMMap.delete(n),b(t)){const r=ls(t,an);_l(r,0,r.length-1,null)}t!==void 0&&il(jr,zr,rs,t,"destroyed")}function _l(n,e,t,r){let o=e;for(;o<=t;++o){const s=n[o];s!==void 0&&ss(s,r)}}function un(n,e){n.setProperty("text-align",e)}const Mm="40px";function Su(n,e){const t=Bt.theme.indent;if(typeof t=="string"){const o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Mm;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Ou(n,e){const t=n.style;e===0?un(t,""):e===Hi?un(t,"left"):e===Yi?un(t,"center"):e===Vi?un(t,"right"):e===Ji?un(t,"justify"):e===Gi?un(t,"start"):e===qi&&un(t,"end")}function is(n,e,t){const r=Xe.get(n);if(r===void 0)throw Error("createNode: node does not exist in nodeMap");const o=r.createDOM(Bt,De);if(Bm(n,o,De),W(r)?o.setAttribute("data-lexical-text","true"):ce(r)&&o.setAttribute("data-lexical-decorator","true"),b(r)){const s=r.__indent,i=r.__size;if(s!==0&&Su(o,s),i!==0){const c=i-1,a=ls(r,Xe);Am(a,c,r,o)}const l=r.__format;l!==0&&Ou(o,l),r.isInline()||bu(null,r,o),Xo(r)&&(ge+=xt,Tt+=xt)}else{const s=r.getTextContent();if(ce(r)){const i=r.decorate(De,Bt);i!==null&&Du(n,i),o.contentEditable="false"}else W(r)&&(r.isDirectionless()||(we+=s));ge+=s,Tt+=s}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const s=e.__lexicalLineBreak;s!=null?e.insertBefore(o,s):e.appendChild(o)}return Object.freeze(r),il(jr,zr,rs,r,"created"),o}function Am(n,e,t,r){const o=we;we="",ml(n,t,0,e,r,null),wu(t,r),we=o}function ml(n,e,t,r,o,s){const i=ge;ge="";let l=t;for(;l<=r;++l){is(n[l],o,s);const c=Xe.get(n[l]);c!==null&&W(c)&&(ft===null&&(ft=c.getFormat()),qe===""&&(qe=c.getStyle()))}Xo(e)&&(ge+=xt),o.__lexicalTextContent=ge,ge=i+ge}function vu(n,e){const t=e.get(n);return fn(t)||ce(t)&&t.isInline()}function bu(n,e,t){const r=n!==null&&(n.__size===0||vu(n.__last,an)),o=e.__size===0||vu(e.__last,Xe);if(r){if(!o){const s=t.__lexicalLineBreak;if(s!=null)try{t.removeChild(s)}catch(i){if(typeof i=="object"&&i!=null){const l=`${i.toString()} Parent: ${t.tagName}, child: ${s.tagName}.`;throw new Error(l)}else throw i}t.__lexicalLineBreak=null}}else if(o){const s=document.createElement("br");t.__lexicalLineBreak=s,t.appendChild(s)}}function km(n){Ll(n)&&ft!=null&&ft!==n.__textFormat&&!Wr&&(n.setTextFormat(ft),n.setTextStyle(qe))}function Pm(n){Ll(n)&&qe!==""&&qe!==n.__textStyle&&!Wr&&n.setTextStyle(qe)}function wu(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==we||r!==os){const o=we==="",s=o?os:w_(we);if(s!==r){const i=e.classList,l=Bt.theme;let c=r!==null?l[r]:void 0,a=s!==null?l[s]:void 0;if(c!==void 0){if(typeof c=="string"){const u=Vo(c);c=l[r]=u}i.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(a!==void 0){if(typeof a=="string"){const u=Vo(a);a=l[s]=u}a!==void 0&&i.add(...a)}e.dir=s}if(!Wr){const u=n.getWritable();u.__dir=s}}os=s,e.__lexicalDirTextContent=we,e.__lexicalDir=s}}function Rm(n,e,t){const r=we;we="",ft=null,qe="",$m(n,e,t),wu(e,t),km(e),Pm(e),we=r}function ls(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);if(o===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");t.push(r),r=o.__next}return t}function $m(n,e,t){const r=ge,o=n.__size,s=e.__size;if(ge="",o===1&&s===1){const i=n.__first,l=e.__first;if(i===l)Ur(i,t);else{const a=Nl(i),u=is(l,null,null);try{t.replaceChild(u,a)}catch(d){if(typeof d=="object"&&d!=null){const f=`${d.toString()} Parent: ${t.tagName}, new child: {tag: ${u.tagName} key: ${l}}, old child: {tag: ${a.tagName}, key: ${i}}.`;throw new Error(f)}else throw d}ss(i,null)}const c=Xe.get(l);W(c)&&(ft===null&&(ft=c.getFormat()),qe===""&&(qe=c.getStyle()))}else{const i=ls(n,an),l=ls(e,Xe);if(o===0)s!==0&&ml(l,e,0,s-1,t,null);else if(s===0){if(o!==0){const a=t.__lexicalLineBreak==null;_l(i,0,o-1,a?null:t),a&&(t.textContent="")}}else Lm(e,i,l,o,s,t)}Xo(e)&&(ge+=xt),t.__lexicalTextContent=ge,ge=r+ge}function Ur(n,e){const t=an.get(n);let r=Xe.get(n);if(t===void 0||r===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const o=Eu||gl.has(n)||hl.has(n),s=Qo(De,n);if(t===r&&!o){if(b(t)){const i=s.__lexicalTextContent;i!==void 0&&(ge+=i,Tt+=i);const l=s.__lexicalDirTextContent;l!==void 0&&(we+=l)}else{const i=t.getTextContent();W(t)&&!t.isDirectionless()&&(we+=i),Tt+=i,ge+=i}return s}if(t!==r&&o&&il(jr,zr,rs,r,"updated"),r.updateDOM(t,s,Bt)){const i=is(n,null,null);if(e===null)throw Error("reconcileNode: parentDOM is null");return e.replaceChild(i,s),ss(n,null),i}if(b(t)&&b(r)){const i=r.__indent;i!==t.__indent&&Su(s,i);const l=r.__format;l!==t.__format&&Ou(s,l),o&&(Rm(t,r,s),!Ie(r)&&!r.isInline()&&bu(t,r,s)),Xo(r)&&(ge+=xt,Tt+=xt)}else{const i=r.getTextContent();if(ce(r)){const l=r.decorate(De,Bt);l!==null&&Du(n,l)}else W(r)&&!r.isDirectionless()&&(we+=i);ge+=i,Tt+=i}if(!Wr&&Ie(r)&&r.__cachedText!==Tt){const i=r.getWritable();i.__cachedText=Tt,r=i}return Object.freeze(r),s}function Du(n,e){let t=De._pendingDecorators;const r=De._decorators;if(t===null){if(r[n]===e)return;t=ru(De)}t[n]=e}function Im(n){return n.firstChild}function yl(n){let e=n.nextSibling;return e!==null&&e===De._blockCursorElement&&(e=e.nextSibling),e}function Lm(n,e,t,r,o,s){const i=r-1,l=o-1;let c,a,u=Im(s),d=0,f=0;for(;d<=i&&f<=l;){const p=e[d],_=t[f];if(p===_)u=yl(Ur(_,s)),d++,f++;else{c===void 0&&(c=new Set(e)),a===void 0&&(a=new Set(t));const m=a.has(p),N=c.has(_);if(!m)u=yl(Nl(p)),ss(p,s),d++;else if(!N)is(_,s,u),f++;else{const x=Qo(De,_);x===u?u=yl(Ur(_,s)):(u!=null?s.insertBefore(x,u):s.appendChild(x),Ur(_,s)),d++,f++}}const y=Xe.get(_);y!==null&&W(y)&&(ft===null&&(ft=y.getFormat()),qe===""&&(qe=y.getStyle()))}const h=d>i,g=f>l;if(h&&!g){const p=t[l+1],_=p===void 0?null:De.getElementByKey(p);ml(t,n,f,l,s,_)}else g&&!h&&_l(e,d,i,s)}function Fm(n,e,t,r,o,s){ge="",Tt="",we="",Eu=r===bn,os=null,De=t,Bt=t._config,zr=t._nodes,rs=De._listeners.mutation,hl=o,gl=s,an=n._nodeMap,Xe=e._nodeMap,Wr=e._readOnly,pl=new Map(t._keyToDOMMap);const i=new Map;return jr=i,Ur("root",null),De=void 0,zr=void 0,hl=void 0,gl=void 0,an=void 0,Xe=void 0,Bt=void 0,pl=void 0,jr=void 0,i}function Bm(n,e,t){const r=t._keyToDOMMap;e["__lexicalKey_"+t._key]=n,r.set(n,e)}function Nl(n){const e=pl.get(n);if(e===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${n}`);return e}const Et=Object.freeze({}),Cl=30,xl=[["keydown",Jm],["pointerdown",zm],["compositionstart",Ym],["compositionend",Vm],["input",Hm],["click",Km],["cut",Et],["copy",Et],["dragstart",Et],["dragover",Et],["dragend",Et],["paste",Et],["focus",Et],["blur",Et],["drop",Et]];Lo&&xl.push(["beforeinput",(n,e)=>Um(n,e)]);let Hr=0,Mu=null,Au=0,Mn=null;const cs=new WeakMap;let Tl=!1,El=!1,Yr=!1,Vr=!1,ku=[0,"",0,"root",0];function Pu(n,e,t,r,o){const s=n.anchor,i=n.focus,l=s.getNode(),c=le(),a=ut(c._window),u=a!==null?a.anchorNode:null,d=s.key,f=c.getElementByKey(d),h=t.length;return d!==i.key||!W(l)||(!o&&(!Lo||Au<r+50)||l.isDirty()&&h<2||lu(t))&&s.offset!==i.offset&&!l.isComposing()||ln(l)||l.isDirty()&&h>1||(o||!Lo)&&f!==null&&!l.isComposing()&&u!==Go(f)||a!==null&&e!==null&&(!e.collapsed||e.startContainer!==a.anchorNode||e.startOffset!==a.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||F_(n,l)}function Ru(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===It&&e!==0&&e!==n.nodeValue.length}function $u(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:i}=n;Tl&&(Tl=!1,Ru(r,o)&&Ru(s,i))||Ue(e,()=>{if(!t){at(null);return}if(!Pr(e,r,s))return;const l=re();if(H(l)){const c=l.anchor,a=c.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=ts(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,_]=ku,y=je(),m=e.isComposing()===!1&&y.getTextContent()==="";if(d<_+200&&c.offset===g&&c.key===p)l.format=f,l.style=h;else if(c.type==="text"){if(!W(a))throw Error("Point.getNode() must return TextNode when type is text");l.format=a.getFormat(),l.style=a.getStyle()}else if(c.type==="element"&&!m){const N=c.getNode();l.style="",N instanceof dn&&N.getChildrenSize()===0?(l.format=N.getTextFormat(),l.style=N.getTextStyle()):l.format=0}}else{const u=c.key,f=l.focus.key,h=l.getNodes(),g=h.length,p=l.isBackward(),_=p?i:o,y=p?o:i,m=p?f:u,N=p?u:f;let x=za,T=!1;for(let E=0;E<g;E++){const O=h[E],S=O.getTextContentSize();if(W(O)&&S!==0&&!(E===0&&O.__key===m&&_===S||E===g-1&&O.__key===N&&y===0)&&(T=!0,x&=O.getFormat(),x===0))break}l.format=T?x:0}}$(e,$o,void 0)})}function Km(n,e){Ue(e,()=>{const t=re(),r=ut(e._window),o=In();if(r){if(H(t)){const s=t.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Ie(i)&&je().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()){const c=t.focus.getNode();i!==c&&(b(i)?i.select(0):i.getParentOrThrow().select(0))}}else if(n.pointerType==="touch"){const s=r.anchorNode;if(s!==null){const i=s.nodeType;if(i===Mr||i===It){const l=gs(o,r,e,n);at(l)}}}}$(e,ya,n)})}function zm(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Ue(e,()=>{b_(t)||(El=!0)})}function Iu(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Wm(n,e){return n!==e||b(n)||b(e)||!n.isToken()||!e.isToken()}function jm(n){return Mu==="MediaLast"&&n<Hr+Cl}function Um(n,e){const t=n.inputType,r=Iu(n);t==="deleteCompositionText"||$t&&pu(e)||t!=="insertCompositionText"&&Ue(e,()=>{const o=re();if(t==="deleteContentBackward"){if(o===null){const u=In();if(!H(u))return;at(u.clone())}if(H(o)){const u=o.anchor.key===o.focus.key;if(jm(n.timeStamp)&&e.isComposing()&&u){if(ye(null),Hr=0,setTimeout(()=>{Ue(e,()=>{ye(null)})},Cl),H(o)){const d=o.anchor.getNode();if(d.markDirty(),o.format=d.getFormat(),!W(d))throw Error("Anchor node must be a TextNode");o.style=d.getStyle()}}else{ye(null),n.preventDefault();const d=o.anchor.getNode().getTextContent(),f=o.anchor.offset===0&&o.focus.offset===d.length;c_&&u&&!f||$(e,vr,!0)}return}}if(!H(o))return;const s=n.data;Mn!==null&&ol(!1,e,Mn),(!o.dirty||Mn!==null)&&o.isCollapsed()&&!Ie(o.anchor.getNode())&&r!==null&&o.applyDOMRange(r),Mn=null;const i=o.anchor,l=o.focus,c=i.getNode(),a=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
14
- `)n.preventDefault(),$(e,br,!1);else if(s===xt)n.preventDefault(),$(e,ki,void 0);else if(s==null&&n.dataTransfer){const u=n.dataTransfer.getData("text/plain");n.preventDefault(),o.insertRawText(u)}else s!=null&&Pu(o,r,s,n.timeStamp,!0)?(n.preventDefault(),$(e,vn,s)):Mn=s;Au=n.timeStamp;return}switch(n.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{$(e,vn,n);break}case"insertFromComposition":{ye(null),$(e,vn,n);break}case"insertLineBreak":{ye(null),$(e,br,!1);break}case"insertParagraph":{ye(null),Yr&&!Fo?(Yr=!1,$(e,br,!1)):$(e,ki,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{$(e,Pi,n);break}case"deleteByComposition":{Wm(c,a)&&$(e,Ri,n);break}case"deleteByDrag":case"deleteByCut":{$(e,Ri,n);break}case"deleteContent":{$(e,vr,!1);break}case"deleteWordBackward":{$(e,wr,!0);break}case"deleteWordForward":{$(e,wr,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{$(e,Dr,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{$(e,Dr,!1);break}case"formatStrikeThrough":{$(e,Rt,"strikethrough");break}case"formatBold":{$(e,Rt,"bold");break}case"formatItalic":{$(e,Rt,"italic");break}case"formatUnderline":{$(e,Rt,"underline");break}case"historyUndo":{$(e,$i,void 0);break}case"historyRedo":{$(e,Ii,void 0);break}}})}function Hm(n,e){n.stopPropagation(),Ue(e,()=>{const t=re(),r=n.data,o=Iu(n);if(r!=null&&H(t)&&Pu(t,o,r,n.timeStamp,!1)){Vr&&(Sl(e,r),Vr=!1);const i=t.anchor.getNode(),l=ut(e._window);if(l===null)return;const c=t.isBackward(),a=c?t.anchor.offset:t.focus.offset,u=c?t.focus.offset:t.anchor.offset;(!Lo||t.isCollapsed()||!W(i)||l.anchorNode===null||i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+u)!==au(l.anchorNode))&&$(e,vn,r);const d=r.length;$t&&d>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=d),!Ki&&!Fo&&!zi&&e.isComposing()&&(Hr=0,ye(null))}else ol(!1,e,r!==null?r:void 0),Vr&&(Sl(e,r||void 0),Vr=!1);$_()}),Mn=null}function Ym(n,e){Ue(e,()=>{const t=re();if(H(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();ye(r.key),(n.timeStamp<Hr+Cl||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||W(o)&&o.getStyle()!==t.style)&&$(e,vn,a_)}})}function Sl(n,e){const t=n._compositionKey;if(ye(null),t!==null&&e!=null){if(e===""){const r=Ee(t),o=Go(n.getElementByKey(t));o!==null&&o.nodeValue!==null&&W(r)&&sl(r,o.nodeValue,null,null,!0);return}if(e[e.length-1]===`
15
- `){const r=re();if(H(r)){const o=r.focus;r.anchor.set(o.key,o.offset,o.type),$(n,Io,null);return}}}ol(!0,n,e)}function Vm(n,e){$t?Vr=!0:Ue(e,()=>{Sl(e,n.data)})}function Jm(n,e){if(Hr=n.timeStamp,Mu=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:s,altKey:i}=n;if(!$(e,Na,n)&&t!=null){if(im(t,o,i,s))$(e,Ca,n);else if(lm(t,o,r,i,s))$(e,xa,n);else if(om(t,o,i,s))$(e,Ta,n);else if(sm(t,o,r,i,s))$(e,Ea,n);else if(cm(t,o,s))$(e,Sa,n);else if(am(t,o,s))$(e,Oa,n);else if(U_(t,r))Yr=!0,$(e,Io,n);else if(fm(t))$(e,va,n);else if(H_(t,o))n.preventDefault(),Yr=!0,$(e,br,!0);else if(j_(t,r))Yr=!1,$(e,Io,n);else if(q_(t,i,s,o))Lr(t)?$(e,ba,n):(n.preventDefault(),$(e,vr,!0));else if(dm(t))$(e,wa,n);else if(X_(t,o,r,i,s))Fr(t)?$(e,Da,n):(n.preventDefault(),$(e,vr,!1));else if(Y_(t,i,o))n.preventDefault(),$(e,wr,!0);else if(V_(t,i,o))n.preventDefault(),$(e,wr,!1);else if(J_(t,s))n.preventDefault(),$(e,Dr,!0);else if(G_(t,s))n.preventDefault(),$(e,Dr,!1);else if(K_(t,i,s,o))n.preventDefault(),$(e,Rt,"bold");else if(W_(t,i,s,o))n.preventDefault(),$(e,Rt,"underline");else if(z_(t,i,s,o))n.preventDefault(),$(e,Rt,"italic");else if(B_(t,i,o,s))$(e,Ma,n);else if(Q_(t,r,s,o))n.preventDefault(),$(e,$i,void 0);else if(Z_(t,r,s,o))n.preventDefault(),$(e,Ii,void 0);else{const l=e._editorState._selection;Jr(l)?em(t,r,s,o)?(n.preventDefault(),$(e,Li,n)):tm(t,r,s,o)?(n.preventDefault(),$(e,Fi,n)):hu(t,s,o)&&(n.preventDefault(),$(e,Bi,n)):!$t&&hu(t,s,o)&&(n.preventDefault(),$(e,Bi,n))}um(o,r,i,s)&&$(e,La,n)}}function Lu(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const An=new Map;function Fu(n){const e=n.target,t=e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView,r=ut(t);if(r===null)return;const o=tl(r.anchorNode);if(o===null)return;El&&(El=!1,Ue(o,()=>{const u=In(),d=r.anchorNode;if(d===null)return;const f=d.nodeType;if(f!==Mr&&f!==It)return;const h=gs(u,r,o,n);at(h)}));const s=rl(o),i=s[s.length-1],l=i._key,c=An.get(l),a=c||i;a!==o&&$u(r,a,!1),$u(r,o,!0),o!==i?An.set(l,o):c&&An.delete(l)}function Bu(n){n._lexicalHandled=!0}function Ku(n){return n._lexicalHandled===!0}function Gm(n,e){const t=n.ownerDocument,r=cs.get(t);(r===void 0||r<1)&&t.addEventListener("selectionchange",Fu),cs.set(t,(r||0)+1),n.__lexicalEditor=e;const o=Lu(n);for(let s=0;s<xl.length;s++){const[i,l]=xl[s],c=typeof l=="function"?a=>{Ku(a)||(Bu(a),(e.isEditable()||i==="click")&&l(a,e))}:a=>{if(Ku(a))return;Bu(a);const u=e.isEditable();switch(i){case"cut":return u&&$(e,Fi,a);case"copy":return $(e,Li,a);case"paste":return u&&$(e,Pi,a);case"dragstart":return u&&$(e,ka,a);case"dragover":return u&&$(e,Pa,a);case"dragend":return u&&$(e,Ra,a);case"focus":return u&&$(e,$a,a);case"blur":return u&&$(e,Ia,a);case"drop":return u&&$(e,Aa,a)}};n.addEventListener(i,c),o.push(()=>{n.removeEventListener(i,c)})}}function qm(n){const e=n.ownerDocument,t=cs.get(e);if(t===void 0)throw Error("Root element not registered");const r=t-1;if(!(r>=0))throw Error("Root element count less than 0");cs.set(e,r),r===0&&e.removeEventListener("selectionchange",Fu);const o=Rr(n);if(Jo(o))Xm(o),n.__lexicalEditor=null;else if(o)throw Error("Attempted to remove event handlers from a node that does not belong to this build of Lexical");const s=Lu(n);for(let i=0;i<s.length;i++)s[i]();n.__lexicalEventHandles=[]}function Xm(n){if(n._parentEditor!==null){const e=rl(n),r=e[e.length-1]._key;An.get(r)===n&&An.delete(r)}else An.delete(n._key)}function Qm(){Tl=!0}function Zm(n,e,t,r,o){ku=[n,e,t,r,o]}function Ol(n,e,t){be();const r=n.__key,o=n.getParent();if(o===null)return;const s=ym(n);let i=!1;if(H(s)&&e){const l=s.anchor,c=s.focus;l.key===r&&(_s(l,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0),c.key===r&&(_s(c,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else Jr(s)&&e&&n.isSelected()&&n.selectPrevious();if(H(s)&&e&&!i){const l=n.getIndexWithinParent();cn(n),ps(s,o,l,-1)}else cn(n);!t&&!Ft(o)&&!o.canBeEmpty()&&o.isEmpty()&&Ol(o,e),e&&Ie(o)&&o.isEmpty()&&o.selectEnd()}class as{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(e){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,tu(this,e),this.__type!=="root"&&(be(),ey(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Ee(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||re();if(t==null)return!1;const r=t.getNodes().some(s=>s.__key===this.__key);if(W(this))return r;if(H(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(ce(this)&&this.isInline()&&s){const i=t.isBackward()?t.focus:t.anchor,l=i.getNode();if(i.offset===l.getChildrenSize()&&l.is(s)&&l.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Ee(e)}getParentOrThrow(){const e=this.getParent();if(e===null)throw Error(`Expected node ${this.__key} to have a parent.`);return e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(Ft(t)){if(!(b(e)||e===this&&ce(e)))throw Error("Children of root nodes must be elements or decorators");return e}e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();if(e===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Ee(t)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Ee(t)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();b(this)&&t.unshift(this),b(e)&&r.unshift(e);const o=t.length,s=r.length;if(o===0||s===0||t[o-1]!==r[s-1])return null;const i=new Set(r);for(let l=0;l<o;l++){const c=t[l];if(i.has(c))return c}return null}is(e){return e==null?!1:this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,o=0,s=this;for(;;){const i=s.getParentOrThrow();if(i===t){r=s.getIndexWithinParent();break}s=i}for(s=e;;){const i=s.getParentOrThrow();if(i===t){o=s.getIndexWithinParent();break}s=i}return r<o}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],o=new Set;let s=this;for(;s!==null;){const i=s.__key;if(o.has(i)||(o.add(i),r.push(s)),s===e)break;const l=b(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const c=t?s.getNextSibling():s.getPreviousSibling();if(c!==null){s=c;continue}const a=s.getParentOrThrow();if(o.has(a.__key)||r.push(a),a===e)break;let u=null,d=a;do{if(d===null)throw Error("getNodesBetween: ancestor is null");if(u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d!==null)u===null&&!o.has(d.__key)&&r.push(d);else break}while(u===null);s=u}return t||r.reverse(),r}isDirty(){const t=le()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){const e=Ee(this.__key);if(e===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return e}getWritable(){be();const e=dt(),t=le(),r=e._nodeMap,o=this.__key,s=this.getLatest(),i=t._cloneNotNeeded,l=re();if(l!==null&&l.setCachedNodes(null),i.has(o))return qo(s),s;const c=xu(s);return i.add(o),qo(c),r.set(o,c),c}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){throw Error("createDOM: base method not extended")}updateDOM(e,t,r){throw Error("updateDOM: base method not extended")}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(e){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(e){Ol(this,!0,e)}replace(e,t){be();let r=re();r!==null&&(r=r.clone()),cl(this,e);const o=this.getLatest(),s=this.__key,i=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;cn(l);const u=o.getPreviousSibling(),d=o.getNextSibling(),f=o.__prev,h=o.__next,g=o.__parent;if(Ol(o,!1,!0),u===null)c.__first=i;else{const p=u.getWritable();p.__next=i}if(l.__prev=f,d===null)c.__last=i;else{const p=d.getWritable();p.__prev=i}if(l.__next=h,l.__parent=g,c.__size=a,t){if(!(b(this)&&b(l)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(p=>{l.append(p)})}if(H(r)){at(r);const p=r.anchor,_=r.focus;p.key===s&&Vu(p,l),_.key===s&&Vu(_,l)}return Lt()===s&&ye(i),l}insertAfter(e,t=!0){be(),cl(this,e);const r=this.getWritable(),o=e.getWritable(),s=o.getParent(),i=re();let l=!1,c=!1;if(s!==null){const h=e.getIndexWithinParent();if(cn(o),H(i)){const g=s.__key,p=i.anchor,_=i.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,c=_.type==="element"&&_.key===g&&_.offset===h+1}}const a=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,f=r.__next;if(a===null)u.__last=d;else{const h=a.getWritable();h.__prev=d}if(u.__size++,r.__next=d,o.__next=f,o.__prev=r.__key,o.__parent=r.__parent,t&&H(i)){const h=this.getIndexWithinParent();ps(i,u,h+1);const g=u.__key;l&&i.anchor.set(g,h+2,"element"),c&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){be(),cl(this,e);const r=this.getWritable(),o=e.getWritable(),s=o.__key;cn(o);const i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),c=r.__prev,a=this.getIndexWithinParent();if(i===null)l.__first=s;else{const d=i.getWritable();d.__next=s}l.__size++,r.__prev=s,o.__prev=c,o.__next=r.__key,o.__parent=r.__parent;const u=re();if(t&&H(u)){const d=this.getParentOrThrow();ps(u,d,a)}return e}isParentRequired(){return!1}createParentElementNode(){return St()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){be();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(b(r))return r.select();if(!W(r)){const s=r.getIndexWithinParent()+1;return o.select(s,s)}return r.select(e,t)}selectNext(e,t){be();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(b(r))return r.select(0,0);if(!W(r)){const s=r.getIndexWithinParent();return o.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}}function ey(n,e){const t=le()._nodes.get(n);if(t===void 0)throw Error(`Create node: Attempted to create node ${e.name} that was not configured to be used on the editor.`);const r=t.klass;if(r!==e)throw Error(`Create node: Type ${n} in node ${e.name} does not match registered node ${r.name} with the same type`)}function ty(n,e,t){const r=e.getParentOrThrow().getLastChild();let o=e;const s=[e];for(;o!==r;){if(!o.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");o=o.getNextSibling(),s.push(o)}let i=n;for(const l of s)i=i.insertAfter(l)}class kn extends as{static getType(){return"linebreak"}static clone(e){return new kn(e.__key)}constructor(e){super(e)}getTextContent(){return`
16
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>ry(e)||oy(e)?null:{conversion:ny,priority:0}}}static importJSON(e){return Pn()}exportJSON(){return{type:"linebreak",version:1}}}function ny(n){return{node:Pn()}}function Pn(){return Kr(new kn)}function fn(n){return n instanceof kn}function ry(n){const e=n.parentElement;if(e!==null&&fl(e)){const t=e.firstChild;if(t===n||t.nextSibling===n&&us(t)){const r=e.lastChild;if(r===n||r.previousSibling===n&&us(r))return!0}}return!1}function oy(n){const e=n.parentElement;if(e!==null&&fl(e)){const t=e.firstChild;if(t===n||t.nextSibling===n&&us(t))return!1;const r=e.lastChild;if(r===n||r.previousSibling===n&&us(r))return!0}return!1}function us(n){return n.nodeType===It&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function vl(n,e){return e&zo?"code":e&Uo?"mark":e&Wo?"sub":e&jo?"sup":null}function bl(n,e){return e&Bo?"strong":e&Ko?"em":"span"}function zu(n,e,t,r,o){const s=r.classList;let i=Br(o,"base");i!==void 0&&s.add(...i),i=Br(o,"underlineStrikethrough");let l=!1;const c=e&kr&&e&Ar,a=t&kr&&t&Ar;i!==void 0&&(a?(l=!0,c||s.add(...i)):c&&s.remove(...i));for(const u in ct){const f=ct[u];if(i=Br(o,u),i!==void 0)if(t&f){if(l&&(u==="underline"||u==="strikethrough")){e&f&&s.remove(...i);continue}(!(e&f)||c&&u==="underline"||u==="strikethrough")&&s.add(...i)}else e&f&&s.remove(...i)}}function sy(n,e){const t=n.length,r=e.length;let o=0,s=0;for(;o<t&&o<r&&n[o]===e[o];)o++;for(;s+o<t&&s+o<r&&n[t-s-1]===e[r-s-1];)s++;return[o,t-o-s,e.slice(o,r-s)]}function Wu(n,e,t){const r=e.firstChild,o=t.isComposing(),i=n+(o?Yo:"");if(r==null)e.textContent=i;else{const l=r.nodeValue;if(l!==i)if(o||$t){const[c,a,u]=sy(l,i);a!==0&&r.deleteData(c,a),r.insertData(c,u)}else r.nodeValue=i}}function ju(n,e,t,r,o,s){Wu(o,n,e);const l=s.theme.text;l!==void 0&&zu(t,0,r,n,l)}function fs(n,e){const t=document.createElement(e);return t.appendChild(n),t}let Rn=class extends as{static getType(){return"text"}static clone(e){return new Rn(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),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(){const e=this.getLatest();return p_[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Wi}isComposing(){return this.__key===Lt()}isSegmented(){return this.getLatest().__mode===ji}isDirectionless(){return(this.getLatest().__detail&Ui)!==0}isUnmergeable(){return(this.getLatest().__detail&Ho)!==0}hasFormat(e){const t=ct[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){const o=this.getLatest().__format;return nl(o,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=vl(this,r),s=bl(this,r),i=o===null?s:o,l=document.createElement(i);let c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(c=document.createElement(s),l.appendChild(c));const a=this.__text;ju(c,this,s,r,a,e);const u=this.__style;return u!==""&&(l.style.cssText=u),l}updateDOM(e,t,r){const o=this.__text,s=e.__format,i=this.__format,l=vl(this,s),c=vl(this,i),a=bl(this,s),u=bl(this,i);if((l===null?a:l)!==(c===null?u:c))return!0;if(l===c&&a!==u){const m=t.firstChild;if(m==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const N=document.createElement(u);return ju(N,this,u,i,o,r),t.replaceChild(N,m),!1}let h=t;if(c!==null&&l!==null&&(h=t.firstChild,h==null))throw Error("updateDOM: innerDOM is null or undefined");Wu(o,h,this);const p=r.theme.text;p!==void 0&&s!==i&&zu(u,s,i,h,p);const _=e.__style,y=this.__style;return _!==y&&(t.style.cssText=y),!1}static importDOM(){return{"#text":()=>({conversion:uy,priority:0}),b:()=>({conversion:ly,priority:0}),code:()=>({conversion:Kt,priority:0}),em:()=>({conversion:Kt,priority:0}),i:()=>({conversion:Kt,priority:0}),s:()=>({conversion:Kt,priority:0}),span:()=>({conversion:iy,priority:0}),strong:()=>({conversion:Kt,priority:0}),sub:()=>({conversion:Kt,priority:0}),sup:()=>({conversion:Kt,priority:0}),u:()=>({conversion:Kt,priority:0})}}static importJSON(e){const t=Se(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);if(!(t!==null&&ns(t)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=fs(t,"b")),this.hasFormat("italic")&&(t=fs(t,"i")),this.hasFormat("strikethrough")&&(t=fs(t,"s")),this.hasFormat("underline")&&(t=fs(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?ct[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?d_[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=this.getFormat(),r=nl(t,e,null);return this.setFormat(r)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=Ui,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=Ho,e}setMode(e){const t=g_[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){be();let r=e,o=t;const s=re(),i=this.getTextContent(),l=this.__key;if(typeof i=="string"){const c=i.length;r===void 0&&(r=c),o===void 0&&(o=c)}else r=0,o=0;if(H(s)){const c=Lt();(c===s.anchor.key||c===s.focus.key)&&ye(l),s.setTextNodeRange(this,r,this,o)}else return ef(l,r,l,o,"text","text");return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const s=this.getWritable(),i=s.__text,l=r.length;let c=e;c<0&&(c=l+c,c<0&&(c=0));const a=re();if(o&&H(a)){const d=e+l;a.setTextNodeRange(s,d,s,d)}const u=i.slice(0,c)+r+i.slice(c+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){be();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,s=Lt(),i=new Set(e),l=[],c=r.length;let a="";for(let T=0;T<c;T++)a!==""&&i.has(T)&&(l.push(a),a=""),a+=r[T];a!==""&&l.push(a);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),p=t.getStyle(),_=t.__detail;let y=!1;t.isSegmented()?(h=Se(d),h.__format=g,h.__style=p,h.__detail=_,y=!0):(h=t.getWritable(),h.__text=d);const m=re(),N=[h];let x=d.length;for(let T=1;T<u;T++){const E=l[T],O=E.length,S=Se(E).getWritable();S.__format=g,S.__style=p,S.__detail=_;const v=S.__key,M=x+O;if(H(m)){const B=m.anchor,X=m.focus;B.key===o&&B.type==="text"&&B.offset>x&&B.offset<=M&&(B.key=v,B.offset-=x,m.dirty=!0),X.key===o&&X.type==="text"&&X.offset>x&&X.offset<=M&&(X.key=v,X.offset-=x,m.dirty=!0)}s===o&&ye(v),x=M,N.push(S)}if(f!==null){P_(this);const T=f.getWritable(),E=this.getIndexWithinParent();y?(T.splice(E,0,N),this.remove()):T.splice(E,1,N),H(m)&&ps(m,f,E,u-1)}return N}mergeWithSibling(e){const t=e===this.getPreviousSibling();if(!t&&e!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const r=this.__key,o=e.__key,s=this.__text,i=s.length;Lt()===o&&ye(r);const c=re();if(H(c)){const f=c.anchor,h=c.focus;f!==null&&f.key===o&&(nf(f,t,r,e,i),c.dirty=!0),h!==null&&h.key===o&&(nf(h,t,r,e,i),c.dirty=!0)}const a=e.__text,u=t?a+s:s+a;this.setTextContent(u);const d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}};function iy(n){const t=n.style;return{forChild:wl(t),node:null}}function ly(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:wl(e.style,t?void 0:"bold"),node:null}}const Uu=new WeakMap;function cy(n){return n.nodeName==="PRE"||n.nodeType===Mr&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function ay(n){let e,t=n.parentNode;const r=[n];for(;t!==null&&(e=Uu.get(t))===void 0&&!cy(t);)r.push(t),t=t.parentNode;const o=e===void 0?t:e;for(let s=0;s<r.length;s++)Uu.set(r[s],o);return o}function uy(n){const e=n;if(n.parentElement===null)throw Error("Expected parentElement of Text not to be null");let r=e.textContent||"";if(ay(e)!==null){const o=r.split(/(\r?\n|\t)/),s=[],i=o.length;for(let l=0;l<i;l++){const c=o[l];c===`
17
- `||c===`\r
18
- `?s.push(Pn()):c===" "?s.push(ds()):c!==""&&s.push(Se(c))}return{node:s}}if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let o=e,s=!0;for(;o!==null&&(o=Hu(o,!1))!==null;){const i=o.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(r=r.slice(1)),s=!1;break}}s&&(r=r.slice(1))}if(r[r.length-1]===" "){let o=e,s=!0;for(;o!==null&&(o=Hu(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Se(r)}}function Hu(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,t.nodeType===Mr){const s=t.style.display;if(s===""&&!yu(t)||s!==""&&!s.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===It)return t;if(t.nodeName==="BR")return null}}const fy={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Kt(n){const e=fy[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:wl(n.style,e),node:null}}function Se(n=""){return Kr(new Rn(n))}function W(n){return n instanceof Rn}function wl(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",s=r.includes("line-through"),i=n.fontStyle==="italic",l=r.includes("underline"),c=n.verticalAlign;return a=>(W(a)&&(o&&!a.hasFormat("bold")&&a.toggleFormat("bold"),s&&!a.hasFormat("strikethrough")&&a.toggleFormat("strikethrough"),i&&!a.hasFormat("italic")&&a.toggleFormat("italic"),l&&!a.hasFormat("underline")&&a.toggleFormat("underline"),c==="sub"&&!a.hasFormat("subscript")&&a.toggleFormat("subscript"),c==="super"&&!a.hasFormat("superscript")&&a.toggleFormat("superscript"),e&&!a.hasFormat(e)&&a.toggleFormat(e)),a)}class $n extends Rn{static getType(){return"tab"}static clone(e){return new $n(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=Ho}static importDOM(){return null}static importJSON(e){const t=ds();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){throw Error("TabNode does not support setTextContent")}setDetail(e){throw Error("TabNode does not support setDetail")}setMode(e){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function ds(){return Kr(new $n)}function Yu(n){return n instanceof $n}class dy{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const o=this.offset,s=e.offset;if(b(t)){const i=t.getDescendantByIndex(o);t=i??t}if(b(r)){const i=r.getDescendantByIndex(s);r=i??r}return t===r?o<s:t.isBefore(r)}getNode(){const e=this.key,t=Ee(e);if(t===null)throw Error("Point.getNode: node not found");return t}set(e,t,r){const o=this._selection,s=this.key;this.key=e,this.offset=t,this.type=r,Ln()||(Lt()===s&&ye(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function Qe(n,e,t){return new dy(n,e,t)}function Dl(n,e){let t=e.__key,r=n.offset,o="element";if(W(e)){o="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!b(e)){const s=e.getNextSibling();if(W(s))t=s.__key,r=0,o="text";else{const i=e.getParent();i&&(t=i.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function Vu(n,e){if(b(e)){const t=e.getLastDescendant();b(t)||W(t)?Dl(n,t):Dl(n,e)}else Dl(n,e)}function hy(n,e,t,r){const o=n.getNode(),s=o.getChildAtIndex(n.offset),i=Se(),l=Ie(o)?St().append(i):i;i.setFormat(t),i.setStyle(r),s===null?o.append(l):s.insertBefore(l),n.is(e)&&e.set(i.__key,0,"text"),n.set(i.__key,0,"text")}function zt(n,e,t,r){n.key=e,n.offset=t,n.type=r}class hs{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Jr(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}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 hs(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,o=t[r-1];let s;if(W(o))s=o.select();else{const i=o.getIndexWithinParent()+1;s=o.getParentOrThrow().select(i,i)}s.insertNodes(e);for(let i=0;i<r;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const o of t){const s=Ee(o);s!==null&&r.push(s)}return Ln()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function H(n){return n instanceof Wt}class Wt{constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return H(e)?this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,o=t.isBefore(r),s=o?t:r,i=o?r:t;let l=s.getNode(),c=i.getNode();const a=s.offset,u=i.offset;if(b(l)){const f=l.getDescendantByIndex(a);l=f??l}if(b(c)){let f=c.getDescendantByIndex(u);f!==null&&f!==l&&c.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),c=f??c}let d;return l.is(c)?b(l)&&l.getChildrenSize()>0?d=[]:d=[l]:d=l.getNodesBetween(c),Ln()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,o){zt(this.anchor,e.__key,t,"text"),zt(this.focus,r.__key,o,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],o=this.anchor,s=this.focus,i=o.isBefore(s),[l,c]=Ml(this);let a="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(b(f)&&!f.isInline())u||(a+=`
19
- `),f.isEmpty()?u=!1:u=!0;else if(u=!1,W(f)){let h=f.getTextContent();f===t?f===r?(o.type!=="element"||s.type!=="element"||s.offset===o.offset)&&(h=l<c?h.slice(l,c):h.slice(c,l)):h=i?h.slice(l):h.slice(c):f===r&&(h=i?h.slice(0,c):h.slice(0,l)),a+=h}else(ce(f)||fn(f))&&(f!==r||!this.isCollapsed())&&(a+=f.getTextContent())}return a}applyDOMRange(e){const t=le(),o=t.getEditorState()._selection,s=Zu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,o);if(s===null)return;const[i,l]=s;zt(this.anchor,i.key,i.offset,i.type),zt(this.focus,l.key,l.offset,l.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Wt(Qe(e.key,e.offset,e.type),Qe(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=nl(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ct[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];i===`
20
- `||i===`\r
21
- `?r.push(Pn()):i===" "?r.push(ds()):r.push(Se(i))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,s=this.style;let i=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(i=r,l=t),i.type==="element"&&hy(i,l,o,s);const c=i.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];if(!W(f))throw Error("insertText: first node is not a text node");const g=f.getTextContent().length,p=f.getParentOrThrow(),_=d-1;let y=u[_];if(d===1&&l.type==="element"&&(a=g,l.set(i.key,a,"text")),this.isCollapsed()&&c===g&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!p.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if((!W(m)||!m.canInsertTextBefore()||ln(m))&&(m=Se(),m.setFormat(o),m.setStyle(s),p.canInsertTextAfter()?f.insertAfter(m):p.insertAfter(m)),m.select(0,0),f=m,e!==""){this.insertText(e);return}}else if(this.isCollapsed()&&c===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!p.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if((!W(m)||ln(m))&&(m=Se(),m.setFormat(o),p.canInsertTextBefore()?f.insertBefore(m):p.insertBefore(m)),m.select(),f=m,e!==""){this.insertText(e);return}}else if(f.isSegmented()&&c!==g){const m=Se(f.getTextContent());m.setFormat(o),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=y.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||b(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter())){this.insertText(""),Qu(this.anchor,this.focus,null),this.insertText(e);return}}if(d===1){if(f.isToken()){const T=Se(e);T.select(),f.replace(T);return}const m=f.getFormat(),N=f.getStyle();if(c===a&&(m!==o||N!==s))if(f.getTextContent()==="")f.setFormat(o),f.setStyle(s);else{const T=Se(e);if(T.setFormat(o),T.setStyle(s),T.select(),c===0)f.insertBefore(T,!1);else{const[E]=f.splitText(c);E.insertAfter(T,!1)}T.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);return}else if(Yu(f)){const T=Se(e);T.setFormat(o),T.setStyle(s),T.select(),f.replace(T);return}const x=a-c;f=f.spliceText(c,x,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=N))}else{const m=new Set([...f.getParentKeys(),...y.getParentKeys()]),N=b(f)?f:f.getParentOrThrow();let x=b(y)?y:y.getParentOrThrow(),T=y;if(!N.is(x)&&x.isInline())do T=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(a!==0||y.getTextContent()==="")||l.type==="element"&&y.getIndexWithinParent()<a)if(W(y)&&!y.isToken()&&a!==y.getTextContentSize()){if(y.isSegmented()){const M=Se(y.getTextContent());y.replace(M),y=M}!Ie(l.getNode())&&l.type==="text"&&(y=y.spliceText(0,a,"")),m.add(y.__key)}else{const M=y.getParentOrThrow();!M.canBeEmpty()&&M.getChildrenSize()===1?M.remove():y.remove()}else m.add(y.__key);const E=x.getChildren(),O=new Set(u),S=N.is(x),v=N.isInline()&&f.getNextSibling()===null?N:f;for(let M=E.length-1;M>=0;M--){const B=E[M];if(B.is(f)||b(B)&&B.isParentOf(f))break;B.isAttached()&&(!O.has(B)||B.is(T)?S||v.insertAfter(B,!1):B.remove())}if(!S){let M=x,B=null;for(;M!==null;){const X=M.getChildren(),te=X.length;(te===0||X[te-1].is(B))&&(m.delete(M.__key),B=M),M=M.getParent()}}if(!f.isToken())f=f.spliceText(c,g-c,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);else if(c===g)f.select();else{const M=Se(e);M.select(),f.replace(M)}for(let M=1;M<d;M++){const B=u[M],X=B.__key;m.has(X)||B.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed()){this.toggleFormat(e),ye(null);return}const t=this.getNodes(),r=[];for(const m of t)W(m)&&r.push(m);const o=r.length;if(o===0){this.toggleFormat(e),ye(null);return}const s=this.anchor,i=this.focus,l=this.isBackward(),c=l?i:s,a=l?s:i;let u=0,d=r[0],f=c.type==="element"?0:c.offset;if(c.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=o-1;let p=r[g];const _=a.type==="text"?a.offset:p.getTextContentSize();if(d.is(p)){if(f===_)return;if(ln(d)||f===0&&_===d.getTextContentSize())d.setFormat(h);else{const m=d.splitText(f,_),N=f===0?m[0]:m[1];N.setFormat(h),c.type==="text"&&c.set(N.__key,0,"text"),a.type==="text"&&a.set(N.__key,_-f,"text")}this.format=h;return}f!==0&&!ln(d)&&([,d]=d.splitText(f),f=0),d.setFormat(h);const y=p.getFormatFlags(e,h);_>0&&(_!==p.getTextContentSize()&&!ln(p)&&([p]=p.splitText(_)),p.setFormat(y));for(let m=u+1;m<g;m++){const N=r[m],x=N.getFormatFlags(e,y);N.setFormat(x)}c.type==="text"&&c.set(d.__key,f,"text"),a.type==="text"&&a.set(p.__key,_,"text"),this.format=h|y}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const _=re();if(!H(_))throw Error("Expected RangeSelection after insertParagraph");return _.insertNodes(e)}const t=this.isBackward()?this.focus:this.anchor,r=dl(t.getNode(),Dn),o=e[e.length-1];if("__language"in r&&b(r)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const _=kl(this);r.splice(_,0,e),o.selectEnd()}return}const s=_=>(b(_)||ce(_))&&!_.isInline();if(!e.some(s)){if(!b(r))throw Error("Expected 'firstBlock' to be an ElementNode");const _=kl(this);r.splice(_,0,e),o.selectEnd();return}const i=by(e),l=i.getLastDescendant(),c=i.getChildren(),a=_=>b(_)&&Dn(_)&&!_.isEmpty()&&b(r)&&(!r.isEmpty()||r.canMergeWhenEmpty()),d=!b(r)||!r.isEmpty()?this.insertParagraph():null,f=c[c.length-1];let h=c[0];if(a(h)){if(!b(r))throw Error("Expected 'firstBlock' to be an ElementNode");r.append(...h.getChildren()),h=c[1]}h&&ty(r,h);const g=dl(l,Dn);d&&b(g)&&(d.canMergeWhenEmpty()||Dn(f))&&(g.append(...d.getChildren()),d.remove()),b(r)&&r.isEmpty()&&r.remove(),l.selectEnd();const p=b(r)?r.getLastChild():null;fn(p)&&g!==r&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=St();return je().splice(this.anchor.offset,0,[i]),i.select(),i}const e=kl(this),t=dl(this.anchor.getNode(),Dn);if(!b(t))throw Error("Expected ancestor to be an ElementNode");const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...o),s.selectStart(),s):null}insertLineBreak(e){const t=Pn();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,o=this.anchor,s=this.focus;let i=e[0],l=e[r];const[c,a]=Ml(this);if(t===0)return[];if(t===1){if(W(i)&&!this.isCollapsed()){const d=c>a?a:c,f=c>a?c:a,h=i.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[i]}const u=o.isBefore(s);if(W(i)){const d=u?c:a;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(W(l)){const f=l.getTextContent().length,h=u?a:c;h===0?e.pop():h!==f&&([l]=l.splitText(h),e[r]=l)}return e}modify(e,t,r){const o=this.focus,s=this.anchor,i=e==="move",l=ll(o,t);if(ce(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=Al();h.add(l.__key),at(h);return}const f=t?l.getPreviousSibling():l.getNextSibling();if(W(f)){const h=f.__key,g=t?f.getTextContent().length:0;o.set(h,g,"text"),i&&s.set(h,g,"text");return}else{const h=l.getParentOrThrow();let g,p;b(f)?(p=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),p=h.__key,t||g++),o.set(p,g,"element"),i&&s.set(p,g,"element");return}}const c=le(),a=ut(c._window);if(!a)return;const u=c._blockCursorElement,d=c._rootElement;if(d!==null&&u!==null&&b(l)&&!l.isInline()&&!l.canBeEmpty()&&ul(u,c,d),py(a,e,t?"backward":"forward",r),a.rangeCount>0){const f=a.getRangeAt(0),h=this.anchor.getNode(),g=Ie(h)?h:_u(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const p=this.getNodes(),_=[];let y=!1;for(let m=0;m<p.length;m++){const N=p[m];es(N,g)?_.push(N):y=!0}if(y&&_.length>0)if(t){const m=_[0];b(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=_[_.length-1];b(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}(a.anchorNode!==f.startContainer||a.anchorOffset!==f.startOffset)&&gy(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&b(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),s=t.getNextSibling()||(o===null?null:o.getNextSibling());if(b(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e))return;const s=this.focus,i=ll(s,e);if(ce(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&b(o)&&o.getChildrenSize()===0){o.remove();const l=Al();l.add(i.__key),at(l)}else i.remove(),le().dispatchCommand($o,void 0);return}else if(!e&&b(i)&&b(o)&&o.isEmpty()){o.remove(),i.selectStart();return}if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const c=s.offset,a=l.getTextContentSize();if(l.is(o)||e&&c!==a||!e&&c!==0){Gu(l,e,c);return}}else if(o!==null&&o.isSegmented()){const c=r.offset,a=o.getTextContentSize();if(o.is(l)||e&&c!==0||!e&&c!==a){Gu(o,e,c);return}}_y(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Ie(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const o=e?this.anchor:this.focus;o.set(o.key,o.offset+1,o.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Jr(n){return n instanceof hs}function Ju(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Ml(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Ju(t),Ju(r)]}function gy(n){const e=n.focus,t=n.anchor,r=t.key,o=t.offset,s=t.type;zt(t,e.key,e.offset,e.type),zt(e,r,o,s),n._cachedNodes=null}function py(n,e,t,r){n.modify(e,t,r)}function _y(n,e){const t=n.anchor,r=n.focus,o=t.getNode(),s=r.getNode();if(o===s&&t.type==="text"&&r.type==="text"){const i=t.offset,l=r.offset,c=i<l,a=c?i:l,u=c?l:i,d=u-1;if(a!==d){const f=o.getTextContent().slice(a,u);lu(f)||(e?r.offset=d:t.offset=d)}}}function Gu(n,e,t){const r=n,s=r.getTextContent().split(/(?=\s)/g),i=s.length;let l=0,c=0;for(let u=0;u<i;u++){const d=s[u],f=u===i-1;if(c=l,l+=d.length,e&&l===t||l>t||f){s.splice(u,1),f&&(c=void 0);break}}const a=s.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(c,c))}function my(n,e,t){const r=n.getParent();return t===null||r===null||!r.canBeEmpty()||r!==t.getNode()}function qu(n,e,t,r){let o=e,s;if(n.nodeType===Mr){let i=!1;const l=n.childNodes,c=l.length,a=r._blockCursorElement;o===c&&(i=!0,o=c-1);let u=l[o],d=!1;if(u===a)u=l[o+1],d=!0;else if(a!==null){const f=a.parentNode;if(n===f){const h=Array.prototype.indexOf.call(f.children,a);e>h&&o--}}if(s=wn(u),W(s))o=iu(s,i);else{let f=wn(n);if(f===null)return null;if(b(f)){o=Math.min(f.getChildrenSize(),o);let h=f.getChildAtIndex(o);if(b(h)&&my(h,o,t)){const g=i?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=b(h)?h:h.getParentOrThrow()),o=0}W(h)?(s=h,f=null,o=iu(h,i)):h!==f&&i&&!d&&o++}else{const h=f.getIndexWithinParent();e===0&&ce(f)&&wn(n)===f?o=h:o=h+1,f=f.getParentOrThrow()}if(b(f))return Qe(f.__key,o,"element")}}else s=wn(n);return W(s)?Qe(s.__key,o,"text"):null}function Xu(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const s=o.getPreviousSibling(),i=o.getParent();if(!e)b(s)&&!t&&s.isInline()?(n.key=s.__key,n.offset=s.getChildrenSize(),n.type="element"):W(s)&&(n.key=s.__key,n.offset=s.getTextContent().length);else if((t||!e)&&s===null&&b(i)&&i.isInline()){const l=i.getPreviousSibling();W(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else if(r===o.getTextContent().length){const s=o.getNextSibling(),i=o.getParent();if(e&&b(s)&&s.isInline())n.key=s.__key,n.offset=0,n.type="element";else if((t||e)&&s===null&&b(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();W(l)&&(n.key=l.__key,n.offset=0)}}}function Qu(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),o=n.is(e);Xu(n,r,o),Xu(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const s=le();if(s.isComposing()&&s._compositionKey!==n.key&&H(t)){const i=t.anchor,l=t.focus;zt(n,i.key,i.offset,i.type),zt(e,l.key,l.offset,l.type)}}}function Zu(n,e,t,r,o,s){if(n===null||t===null||!Pr(o,n,t))return null;const i=qu(n,e,H(s)?s.anchor:null,o);if(i===null)return null;const l=qu(t,r,H(s)?s.focus:null,o);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const c=wn(n),a=wn(t);if(ce(c)&&ce(a))return null}return Qu(i,l,s),[i,l]}function yy(n){return b(n)&&!n.isInline()}function ef(n,e,t,r,o,s){const i=dt(),l=new Wt(Qe(n,e,o),Qe(t,r,s),0,"");return l.dirty=!0,i._selection=l,l}function Ny(){const n=Qe("root",0,"element"),e=Qe("root",0,"element");return new Wt(n,e,0,"")}function Al(){return new hs(new Set)}function Cy(n){const t=n.getEditorState()._selection,r=ut(n._window);return H(t)||t==null?gs(t,r,n,null):t.clone()}function xy(n,e){return gs(null,n,e,null)}function gs(n,e,t,r){const o=t._window;if(o===null)return null;const s=r||o.event,i=s?s.type:void 0,l=i==="selectionchange",c=!m_()&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0);let a,u,d,f;if(!H(n)||c){if(e===null)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&H(n)&&!Pr(t,a,u))return n.clone()}else return n.clone();const h=Zu(a,d,u,f,t,n);if(h===null)return null;const[g,p]=h;return new Wt(g,p,H(n)?n.format:0,H(n)?n.style:"")}function re(){return dt()._selection}function In(){return le()._editorState._selection}function ps(n,e,t,r=1){const o=n.anchor,s=n.focus,i=o.getNode(),l=s.getNode();if(!e.is(i)&&!e.is(l))return;const c=e.__key;if(n.isCollapsed()){const a=o.offset;if(t<=a&&r>0||t<a&&r<0){const u=Math.max(0,a+r);o.set(c,u,"element"),s.set(c,u,"element"),tf(n)}}else{const a=n.isBackward(),u=a?s:o,d=u.getNode(),f=a?o:s,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(c,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(c,Math.max(0,g+r),"element")}}tf(n)}function tf(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,s=e.getNode(),i=r.getNode();if(n.isCollapsed()){if(!b(s))return;const l=s.getChildrenSize(),c=t>=l,a=c?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(W(a)){let u=0;c&&(u=a.getTextContentSize()),e.set(a.__key,u,"text"),r.set(a.__key,u,"text")}return}if(b(s)){const l=s.getChildrenSize(),c=t>=l,a=c?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(W(a)){let u=0;c&&(u=a.getTextContentSize()),e.set(a.__key,u,"text")}}if(b(i)){const l=i.getChildrenSize(),c=o>=l,a=c?i.getChildAtIndex(l-1):i.getChildAtIndex(o);if(W(a)){let u=0;c&&(u=a.getTextContentSize()),r.set(a.__key,u,"text")}}}function Ty(n,e){const r=e.getEditorState()._selection,o=n._selection;if(H(o)){const s=o.anchor,i=o.focus;let l;if(s.type==="text"&&(l=s.getNode(),l.selectionTransform(r,o)),i.type==="text"){const c=i.getNode();l!==c&&c.selectionTransform(r,o)}}}function _s(n,e,t,r,o){let s=null,i=0,l=null;r!==null?(s=r.__key,W(r)?(i=r.getTextContentSize(),l="text"):b(r)&&(i=r.getChildrenSize(),l="element")):o!==null&&(s=o.__key,W(o)?l="text":b(o)&&(l="element")),s!==null&&l!==null?n.set(s,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function nf(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Ey(n,e,t,r,o,s,i){const l=r.anchorNode,c=r.focusNode,a=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(o.has("collaboration")&&d!==s||d!==null&&el(d))return;if(!H(e)){n!==null&&Pr(t,l,c)&&r.removeAllRanges();return}const f=e.anchor,h=e.focus,g=f.key,p=h.key,_=Qo(t,g),y=Qo(t,p),m=f.offset,N=h.offset,x=e.format,T=e.style,E=e.isCollapsed();let O=_,S=y,v=!1;if(f.type==="text"){O=Go(_);const M=f.getNode();v=M.getFormat()!==x||M.getStyle()!==T}else H(n)&&n.anchor.type==="text"&&(v=!0);if(h.type==="text"&&(S=Go(y)),!(O===null||S===null)&&(E&&(n===null||v||H(n)&&(n.format!==x||n.style!==T))&&Zm(x,T,m,g,performance.now()),!(a===m&&u===N&&l===O&&c===S&&!(r.type==="Range"&&E)&&((d===null||!s.contains(d))&&s.focus({preventScroll:!0}),f.type!=="element")))){try{r.setBaseAndExtent(O,m,S,N)}catch(M){console.warn(M)}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&s!==null&&s===document.activeElement){const M=e instanceof Wt&&e.anchor.type==="element"?O.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(M!==null){let B;if(M instanceof Text){const X=document.createRange();X.selectNode(M),B=X.getBoundingClientRect()}else B=M.getBoundingClientRect();pm(t,B,s)}}Qm()}}function Sy(n){let e=re()||In();e===null&&(e=je().selectEnd()),e.insertNodes(n)}function Oy(){const n=re();return n===null?"":n.getTextContent()}function kl(n){let e=n;n.isCollapsed()||e.removeText();const t=re();if(H(t)&&(e=t),!H(e))throw Error("Unexpected dirty selection to be null");const r=e.anchor;let o=r.getNode(),s=r.offset;for(;!Dn(o);)[o,s]=vy(o,s);return s}function vy(n,e){const t=n.getParent();if(!t){const o=St();return je().append(o),o.select(),[je(),0]}if(W(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1,i=o[0].getIndexWithinParent()+s;return[t,i]}if(!b(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new Wt(Qe(n.__key,e,"element"),Qe(n.__key,e,"element"),0,""),s=n.insertNewAfter(o);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function by(n){const e=St();let t=null;for(let r=0;r<n.length;r++){const o=n[r],s=fn(o);if(s||ce(o)&&o.isInline()||b(o)&&o.isInline()||W(o)||o.isParentRequired()){if(t===null&&(t=o.createParentElementNode(),e.append(t),s))continue;t!==null&&t.append(o)}else e.append(o),t=null}return e}let pe=null,Ne=null,$e=!1,Pl=!1,ms=0;const rf={characterData:!0,childList:!0,subtree:!0};function Ln(){return $e||pe!==null&&pe._readOnly}function be(){if($e)throw Error("Cannot use method in read-only mode.")}function of(){if(ms>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function dt(){if(pe===null)throw Error(`Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update(), editor.read(), or editorState.read().${sf()}`);return pe}function le(){if(Ne===null)throw Error(`Unable to find an active editor. This method can only be used synchronously during the callback of editor.update() or editor.read().${sf()}`);return Ne}function sf(){let n=0;const e=new Set,t=Ns.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const s=Rr(o);if(Jo(s))n++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function wy(){return Ne}function Dy(){return pe}function lf(n,e,t){const r=e.__type,o=O_(n,r);let s=t.get(r);s===void 0&&(s=Array.from(o.transforms),t.set(r,s));const i=s.length;for(let l=0;l<i&&(s[l](e),!!e.isAttached());l++);}function cf(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function My(n,e){const t=e._dirtyLeaves,r=n._nodeMap;for(const o of t){const s=r.get(o);W(s)&&s.isAttached()&&s.isSimpleText()&&!s.isUnmergeable()&&Xa(s)}}function Ay(n,e){const t=e._dirtyLeaves,r=e._dirtyElements,o=n._nodeMap,s=Lt(),i=new Map;let l=t,c=l.size,a=r,u=a.size;for(;c>0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const d of l){const f=o.get(d);W(f)&&f.isAttached()&&f.isSimpleText()&&!f.isUnmergeable()&&Xa(f),f!==void 0&&cf(f,s)&&lf(e,f,i),t.add(d)}if(l=e._dirtyLeaves,c=l.size,c>0){ms++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map;for(const d of a){const f=d[0],h=d[1];if(f!=="root"&&!h)continue;const g=o.get(f);g!==void 0&&cf(g,s)&&lf(e,g,i),r.set(f,h)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,ms++}e._dirtyLeaves=t,e._dirtyElements=r}function ky(n){return Rl(n,le()._nodes)}function Rl(n,e){const t=n.type,r=e.get(t);if(r===void 0)throw Error(`parseEditorState: type "${t}" + not found`);const o=r.klass;if(n.type!==o.getType())throw Error(`LexicalNode: Node ${o.name} does not implement .importJSON().`);const s=o.importJSON(n),i=n.children;if(b(s)&&Array.isArray(i))for(let l=0;l<i.length;l++){const c=i[l],a=Rl(c,e);s.append(a)}return s}function Py(n,e,t){const r=Il(),o=pe,s=$e,i=Ne,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,pe=r,$e=!1,Ne=e;try{const d=e._nodes,f=n.root;Rl(f,d),t&&t(),r._readOnly=!0,uf(r)}catch(d){d instanceof Error&&e._onError(d)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,pe=o,$e=s,Ne=i}return r}function af(n,e,t){const r=pe,o=$e,s=Ne;pe=e,$e=!0,Ne=n;try{return t()}finally{pe=r,$e=o,Ne=s}}function uf(n){const e=n._nodeMap;e.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},e.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},e.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function jt(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const s=n._editorState,i=s._selection,l=t._selection,c=n._dirtyType!==sn,a=pe,u=$e,d=Ne,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!o&&c&&h!==null){Ne=n,pe=t,$e=!1,n._updating=!0;try{const E=n._dirtyType,O=n._dirtyElements,S=n._dirtyLeaves;h.disconnect(),g=Fm(s,t,n,E,O,S)}catch(E){if(E instanceof Error&&n._onError(E),!Pl)mf(n,null,r,t),Ja(n),n._dirtyType=bn,Pl=!0,jt(n,s),Pl=!1;else throw E;return}finally{h.observe(r,rf),n._updating=f,pe=a,$e=u,Ne=d}}t._readOnly||(t._readOnly=!0,uf(t),H(l)&&(Object.freeze(l.anchor),Object.freeze(l.focus)),Object.freeze(l));const p=n._dirtyLeaves,_=n._dirtyElements,y=n._normalizedNodes,m=n._updateTags,N=n._deferred;c&&(n._dirtyType=sn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),wm(n,t);const x=o?null:ut(n._window);if(n._editable&&x!==null&&(c||l===null||l.dirty)){Ne=n,pe=t;try{if(h!==null&&h.disconnect(),c||l===null||l.dirty){const E=n._blockCursorElement;E!==null&&ul(E,n,r),Ey(i,l,n,x,m,r)}Em(n,r,l),h!==null&&h.observe(r,rf)}finally{Ne=d,pe=a}}g!==null&&$y(n,g,m,p,s),!H(l)&&l!==null&&(i===null||!i.is(l))&&n.dispatchCommand($o,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,Gr("decorator",n,!0,T)),Ry(n,e||s,t),Gr("update",n,!0,{dirtyElements:_,dirtyLeaves:p,editorState:t,normalizedNodes:y,prevEditorState:e||s,tags:m}),Ly(n,N),Iy(n)}function Ry(n,e,t){const r=ou(e),o=ou(t);r!==o&&Gr("textcontent",n,!0,o)}function $y(n,e,t,r,o){const s=Array.from(n._listeners.mutation),i=s.length;for(let l=0;l<i;l++){const[c,a]=s[l],u=e.get(a);u!==void 0&&c(u,{dirtyLeaves:r,prevEditorState:o,updateTags:t})}}function Gr(n,e,t,...r){const o=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let i=0;i<s.length;i++)s[i].apply(null,r)}finally{e._updating=o}}function ff(n,e,t){if(n._updating===!1||Ne!==n){let o=!1;return n.update(()=>{o=ff(n,e,t)}),o}const r=rl(n);for(let o=4;o>=0;o--)for(let s=0;s<r.length;s++){const c=r[s]._commands.get(e);if(c!==void 0){const a=c[o];if(a!==void 0){const u=Array.from(a),d=u.length;for(let f=0;f<d;f++)if(u[f](t,n)===!0)return!0}}}return!1}function Iy(n){const e=n._updates;if(e.length!==0){const t=e.shift();if(t){const[r,o]=t;hf(n,r,o)}}}function Ly(n,e){if(n._deferred=[],e.length!==0){const t=n._updating;n._updating=!0;try{for(let r=0;r<e.length;r++)e[r]()}finally{n._updating=t}}}function df(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[s,i]=o;let l,c;if(i!==void 0){if(l=i.onUpdate,c=i.tag,i.skipTransforms&&(r=!0),i.discrete){const a=n._pendingEditorState;if(a===null)throw Error("Unexpected empty pending editor state on discrete nested update");a._flushSync=!0}l&&n._deferred.push(l),c&&n._updateTags.add(c)}s()}}return r}function hf(n,e,t){const r=n._updateTags;let o,s,i=!1,l=!1;t!==void 0&&(o=t.onUpdate,s=t.tag,s!=null&&r.add(s),i=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const c=n._editorState;let a=n._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=Ky(a||c),u=!0),a._flushSync=l;const d=pe,f=$e,h=Ne,g=n._updating;pe=a,$e=!1,n._updating=!0,Ne=n;try{u&&(n._headless?c._selection!==null&&(a._selection=c._selection.clone()):a._selection=Cy(n));const _=n._compositionKey;e(),i=df(n,i),Ty(a,n),n._dirtyType!==sn&&(i?My(a,n):Ay(a,n),df(n),Dm(c,a,n._dirtyLeaves,n._dirtyElements));const y=n._compositionKey;_!==y&&(a._flushSync=!0);const m=a._selection;if(H(m)){const N=a._nodeMap,x=m.anchor.key,T=m.focus.key;if(N.get(x)===void 0||N.get(T)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Jr(m)&&m._nodes.size===0&&(a._selection=null)}catch(_){_ instanceof Error&&n._onError(_),n._pendingEditorState=c,n._dirtyType=bn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),jt(n);return}finally{pe=d,$e=f,Ne=h,n._updating=g,ms=0}n._dirtyType!==sn||By(a,n)?a._flushSync?(a._flushSync=!1,jt(n)):u&&v_(()=>{jt(n)}):(a._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Ue(n,e,t){n._updating?n._updates.push([e,t]):hf(n,e,t)}let qr=class extends as{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return h_[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=le()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(W(t)&&e.push(t),b(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;b(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;b(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return b(s)&&s.getLastDescendant()||s||null}const o=t[e];return b(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Ee(t)}getFirstChildOrThrow(){const e=this.getFirstChild();if(e===null)throw Error(`Expected node ${this.__key} to have a first child.`);return e}getLastChild(){const t=this.getLatest().__last;return t===null?null:Ee(t)}getLastChildOrThrow(){const e=this.getLastChild();if(e===null)throw Error(`Expected node ${this.__key} to have a last child.`);return e}getChildAtIndex(e){const t=this.getChildrenSize();let r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const s=t[o];e+=s.getTextContent(),b(s)&&o!==r-1&&!s.isInline()&&(e+=xt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const s=t[o];e+=s.getTextContentSize(),b(s)&&o!==r-1&&!s.isInline()&&(e+=xt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ha[e];return(this.getFormat()&t)!==0}return!1}select(e,t){be();const r=re();let o=e,s=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const c=this.getFirstChild();if(W(c)||b(c))return c.select(0,0)}else if((e===void 0||e===i)&&(t===void 0||t===i)){const c=this.getLastChild();if(W(c)||b(c))return c.select()}}o===void 0&&(o=i),s===void 0&&(s=i);const l=this.__key;if(H(r))r.anchor.set(l,o,"element"),r.focus.set(l,s,"element"),r.dirty=!0;else return ef(l,o,l,s,"element","element");return r}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(r=>r.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){const t=this.getWritable();return t.__format=e!==""?Ha[e]:0,this}setStyle(e){const t=this.getWritable();return t.__style=e||"",this}setIndent(e){const t=this.getWritable();return t.__indent=e,this}splice(e,t,r){const o=r.length,s=this.getChildrenSize(),i=this.getWritable(),l=i.__key,c=[],a=[],u=this.getChildAtIndex(e+t);let d=null,f=s-t+o;if(e!==0)if(e===s)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let p=0;p<t;p++){if(g===null)throw Error("splice: sibling not found");const _=g.getNextSibling(),y=g.__key,m=g.getWritable();cn(m),a.push(y),g=_}}let h=d;for(let g=0;g<o;g++){const p=r[g];h!==null&&p.is(h)&&(d=h=h.getPreviousSibling());const _=p.getWritable();_.__parent===l&&f--,cn(_);const y=p.__key;if(h===null)i.__first=y,_.__prev=null;else{const m=h.getWritable();m.__next=y,_.__prev=m.__key}if(p.__key===l)throw Error("append: attempting to append self");_.__parent=l,c.push(y),h=p}if(e+t===s){if(h!==null){const g=h.getWritable();g.__next=null,i.__last=h.__key}}else if(u!==null){const g=u.getWritable();if(h!==null){const p=h.getWritable();g.__prev=h.__key,p.__next=u.__key}else g.__prev=null}if(i.__size=f,a.length){const g=re();if(H(g)){const p=new Set(a),_=new Set(c),{anchor:y,focus:m}=g;gf(y,p,_)&&_s(y,y.getNode(),this,d,u),gf(m,p,_)&&_s(m,m.getNode(),this,d,u),f===0&&!this.canBeEmpty()&&!Ft(this)&&this.remove()}}return i}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){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,t,r){return!1}canMergeWhenEmpty(){return!1}};function b(n){return n instanceof qr}function gf(n,e,t){let r=n.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}class $l extends as{constructor(e){super(e)}decorate(e,t){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ce(n){return n instanceof $l}class Fn extends qr{static getType(){return"root"}static clone(){return new Fn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const e=this.__cachedText;return(Ln()||le()._dirtyType===sn)&&e!==null?e:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(e){throw Error("replace: cannot be called on root nodes")}insertBefore(e){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(e){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(!b(r)&&!ce(r))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...e)}static importJSON(e){const t=je();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Fy(){return new Fn}function Ie(n){return n instanceof Fn}function By(n,e){const t=e.getEditorState()._selection,r=n._selection;if(r!==null){if(r.dirty||!r.is(t))return!0}else if(t!==null)return!0;return!1}function Ky(n){return new ys(new Map(n._nodeMap))}function Il(){return new ys(new Map([["root",Fy()]]))}function pf(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType())throw Error(`LexicalNode: Node ${t.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(b(n)){const r=e.children;if(!Array.isArray(r))throw Error(`LexicalNode: Node ${t.name} is an element but .exportJSON() does not have a children array.`);const o=n.getChildren();for(let s=0;s<o.length;s++){const i=o[s],l=pf(i);r.push(l)}}return e}class ys{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return af(t&&t.editor||null,this,e)}clone(e){const t=new ys(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return af(null,this,()=>({root:pf(je())}))}}let _f=class extends qr{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}};class dn extends qr{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ct[e];return(this.getTextFormat()&t)!==0}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new dn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Br(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:zy,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&ns(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o);const s=this.getIndent();s>0&&(t.style.textIndent=`${s*20}px`)}return{element:t}}static importJSON(e){const t=St();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=St();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||W(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 zy(n){const e=St();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function St(){return Kr(new dn)}function Ll(n){return n instanceof dn}const Wy=!0,jy=0,Uy=1,Hy=2,Yy=3,Vy=4;function mf(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=Il(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=sn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function Jy(n,e){const t=new Map,r=new Set,o=s=>{Object.keys(s).forEach(i=>{let l=t.get(i);l===void 0&&(l=[],t.set(i,l)),l.push(s[i])})};return n.forEach(s=>{const i=s.klass.importDOM;if(i==null||r.has(i))return;r.add(i);const l=i.call(s.klass);l!==null&&o(l)}),e&&o(e),t}function Gy(n){const e=n||{},t=wy(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,i=Il(),l=e.namespace||(o!==null?o._config.namespace:cu()),c=e.editorState,a=[Fn,Rn,kn,$n,dn,_f,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable!==void 0?e.editable:!0;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<a.length;p++){let _=a[p],y=null,m=null;if(typeof _!="function"){const E=_;_=E.replace,y=E.with,m=E.withKlass||null}{const E=Object.prototype.hasOwnProperty.call(_,"getType")&&_.getType(),O=_.name;if(m&&!(m.prototype instanceof _))throw Error(`${m.name} doesn't extend the ${O}`);if(O!=="RootNode"&&E!=="root"&&E!=="artificial"){const S=_.prototype;["getType","clone"].forEach(v=>{_.hasOwnProperty(v)||console.warn(`${O} must implement static "${v}" method`)}),!_.hasOwnProperty("importDOM")&&_.hasOwnProperty("exportDOM")&&console.warn(`${O} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),S instanceof $l&&(S.hasOwnProperty("decorate")||console.warn(`${S.constructor.name} must implement "decorate" method`)),_.hasOwnProperty("importJSON")||console.warn(`${O} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),S.hasOwnProperty("exportJSON")||console.warn(`${O} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const N=_.getType(),x=_.transform(),T=new Set;x!==null&&T.add(x),h.set(N,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:y,replaceWithKlass:m,transforms:T})}}const g=new Ns(i,o,h,{disableEvents:s,namespace:l,theme:r},u||console.error,Jy(h,d?d.import:void 0),f);return c!==void 0&&(g._pendingEditorState=c,g._dirtyType=bn),g}class Ns{constructor(e,t,r,o,s,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=sn,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=cu(),this._onError=s,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){if(r===void 0)throw Error('Listener for type "command" requires a "priority".');const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=o.get(e);if(s===void 0)throw Error(`registerCommand: Command ${String(e)} not found in command map`);const i=s[r];return i.add(t),()=>{i.delete(t),s.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;s.set(t,o);const i=r&&r.skipInitialization;return(i===void 0?Wy:i)||this.initializeMutationListener(t,o),()=>{s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());if(t===void 0)throw Error(`Node ${e.name} has not been registered. Ensure node has been passed to createEditor.`);return t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=Cu(r).get(t.getType());if(!o)return;const s=new Map;for(const i of o.keys())s.set(i,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),o=[r],s=r.replaceWithKlass;if(s!=null){const i=this.registerNodeTransformToKlass(s,t);o.push(i)}return R_(this,e.getType()),()=>{o.forEach(i=>i.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return $(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Br(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,mf(this,t,e,o),t!==null&&(this._config.disableEvents||qm(t),r!=null&&t.classList.remove(...r)),e!==null){const s=Nm(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=bn,Ja(this),this._updateTags.add("history-merge"),jt(this),this._config.disableEvents||Gm(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,this._pendingEditorState=null,this._window=null;Gr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){if(e.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");Va(this);const r=this._pendingEditorState,o=this._updateTags,s=t!==void 0?t.tag:null;r!==null&&!r.isEmpty()&&(s!=null&&o.add(s),jt(this)),this._pendingEditorState=e,this._dirtyType=bn,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&o.add(s),jt(this)}parseEditorState(e,t){const r=typeof e=="string"?JSON.parse(e):e;return Py(r,this,t)}read(e){return jt(this),this.getEditorState().read(e,{editor:this})}update(e,t){Ue(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Ue(this,()=>{const o=re(),s=je();o!==null?o.dirty=!0:s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=ut(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Gr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ns.version="0.17.1+dev.esm";const qy=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:mm,$applyNodeReplacement:Kr,$cloneWithProperties:xu,$copyNode:mu,$createLineBreakNode:Pn,$createNodeSelection:Al,$createParagraphNode:St,$createPoint:Qe,$createRangeSelection:Ny,$createRangeSelectionFromDom:xy,$createTabNode:ds,$createTextNode:Se,$getAdjacentNode:ll,$getCharacterOffsets:Ml,$getEditor:vm,$getNearestNodeFromDOMNode:$r,$getNearestRootOrShadowRoot:_u,$getNodeByKey:Ee,$getNodeByKeyOrThrow:xm,$getPreviousSelection:In,$getRoot:je,$getSelection:re,$getTextContent:Oy,$hasAncestor:es,$hasUpdateTag:_m,$insertNodes:Sy,$isBlockElementNode:yy,$isDecoratorNode:ce,$isElementNode:b,$isInlineElementOrDecoratorNode:Cm,$isLeafNode:M_,$isLineBreakNode:fn,$isNodeSelection:Jr,$isParagraphNode:Ll,$isRangeSelection:H,$isRootNode:Ie,$isRootOrShadowRoot:Ft,$isTabNode:Yu,$isTextNode:W,$isTokenOrSegmented:ln,$nodesOfType:gm,$normalizeSelection__EXPERIMENTAL:Qa,$parseSerializedNode:ky,$selectAll:hm,$setCompositionKey:ye,$setSelection:at,$splitNode:Sm,ArtificialNode__DO_NOT_USE:_f,BLUR_COMMAND:Ia,CAN_REDO_COMMAND:o_,CAN_UNDO_COMMAND:s_,CLEAR_EDITOR_COMMAND:n_,CLEAR_HISTORY_COMMAND:r_,CLICK_COMMAND:ya,COMMAND_PRIORITY_CRITICAL:Vy,COMMAND_PRIORITY_EDITOR:jy,COMMAND_PRIORITY_HIGH:Yy,COMMAND_PRIORITY_LOW:Uy,COMMAND_PRIORITY_NORMAL:Hy,CONTROLLED_TEXT_INSERTION_COMMAND:vn,COPY_COMMAND:Li,CUT_COMMAND:Fi,DELETE_CHARACTER_COMMAND:vr,DELETE_LINE_COMMAND:Dr,DELETE_WORD_COMMAND:wr,DRAGEND_COMMAND:Ra,DRAGOVER_COMMAND:Pa,DRAGSTART_COMMAND:ka,DROP_COMMAND:Aa,DecoratorNode:$l,ElementNode:qr,FOCUS_COMMAND:$a,FORMAT_ELEMENT_COMMAND:t_,FORMAT_TEXT_COMMAND:Rt,INDENT_CONTENT_COMMAND:Zp,INSERT_LINE_BREAK_COMMAND:br,INSERT_PARAGRAPH_COMMAND:ki,INSERT_TAB_COMMAND:Qp,IS_ALL_FORMATTING:za,IS_BOLD:Bo,IS_CODE:zo,IS_HIGHLIGHT:Uo,IS_ITALIC:Ko,IS_STRIKETHROUGH:Ar,IS_SUBSCRIPT:Wo,IS_SUPERSCRIPT:jo,IS_UNDERLINE:kr,KEY_ARROW_DOWN_COMMAND:Oa,KEY_ARROW_LEFT_COMMAND:Ta,KEY_ARROW_RIGHT_COMMAND:Ca,KEY_ARROW_UP_COMMAND:Sa,KEY_BACKSPACE_COMMAND:ba,KEY_DELETE_COMMAND:Da,KEY_DOWN_COMMAND:Na,KEY_ENTER_COMMAND:Io,KEY_ESCAPE_COMMAND:wa,KEY_MODIFIER_COMMAND:La,KEY_SPACE_COMMAND:va,KEY_TAB_COMMAND:Ma,LineBreakNode:kn,MOVE_TO_END:xa,MOVE_TO_START:Ea,OUTDENT_CONTENT_COMMAND:e_,PASTE_COMMAND:Pi,ParagraphNode:dn,REDO_COMMAND:Ii,REMOVE_TEXT_COMMAND:Ri,RootNode:Fn,SELECTION_CHANGE_COMMAND:$o,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:Xp,SELECT_ALL_COMMAND:Bi,TEXT_TYPE_TO_FORMAT:ct,TabNode:$n,TextNode:Rn,UNDO_COMMAND:$i,createCommand:J,createEditor:Gy,getEditorPropertyFromDOMNode:Rr,getNearestEditorFromDOMNode:tl,isBlockDomNode:fl,isCurrentlyReadOnlyMode:Ln,isHTMLAnchorElement:Om,isHTMLElement:ns,isInlineDomNode:yu,isLexicalEditor:Jo,isSelectionCapturedInDecoratorInput:el,isSelectionWithinEditor:Pr,resetRandomKey:E_},Symbol.toStringTag,{value:"Module"}));function Xy(n){return{}}const Cs={},Qy={},yf={},Xr={},Qr={},Fl={},Bn={},Bl={},Kl={},Zr={},eo={},Ut={},zl={},Wl={},Nf={},Cf={},xf={},Tf={},Ef={},Sf={},Of={},xs={},vf={},bf={},wf={},Df={},Mf={},Zy={},eN={},tN={},Af={},nN={},kf={},Pf={},Rf={},jl={},Ul={},Hl={},rN={},oN={},sN={},iN={},$f={},If={},Lf={},Ze=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lN=Ze&&"documentMode"in document?document.documentMode:null,et=Ze&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ht=Ze&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ts=!(!Ze||!("InputEvent"in window)||lN)&&"getTargetRanges"in new window.InputEvent("input"),Yl=Ze&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Es=Ze&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cN=Ze&&/Android/.test(navigator.userAgent),Ff=Ze&&/^(?=.*Chrome).*/i.test(navigator.userAgent),aN=Ze&&cN&&Ff,Vl=Ze&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ff,to=1,Yt=3,hn=0,Bf=1,Kn=2,uN=0,fN=1,dN=2,hN=1,gN=2,no=4,ro=8,pN=16,_N=32,mN=64,Ss=128,Kf=112|(3|no|ro)|Ss,Jl=1,Gl=2,ql=3,Xl=4,Ql=5,Zl=6,Os=Yl||Es||Vl?" ":"​",Ot=`
22
-
23
- `,yN=Ht?" ":Os,zf="֑-߿יִ-﷽ﹰ-ﻼ",Wf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",NN=new RegExp("^[^"+Wf+"]*["+zf+"]"),CN=new RegExp("^[^"+zf+"]*["+Wf+"]"),ht={bold:1,code:16,highlight:Ss,italic:2,strikethrough:no,subscript:32,superscript:64,underline:ro},xN={directionless:1,unmergeable:2},jf={center:Gl,end:Zl,justify:Xl,left:Jl,right:ql,start:Ql},TN={[Gl]:"center",[Zl]:"end",[Xl]:"justify",[Jl]:"left",[ql]:"right",[Ql]:"start"},EN={normal:0,segmented:2,token:1},SN={[uN]:"normal",[dN]:"segmented",[fN]:"token"};function ON(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var k=ON(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function vs(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const vN=100;let ec=!1,tc=0;function bN(n){tc=n.timeStamp}function nc(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function wN(n,e,t){const r=pt(t._window);let o=null,s=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,s=r.focusOffset);const i=n.nodeValue;i!==null&&cc(e,i,o,s,!1)}function DN(n,e,t){if(Y(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Yt&&t.isAttached()}function Uf(n,e,t){ec=!0;const r=performance.now()-tc>vN;try{Ye(n,()=>{const o=oe()||function(f){return f.getEditorState().read(()=>{const h=oe();return h!==null?h.clone():null})}(n),s=new Map,i=n.getRootElement(),l=n._editorState,c=n._blockCursorElement;let a=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,p=h.target;let _=io(p,l);if(!(_===null&&p!==i||ue(_))){if(g==="characterData")r&&j(_)&&DN(o,p,_)&&wN(p,_,n);else if(g==="childList"){a=!0;const y=h.addedNodes;for(let x=0;x<y.length;x++){const T=y[x],E=ed(T),O=T.parentNode;if(O!=null&&T!==c&&E===null&&(T.nodeName!=="BR"||!nc(T,O,n))){if(Ht){const S=T.innerText||T.nodeValue;S&&(u+=S)}O.removeChild(T)}}const m=h.removedNodes,N=m.length;if(N>0){let x=0;for(let T=0;T<N;T++){const E=m[T];(E.nodeName==="BR"&&nc(E,p,n)||c===E)&&(p.appendChild(E),x++)}N!==x&&(p===i&&(_=rd(l)),s.set(p,_))}}}}if(s.size>0)for(const[f,h]of s)if(w(h)){const g=h.getChildrenKeys();let p=f.firstChild;for(let _=0;_<g.length;_++){const y=g[_],m=n.getElementByKey(y);m!==null&&(p==null?(f.appendChild(m),p=m):p!==m&&f.replaceChild(m,p),p=p.nextSibling)}}else j(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let _=0;_<g.length;_++){const y=g[_],m=y.parentNode;m==null||y.nodeName!=="BR"||nc(y,p,n)||m.removeChild(y)}}t.takeRecords()}o!==null&&(a&&(o.dirty=!0,gt(o)),Ht&&hd(n)&&o.insertRawText(u))})}finally{ec=!1}}function Hf(n){const e=n._observer;e!==null&&Uf(n,e.takeRecords(),e)}function Yf(n){(function(e){tc===0&&Rs(e).addEventListener("textInput",bN,!0)})(n),n._observer=new MutationObserver((e,t)=>{Uf(n,e,t)})}function Vf(n,e){const t=n.__mode,r=n.__format,o=n.__style,s=e.__mode,i=e.__format,l=e.__style;return!(t!==null&&t!==s||r!==null&&r!==i||o!==null&&o!==l)}function Jf(n,e){const t=n.mergeWithSibling(e),r=ae()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Gf(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&j(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Vf(e,r)){r=Jf(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Vf(r,t)){r=Jf(r,t);break}break}t.remove()}}else r.remove()}function qf(n){return Xf(n.anchor),Xf(n.focus),n}function Xf(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,o;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),o=!0):(r=e.getChildAtIndex(t),o=!1),j(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!w(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let Qf=1;function MN(){Qf=1}const AN=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function rc(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return ue(io(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&so(e)==null)}function oo(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!rc(e)&&oc(e)===n}catch{return!1}}function bs(n){return n instanceof Qs}function oc(n){let e=n;for(;e!=null;){const t=so(e);if(bs(t))return t;e=ks(e)}return null}function so(n){return n?n.__lexicalEditor:null}function gn(n){return n.isToken()||n.isSegmented()}function kN(n){return n.nodeType===Yt}function ws(n){let e=n;for(;e!=null;){if(kN(e))return e;e=e.firstChild}return null}function sc(n,e,t){const r=ht[e];if(t!==null&&(n&r)==(t&r))return n;let o=n^r;return e==="subscript"?o&=~ht.superscript:e==="superscript"&&(o&=~ht.subscript),o}function PN(n){return j(n)||yn(n)||ue(n)}function Zf(n,e){if(e!=null)return void(n.__key=e);ke(),nh();const t=ae(),r=mt(),o=""+Qf++;r._nodeMap.set(o,n),w(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=Bf,n.__key=o}function pn(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),s=n.getNextSibling();if(o===null)if(s!==null){const i=s.getWritable();r.__first=s.__key,i.__prev=null}else r.__first=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(s===null)if(o!==null){const i=o.getWritable();r.__last=o.__key,i.__next=null}else r.__last=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Ds(n){nh();const e=n.getLatest(),t=e.__parent,r=mt(),o=ae(),s=r._nodeMap,i=o._dirtyElements;t!==null&&function(c,a,u){let d=c;for(;d!==null;){if(u.has(d))return;const f=a.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,s,i);const l=e.__key;o._dirtyType=Bf,w(n)?i.set(l,!0):o._dirtyLeaves.add(l)}function Ce(n){ke();const e=ae(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Oe(t);r!==null&&r.getWritable()}if(n!==null){const r=Oe(n);r!==null&&r.getWritable()}}}function Vt(){return Gn()?null:ae()._compositionKey}function Oe(n,e){const t=(e||mt())._nodeMap.get(n);return t===void 0?null:t}function ed(n,e){const t=n[`__lexicalKey_${ae()._key}`];return t!==void 0?Oe(t,e):null}function io(n,e){let t=n;for(;t!=null;){const r=ed(t,e);if(r!==null)return r;t=ks(t)}return null}function td(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function nd(n){return n.read(()=>He().getTextContent())}function He(){return rd(mt())}function rd(n){return n._nodeMap.get("root")}function gt(n){ke();const e=mt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function zn(n){const e=ae(),t=function(r,o){let s=r;for(;s!=null;){const i=s[`__lexicalKey_${o._key}`];if(i!==void 0)return i;s=ks(s)}return null}(n,e);return t===null?n===e.getRootElement()?Oe("root"):null:Oe(t)}function od(n,e){return e?n.getTextContentSize():0}function sd(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function ic(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function id(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ld(n){return n.nodeType===Yt?n.nodeValue:null}function lc(n,e,t){const r=pt(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:s,focusOffset:i}=r;if(o!==null){let l=ld(o);const c=io(o);if(l!==null&&j(c)){if(l===Os&&t){const a=t.length;l=t,s=a,i=a}l!==null&&cc(c,l,s,i,n)}}}function cc(n,e,t,r,o){let s=n;if(s.isAttached()&&(o||!s.isDirty())){const i=s.isComposing();let l=e;(i||o)&&e[e.length-1]===Os&&(l=e.slice(0,-1));const c=s.getTextContent();if(o||l!==c){if(l===""){if(Ce(null),Yl||Es||Vl)s.remove();else{const p=ae();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}const a=s.getParent(),u=Jn(),d=s.getTextContentSize(),f=Vt(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!i||Y(u)&&(a!==null&&!a.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i))return void s.markDirty();const g=oe();if(!Y(g)||t===null||r===null)return void s.setTextContent(l);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const p=ve(s.getTextContent());s.replace(p),s=p}s.setTextContent(l)}}}function RN(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),o=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||o||function(s){const i=s.getPreviousSibling();return(j(i)||w(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o)}function cd(n){return n==="ArrowLeft"}function ad(n){return n==="ArrowRight"}function lo(n,e){return et?n:e}function ud(n){return n==="Enter"}function co(n){return n==="Backspace"}function ao(n){return n==="Delete"}function fd(n,e,t){return n.toLowerCase()==="a"&&lo(e,t)}function $N(){const n=He();gt(qf(n.select(0,n.getChildrenSize())))}function uo(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const o=n[e];if(typeof o=="string"){const s=vs(o);return t[e]=s,s}return o}function ac(n,e,t,r,o){if(t.size===0)return;const s=r.__type,i=r.__key,l=e.get(s);l===void 0&&k(33,s);const c=l.klass;let a=n.get(c);a===void 0&&(a=new Map,n.set(c,a));const u=a.get(i),d=u==="destroyed"&&o==="created";(u===void 0||d)&&a.set(i,d?"updated":o)}function IN(n){const e=n.getType(),t=mt();if(t._readOnly){const s=yd(t).get(e);return s?Array.from(s.values()):[]}const r=t._nodeMap,o=[];for(const[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&o.push(s);return o}function dd(n,e,t){const r=n.getParent();let o=t,s=n;return r!==null&&(e&&t===0?(o=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(o=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?o-1:o)}function uc(n,e){const t=n.offset;if(n.type==="element")return dd(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const o=e?r.getPreviousSibling():r.getNextSibling();return o===null?dd(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function hd(n){const e=Rs(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return lh(n,e,t)}function Ms(n){return!Fe(n)&&!n.isLastChild()&&!n.isInline()}function As(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&k(75,e),t}function ks(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function LN(n){return ae()._updateTags.has(n)}function FN(n){ke(),ae()._updateTags.add(n)}function Ps(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Rs(n){const e=n._window;return e===null&&k(78),e}function BN(n){return w(n)&&n.isInline()||ue(n)&&n.isInline()}function gd(n){let e=n.getParentOrThrow();for(;e!==null;){if(Jt(e))return e;e=e.getParentOrThrow()}return e}function Jt(n){return Fe(n)||w(n)&&n.isShadowRoot()}function pd(n){const e=n.constructor.clone(n);return Zf(e,null),e}function fo(n){const e=ae(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&k(97);const o=r.replace;if(o!==null){const s=o(n);return s instanceof n.constructor||k(98),s}return n}function fc(n,e){!Fe(n.getParent())||w(e)||ue(e)||k(99)}function KN(n){const e=Oe(n);return e===null&&k(63,n),e}function dc(n){return(ue(n)||w(n)&&!n.canBeEmpty())&&!n.isInline()}function hc(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function zN(n,e,t){let r=n._blockCursorElement;if(Y(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,s=o.getNode(),i=o.offset;let l=!1,c=null;if(i===s.getChildrenSize())dc(s.getChildAtIndex(i-1))&&(l=!0);else{const a=s.getChildAtIndex(i);if(dc(a)){const u=a.getPreviousSibling();(u===null||dc(u))&&(l=!0,c=n.getElementByKey(a.__key))}}if(l){const a=n.getElementByKey(s.__key);return r===null&&(n._blockCursorElement=r=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=vs(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(c===null?a.appendChild(r):a.insertBefore(r,c))}}r!==null&&hc(r,n,e)}function pt(n){return Ze?(n||window).getSelection():null}function WN(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Jt(n)&&k(102);const r=i=>{const l=i.getParentOrThrow(),c=Jt(l),a=i!==t||c?pd(i):i;if(c)return w(i)&&w(a)||k(133),i.insertAfter(a),[i,a,a];{const[u,d,f]=r(l),h=i.getNextSiblings();return f.append(a,...h),[u,d,a]}},[o,s]=r(t);return[o,s]}function jN(n){return $s(n)&&n.tagName==="A"}function $s(n){return n.nodeType===1}function _d(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function gc(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function Wn(n){if(Fe(n)||ue(n)&&!n.isInline())return!0;if(!w(n)||Jt(n))return!1;const e=n.getFirstChild(),t=e===null||yn(e)||j(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function pc(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function UN(){return ae()}const md=new WeakMap,HN=new Map;function yd(n){if(!n._readOnly&&n.isEmpty())return HN;n._readOnly||k(192);let e=md.get(n);if(!e){e=new Map,md.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let s=e.get(o);s||(s=new Map,e.set(o,s)),s.set(t,r)}}return e}function Nd(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Cd(n,e,t,r,o,s){let i=n.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(w(i)&&Cd(i,l,t,r,o,s),t.has(l)||s.delete(l),o.push(l)),i=i.getNextSibling()}}let Gt,Me,ho,Is,_c,mc,_n,tt,yc,go,_e="",Ae="",_t=null,nt="",vt="",xd=!1,po=!1,Ls=null;function Fs(n,e){const t=_n.get(n);if(e!==null){const r=Tc(n);r.parentNode===e&&e.removeChild(r)}if(tt.has(n)||Me._keyToDOMMap.delete(n),w(t)){const r=Ks(t,_n);Nc(r,0,r.length-1,null)}t!==void 0&&ac(go,ho,Is,t,"destroyed")}function Nc(n,e,t,r){let o=e;for(;o<=t;++o){const s=n[o];s!==void 0&&Fs(s,r)}}function mn(n,e){n.setProperty("text-align",e)}const YN="40px";function Td(n,e){const t=Gt.theme.indent;if(typeof t=="string"){const o=n.classList.contains(t);e>0&&!o?n.classList.add(t):e<1&&o&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||YN;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Ed(n,e){const t=n.style;e===0?mn(t,""):e===Jl?mn(t,"left"):e===Gl?mn(t,"center"):e===ql?mn(t,"right"):e===Xl?mn(t,"justify"):e===Ql?mn(t,"start"):e===Zl&&mn(t,"end")}function Bs(n,e,t){const r=tt.get(n);r===void 0&&k(60);const o=r.createDOM(Gt,Me);if(function(s,i,l){const c=l._keyToDOMMap;i["__lexicalKey_"+l._key]=s,c.set(s,i)}(n,o,Me),j(r)?o.setAttribute("data-lexical-text","true"):ue(r)&&o.setAttribute("data-lexical-decorator","true"),w(r)){const s=r.__indent,i=r.__size;if(s!==0&&Td(o,s),i!==0){const c=i-1;(function(a,u,d,f){const h=Ae;Ae="",Cc(a,d,0,u,f,null),vd(d,f),Ae=h})(Ks(r,tt),c,r,o)}const l=r.__format;l!==0&&Ed(o,l),r.isInline()||Od(null,r,o),Ms(r)&&(_e+=Ot,vt+=Ot)}else{const s=r.getTextContent();if(ue(r)){const i=r.decorate(Me,Gt);i!==null&&bd(n,i),o.contentEditable="false"}else j(r)&&(r.isDirectionless()||(Ae+=s));_e+=s,vt+=s}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const s=e.__lexicalLineBreak;s!=null?e.insertBefore(o,s):e.appendChild(o)}return ac(go,ho,Is,r,"created"),o}function Cc(n,e,t,r,o,s){const i=_e;_e="";let l=t;for(;l<=r;++l){Bs(n[l],o,s);const c=tt.get(n[l]);c!==null&&j(c)&&(_t===null&&(_t=c.getFormat()),nt===""&&(nt=c.getStyle()))}Ms(e)&&(_e+=Ot),o.__lexicalTextContent=_e,_e=i+_e}function Sd(n,e){const t=e.get(n);return yn(t)||ue(t)&&t.isInline()}function Od(n,e,t){const r=n!==null&&(n.__size===0||Sd(n.__last,_n)),o=e.__size===0||Sd(e.__last,tt);if(r){if(!o){const s=t.__lexicalLineBreak;if(s!=null)try{t.removeChild(s)}catch(i){if(typeof i=="object"&&i!=null){const l=`${i.toString()} Parent: ${t.tagName}, child: ${s.tagName}.`;throw new Error(l)}throw i}t.__lexicalLineBreak=null}}else if(o){const s=document.createElement("br");t.__lexicalLineBreak=s,t.appendChild(s)}}function vd(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==Ae||r!==Ls){const s=Ae==="",i=s?Ls:(o=Ae,NN.test(o)?"rtl":CN.test(o)?"ltr":null);if(i!==r){const l=e.classList,c=Gt.theme;let a=r!==null?c[r]:void 0,u=i!==null?c[i]:void 0;if(a!==void 0){if(typeof a=="string"){const d=vs(a);a=c[r]=d}l.remove(...a)}if(i===null||s&&i==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=vs(u);u=c[i]=d}u!==void 0&&l.add(...u)}e.dir=i}po||(n.getWritable().__dir=i)}Ls=i,e.__lexicalDirTextContent=Ae,e.__lexicalDir=i}var o}function VN(n,e,t){const r=Ae;var o;Ae="",_t=null,nt="",function(s,i,l){const c=_e,a=s.__size,u=i.__size;if(_e="",a===1&&u===1){const d=s.__first,f=i.__first;if(d===f)_o(d,l);else{const g=Tc(d),p=Bs(f,null,null);try{l.replaceChild(p,g)}catch(_){if(typeof _=="object"&&_!=null){const y=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(y)}throw _}Fs(d,null)}const h=tt.get(f);j(h)&&(_t===null&&(_t=h.getFormat()),nt===""&&(nt=h.getStyle()))}else{const d=Ks(s,_n),f=Ks(i,tt);if(a===0)u!==0&&Cc(f,i,0,u-1,l,null);else if(u===0){if(a!==0){const h=l.__lexicalLineBreak==null;Nc(d,0,a-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,p,_,y,m){const N=_-1,x=y-1;let T,E,O=(M=m,M.firstChild),S=0,v=0;for(var M;S<=N&&v<=x;){const te=g[S],q=p[v];if(te===q)O=xc(_o(q,m)),S++,v++;else{T===void 0&&(T=new Set(g)),E===void 0&&(E=new Set(p));const me=E.has(te),Q=T.has(q);if(me)if(Q){const rn=As(Me,q);rn===O?O=xc(_o(q,m)):(O!=null?m.insertBefore(rn,O):m.appendChild(rn),_o(q,m)),S++,v++}else Bs(q,m,O),v++;else O=xc(Tc(te)),Fs(te,m),S++}const ne=tt.get(q);ne!==null&&j(ne)&&(_t===null&&(_t=ne.getFormat()),nt===""&&(nt=ne.getStyle()))}const B=S>N,X=v>x;if(B&&!X){const te=p[x+1];Cc(p,h,v,x,m,te===void 0?null:Me.getElementByKey(te))}else X&&!B&&Nc(g,S,N,m)})(i,d,f,a,u,l)}Ms(i)&&(_e+=Ot),l.__lexicalTextContent=_e,_e=c+_e}(n,e,t),vd(e,t),Bc(o=e)&&_t!=null&&_t!==o.__textFormat&&!po&&(o.setTextFormat(_t),o.setTextStyle(nt)),function(s){Bc(s)&&nt!==""&&nt!==s.__textStyle&&!po&&s.setTextStyle(nt)}(e),Ae=r}function Ks(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);o===void 0&&k(101),t.push(r),r=o.__next}return t}function _o(n,e){const t=_n.get(n);let r=tt.get(n);t!==void 0&&r!==void 0||k(61);const o=xd||mc.has(n)||_c.has(n),s=As(Me,n);if(t===r&&!o){if(w(t)){const i=s.__lexicalTextContent;i!==void 0&&(_e+=i,vt+=i);const l=s.__lexicalDirTextContent;l!==void 0&&(Ae+=l)}else{const i=t.getTextContent();j(t)&&!t.isDirectionless()&&(Ae+=i),vt+=i,_e+=i}return s}if(t!==r&&o&&ac(go,ho,Is,r,"updated"),r.updateDOM(t,s,Gt)){const i=Bs(n,null,null);return e===null&&k(62),e.replaceChild(i,s),Fs(n,null),i}if(w(t)&&w(r)){const i=r.__indent;i!==t.__indent&&Td(s,i);const l=r.__format;l!==t.__format&&Ed(s,l),o&&(VN(t,r,s),Fe(r)||r.isInline()||Od(t,r,s)),Ms(r)&&(_e+=Ot,vt+=Ot)}else{const i=r.getTextContent();if(ue(r)){const l=r.decorate(Me,Gt);l!==null&&bd(n,l)}else j(r)&&!r.isDirectionless()&&(Ae+=i);_e+=i,vt+=i}if(!po&&Fe(r)&&r.__cachedText!==vt){const i=r.getWritable();i.__cachedText=vt,r=i}return s}function bd(n,e){let t=Me._pendingDecorators;const r=Me._decorators;if(t===null){if(r[n]===e)return;t=td(Me)}t[n]=e}function xc(n){let e=n.nextSibling;return e!==null&&e===Me._blockCursorElement&&(e=e.nextSibling),e}function JN(n,e,t,r,o,s){_e="",vt="",Ae="",xd=r===Kn,Ls=null,Me=t,Gt=t._config,ho=t._nodes,Is=Me._listeners.mutation,_c=o,mc=s,_n=n._nodeMap,tt=e._nodeMap,po=e._readOnly,yc=new Map(t._keyToDOMMap);const i=new Map;return go=i,_o("root",null),Me=void 0,ho=void 0,_c=void 0,mc=void 0,_n=void 0,tt=void 0,Gt=void 0,yc=void 0,go=void 0,i}function Tc(n){const e=yc.get(n);return e===void 0&&k(75,n),e}const bt=Object.freeze({}),Ec=30,Sc=[["keydown",function(n,e){if(mo=n.timeStamp,wd=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:s,altKey:i}=n;I(e,Nf,n)||t!=null&&(function(l,c,a,u){return ad(l)&&!c&&!u&&!a}(t,o,i,s)?I(e,Cf,n):function(l,c,a,u,d){return ad(l)&&!u&&!a&&(c||d)}(t,o,r,i,s)?I(e,xf,n):function(l,c,a,u){return cd(l)&&!c&&!u&&!a}(t,o,i,s)?I(e,Tf,n):function(l,c,a,u,d){return cd(l)&&!u&&!a&&(c||d)}(t,o,r,i,s)?I(e,Ef,n):function(l,c,a){return function(u){return u==="ArrowUp"}(l)&&!c&&!a}(t,o,s)?I(e,Sf,n):function(l,c,a){return function(u){return u==="ArrowDown"}(l)&&!c&&!a}(t,o,s)?I(e,Of,n):function(l,c){return ud(l)&&c}(t,r)?(yo=!0,I(e,xs,n)):function(l){return l===" "}(t)?I(e,vf,n):function(l,c){return et&&c&&l.toLowerCase()==="o"}(t,o)?(n.preventDefault(),yo=!0,I(e,Qr,!0)):function(l,c){return ud(l)&&!c}(t,r)?(yo=!1,I(e,xs,n)):function(l,c,a,u){return et?!c&&!a&&(co(l)||l.toLowerCase()==="h"&&u):!(u||c||a)&&co(l)}(t,i,s,o)?co(t)?I(e,bf,n):(n.preventDefault(),I(e,Xr,!0)):function(l){return l==="Escape"}(t)?I(e,wf,n):function(l,c,a,u,d){return et?!(a||u||d)&&(ao(l)||l.toLowerCase()==="d"&&c):!(c||u||d)&&ao(l)}(t,o,r,i,s)?ao(t)?I(e,Df,n):(n.preventDefault(),I(e,Xr,!1)):function(l,c,a){return co(l)&&(et?c:a)}(t,i,o)?(n.preventDefault(),I(e,Zr,!0)):function(l,c,a){return ao(l)&&(et?c:a)}(t,i,o)?(n.preventDefault(),I(e,Zr,!1)):function(l,c){return et&&c&&co(l)}(t,s)?(n.preventDefault(),I(e,eo,!0)):function(l,c){return et&&c&&ao(l)}(t,s)?(n.preventDefault(),I(e,eo,!1)):function(l,c,a,u){return l.toLowerCase()==="b"&&!c&&lo(a,u)}(t,i,s,o)?(n.preventDefault(),I(e,Ut,"bold")):function(l,c,a,u){return l.toLowerCase()==="u"&&!c&&lo(a,u)}(t,i,s,o)?(n.preventDefault(),I(e,Ut,"underline")):function(l,c,a,u){return l.toLowerCase()==="i"&&!c&&lo(a,u)}(t,i,s,o)?(n.preventDefault(),I(e,Ut,"italic")):function(l,c,a,u){return l==="Tab"&&!c&&!a&&!u}(t,i,o,s)?I(e,Mf,n):function(l,c,a,u){return l.toLowerCase()==="z"&&!c&&lo(a,u)}(t,r,s,o)?(n.preventDefault(),I(e,zl,void 0)):function(l,c,a,u){return et?l.toLowerCase()==="z"&&a&&c:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&c}(t,r,s,o)?(n.preventDefault(),I(e,Wl,void 0)):Co(e._editorState._selection)?function(l,c,a,u){return!c&&l.toLowerCase()==="c"&&(et?a:u)}(t,r,s,o)?(n.preventDefault(),I(e,jl,n)):function(l,c,a,u){return!c&&l.toLowerCase()==="x"&&(et?a:u)}(t,r,s,o)?(n.preventDefault(),I(e,Ul,n)):fd(t,s,o)&&(n.preventDefault(),I(e,Hl,n)):!Ht&&fd(t,s,o)&&(n.preventDefault(),I(e,Hl,n)),function(l,c,a,u){return l||c||a||u}(o,r,i,s)&&I(e,Lf,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Ye(e,()=>{ue(io(t))||(vc=!0)})}],["compositionstart",function(n,e){Ye(e,()=>{const t=oe();if(Y(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();Ce(r.key),(n.timeStamp<mo+Ec||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||j(o)&&o.getStyle()!==t.style)&&I(e,Bn,yN)}})}],["compositionend",function(n,e){Ht?No=!0:Ye(e,()=>{bc(e,n.data)})}],["input",function(n,e){n.stopPropagation(),Ye(e,()=>{const t=oe(),r=n.data,o=Rd(n);if(r!=null&&Y(t)&&Ad(t,o,r,n.timeStamp,!1)){No&&(bc(e,r),No=!1);const s=t.anchor.getNode(),i=pt(e._window);if(i===null)return;const l=t.isBackward(),c=l?t.anchor.offset:t.focus.offset,a=l?t.focus.offset:t.anchor.offset;Ts&&!t.isCollapsed()&&j(s)&&i.anchorNode!==null&&s.getTextContent().slice(0,c)+r+s.getTextContent().slice(c+a)===ld(i.anchorNode)||I(e,Bn,r);const u=r.length;Ht&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),Yl||Es||Vl||!e.isComposing()||(mo=0,Ce(null))}else lc(!1,e,r!==null?r:void 0),No&&(bc(e,r||void 0),No=!1);ke(),Hf(ae())}),jn=null}],["click",function(n,e){Ye(e,()=>{const t=oe(),r=pt(e._window),o=Jn();if(r){if(Y(t)){const s=t.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Fe(i)&&He().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(w(i)?i.select(0):i.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const s=r.anchorNode;if(s!==null){const i=s.nodeType;(i===to||i===Yt)&&gt(Vs(o,r,e,n))}}}I(e,yf,n)})}],["cut",bt],["copy",bt],["dragstart",bt],["dragover",bt],["dragend",bt],["paste",bt],["focus",bt],["blur",bt],["drop",bt]];Ts&&Sc.push(["beforeinput",(n,e)=>function(t,r){const o=t.inputType,s=Rd(t);o==="deleteCompositionText"||Ht&&hd(r)||o!=="insertCompositionText"&&Ye(r,()=>{const i=oe();if(o==="deleteContentBackward"){if(i===null){const h=Jn();if(!Y(h))return;gt(h.clone())}if(Y(i)){const h=i.anchor.key===i.focus.key;if(l=t.timeStamp,wd==="MediaLast"&&l<mo+Ec&&r.isComposing()&&h){if(Ce(null),mo=0,setTimeout(()=>{Ye(r,()=>{Ce(null)})},Ec),Y(i)){const g=i.anchor.getNode();g.markDirty(),i.format=g.getFormat(),j(g)||k(142),i.style=g.getStyle()}}else{Ce(null),t.preventDefault();const g=i.anchor.getNode().getTextContent(),p=i.anchor.offset===0&&i.focus.offset===g.length;aN&&h&&!p||I(r,Xr,!0)}return}}var l;if(!Y(i))return;const c=t.data;jn!==null&&lc(!1,r,jn),i.dirty&&jn===null||!i.isCollapsed()||Fe(i.anchor.getNode())||s===null||i.applyDOMRange(s),jn=null;const a=i.anchor,u=i.focus,d=a.getNode(),f=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,Bn,t);break;case"insertFromComposition":Ce(null),I(r,Bn,t);break;case"insertLineBreak":Ce(null),I(r,Qr,!1);break;case"insertParagraph":Ce(null),yo&&!Es?(yo=!1,I(r,Qr,!1)):I(r,Fl,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,Bl,t);break;case"deleteByComposition":(function(h,g){return h!==g||w(h)||w(g)||!h.isToken()||!g.isToken()})(d,f)&&I(r,Kl,t);break;case"deleteByDrag":case"deleteByCut":I(r,Kl,t);break;case"deleteContent":I(r,Xr,!1);break;case"deleteWordBackward":I(r,Zr,!0);break;case"deleteWordForward":I(r,Zr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,eo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,eo,!1);break;case"formatStrikeThrough":I(r,Ut,"strikethrough");break;case"formatBold":I(r,Ut,"bold");break;case"formatItalic":I(r,Ut,"italic");break;case"formatUnderline":I(r,Ut,"underline");break;case"historyUndo":I(r,zl,void 0);break;case"historyRedo":I(r,Wl,void 0)}else{if(c===`
24
- `)t.preventDefault(),I(r,Qr,!1);else if(c===Ot)t.preventDefault(),I(r,Fl,void 0);else if(c==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(h)}else c!=null&&Ad(i,s,c,t.timeStamp,!0)?(t.preventDefault(),I(r,Bn,c)):jn=c;Dd=t.timeStamp}})}(n,e)]);let mo=0,wd=null,Dd=0,jn=null;const zs=new WeakMap;let Oc=!1,vc=!1,yo=!1,No=!1,Md=[0,"",0,"root",0];function Ad(n,e,t,r,o){const s=n.anchor,i=n.focus,l=s.getNode(),c=ae(),a=pt(c._window),u=a!==null?a.anchorNode:null,d=s.key,f=c.getElementByKey(d),h=t.length;return d!==i.key||!j(l)||(!o&&(!Ts||Dd<r+50)||l.isDirty()&&h<2||sd(t))&&s.offset!==i.offset&&!l.isComposing()||gn(l)||l.isDirty()&&h>1||(o||!Ts)&&f!==null&&!l.isComposing()&&u!==ws(f)||a!==null&&e!==null&&(!e.collapsed||e.startContainer!==a.anchorNode||e.startOffset!==a.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||RN(n,l)}function kd(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Yt&&e!==0&&e!==n.nodeValue.length}function Pd(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:i}=n;Oc&&(Oc=!1,kd(r,o)&&kd(s,i))||Ye(e,()=>{if(!t)return void gt(null);if(!oo(e,r,s))return;const l=oe();if(Y(l)){const c=l.anchor,a=c.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Rs(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,_]=Md,y=He(),m=e.isComposing()===!1&&y.getTextContent()==="";if(d<_+200&&c.offset===g&&c.key===p)l.format=f,l.style=h;else if(c.type==="text")j(a)||k(141),l.format=a.getFormat(),l.style=a.getStyle();else if(c.type==="element"&&!m){const N=c.getNode();l.style="",N instanceof Cn&&N.getChildrenSize()===0?(l.format=N.getTextFormat(),l.style=N.getTextStyle()):l.format=0}}else{const u=c.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),p=g?i:o,_=g?o:i,y=g?d:u,m=g?u:d;let N=Kf,x=!1;for(let T=0;T<h;T++){const E=f[T],O=E.getTextContentSize();if(j(E)&&O!==0&&!(T===0&&E.__key===y&&p===O||T===h-1&&E.__key===m&&_===0)&&(x=!0,N&=E.getFormat(),N===0))break}l.format=x?N:0}}I(e,Cs,void 0)})}function Rd(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function bc(n,e){const t=n._compositionKey;if(Ce(null),t!==null&&e!=null){if(e===""){const r=Oe(t),o=ws(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&j(r)&&cc(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
25
- `){const r=oe();if(Y(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void I(n,xs,null)}}}lc(!0,n,e)}function $d(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Un=new Map;function Id(n){const e=n.target,t=pt(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=oc(t.anchorNode);if(r===null)return;vc&&(vc=!1,Ye(r,()=>{const a=Jn(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==to&&d!==Yt||gt(Vs(a,t,r,n))}));const o=ic(r),s=o[o.length-1],i=s._key,l=Un.get(i),c=l||s;c!==r&&Pd(t,c,!1),Pd(t,r,!0),r!==s?Un.set(i,r):l&&Un.delete(i)}function Ld(n){n._lexicalHandled=!0}function Fd(n){return n._lexicalHandled===!0}function GN(n){const e=n.ownerDocument,t=zs.get(e);t===void 0&&k(162);const r=t-1;r>=0||k(164),zs.set(e,r),r===0&&e.removeEventListener("selectionchange",Id);const o=so(n);bs(o)?(function(i){if(i._parentEditor!==null){const l=ic(i),c=l[l.length-1]._key;Un.get(c)===i&&Un.delete(c)}else Un.delete(i._key)}(o),n.__lexicalEditor=null):o&&k(198);const s=$d(n);for(let i=0;i<s.length;i++)s[i]();n.__lexicalEventHandles=[]}function wc(n,e,t){ke();const r=n.__key,o=n.getParent();if(o===null)return;const s=function(l){const c=oe();if(!Y(c)||!w(l))return c;const{anchor:a,focus:u}=c,d=a.getNode(),f=u.getNode();return Ps(d,l)&&a.set(l.__key,0,"element"),Ps(f,l)&&u.set(l.__key,0,"element"),c}(n);let i=!1;if(Y(s)&&e){const l=s.anchor,c=s.focus;l.key===r&&(Gs(l,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0),c.key===r&&(Gs(c,n,o,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else Co(s)&&e&&n.isSelected()&&n.selectPrevious();if(Y(s)&&e&&!i){const l=n.getIndexWithinParent();pn(n),Js(s,o,l,-1)}else pn(n);t||Jt(o)||o.canBeEmpty()||!o.isEmpty()||wc(o,e),e&&Fe(o)&&o.isEmpty()&&o.selectEnd()}class Ws{static getType(){k(64,this.name)}static clone(e){k(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Zf(this,e)}getType(){return this.__type}isInline(){k(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Oe(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||oe();if(t==null)return!1;const r=t.getNodes().some(o=>o.__key===this.__key);if(j(this))return r;if(Y(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const o=this.getParent();if(ue(this)&&this.isInline()&&o){const s=t.isBackward()?t.focus:t.anchor,i=s.getNode();if(s.offset===i.getChildrenSize()&&i.is(o)&&i.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Oe(e)}getParentOrThrow(){const e=this.getParent();return e===null&&k(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(Jt(t))return w(e)||e===this&&ue(e)||k(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&k(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Oe(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Oe(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();w(this)&&t.unshift(this),w(e)&&r.unshift(e);const o=t.length,s=r.length;if(o===0||s===0||t[o-1]!==r[s-1])return null;const i=new Set(r);for(let l=0;l<o;l++){const c=t[l];if(i.has(c))return c}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,o=0,s=this;for(;;){const i=s.getParentOrThrow();if(i===t){r=s.getIndexWithinParent();break}s=i}for(s=e;;){const i=s.getParentOrThrow();if(i===t){o=s.getIndexWithinParent();break}s=i}return r<o}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],o=new Set;let s=this;for(;s!==null;){const i=s.__key;if(o.has(i)||(o.add(i),r.push(s)),s===e)break;const l=w(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const c=t?s.getNextSibling():s.getPreviousSibling();if(c!==null){s=c;continue}const a=s.getParentOrThrow();if(o.has(a.__key)||r.push(a),a===e)break;let u=null,d=a;do{if(d===null&&k(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||o.has(d.__key)||r.push(d)}while(u===null);s=u}return t||r.reverse(),r}isDirty(){const e=ae()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=Oe(this.__key);return e===null&&k(113),e}getWritable(){ke();const e=mt(),t=ae(),r=e._nodeMap,o=this.__key,s=this.getLatest(),i=t._cloneNotNeeded,l=oe();if(l!==null&&l.setCachedNodes(null),i.has(o))return Ds(s),s;const c=Nd(s);return i.add(o),Ds(c),r.set(o,c),c}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){k(70)}updateDOM(e,t,r){k(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){k(72)}static importJSON(e){k(18,this.name)}static transform(){return null}remove(e){wc(this,!0,e)}replace(e,t){ke();let r=oe();r!==null&&(r=r.clone()),fc(this,e);const o=this.getLatest(),s=this.__key,i=e.__key,l=e.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;pn(l);const u=o.getPreviousSibling(),d=o.getNextSibling(),f=o.__prev,h=o.__next,g=o.__parent;if(wc(o,!1,!0),u===null?c.__first=i:u.getWritable().__next=i,l.__prev=f,d===null?c.__last=i:d.getWritable().__prev=i,l.__next=h,l.__parent=g,c.__size=a,t&&(w(this)&&w(l)||k(139),this.getChildren().forEach(p=>{l.append(p)})),Y(r)){gt(r);const p=r.anchor,_=r.focus;p.key===s&&Hd(p,l),_.key===s&&Hd(_,l)}return Vt()===s&&Ce(i),l}insertAfter(e,t=!0){ke(),fc(this,e);const r=this.getWritable(),o=e.getWritable(),s=o.getParent(),i=oe();let l=!1,c=!1;if(s!==null){const h=e.getIndexWithinParent();if(pn(o),Y(i)){const g=s.__key,p=i.anchor,_=i.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,c=_.type==="element"&&_.key===g&&_.offset===h+1}}const a=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=o.__key,f=r.__next;if(a===null?u.__last=d:a.getWritable().__prev=d,u.__size++,r.__next=d,o.__next=f,o.__prev=r.__key,o.__parent=r.__parent,t&&Y(i)){const h=this.getIndexWithinParent();Js(i,u,h+1);const g=u.__key;l&&i.anchor.set(g,h+2,"element"),c&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){ke(),fc(this,e);const r=this.getWritable(),o=e.getWritable(),s=o.__key;pn(o);const i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),c=r.__prev,a=this.getIndexWithinParent();i===null?l.__first=s:i.getWritable().__next=s,l.__size++,r.__prev=s,o.__prev=c,o.__next=r.__key,o.__parent=r.__parent;const u=oe();return t&&Y(u)&&Js(u,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return wt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ke();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(w(r))return r.select();if(!j(r)){const s=r.getIndexWithinParent()+1;return o.select(s,s)}return r.select(e,t)}selectNext(e,t){ke();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(w(r))return r.select(0,0);if(!j(r)){const s=r.getIndexWithinParent();return o.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}}class Hn extends Ws{static getType(){return"linebreak"}static clone(e){return new Hn(e.__key)}constructor(e){super(e)}getTextContent(){return`
26
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&gc(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&js(o)){const s=r.lastChild;if(s===t||s.previousSibling===t&&js(s))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&gc(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&js(o))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&js(s))return!0}return!1}(e)?null:{conversion:qN,priority:0}}}static importJSON(e){return Yn()}exportJSON(){return{type:"linebreak",version:1}}}function qN(n){return{node:Yn()}}function Yn(){return fo(new Hn)}function yn(n){return n instanceof Hn}function js(n){return n.nodeType===Yt&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Dc(n,e){return 16&e?"code":e&Ss?"mark":32&e?"sub":64&e?"sup":null}function Mc(n,e){return 1&e?"strong":2&e?"em":"span"}function Bd(n,e,t,r,o){const s=r.classList;let i=uo(o,"base");i!==void 0&&s.add(...i),i=uo(o,"underlineStrikethrough");let l=!1;const c=e&ro&&e&no;i!==void 0&&(t&ro&&t&no?(l=!0,c||s.add(...i)):c&&s.remove(...i));for(const a in ht){const u=ht[a];if(i=uo(o,a),i!==void 0)if(t&u){if(l&&(a==="underline"||a==="strikethrough")){e&u&&s.remove(...i);continue}e&u&&(!c||a!=="underline")&&a!=="strikethrough"||s.add(...i)}else e&u&&s.remove(...i)}}function Kd(n,e,t){const r=e.firstChild,o=t.isComposing(),s=n+(o?Os:"");if(r==null)e.textContent=s;else{const i=r.nodeValue;if(i!==s)if(o||Ht){const[l,c,a]=function(u,d){const f=u.length,h=d.length;let g=0,p=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;p+g<f&&p+g<h&&u[f-p-1]===d[h-p-1];)p++;return[g,f-g-p,d.slice(g,h-p)]}(i,s);c!==0&&r.deleteData(l,c),r.insertData(l,a)}else r.nodeValue=s}}function zd(n,e,t,r,o,s){Kd(o,n,e);const i=s.theme.text;i!==void 0&&Bd(0,0,r,n,i)}function Us(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Nn extends Ws{static getType(){return"text"}static clone(e){return new Nn(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),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(){const e=this.getLatest();return SN[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Vt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ht[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return sc(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=Dc(0,r),s=Mc(0,r),i=o===null?s:o,l=document.createElement(i);let c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(c=document.createElement(s),l.appendChild(c)),zd(c,this,0,r,this.__text,e);const a=this.__style;return a!==""&&(l.style.cssText=a),l}updateDOM(e,t,r){const o=this.__text,s=e.__format,i=this.__format,l=Dc(0,s),c=Dc(0,i),a=Mc(0,s),u=Mc(0,i);if((l===null?a:l)!==(c===null?u:c))return!0;if(l===c&&a!==u){const p=t.firstChild;p==null&&k(48);const _=document.createElement(u);return zd(_,this,0,i,o,r),t.replaceChild(_,p),!1}let d=t;c!==null&&l!==null&&(d=t.firstChild,d==null&&k(49)),Kd(o,d,this);const f=r.theme.text;f!==void 0&&s!==i&&Bd(0,s,i,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:eC,priority:0}),b:()=>({conversion:QN,priority:0}),code:()=>({conversion:qt,priority:0}),em:()=>({conversion:qt,priority:0}),i:()=>({conversion:qt,priority:0}),s:()=>({conversion:qt,priority:0}),span:()=>({conversion:XN,priority:0}),strong:()=>({conversion:qt,priority:0}),sub:()=>({conversion:qt,priority:0}),sup:()=>({conversion:qt,priority:0}),u:()=>({conversion:qt,priority:0})}}static importJSON(e){const t=ve(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&$s(t)||k(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Us(t,"b")),this.hasFormat("italic")&&(t=Us(t,"i")),this.hasFormat("strikethrough")&&(t=Us(t,"s")),this.hasFormat("underline")&&(t=Us(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?ht[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?xN[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=sc(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=EN[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){ke();let r=e,o=t;const s=oe(),i=this.getTextContent(),l=this.__key;if(typeof i=="string"){const c=i.length;r===void 0&&(r=c),o===void 0&&(o=c)}else r=0,o=0;if(!Y(s))return Qd(l,r,l,o,"text","text");{const c=Vt();c!==s.anchor.key&&c!==s.focus.key||Ce(l),s.setTextNodeRange(this,r,this,o)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const s=this.getWritable(),i=s.__text,l=r.length;let c=e;c<0&&(c=l+c,c<0&&(c=0));const a=oe();if(o&&Y(a)){const d=e+l;a.setTextNodeRange(s,d,s,d)}const u=i.slice(0,c)+r+i.slice(c+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ke();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,s=Vt(),i=new Set(e),l=[],c=r.length;let a="";for(let T=0;T<c;T++)a!==""&&i.has(T)&&(l.push(a),a=""),a+=r[T];a!==""&&l.push(a);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),p=t.getStyle(),_=t.__detail;let y=!1;t.isSegmented()?(h=ve(d),h.__format=g,h.__style=p,h.__detail=_,y=!0):(h=t.getWritable(),h.__text=d);const m=oe(),N=[h];let x=d.length;for(let T=1;T<u;T++){const E=l[T],O=E.length,S=ve(E).getWritable();S.__format=g,S.__style=p,S.__detail=_;const v=S.__key,M=x+O;if(Y(m)){const B=m.anchor,X=m.focus;B.key===o&&B.type==="text"&&B.offset>x&&B.offset<=M&&(B.key=v,B.offset-=x,m.dirty=!0),X.key===o&&X.type==="text"&&X.offset>x&&X.offset<=M&&(X.key=v,X.offset-=x,m.dirty=!0)}s===o&&Ce(v),x=M,N.push(S)}if(f!==null){(function(O){const S=O.getPreviousSibling(),v=O.getNextSibling();S!==null&&Ds(S),v!==null&&Ds(v)})(this);const T=f.getWritable(),E=this.getIndexWithinParent();y?(T.splice(E,0,N),this.remove()):T.splice(E,1,N),Y(m)&&Js(m,f,E,u-1)}return N}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||k(50);const r=this.__key,o=e.__key,s=this.__text,i=s.length;Vt()===o&&Ce(r);const l=oe();if(Y(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===o&&(eh(d,t,r,e,i),l.dirty=!0),f!==null&&f.key===o&&(eh(f,t,r,e,i),l.dirty=!0)}const c=e.__text,a=t?c+s:s+c;this.setTextContent(a);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function XN(n){return{forChild:Ac(n.style),node:null}}function QN(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Ac(e.style,t?void 0:"bold"),node:null}}const Wd=new WeakMap;function ZN(n){return n.nodeName==="PRE"||n.nodeType===to&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function eC(n){const e=n;n.parentElement===null&&k(129);let t=e.textContent||"";if(function(r){let o,s=r.parentNode;const i=[r];for(;s!==null&&(o=Wd.get(s))===void 0&&!ZN(s);)i.push(s),s=s.parentNode;const l=o===void 0?s:o;for(let c=0;c<i.length;c++)Wd.set(i[c],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),o=[],s=r.length;for(let i=0;i<s;i++){const l=r[i];l===`
31
+ `,ll=Me?" ":hn,Oi="֑-߿יִ-﷽ﹰ-ﻼ",Di="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",al=new RegExp("^[^"+Di+"]*["+Oi+"]"),cl=new RegExp("^[^"+Oi+"]*["+Di+"]"),Pe={bold:1,code:16,highlight:rr,italic:2,strikethrough:fn,subscript:32,superscript:64,underline:dn},ul={directionless:1,unmergeable:2},Ri={center:or,end:cr,justify:lr,left:ir,right:sr,start:ar},fl={[or]:"center",[cr]:"end",[lr]:"justify",[ir]:"left",[sr]:"right",[ar]:"start"},dl={normal:0,segmented:2,token:1},hl={[rl]:"normal",[ol]:"segmented",[il]:"token"};function gl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var O=gl(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function gn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const pl=100;let ur=!1,fr=0;function _l(n){fr=n.timeStamp}function dr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function ml(n,e,t){const r=Se(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&yr(e,s,i,o,!1)}function yl(n,e,t){if(P(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===je&&t.isAttached()}function Fi(n,e,t){ur=!0;const r=performance.now()-fr>pl;try{he(n,()=>{const i=I()||function(f){return f.getEditorState().read(()=>{const h=I();return h!==null?h.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,_=h.target;let m=Ge(_,l);if(!(m===null&&_!==s||U(m))){if(g==="characterData")r&&D(m)&&yl(i,_,m)&&ml(_,m,n);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let T=0;T<x.length;T++){const S=x[T],b=$i(S),N=S.parentNode;if(N!=null&&S!==a&&b===null&&(S.nodeName!=="BR"||!dr(S,N,n))){if(Me){const w=S.innerText||S.nodeValue;w&&(u+=w)}N.removeChild(S)}}const y=h.removedNodes,v=y.length;if(v>0){let T=0;for(let S=0;S<v;S++){const b=y[S];(b.nodeName==="BR"&&dr(b,_,n)||a===b)&&(_.appendChild(b),T++)}v!==T&&(_===s&&(m=Ji(l)),o.set(_,m))}}}}if(o.size>0)for(const[f,h]of o)if(C(h)){const g=h.getChildrenKeys();let _=f.firstChild;for(let m=0;m<g.length;m++){const x=g[m],y=n.getElementByKey(x);y!==null&&(_==null?(f.appendChild(y),_=y):_!==y&&f.replaceChild(y,_),_=_.nextSibling)}}else D(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,_=h.target;for(let m=0;m<g.length;m++){const x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||dr(x,_,n)||y.removeChild(x)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,be(i)),Me&&to(n)&&i.insertRawText(u))})}finally{ur=!1}}function Ii(n){const e=n._observer;e!==null&&Fi(n,e.takeRecords(),e)}function Li(n){(function(e){fr===0&&Cn(e).addEventListener("textInput",_l,!0)})(n),n._observer=new MutationObserver((e,t)=>{Fi(n,e,t)})}function Ai(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function Mi(n,e){const t=n.mergeWithSibling(e),r=H()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ji(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Ai(e,r)){r=Mi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ai(r,t)){r=Mi(r,t);break}break}t.remove()}}else r.remove()}function Wi(n){return Bi(n.anchor),Bi(n.focus),n}function Bi(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let vl=1;const xl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function hr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Ge(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&pn(e)==null)}function Dt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!hr(e)&&zi(e)===n}catch{return!1}}function gr(n){return n instanceof Wn}function zi(n){let e=n;for(;e!=null;){const t=pn(e);if(gr(t))return t;e=xn(e)}return null}function pn(n){return n?n.__lexicalEditor:null}function at(n){return n.isToken()||n.isSegmented()}function Cl(n){return n.nodeType===je}function _n(n){let e=n;for(;e!=null;){if(Cl(e))return e;e=e.firstChild}return null}function pr(n,e,t){const r=Pe[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~Pe.superscript:e==="superscript"&&(i&=~Pe.subscript),i}function bl(n,e){if(e!=null)return void(n.__key=e);de(),Bo();const t=H(),r=Re(),i=""+vl++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Pi,n.__key=i}function He(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function mn(n){Bo();const e=n.getLatest(),t=e.__parent,r=Re(),i=H(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Pi,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){de();const e=H(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function We(){return Ht()?null:H()._compositionKey}function se(n,e){const t=(e||Re())._nodeMap.get(n);return t===void 0?null:t}function $i(n,e){const t=n[`__lexicalKey_${H()._key}`];return t!==void 0?se(t,e):null}function Ge(n,e){let t=n;for(;t!=null;){const r=$i(t,e);if(r!==null)return r;t=xn(t)}return null}function Ki(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Ui(n){return n.read(()=>X().getTextContent())}function X(){return Ji(Re())}function Ji(n){return n._nodeMap.get("root")}function be(n){de();const e=Re();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ct(n){const e=H(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=xn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Vi(n,e){return e?n.getTextContentSize():0}function Yi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function _r(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function qi(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Hi(n){return n.nodeType===je?n.nodeValue:null}function mr(n,e,t){const r=Se(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=Hi(i);const a=Ge(i);if(l!==null&&D(a)){if(l===hn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&yr(a,l,o,s,n)}}}function yr(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===hn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),tr||un||nr)o.remove();else{const _=H();setTimeout(()=>{_.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=qt(),d=o.getTextContentSize(),f=We(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!s||P(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===d&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=I();if(!P(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const _=ie(o.getTextContent());o.replace(_),o=_}o.setTextContent(l)}}}function Sl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(D(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function Gi(n){return n==="ArrowLeft"}function Xi(n){return n==="ArrowRight"}function Rt(n,e){return me?n:e}function Qi(n){return n==="Enter"}function Ft(n){return n==="Backspace"}function It(n){return n==="Delete"}function Zi(n,e,t){return n.toLowerCase()==="a"&&Rt(e,t)}function wl(){const n=X();be(Wi(n.select(0,n.getChildrenSize())))}function Lt(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=gn(i);return t[e]=o,o}return i}function vr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&O(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(s,d?"updated":i)}function eo(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function At(n,e){const t=n.offset;if(n.type==="element")return eo(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?eo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function to(n){const e=Cn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function F(n,e,t){return Jo(n,e,t)}function yn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function vn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&O(75,e),t}function xn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function xr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Cn(n){const e=n._window;return e===null&&O(78),e}function Tl(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return oe(n)||C(n)&&n.isShadowRoot()}function bn(n){const e=H(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&O(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||O(98),o}return n}function Cr(n,e){!oe(n.getParent())||C(e)||U(e)||O(99)}function br(n){return(U(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Sr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function kl(n,e,t){let r=n._blockCursorElement;if(P(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())br(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(br(c)){const u=c.getPreviousSibling();(u===null||br(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=gn(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Sr(r,n,e)}function Se(n){return _e?(n||window).getSelection():null}function wr(n){return n.nodeType===1}function Tr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Sn(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function ft(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!C(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||Jt(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function kr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function El(){return H()}const no=new WeakMap,Nl=new Map;function Pl(n){if(!n._readOnly&&n.isEmpty())return Nl;n._readOnly||O(192);let e=no.get(n);if(!e){e=new Map,no.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function Er(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ro(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&ro(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Be,le,Mt,wn,Nr,Pr,Xe,ye,Or,jt,Z="",ae="",we=null,ve="",Oe="",io=!1,Wt=!1,Tn=null;function kn(n,e){const t=Xe.get(n);if(e!==null){const r=Ir(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=Nn(t,Xe);Dr(r,0,r.length-1,null)}t!==void 0&&vr(jt,Mt,wn,t,"destroyed")}function Dr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&kn(o,r)}}function Qe(n,e){n.setProperty("text-align",e)}const Ol="40px";function oo(n,e){const t=Be.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Ol;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function so(n,e){const t=n.style;e===0?Qe(t,""):e===ir?Qe(t,"left"):e===or?Qe(t,"center"):e===sr?Qe(t,"right"):e===lr?Qe(t,"justify"):e===ar?Qe(t,"start"):e===cr&&Qe(t,"end")}function En(n,e,t){const r=ye.get(n);r===void 0&&O(60);const i=r.createDOM(Be,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),D(r)?i.setAttribute("data-lexical-text","true"):U(r)&&i.setAttribute("data-lexical-decorator","true"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&oo(i,o),s!==0){const a=s-1;(function(c,u,d,f){const h=ae;ae="",Rr(c,d,0,u,f,null),co(d,f),ae=h})(Nn(r,ye),a,r,i)}const l=r.__format;l!==0&&so(i,l),r.isInline()||ao(null,r,i),yn(r)&&(Z+=Ne,Oe+=Ne)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Be);s!==null&&uo(n,s),i.contentEditable="false"}else D(r)&&(r.isDirectionless()||(ae+=o));Z+=o,Oe+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return vr(jt,Mt,wn,r,"created"),i}function Rr(n,e,t,r,i,o){const s=Z;Z="";let l=t;for(;l<=r;++l){En(n[l],i,o);const a=ye.get(n[l]);a!==null&&D(a)&&(we===null&&(we=a.getFormat()),ve===""&&(ve=a.getStyle()))}yn(e)&&(Z+=Ne),i.__lexicalTextContent=Z,Z=s+Z}function lo(n,e){const t=e.get(n);return Jt(t)||U(t)&&t.isInline()}function ao(n,e,t){const r=n!==null&&(n.__size===0||lo(n.__last,Xe)),i=e.__size===0||lo(e.__last,ye);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function co(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Tn){const o=ae==="",s=o?Tn:(i=ae,al.test(i)?"rtl":cl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Be.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const d=gn(c);c=a[r]=d}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=gn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}Wt||(n.getWritable().__dir=s)}Tn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Dl(n,e,t){const r=ae;var i;ae="",we=null,ve="",function(o,s,l){const a=Z,c=o.__size,u=s.__size;if(Z="",c===1&&u===1){const d=o.__first,f=s.__first;if(d===f)Bt(d,l);else{const g=Ir(d),_=En(f,null,null);try{l.replaceChild(_,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${_.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw m}kn(d,null)}const h=ye.get(f);D(h)&&(we===null&&(we=h.getFormat()),ve===""&&(ve=h.getStyle()))}else{const d=Nn(o,Xe),f=Nn(s,ye);if(c===0)u!==0&&Rr(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;Dr(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,_,m,x,y){const v=m-1,T=x-1;let S,b,N=(j=y,j.firstChild),w=0,E=0;for(var j;w<=v&&E<=T;){const q=g[w],W=_[E];if(q===W)N=Fr(Bt(W,y)),w++,E++;else{S===void 0&&(S=new Set(g)),b===void 0&&(b=new Set(_));const ce=b.has(q),Fe=S.has(W);if(ce)if(Fe){const Je=vn(le,W);Je===N?N=Fr(Bt(W,y)):(N!=null?y.insertBefore(Je,N):y.appendChild(Je),Bt(W,y)),w++,E++}else En(W,y,N),E++;else N=Fr(Ir(q)),kn(q,y),w++}const Y=ye.get(W);Y!==null&&D(Y)&&(we===null&&(we=Y.getFormat()),ve===""&&(ve=Y.getStyle()))}const z=w>v,ee=E>T;if(z&&!ee){const q=_[T+1];Rr(_,h,E,T,y,q===void 0?null:le.getElementByKey(q))}else ee&&!z&&Dr(g,w,v,y)})(s,d,f,c,u,l)}yn(s)&&(Z+=Ne),l.__lexicalTextContent=Z,Z=a+Z}(n,e,t),co(e,t),Zr(i=e)&&we!=null&&we!==i.__textFormat&&!Wt&&(i.setTextFormat(we),i.setTextStyle(ve)),function(o){Zr(o)&&ve!==""&&ve!==o.__textStyle&&!Wt&&o.setTextStyle(ve)}(e),ae=r}function Nn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&O(101),t.push(r),r=i.__next}return t}function Bt(n,e){const t=Xe.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||O(61);const i=io||Pr.has(n)||Nr.has(n),o=vn(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(Z+=s,Oe+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(ae+=s),Oe+=s,Z+=s}return o}if(t!==r&&i&&vr(jt,Mt,wn,r,"updated"),r.updateDOM(t,o,Be)){const s=En(n,null,null);return e===null&&O(62),e.replaceChild(s,o),kn(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&oo(o,s);const l=r.__format;l!==t.__format&&so(o,l),i&&(Dl(t,r,o),oe(r)||r.isInline()||ao(t,r,o)),yn(r)&&(Z+=Ne,Oe+=Ne)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Be);l!==null&&uo(n,l)}else D(r)&&!r.isDirectionless()&&(ae+=s);Z+=s,Oe+=s}if(!Wt&&oe(r)&&r.__cachedText!==Oe){const s=r.getWritable();s.__cachedText=Oe,r=s}return o}function uo(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Ki(le)}t[n]=e}function Fr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Rl(n,e,t,r,i,o){Z="",Oe="",ae="",io=r===lt,Tn=null,le=t,Be=t._config,Mt=t._nodes,wn=le._listeners.mutation,Nr=i,Pr=o,Xe=n._nodeMap,ye=e._nodeMap,Wt=e._readOnly,Or=new Map(t._keyToDOMMap);const s=new Map;return jt=s,Bt("root",null),le=void 0,Mt=void 0,Nr=void 0,Pr=void 0,Xe=void 0,ye=void 0,Be=void 0,Or=void 0,jt=void 0,s}function Ir(n){const e=Or.get(n);return e===void 0&&O(75,n),e}const De=Object.freeze({}),Lr=30,Ar=[["keydown",function(n,e){if(zt=n.timeStamp,fo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;F(e,zs,n)||t!=null&&(function(l,a,c,u){return Xi(l)&&!a&&!u&&!c}(t,i,s,o)?F(e,mi,n):function(l,a,c,u,d){return Xi(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?F(e,$s,n):function(l,a,c,u){return Gi(l)&&!a&&!u&&!c}(t,i,s,o)?F(e,yi,n):function(l,a,c,u,d){return Gi(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?F(e,Ks,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?F(e,vi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?F(e,xi,n):function(l,a){return Qi(l)&&a}(t,r)?($t=!0,F(e,ln,n)):function(l){return l===" "}(t)?F(e,Us,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),$t=!0,F(e,ot,!0)):function(l,a){return Qi(l)&&!a}(t,r)?($t=!1,F(e,ln,n)):function(l,a,c,u){return me?!a&&!c&&(Ft(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Ft(l)}(t,s,o,i)?Ft(t)?F(e,Ci,n):(n.preventDefault(),F(e,Ye,!0)):function(l){return l==="Escape"}(t)?F(e,bi,n):function(l,a,c,u,d){return me?!(c||u||d)&&(It(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&It(l)}(t,i,r,s,o)?It(t)?F(e,Si,n):(n.preventDefault(),F(e,Ye,!1)):function(l,a,c){return Ft(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),F(e,Tt,!0)):function(l,a,c){return It(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),F(e,Tt,!1)):function(l,a){return me&&a&&Ft(l)}(t,o)?(n.preventDefault(),F(e,kt,!0)):function(l,a){return me&&a&&It(l)}(t,o)?(n.preventDefault(),F(e,kt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?F(e,Js,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&Rt(c,u)}(t,r,o,i)?(n.preventDefault(),F(e,on,void 0)):function(l,a,c,u){return me?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),F(e,sn,void 0)):xe(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),F(e,an,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),F(e,Zn,n)):Zi(t,o,i)&&(n.preventDefault(),F(e,er,n)):!Me&&Zi(t,o,i)&&(n.preventDefault(),F(e,er,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&F(e,Zs,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{U(Ge(t))||(jr=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=I();if(P(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<zt+Lr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&F(e,st,ll)}})}],["compositionend",function(n,e){Me?Kt=!0:he(e,()=>{Wr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=I(),r=n.data,i=yo(n);if(r!=null&&P(t)&&po(t,i,r,n.timeStamp,!1)){Kt&&(Wr(e,r),Kt=!1);const o=t.anchor.getNode(),s=Se(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;cn&&!t.isCollapsed()&&D(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===Hi(s.anchorNode)||F(e,st,r);const u=r.length;Me&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),tr||un||nr||!e.isComposing()||(zt=0,re(null))}else mr(!1,e,r!==null?r:void 0),Kt&&(Wr(e,r||void 0),Kt=!1);de(),Ii(H())}),dt=null}],["click",function(n,e){he(e,()=>{const t=I(),r=Se(e._window),i=qt();if(r){if(P(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&X().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===Ot||s===je)&&be(Yr(i,r,e,n))}}}F(e,_i,n)})}],["cut",De],["copy",De],["dragstart",De],["dragover",De],["dragend",De],["paste",De],["focus",De],["blur",De],["drop",De]];cn&&Ar.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=yo(t);i==="deleteCompositionText"||Me&&to(r)||i!=="insertCompositionText"&&he(r,()=>{const s=I();if(i==="deleteContentBackward"){if(s===null){const h=qt();if(!P(h))return;be(h.clone())}if(P(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,fo==="MediaLast"&&l<zt+Lr&&r.isComposing()&&h){if(re(null),zt=0,setTimeout(()=>{he(r,()=>{re(null)})},Lr),P(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),D(g)||O(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),_=s.anchor.offset===0&&s.focus.offset===g.length;nl&&h&&!_||F(r,Ye,!0)}return}}var l;if(!P(s))return;const a=t.data;dt!==null&&mr(!1,r,dt),s.dirty&&dt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),dt=null;const c=s.anchor,u=s.focus,d=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":F(r,st,t);break;case"insertFromComposition":re(null),F(r,st,t);break;case"insertLineBreak":re(null),F(r,ot,!1);break;case"insertParagraph":re(null),$t&&!un?($t=!1,F(r,ot,!1)):F(r,rn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":F(r,Xn,t);break;case"deleteByComposition":(function(h,g){return h!==g||C(h)||C(g)||!h.isToken()||!g.isToken()})(d,f)&&F(r,Qn,t);break;case"deleteByDrag":case"deleteByCut":F(r,Qn,t);break;case"deleteContent":F(r,Ye,!1);break;case"deleteWordBackward":F(r,Tt,!0);break;case"deleteWordForward":F(r,Tt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":F(r,kt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":F(r,kt,!1);break;case"formatStrikeThrough":F(r,ge,"strikethrough");break;case"formatBold":F(r,ge,"bold");break;case"formatItalic":F(r,ge,"italic");break;case"formatUnderline":F(r,ge,"underline");break;case"historyUndo":F(r,on,void 0);break;case"historyRedo":F(r,sn,void 0)}else{if(a===`
32
+ `)t.preventDefault(),F(r,ot,!1);else if(a===Ne)t.preventDefault(),F(r,rn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),F(r,st,a)):dt=a;ho=t.timeStamp}})}(n,e)]);let zt=0,fo=null,ho=0,dt=null;const Pn=new WeakMap;let Mr=!1,jr=!1,$t=!1,Kt=!1,go=[0,"",0,"root",0];function po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=H(),c=Se(a._window),u=c!==null?c.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==s.key||!D(l)||(!i&&(!cn||ho<r+50)||l.isDirty()&&h<2||Yi(t))&&o.offset!==s.offset&&!l.isComposing()||at(l)||l.isDirty()&&h>1||(i||!cn)&&f!==null&&!l.isComposing()&&u!==_n(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Sl(n,l)}function _o(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===je&&e!==0&&e!==n.nodeValue.length}function mo(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Mr&&(Mr=!1,_o(r,i)&&_o(o,s))||he(e,()=>{if(!t)return void be(null);if(!Dt(e,r,o))return;const l=I();if(P(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Cn(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,_,m]=go,x=X(),y=e.isComposing()===!1&&x.getTextContent()==="";if(d<m+200&&a.offset===g&&a.key===_)l.format=f,l.style=h;else if(a.type==="text")D(c)||O(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!y){const v=a.getNode();l.style="",v instanceof pt&&v.getChildrenSize()===0?(l.format=v.getTextFormat(),l.style=v.getTextStyle()):l.format=0}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),_=g?s:i,m=g?i:s,x=g?d:u,y=g?u:d;let v=sl,T=!1;for(let S=0;S<h;S++){const b=f[S],N=b.getTextContentSize();if(D(b)&&N!==0&&!(S===0&&b.__key===x&&_===N||S===h-1&&b.__key===y&&m===0)&&(T=!0,v&=b.getFormat(),v===0))break}l.format=T?v:0}}F(e,nn,void 0)})}function yo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Wr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=_n(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&D(r)&&yr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=I();if(P(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void F(n,ln,null)}}}mr(!0,n,e)}function vo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const ht=new Map;function xo(n){const e=n.target,t=Se(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=zi(t.anchorNode);if(r===null)return;jr&&(jr=!1,he(r,()=>{const c=qt(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Ot&&d!==je||be(Yr(c,t,r,n))}));const i=_r(r),o=i[i.length-1],s=o._key,l=ht.get(s),a=l||o;a!==r&&mo(t,a,!1),mo(t,r,!0),r!==o?ht.set(s,r):l&&ht.delete(s)}function Co(n){n._lexicalHandled=!0}function bo(n){return n._lexicalHandled===!0}function Fl(n){const e=n.ownerDocument,t=Pn.get(e);t===void 0&&O(162);const r=t-1;r>=0||O(164),Pn.set(e,r),r===0&&e.removeEventListener("selectionchange",xo);const i=pn(n);gr(i)?(function(s){if(s._parentEditor!==null){const l=_r(s),a=l[l.length-1]._key;ht.get(a)===s&&ht.delete(a)}else ht.delete(s._key)}(i),n.__lexicalEditor=null):i&&O(198);const o=vo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Br(n,e,t){de();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=I();if(!P(a)||!C(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return xr(d,l)&&c.set(l.__key,0,"element"),xr(f,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(P(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Ln(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Ln(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else xe(o)&&e&&n.isSelected()&&n.selectPrevious();if(P(o)&&e&&!s){const l=n.getIndexWithinParent();He(n),In(o,i,l,-1)}else He(n);t||ut(i)||i.canBeEmpty()||!i.isEmpty()||Br(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class On{static getType(){O(64,this.name)}static clone(e){O(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,bl(this,e)}getType(){return this.__type}isInline(){O(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||I();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(D(this))return r;if(P(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(U(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&O(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ut(t))return C(e)||e===this&&U(e)||O(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&O(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();C(this)&&t.unshift(this),C(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=C(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&O(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=H()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&O(113),e}getWritable(){de();const e=Re(),t=H(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=I();if(l!==null&&l.setCachedNodes(null),s.has(i))return mn(o),o;const a=Er(o);return s.add(i),mn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){O(70)}updateDOM(e,t,r){O(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){O(72)}static importJSON(e){O(18,this.name)}static transform(){return null}remove(e){Br(this,!0,e)}replace(e,t){de();let r=I();r!==null&&(r=r.clone()),Cr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;He(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(Br(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=f,d===null?a.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,a.__size=c,t&&(C(this)&&C(l)||O(139),this.getChildren().forEach(_=>{l.append(_)})),P(r)){be(r);const _=r.anchor,m=r.focus;_.key===o&&No(_,l),m.key===o&&No(m,l)}return We()===o&&re(s),l}insertAfter(e,t=!0){de(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=I();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(He(i),P(s)){const g=o.__key,_=s.anchor,m=s.focus;l=_.type==="element"&&_.key===g&&_.offset===h+1,a=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&P(s)){const h=this.getIndexWithinParent();In(s,u,h+1);const g=u.__key;l&&s.anchor.set(g,h+2,"element"),a&&s.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){de(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;He(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=I();return t&&P(u)&&In(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return ke()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){de();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!D(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){de();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!D(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Ut extends On{static getType(){return"linebreak"}static clone(e){return new Ut(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Sn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Dn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Sn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Dn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}return!1}(e)?null:{conversion:Il,priority:0}}}static importJSON(e){return Ze()}exportJSON(){return{type:"linebreak",version:1}}}function Il(n){return{node:Ze()}}function Ze(){return bn(new Ut)}function Jt(n){return n instanceof Ut}function Dn(n){return n.nodeType===je&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function zr(n,e){return 16&e?"code":e&rr?"mark":32&e?"sub":64&e?"sup":null}function $r(n,e){return 1&e?"strong":2&e?"em":"span"}function So(n,e,t,r,i){const o=r.classList;let s=Lt(i,"base");s!==void 0&&o.add(...s),s=Lt(i,"underlineStrikethrough");let l=!1;const a=e&dn&&e&fn;s!==void 0&&(t&dn&&t&fn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in Pe){const u=Pe[c];if(s=Lt(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function wo(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?hn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||Me){const[l,a,c]=function(u,d){const f=u.length,h=d.length;let g=0,_=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;_+g<f&&_+g<h&&u[f-_-1]===d[h-_-1];)_++;return[g,f-g-_,d.slice(g,h-_)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function To(n,e,t,r,i,o){wo(i,n,e);const s=o.theme.text;s!==void 0&&So(0,0,r,n,s)}function Rn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class gt extends On{static getType(){return"text"}static clone(e){return new gt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),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(){const e=this.getLatest();return hl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===We()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Pe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return pr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=zr(0,r),o=$r(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),To(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=zr(0,o),a=zr(0,s),c=$r(0,o),u=$r(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const _=t.firstChild;_==null&&O(48);const m=document.createElement(u);return To(m,this,0,s,i,r),t.replaceChild(m,_),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&O(49)),wo(i,d,this);const f=r.theme.text;f!==void 0&&o!==s&&So(0,o,s,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:jl,priority:0}),b:()=>({conversion:Al,priority:0}),code:()=>({conversion:ze,priority:0}),em:()=>({conversion:ze,priority:0}),i:()=>({conversion:ze,priority:0}),s:()=>({conversion:ze,priority:0}),span:()=>({conversion:Ll,priority:0}),strong:()=>({conversion:ze,priority:0}),sub:()=>({conversion:ze,priority:0}),sup:()=>({conversion:ze,priority:0}),u:()=>({conversion:ze,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&wr(t)||O(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Rn(t,"b")),this.hasFormat("italic")&&(t=Rn(t,"i")),this.hasFormat("strikethrough")&&(t=Rn(t,"s")),this.hasFormat("underline")&&(t=Rn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Pe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ul[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=pr(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=dl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){de();let r=e,i=t;const o=I(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!P(o))return Lo(l,r,l,i,"text","text");{const a=We();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=I();if(i&&P(c)){const d=e+l;c.setTextNodeRange(o,d,o,d)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){de();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=We(),s=new Set(e),l=[],a=r.length;let c="";for(let S=0;S<a;S++)c!==""&&s.has(S)&&(l.push(c),c=""),c+=r[S];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),_=t.getStyle(),m=t.__detail;let x=!1;t.isSegmented()?(h=ie(d),h.__format=g,h.__style=_,h.__detail=m,x=!0):(h=t.getWritable(),h.__text=d);const y=I(),v=[h];let T=d.length;for(let S=1;S<u;S++){const b=l[S],N=b.length,w=ie(b).getWritable();w.__format=g,w.__style=_,w.__detail=m;const E=w.__key,j=T+N;if(P(y)){const z=y.anchor,ee=y.focus;z.key===i&&z.type==="text"&&z.offset>T&&z.offset<=j&&(z.key=E,z.offset-=T,y.dirty=!0),ee.key===i&&ee.type==="text"&&ee.offset>T&&ee.offset<=j&&(ee.key=E,ee.offset-=T,y.dirty=!0)}o===i&&re(E),T=j,v.push(w)}if(f!==null){(function(N){const w=N.getPreviousSibling(),E=N.getNextSibling();w!==null&&mn(w),E!==null&&mn(E)})(this);const S=f.getWritable(),b=this.getIndexWithinParent();x?(S.splice(b,0,v),this.remove()):S.splice(b,1,v),P(y)&&In(y,f,b,u-1)}return v}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||O(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;We()===i&&re(r);const l=I();if(P(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&(jo(d,t,r,e,s),l.dirty=!0),f!==null&&f.key===i&&(jo(f,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Ll(n){return{forChild:Kr(n.style),node:null}}function Al(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Kr(e.style,t?void 0:"bold"),node:null}}const ko=new WeakMap;function Ml(n){return n.nodeName==="PRE"||n.nodeType===Ot&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function jl(n){const e=n;n.parentElement===null&&O(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=ko.get(o))===void 0&&!Ml(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)ko.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
27
35
  `||l===`\r
28
- `?o.push(Yn()):l===" "?o.push(Hs()):l!==""&&o.push(ve(l))}return{node:o}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,o=!0;for(;r!==null&&(r=jd(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),o=!1;break}}o&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=jd(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ve(t)}}function jd(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,t.nodeType===to){const s=t.style.display;if(s===""&&!_d(t)||s!==""&&!s.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===Yt)return t;if(t.nodeName==="BR")return null}}const tC={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qt(n){const e=tC[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ac(n.style,e),node:null}}function ve(n=""){return fo(new Nn(n))}function j(n){return n instanceof Nn}function Ac(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",s=r.includes("line-through"),i=n.fontStyle==="italic",l=r.includes("underline"),c=n.verticalAlign;return a=>(j(a)&&(o&&!a.hasFormat("bold")&&a.toggleFormat("bold"),s&&!a.hasFormat("strikethrough")&&a.toggleFormat("strikethrough"),i&&!a.hasFormat("italic")&&a.toggleFormat("italic"),l&&!a.hasFormat("underline")&&a.toggleFormat("underline"),c!=="sub"||a.hasFormat("subscript")||a.toggleFormat("subscript"),c!=="super"||a.hasFormat("superscript")||a.toggleFormat("superscript"),e&&!a.hasFormat(e)&&a.toggleFormat(e)),a)}class Vn extends Nn{static getType(){return"tab"}static clone(e){return new Vn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Hs();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){k(126)}setDetail(e){k(127)}setMode(e){k(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Hs(){return fo(new Vn)}function Ud(n){return n instanceof Vn}class nC{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const o=this.offset,s=e.offset;if(w(t)){const i=t.getDescendantByIndex(o);t=i??t}if(w(r)){const i=r.getDescendantByIndex(s);r=i??r}return t===r?o<s:t.isBefore(r)}getNode(){const e=Oe(this.key);return e===null&&k(20),e}set(e,t,r){const o=this._selection,s=this.key;this.key=e,this.offset=t,this.type=r,Gn()||(Vt()===s&&Ce(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function rt(n,e,t){return new nC(n,e,t)}function kc(n,e){let t=e.__key,r=n.offset,o="element";if(j(e)){o="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!w(e)){const s=e.getNextSibling();if(j(s))t=s.__key,r=0,o="text";else{const i=e.getParent();i&&(t=i.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function Hd(n,e){if(w(e)){const t=e.getLastDescendant();w(t)||j(t)?kc(n,t):kc(n,e)}else kc(n,e)}function Xt(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Ys{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Co(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(o=>r.has(o))}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 Ys(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,o=t[r-1];let s;if(j(o))s=o.select();else{const i=o.getIndexWithinParent()+1;s=o.getParentOrThrow().select(i,i)}s.insertNodes(e);for(let i=0;i<r;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const o of t){const s=Oe(o);s!==null&&r.push(s)}return Gn()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function Y(n){return n instanceof Qt}class Qt{constructor(e,t,r,o){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Y(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(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,o=t.isBefore(r),s=o?t:r,i=o?r:t;let l=s.getNode(),c=i.getNode();const a=s.offset,u=i.offset;if(w(l)){const f=l.getDescendantByIndex(a);l=f??l}if(w(c)){let f=c.getDescendantByIndex(u);f!==null&&f!==l&&c.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),c=f??c}let d;return d=l.is(c)?w(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(c),Gn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,o){Xt(this.anchor,e.__key,t,"text"),Xt(this.focus,r.__key,o,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],o=this.anchor,s=this.focus,i=o.isBefore(s),[l,c]=Pc(this);let a="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(w(f)&&!f.isInline())u||(a+=`
29
- `),u=!f.isEmpty();else if(u=!1,j(f)){let h=f.getTextContent();f===t?f===r?o.type==="element"&&s.type==="element"&&s.offset!==o.offset||(h=l<c?h.slice(l,c):h.slice(c,l)):h=i?h.slice(l):h.slice(c):f===r&&(h=i?h.slice(0,c):h.slice(0,l)),a+=h}else!ue(f)&&!yn(f)||f===r&&this.isCollapsed()||(a+=f.getTextContent())}return a}applyDOMRange(e){const t=ae(),r=t.getEditorState()._selection,o=Xd(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;const[s,i]=o;Xt(this.anchor,s.key,s.offset,s.type),Xt(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Qt(rt(e.key,e.offset,e.type),rt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=sc(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ht[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];i===`
30
- `||i===`\r
31
- `?r.push(Yn()):i===" "?r.push(Hs()):r.push(ve(i))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,s=this.style;let i=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(i=r,l=t),i.type==="element"&&function(_,y,m,N){const x=_.getNode(),T=x.getChildAtIndex(_.offset),E=ve(),O=Fe(x)?wt().append(E):E;E.setFormat(m),E.setStyle(N),T===null?x.append(O):T.insertBefore(O),_.is(y)&&y.set(E.__key,0,"text"),_.set(E.__key,0,"text")}(i,l,o,s);const c=i.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];j(f)||k(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(d===1&&l.type==="element"&&(a=h,l.set(i.key,a,"text")),this.isCollapsed()&&c===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let _=f.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!gn(_)||(_=ve(),_.setFormat(o),_.setStyle(s),g.canInsertTextAfter()?f.insertAfter(_):g.insertAfter(_)),_.select(0,0),f=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&c===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let _=f.getPreviousSibling();if(j(_)&&!gn(_)||(_=ve(),_.setFormat(o),g.canInsertTextBefore()?f.insertBefore(_):g.insertBefore(_)),_.select(),f=_,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&c!==h){const _=ve(f.getTextContent());_.setFormat(o),f.replace(_),f=_}else if(!this.isCollapsed()&&e!==""){const _=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||w(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),qd(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const N=ve(e);return N.select(),void f.replace(N)}const _=f.getFormat(),y=f.getStyle();if(c!==a||_===o&&y===s){if(Ud(f)){const N=ve(e);return N.setFormat(o),N.setStyle(s),N.select(),void f.replace(N)}}else{if(f.getTextContent()!==""){const N=ve(e);if(N.setFormat(o),N.setStyle(s),N.select(),c===0)f.insertBefore(N,!1);else{const[x]=f.splitText(c);x.insertAfter(N,!1)}return void(N.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(o),f.setStyle(s)}const m=a-c;f=f.spliceText(c,m,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=y))}else{const _=new Set([...f.getParentKeys(),...p.getParentKeys()]),y=w(f)?f:f.getParentOrThrow();let m=w(p)?p:p.getParentOrThrow(),N=p;if(!y.is(m)&&m.isInline())do N=m,m=m.getParentOrThrow();while(m.isInline());if(l.type==="text"&&(a!==0||p.getTextContent()==="")||l.type==="element"&&p.getIndexWithinParent()<a)if(j(p)&&!p.isToken()&&a!==p.getTextContentSize()){if(p.isSegmented()){const S=ve(p.getTextContent());p.replace(S),p=S}Fe(l.getNode())||l.type!=="text"||(p=p.spliceText(0,a,"")),_.add(p.__key)}else{const S=p.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?p.remove():S.remove()}else _.add(p.__key);const x=m.getChildren(),T=new Set(u),E=y.is(m),O=y.isInline()&&f.getNextSibling()===null?y:f;for(let S=x.length-1;S>=0;S--){const v=x[S];if(v.is(f)||w(v)&&v.isParentOf(f))break;v.isAttached()&&(!T.has(v)||v.is(N)?E||O.insertAfter(v,!1):v.remove())}if(!E){let S=m,v=null;for(;S!==null;){const M=S.getChildren(),B=M.length;(B===0||M[B-1].is(v))&&(_.delete(S.__key),v=S),S=S.getParent()}}if(f.isToken())if(c===h)f.select();else{const S=ve(e);S.select(),f.replace(S)}else f=f.spliceText(c,h-c,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let S=1;S<d;S++){const v=u[S],M=v.__key;_.has(M)||v.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void Ce(null);const t=this.getNodes(),r=[];for(const m of t)j(m)&&r.push(m);const o=r.length;if(o===0)return this.toggleFormat(e),void Ce(null);const s=this.anchor,i=this.focus,l=this.isBackward(),c=l?i:s,a=l?s:i;let u=0,d=r[0],f=c.type==="element"?0:c.offset;if(c.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=o-1;let p=r[g];const _=a.type==="text"?a.offset:p.getTextContentSize();if(d.is(p)){if(f===_)return;if(gn(d)||f===0&&_===d.getTextContentSize())d.setFormat(h);else{const m=d.splitText(f,_),N=f===0?m[0]:m[1];N.setFormat(h),c.type==="text"&&c.set(N.__key,0,"text"),a.type==="text"&&a.set(N.__key,_-f,"text")}return void(this.format=h)}f===0||gn(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const y=p.getFormatFlags(e,h);_>0&&(_===p.getTextContentSize()||gn(p)||([p]=p.splitText(_)),p.setFormat(y));for(let m=u+1;m<g;m++){const N=r[m],x=N.getFormatFlags(e,y);N.setFormat(x)}c.type==="text"&&c.set(d.__key,f,"text"),a.type==="text"&&a.set(p.__key,_,"text"),this.format=h|y}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=oe();return Y(h)||k(134),h.insertNodes(e)}const t=pc((this.isBackward()?this.focus:this.anchor).getNode(),Wn),r=e[e.length-1];if("__language"in t&&w(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=$c(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(w(h)||ue(h))&&!h.isInline())){w(t)||k(135);const h=$c(this);return t.splice(h,0,e),void r.selectEnd()}const o=function(h){const g=wt();let p=null;for(let _=0;_<h.length;_++){const y=h[_],m=yn(y);if(m||ue(y)&&y.isInline()||w(y)&&y.isInline()||j(y)||y.isParentRequired()){if(p===null&&(p=y.createParentElementNode(),g.append(p),m))continue;p!==null&&p.append(y)}else g.append(y),p=null}return g}(e),s=o.getLastDescendant(),i=o.getChildren(),l=!w(t)||!t.isEmpty()?this.insertParagraph():null,c=i[i.length-1];let a=i[0];var u;w(u=a)&&Wn(u)&&!u.isEmpty()&&w(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(w(t)||k(135),t.append(...a.getChildren()),a=i[1]),a&&function(h,g,p){const _=g.getParentOrThrow().getLastChild();let y=g;const m=[g];for(;y!==_;)y.getNextSibling()||k(140),y=y.getNextSibling(),m.push(y);let N=h;for(const x of m)N=N.insertAfter(x)}(t,a);const d=pc(s,Wn);l&&w(d)&&(l.canMergeWhenEmpty()||Wn(c))&&(d.append(...l.getChildren()),l.remove()),w(t)&&t.isEmpty()&&t.remove(),s.selectEnd();const f=w(t)?t.getLastChild():null;yn(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=wt();return He().splice(this.anchor.offset,0,[i]),i.select(),i}const e=$c(this),t=pc(this.anchor.getNode(),Wn);w(t)||k(136);const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...o),s.selectStart(),s):null}insertLineBreak(e){const t=Yn();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),o=t.getIndexWithinParent();r.select(o,o)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,o=this.anchor,s=this.focus;let i=e[0],l=e[r];const[c,a]=Pc(this);if(t===0)return[];if(t===1){if(j(i)&&!this.isCollapsed()){const d=c>a?a:c,f=c>a?c:a,h=i.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[i]}const u=o.isBefore(s);if(j(i)){const d=u?c:a;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(j(l)){const d=l.getTextContent().length,f=u?a:c;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const o=this.focus,s=this.anchor,i=e==="move",l=uc(o,t);if(ue(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=Rc();return h.add(l.__key),void gt(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(j(f)){const h=f.__key,g=t?f.getTextContent().length:0;return o.set(h,g,"text"),void(i&&s.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,p;return w(f)?(p=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),p=h.__key,t||g++),o.set(p,g,"element"),void(i&&s.set(p,g,"element"))}}const c=ae(),a=pt(c._window);if(!a)return;const u=c._blockCursorElement,d=c._rootElement;if(d===null||u===null||!w(l)||l.isInline()||l.canBeEmpty()||hc(u,c,d),function(f,h,g,p){f.modify(h,g,p)}(a,e,t?"backward":"forward",r),a.rangeCount>0){const f=a.getRangeAt(0),h=this.anchor.getNode(),g=Fe(h)?h:gd(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const p=this.getNodes(),_=[];let y=!1;for(let m=0;m<p.length;m++){const N=p[m];Ps(N,g)?_.push(N):y=!0}if(y&&_.length>0)if(t){const m=_[0];w(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=_[_.length-1];w(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}a.anchorNode===f.startContainer&&a.anchorOffset===f.startOffset||function(m){const N=m.focus,x=m.anchor,T=x.key,E=x.offset,O=x.type;Xt(x,N.key,N.offset,N.type),Xt(N,T,E,O),m._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&w(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),s=t.getNextSibling()||(o===null?null:o.getNextSibling());if(w(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,e))return;const s=this.focus,i=uc(s,e);if(ue(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&w(o)&&o.getChildrenSize()===0){o.remove();const l=Rc();l.add(i.__key),gt(l)}else i.remove(),ae().dispatchCommand(Cs,void 0);return}if(!e&&w(i)&&w(o)&&o.isEmpty())return o.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const c=s.offset,a=l.getTextContentSize();if(l.is(o)||e&&c!==a||!e&&c!==0)return void Vd(l,e,c)}else if(o!==null&&o.isSegmented()){const c=r.offset,a=o.getTextContentSize();if(o.is(l)||e&&c!==0||!e&&c!==a)return void Vd(o,e,c)}(function(c,a){const u=c.anchor,d=c.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,p=d.offset,_=g<p,y=_?g:p,m=_?p:g,N=m-1;y!==N&&(sd(f.getTextContent().slice(y,m))||(a?d.offset=N:u.offset=N))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Fe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Co(n){return n instanceof Ys}function Yd(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Pc(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Yd(t),Yd(r)]}function Vd(n,e,t){const r=n,o=r.getTextContent().split(/(?=\s)/g),s=o.length;let i=0,l=0;for(let a=0;a<s;a++){const u=a===s-1;if(l=i,i+=o[a].length,e&&i===t||i>t||u){o.splice(a,1),u&&(l=void 0);break}}const c=o.join("").trim();c===""?r.remove():(r.setTextContent(c),r.select(l,l))}function Jd(n,e,t,r){let o,s=e;if(n.nodeType===to){let i=!1;const l=n.childNodes,c=l.length,a=r._blockCursorElement;s===c&&(i=!0,s=c-1);let u=l[s],d=!1;if(u===a)u=l[s+1],d=!0;else if(a!==null){const f=a.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,a)&&s--}if(o=zn(u),j(o))s=od(o,i);else{let f=zn(n);if(f===null)return null;if(w(f)){s=Math.min(f.getChildrenSize(),s);let h=f.getChildAtIndex(s);if(w(h)&&function(g,p,_){const y=g.getParent();return _===null||y===null||!y.canBeEmpty()||y!==_.getNode()}(h,0,t)){const g=i?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=w(h)?h:h.getParentOrThrow()),s=0}j(h)?(o=h,f=null,s=od(h,i)):h!==f&&i&&!d&&s++}else{const h=f.getIndexWithinParent();s=e===0&&ue(f)&&zn(n)===f?h:h+1,f=f.getParentOrThrow()}if(w(f))return rt(f.__key,s,"element")}}else o=zn(n);return j(o)?rt(o.__key,s,"text"):null}function Gd(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const s=o.getPreviousSibling(),i=o.getParent();if(e){if((t||!e)&&s===null&&w(i)&&i.isInline()){const l=i.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else w(s)&&!t&&s.isInline()?(n.key=s.__key,n.offset=s.getChildrenSize(),n.type="element"):j(s)&&(n.key=s.__key,n.offset=s.getTextContent().length)}else if(r===o.getTextContent().length){const s=o.getNextSibling(),i=o.getParent();if(e&&w(s)&&s.isInline())n.key=s.__key,n.offset=0,n.type="element";else if((t||e)&&s===null&&w(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function qd(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),o=n.is(e);Gd(n,r,o),Gd(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const s=ae();if(s.isComposing()&&s._compositionKey!==n.key&&Y(t)){const i=t.anchor,l=t.focus;Xt(n,i.key,i.offset,i.type),Xt(e,l.key,l.offset,l.type)}}}function Xd(n,e,t,r,o,s){if(n===null||t===null||!oo(o,n,t))return null;const i=Jd(n,e,Y(s)?s.anchor:null,o);if(i===null)return null;const l=Jd(t,r,Y(s)?s.focus:null,o);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const c=zn(n),a=zn(t);if(ue(c)&&ue(a))return null}return qd(i,l,s),[i,l]}function rC(n){return w(n)&&!n.isInline()}function Qd(n,e,t,r,o,s){const i=mt(),l=new Qt(rt(n,e,o),rt(t,r,s),0,"");return l.dirty=!0,i._selection=l,l}function oC(){const n=rt("root",0,"element"),e=rt("root",0,"element");return new Qt(n,e,0,"")}function Rc(){return new Ys(new Set)}function sC(n,e){return Vs(null,n,e,null)}function Vs(n,e,t,r){const o=t._window;if(o===null)return null;const s=r||o.event,i=s?s.type:void 0,l=i==="selectionchange",c=!ec&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0);let a,u,d,f;if(Y(n)&&!c)return n.clone();if(e===null)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&Y(n)&&!oo(t,a,u))return n.clone();const h=Xd(a,d,u,f,t,n);if(h===null)return null;const[g,p]=h;return new Qt(g,p,Y(n)?n.format:0,Y(n)?n.style:"")}function oe(){return mt()._selection}function Jn(){return ae()._editorState._selection}function Js(n,e,t,r=1){const o=n.anchor,s=n.focus,i=o.getNode(),l=s.getNode();if(!e.is(i)&&!e.is(l))return;const c=e.__key;if(n.isCollapsed()){const a=o.offset;if(t<=a&&r>0||t<a&&r<0){const u=Math.max(0,a+r);o.set(c,u,"element"),s.set(c,u,"element"),Zd(n)}}else{const a=n.isBackward(),u=a?s:o,d=u.getNode(),f=a?o:s,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(c,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(c,Math.max(0,g+r),"element")}}Zd(n)}function Zd(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,s=e.getNode(),i=r.getNode();if(n.isCollapsed()){if(!w(s))return;const l=s.getChildrenSize(),c=t>=l,a=c?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(j(a)){let u=0;c&&(u=a.getTextContentSize()),e.set(a.__key,u,"text"),r.set(a.__key,u,"text")}}else{if(w(s)){const l=s.getChildrenSize(),c=t>=l,a=c?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(j(a)){let u=0;c&&(u=a.getTextContentSize()),e.set(a.__key,u,"text")}}if(w(i)){const l=i.getChildrenSize(),c=o>=l,a=c?i.getChildAtIndex(l-1):i.getChildAtIndex(o);if(j(a)){let u=0;c&&(u=a.getTextContentSize()),r.set(a.__key,u,"text")}}}}function Gs(n,e,t,r,o){let s=null,i=0,l=null;r!==null?(s=r.__key,j(r)?(i=r.getTextContentSize(),l="text"):w(r)&&(i=r.getChildrenSize(),l="element")):o!==null&&(s=o.__key,j(o)?l="text":w(o)&&(l="element")),s!==null&&l!==null?n.set(s,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function eh(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function iC(n,e,t,r,o,s,i){const l=r.anchorNode,c=r.focusNode,a=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(o.has("collaboration")&&d!==s||d!==null&&rc(d))return;if(!Y(e))return void(n!==null&&oo(t,l,c)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,p=h.key,_=As(t,g),y=As(t,p),m=f.offset,N=h.offset,x=e.format,T=e.style,E=e.isCollapsed();let O=_,S=y,v=!1;if(f.type==="text"){O=ws(_);const ne=f.getNode();v=ne.getFormat()!==x||ne.getStyle()!==T}else Y(n)&&n.anchor.type==="text"&&(v=!0);var M,B,X,te,q;if(h.type==="text"&&(S=ws(y)),O!==null&&S!==null&&(E&&(n===null||v||Y(n)&&(n.format!==x||n.style!==T))&&(M=x,B=T,X=m,te=g,q=performance.now(),Md=[M,B,X,te,q]),a!==m||u!==N||l!==O||c!==S||r.type==="Range"&&E||(d!==null&&s.contains(d)||s.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(O,m,S,N)}catch{}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&s!==null&&s===document.activeElement){const ne=e instanceof Qt&&e.anchor.type==="element"?O.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(ne!==null){let me;if(ne instanceof Text){const Q=document.createRange();Q.selectNode(ne),me=Q.getBoundingClientRect()}else me=ne.getBoundingClientRect();(function(Q,rn,Ao){const ko=Ao.ownerDocument,Po=ko.defaultView;if(Po===null)return;let{top:Cr,bottom:xr}=rn,Tr=0,Er=0,Ve=Ao;for(;Ve!==null;){const En=Ve===ko.body;if(En)Tr=0,Er=Rs(Q).innerHeight;else{const on=Ve.getBoundingClientRect();Tr=on.top,Er=on.bottom}let Ct=0;if(Cr<Tr?Ct=-(Tr-Cr):xr>Er&&(Ct=xr-Er),Ct!==0)if(En)Po.scrollBy(0,Ct);else{const on=Ve.scrollTop;Ve.scrollTop+=Ct;const Sn=Ve.scrollTop-on;Cr-=Sn,xr-=Sn}if(En)break;Ve=ks(Ve)}})(t,me,s)}}Oc=!0}}function lC(n){let e=oe()||Jn();e===null&&(e=He().selectEnd()),e.insertNodes(n)}function cC(){const n=oe();return n===null?"":n.getTextContent()}function $c(n){let e=n;n.isCollapsed()||e.removeText();const t=oe();Y(t)&&(e=t),Y(e)||k(161);const r=e.anchor;let o=r.getNode(),s=r.offset;for(;!Wn(o);)[o,s]=aC(o,s);return s}function aC(n,e){const t=n.getParent();if(!t){const o=wt();return He().append(o),o.select(),[He(),0]}if(j(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,o[0].getIndexWithinParent()+s]}if(!w(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new Qt(rt(n.__key,e,"element"),rt(n.__key,e,"element"),0,""),s=n.insertNewAfter(o);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let xe=null,Te=null,Le=!1,Ic=!1,qs=0;const th={characterData:!0,childList:!0,subtree:!0};function Gn(){return Le||xe!==null&&xe._readOnly}function ke(){Le&&k(13)}function nh(){qs>99&&k(14)}function mt(){return xe===null&&k(195,rh()),xe}function ae(){return Te===null&&k(196,rh()),Te}function rh(){let n=0;const e=new Set,t=Qs.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const s=so(o);if(bs(s))n++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function uC(){return Te}function oh(n,e,t){const r=e.__type,o=function(l,c){const a=l._nodes.get(c);return a===void 0&&k(30,c),a}(n,r);let s=t.get(r);s===void 0&&(s=Array.from(o.transforms),t.set(r,s));const i=s.length;for(let l=0;l<i&&(s[l](e),e.isAttached());l++);}function sh(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function fC(n){return Lc(n,ae()._nodes)}function Lc(n,e){const t=n.type,r=e.get(t);r===void 0&&k(17,t);const o=r.klass;n.type!==o.getType()&&k(18,o.name);const s=o.importJSON(n),i=n.children;if(w(s)&&Array.isArray(i))for(let l=0;l<i.length;l++){const c=Lc(i[l],e);s.append(c)}return s}function ih(n,e,t){const r=xe,o=Le,s=Te;xe=e,Le=!0,Te=n;try{return t()}finally{xe=r,Le=o,Te=s}}function Zt(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const s=n._editorState,i=s._selection,l=t._selection,c=n._dirtyType!==hn,a=xe,u=Le,d=Te,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!o&&c&&h!==null){Te=n,xe=t,Le=!1,n._updating=!0;try{const E=n._dirtyType,O=n._dirtyElements,S=n._dirtyLeaves;h.disconnect(),g=JN(s,t,n,E,O,S)}catch(E){if(E instanceof Error&&n._onError(E),Ic)throw E;return gh(n,null,r,t),Yf(n),n._dirtyType=Kn,Ic=!0,Zt(n,s),void(Ic=!1)}finally{h.observe(r,th),n._updating=f,xe=a,Le=u,Te=d}}t._readOnly||(t._readOnly=!0);const p=n._dirtyLeaves,_=n._dirtyElements,y=n._normalizedNodes,m=n._updateTags,N=n._deferred;c&&(n._dirtyType=hn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(E,O){const S=E._decorators;let v=E._pendingDecorators||S;const M=O._nodeMap;let B;for(B in v)M.has(B)||(v===S&&(v=td(E)),delete v[B])}(n,t);const x=o?null:pt(n._window);if(n._editable&&x!==null&&(c||l===null||l.dirty)){Te=n,xe=t;try{if(h!==null&&h.disconnect(),c||l===null||l.dirty){const E=n._blockCursorElement;E!==null&&hc(E,n,r),iC(i,l,n,x,m,r)}zN(n,r,l),h!==null&&h.observe(r,th)}finally{Te=d,xe=a}}g!==null&&function(E,O,S,v,M){const B=Array.from(E._listeners.mutation),X=B.length;for(let te=0;te<X;te++){const[q,ne]=B[te],me=O.get(ne);me!==void 0&&q(me,{dirtyLeaves:v,prevEditorState:M,updateTags:S})}}(n,g,m,p,s),Y(l)||l===null||i!==null&&i.is(l)||n.dispatchCommand(Cs,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,xo("decorator",n,!0,T)),function(E,O,S){const v=nd(O),M=nd(S);v!==M&&xo("textcontent",E,!0,M)}(n,e||s,t),xo("update",n,!0,{dirtyElements:_,dirtyLeaves:p,editorState:t,normalizedNodes:y,prevEditorState:e||s,tags:m}),function(E,O){if(E._deferred=[],O.length!==0){const S=E._updating;E._updating=!0;try{for(let v=0;v<O.length;v++)O[v]()}finally{E._updating=S}}}(n,N),function(E){const O=E._updates;if(O.length!==0){const S=O.shift();if(S){const[v,M]=S;ah(E,v,M)}}}(n)}function xo(n,e,t,...r){const o=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let i=0;i<s.length;i++)s[i].apply(null,r)}finally{e._updating=o}}function lh(n,e,t){if(n._updating===!1||Te!==n){let o=!1;return n.update(()=>{o=lh(n,e,t)}),o}const r=ic(n);for(let o=4;o>=0;o--)for(let s=0;s<r.length;s++){const i=r[s]._commands.get(e);if(i!==void 0){const l=i[o];if(l!==void 0){const c=Array.from(l),a=c.length;for(let u=0;u<a;u++)if(c[u](t,n)===!0)return!0}}}return!1}function ch(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[s,i]=o;let l,c;if(i!==void 0){if(l=i.onUpdate,c=i.tag,i.skipTransforms&&(r=!0),i.discrete){const a=n._pendingEditorState;a===null&&k(191),a._flushSync=!0}l&&n._deferred.push(l),c&&n._updateTags.add(c)}s()}}return r}function ah(n,e,t){const r=n._updateTags;let o,s,i=!1,l=!1;t!==void 0&&(o=t.onUpdate,s=t.tag,s!=null&&r.add(s),i=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const c=n._editorState;let a=n._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=new Xs(new Map((a||c)._nodeMap)),u=!0),a._flushSync=l;const d=xe,f=Le,h=Te,g=n._updating;xe=a,Le=!1,n._updating=!0,Te=n;try{u&&(n._headless?c._selection!==null&&(a._selection=c._selection.clone()):a._selection=function(m){const N=m.getEditorState()._selection,x=pt(m._window);return Y(N)||N==null?Vs(N,x,m,null):N.clone()}(n));const _=n._compositionKey;e(),i=ch(n,i),function(m,N){const x=N.getEditorState()._selection,T=m._selection;if(Y(T)){const E=T.anchor,O=T.focus;let S;if(E.type==="text"&&(S=E.getNode(),S.selectionTransform(x,T)),O.type==="text"){const v=O.getNode();S!==v&&v.selectionTransform(x,T)}}}(a,n),n._dirtyType!==hn&&(i?function(m,N){const x=N._dirtyLeaves,T=m._nodeMap;for(const E of x){const O=T.get(E);j(O)&&O.isAttached()&&O.isSimpleText()&&!O.isUnmergeable()&&Gf(O)}}(a,n):function(m,N){const x=N._dirtyLeaves,T=N._dirtyElements,E=m._nodeMap,O=Vt(),S=new Map;let v=x,M=v.size,B=T,X=B.size;for(;M>0||X>0;){if(M>0){N._dirtyLeaves=new Set;for(const te of v){const q=E.get(te);j(q)&&q.isAttached()&&q.isSimpleText()&&!q.isUnmergeable()&&Gf(q),q!==void 0&&sh(q,O)&&oh(N,q,S),x.add(te)}if(v=N._dirtyLeaves,M=v.size,M>0){qs++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map;for(const te of B){const q=te[0],ne=te[1];if(q!=="root"&&!ne)continue;const me=E.get(q);me!==void 0&&sh(me,O)&&oh(N,me,S),T.set(q,ne)}v=N._dirtyLeaves,M=v.size,B=N._dirtyElements,X=B.size,qs++}N._dirtyLeaves=x,N._dirtyElements=T}(a,n),ch(n),function(m,N,x,T){const E=m._nodeMap,O=N._nodeMap,S=[];for(const[v]of T){const M=O.get(v);M!==void 0&&(M.isAttached()||(w(M)&&Cd(M,v,E,O,S,T),E.has(v)||T.delete(v),S.push(v)))}for(const v of S)O.delete(v);for(const v of x){const M=O.get(v);M===void 0||M.isAttached()||(E.has(v)||x.delete(v),O.delete(v))}}(c,a,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(a._flushSync=!0);const y=a._selection;if(Y(y)){const m=a._nodeMap,N=y.anchor.key,x=y.focus.key;m.get(N)!==void 0&&m.get(x)!==void 0||k(19)}else Co(y)&&y._nodes.size===0&&(a._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=c,n._dirtyType=Kn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Zt(n)}finally{xe=d,Le=f,Te=h,n._updating=g,qs=0}n._dirtyType!==hn||function(_,y){const m=y.getEditorState()._selection,N=_._selection;if(N!==null){if(N.dirty||!N.is(m))return!0}else if(m!==null)return!0;return!1}(a,n)?a._flushSync?(a._flushSync=!1,Zt(n)):u&&AN(()=>{Zt(n)}):(a._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Ye(n,e,t){n._updating?n._updates.push([e,t]):ah(n,e,t)}class To extends Ws{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return TN[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ae()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(j(t)&&e.push(t),w(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;w(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;w(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return w(s)&&s.getLastDescendant()||s||null}const o=t[e];return w(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Oe(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&k(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Oe(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&k(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,o;if(e<t/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=e;){if(o===e)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=t-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const s=t[o];e+=s.getTextContent(),w(s)&&o!==r-1&&!s.isInline()&&(e+=Ot)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const s=t[o];e+=s.getTextContentSize(),w(s)&&o!==r-1&&!s.isInline()&&(e+=Ot.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=jf[e];return!!(this.getFormat()&t)}return!1}select(e,t){ke();const r=oe();let o=e,s=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const c=this.getFirstChild();if(j(c)||w(c))return c.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const c=this.getLastChild();if(j(c)||w(c))return c.select()}}o===void 0&&(o=i),s===void 0&&(s=i);const l=this.__key;return Y(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,s,"element"),r.dirty=!0,r):Qd(l,o,l,s,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?jf[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const o=r.length,s=this.getChildrenSize(),i=this.getWritable(),l=i.__key,c=[],a=[],u=this.getChildAtIndex(e+t);let d=null,f=s-t+o;if(e!==0)if(e===s)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let p=0;p<t;p++){g===null&&k(100);const _=g.getNextSibling(),y=g.__key;pn(g.getWritable()),a.push(y),g=_}}let h=d;for(let g=0;g<o;g++){const p=r[g];h!==null&&p.is(h)&&(d=h=h.getPreviousSibling());const _=p.getWritable();_.__parent===l&&f--,pn(_);const y=p.__key;if(h===null)i.__first=y,_.__prev=null;else{const m=h.getWritable();m.__next=y,_.__prev=m.__key}p.__key===l&&k(76),_.__parent=l,c.push(y),h=p}if(e+t===s)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const p=h.getWritable();g.__prev=h.__key,p.__next=u.__key}else g.__prev=null}if(i.__size=f,a.length){const g=oe();if(Y(g)){const p=new Set(a),_=new Set(c),{anchor:y,focus:m}=g;uh(y,p,_)&&Gs(y,y.getNode(),this,d,u),uh(m,p,_)&&Gs(m,m.getNode(),this,d,u),f!==0||this.canBeEmpty()||Jt(this)||this.remove()}}return i}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){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,t,r){return!1}canMergeWhenEmpty(){return!1}}function w(n){return n instanceof To}function uh(n,e,t){let r=n.getNode();for(;r;){const o=r.__key;if(e.has(o)&&!t.has(o))return!0;r=r.getParent()}return!1}class fh extends Ws{constructor(e){super(e)}decorate(e,t){k(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ue(n){return n instanceof fh}class qn extends To{static getType(){return"root"}static clone(){return new qn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){k(51)}getTextContent(){const e=this.__cachedText;return!Gn()&&ae()._dirtyType!==hn||e===null?super.getTextContent():e}remove(){k(52)}replace(e){k(53)}insertBefore(e){k(54)}insertAfter(e){k(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];w(r)||ue(r)||k(56)}return super.append(...e)}static importJSON(e){const t=He();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Fe(n){return n instanceof qn}function Fc(){return new Xs(new Map([["root",new qn]]))}function dh(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&k(130,t.name),w(n)){const r=e.children;Array.isArray(r)||k(59,t.name);const o=n.getChildren();for(let s=0;s<o.length;s++){const i=dh(o[s]);r.push(i)}}return e}class Xs{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ih(t&&t.editor||null,this,e)}clone(e){const t=new Xs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return ih(null,this,()=>({root:dh(He())}))}}class hh extends To{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Cn extends To{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ht[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Cn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=uo(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:dC,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&$s(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o);const s=this.getIndent();s>0&&(t.style.textIndent=20*s+"px")}return{element:t}}static importJSON(e){const t=wt();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=wt();r.setTextFormat(e.format),r.setTextStyle(e.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||j(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 dC(n){const e=wt();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function wt(){return fo(new Cn)}function Bc(n){return n instanceof Cn}const hC=0,gC=1,pC=2,_C=3,mC=4;function gh(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=Fc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=hn,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function yC(n){const e=n||{},t=uC(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,i=Fc(),l=e.namespace||(o!==null?o._config.namespace:id()),c=e.editorState,a=[qn,Nn,Hn,Vn,Cn,hh,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<a.length;p++){let _=a[p],y=null,m=null;if(typeof _!="function"){const E=_;_=E.replace,y=E.with,m=E.withKlass||null}const N=_.getType(),x=_.transform(),T=new Set;x!==null&&T.add(x),h.set(N,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:y,replaceWithKlass:m,transforms:T})}}const g=new Qs(i,o,h,{disableEvents:s,namespace:l,theme:r},u||console.error,function(p,_){const y=new Map,m=new Set,N=x=>{Object.keys(x).forEach(T=>{let E=y.get(T);E===void 0&&(E=[],y.set(T,E)),E.push(x[T])})};return p.forEach(x=>{const T=x.klass.importDOM;if(T==null||m.has(T))return;m.add(T);const E=T.call(x.klass);E!==null&&N(E)}),_&&N(_),y}(h,d?d.import:void 0),f);return c!==void 0&&(g._pendingEditorState=c,g._dirtyType=Kn),g}class Qs{constructor(e,t,r,o,s,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=hn,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=id(),this._onError=s,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&k(35);const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=o.get(e);s===void 0&&k(36,String(e));const i=s[r];return i.add(t),()=>{i.delete(t),s.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;s.set(t,o);const i=r&&r.skipInitialization;return i===void 0||i||this.initializeMutationListener(t,o),()=>{s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&k(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=yd(r).get(t.getType());if(!o)return;const s=new Map;for(const i of o.keys())s.set(i,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),o=[r],s=r.replaceWithKlass;if(s!=null){const c=this.registerNodeTransformToKlass(s,t);o.push(c)}var i,l;return i=this,l=e.getType(),Ye(i,()=>{const c=mt();if(c.isEmpty())return;if(l==="root")return void He().markDirty();const a=c._nodeMap;for(const[,u]of a)u.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{o.forEach(c=>c.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=uo(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,gh(this,t,e,o),t!==null&&(this._config.disableEvents||GN(t),r!=null&&t.classList.remove(...r)),e!==null){const s=function(l){const c=l.ownerDocument;return c&&c.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=Kn,Yf(this),this._updateTags.add("history-merge"),Zt(this),this._config.disableEvents||function(l,c){const a=l.ownerDocument,u=zs.get(a);(u===void 0||u<1)&&a.addEventListener("selectionchange",Id),zs.set(a,(u||0)+1),l.__lexicalEditor=c;const d=$d(l);for(let f=0;f<Sc.length;f++){const[h,g]=Sc[f],p=typeof g=="function"?_=>{Fd(_)||(Ld(_),(c.isEditable()||h==="click")&&g(_,c))}:_=>{if(Fd(_))return;Ld(_);const y=c.isEditable();switch(h){case"cut":return y&&I(c,Ul,_);case"copy":return I(c,jl,_);case"paste":return y&&I(c,Bl,_);case"dragstart":return y&&I(c,kf,_);case"dragover":return y&&I(c,Pf,_);case"dragend":return y&&I(c,Rf,_);case"focus":return y&&I(c,$f,_);case"blur":return y&&I(c,If,_);case"drop":return y&&I(c,Af,_)}};l.addEventListener(h,p),d.push(()=>{l.removeEventListener(h,p)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,this._pendingEditorState=null,this._window=null;xo("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&k(38),Hf(this);const r=this._pendingEditorState,o=this._updateTags,s=t!==void 0?t.tag:null;r===null||r.isEmpty()||(s!=null&&o.add(s),Zt(this)),this._pendingEditorState=e,this._dirtyType=Kn,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&o.add(s),Zt(this)}parseEditorState(e,t){return function(r,o,s){const i=Fc(),l=xe,c=Le,a=Te,u=o._dirtyElements,d=o._dirtyLeaves,f=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,xe=i,Le=!1,Te=o;try{const g=o._nodes;Lc(r.root,g),s&&s(),i._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=d,o._cloneNotNeeded=f,o._dirtyType=h,xe=l,Le=c,Te=a}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Zt(this),this.getEditorState().read(e,{editor:this})}update(e,t){Ye(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Ye(this,()=>{const o=oe(),s=He();o!==null?o.dirty=!0:s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=pt(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,xo("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Qs.version="0.17.1+prod.esm";const NC=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:FN,$applyNodeReplacement:fo,$cloneWithProperties:Nd,$copyNode:pd,$createLineBreakNode:Yn,$createNodeSelection:Rc,$createParagraphNode:wt,$createPoint:rt,$createRangeSelection:oC,$createRangeSelectionFromDom:sC,$createTabNode:Hs,$createTextNode:ve,$getAdjacentNode:uc,$getCharacterOffsets:Pc,$getEditor:UN,$getNearestNodeFromDOMNode:io,$getNearestRootOrShadowRoot:gd,$getNodeByKey:Oe,$getNodeByKeyOrThrow:KN,$getPreviousSelection:Jn,$getRoot:He,$getSelection:oe,$getTextContent:cC,$hasAncestor:Ps,$hasUpdateTag:LN,$insertNodes:lC,$isBlockElementNode:rC,$isDecoratorNode:ue,$isElementNode:w,$isInlineElementOrDecoratorNode:BN,$isLeafNode:PN,$isLineBreakNode:yn,$isNodeSelection:Co,$isParagraphNode:Bc,$isRangeSelection:Y,$isRootNode:Fe,$isRootOrShadowRoot:Jt,$isTabNode:Ud,$isTextNode:j,$isTokenOrSegmented:gn,$nodesOfType:IN,$normalizeSelection__EXPERIMENTAL:qf,$parseSerializedNode:fC,$selectAll:$N,$setCompositionKey:Ce,$setSelection:gt,$splitNode:WN,ArtificialNode__DO_NOT_USE:hh,BLUR_COMMAND:If,CAN_REDO_COMMAND:sN,CAN_UNDO_COMMAND:iN,CLEAR_EDITOR_COMMAND:rN,CLEAR_HISTORY_COMMAND:oN,CLICK_COMMAND:yf,COMMAND_PRIORITY_CRITICAL:mC,COMMAND_PRIORITY_EDITOR:hC,COMMAND_PRIORITY_HIGH:_C,COMMAND_PRIORITY_LOW:gC,COMMAND_PRIORITY_NORMAL:pC,CONTROLLED_TEXT_INSERTION_COMMAND:Bn,COPY_COMMAND:jl,CUT_COMMAND:Ul,DELETE_CHARACTER_COMMAND:Xr,DELETE_LINE_COMMAND:eo,DELETE_WORD_COMMAND:Zr,DRAGEND_COMMAND:Rf,DRAGOVER_COMMAND:Pf,DRAGSTART_COMMAND:kf,DROP_COMMAND:Af,DecoratorNode:fh,ElementNode:To,FOCUS_COMMAND:$f,FORMAT_ELEMENT_COMMAND:nN,FORMAT_TEXT_COMMAND:Ut,INDENT_CONTENT_COMMAND:eN,INSERT_LINE_BREAK_COMMAND:Qr,INSERT_PARAGRAPH_COMMAND:Fl,INSERT_TAB_COMMAND:Zy,IS_ALL_FORMATTING:Kf,IS_BOLD:hN,IS_CODE:pN,IS_HIGHLIGHT:Ss,IS_ITALIC:gN,IS_STRIKETHROUGH:no,IS_SUBSCRIPT:_N,IS_SUPERSCRIPT:mN,IS_UNDERLINE:ro,KEY_ARROW_DOWN_COMMAND:Of,KEY_ARROW_LEFT_COMMAND:Tf,KEY_ARROW_RIGHT_COMMAND:Cf,KEY_ARROW_UP_COMMAND:Sf,KEY_BACKSPACE_COMMAND:bf,KEY_DELETE_COMMAND:Df,KEY_DOWN_COMMAND:Nf,KEY_ENTER_COMMAND:xs,KEY_ESCAPE_COMMAND:wf,KEY_MODIFIER_COMMAND:Lf,KEY_SPACE_COMMAND:vf,KEY_TAB_COMMAND:Mf,LineBreakNode:Hn,MOVE_TO_END:xf,MOVE_TO_START:Ef,OUTDENT_CONTENT_COMMAND:tN,PASTE_COMMAND:Bl,ParagraphNode:Cn,REDO_COMMAND:Wl,REMOVE_TEXT_COMMAND:Kl,RootNode:qn,SELECTION_CHANGE_COMMAND:Cs,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:Qy,SELECT_ALL_COMMAND:Hl,TEXT_TYPE_TO_FORMAT:ht,TabNode:Vn,TextNode:Nn,UNDO_COMMAND:zl,createCommand:Xy,createEditor:yC,getEditorPropertyFromDOMNode:so,getNearestEditorFromDOMNode:oc,isBlockDomNode:gc,isCurrentlyReadOnlyMode:Gn,isHTMLAnchorElement:jN,isHTMLElement:$s,isInlineDomNode:_d,isLexicalEditor:bs,isSelectionCapturedInDecoratorInput:rc,isSelectionWithinEditor:oo,resetRandomKey:MN},Symbol.toStringTag,{value:"Module"})),A=process.env.NODE_ENV==="development"?qy:NC,Zs=A.$applyNodeReplacement,en=A.$cloneWithProperties,ei=A.$createLineBreakNode,Pe=A.$createParagraphNode,ph=A.$createRangeSelection,ti=A.$createTabNode,Xn=A.$createTextNode,Qn=A.$getAdjacentNode,_h=A.$getCharacterOffsets,mh=A.$getEditor,Zn=A.$getNearestNodeFromDOMNode,yh=A.$getNodeByKey,er=A.$getPreviousSelection,de=A.$getRoot,L=A.$getSelection,Nh=A.$hasAncestor,Ch=A.$insertNodes,tr=A.$isBlockElementNode,Be=A.$isDecoratorNode,K=A.$isElementNode,xh=A.$isLeafNode,Th=A.$isLineBreakNode,Ke=A.$isNodeSelection,Eh=A.$isParagraphNode,P=A.$isRangeSelection,tn=A.$isRootNode,ze=A.$isRootOrShadowRoot,F=A.$isTextNode,nr=A.$isTokenOrSegmented,Sh=A.$normalizeSelection__EXPERIMENTAL,Oh=A.$parseSerializedNode,vh=A.$selectAll,rr=A.$setSelection,ni=A.$splitNode,ri=A.ArtificialNode__DO_NOT_USE,Dt=A.CAN_REDO_COMMAND,Mt=A.CAN_UNDO_COMMAND,bh=A.CLEAR_EDITOR_COMMAND,wh=A.CLEAR_HISTORY_COMMAND,Dh=A.CLICK_COMMAND,Mh=A.COMMAND_PRIORITY_CRITICAL,z=A.COMMAND_PRIORITY_EDITOR,Ah=A.CONTROLLED_TEXT_INSERTION_COMMAND,oi=A.COPY_COMMAND,kh=A.CUT_COMMAND,or=A.DELETE_CHARACTER_COMMAND,Ph=A.DELETE_LINE_COMMAND,Rh=A.DELETE_WORD_COMMAND,$h=A.DRAGOVER_COMMAND,Ih=A.DRAGSTART_COMMAND,Lh=A.DROP_COMMAND,si=A.ElementNode,sr=A.FORMAT_ELEMENT_COMMAND,ir=A.FORMAT_TEXT_COMMAND,Fh=A.INDENT_CONTENT_COMMAND,ii=A.INSERT_LINE_BREAK_COMMAND,li=A.INSERT_PARAGRAPH_COMMAND,Bh=A.INSERT_TAB_COMMAND,Kh=A.KEY_ARROW_DOWN_COMMAND,zh=A.KEY_ARROW_LEFT_COMMAND,Wh=A.KEY_ARROW_RIGHT_COMMAND,jh=A.KEY_ARROW_UP_COMMAND,Uh=A.KEY_BACKSPACE_COMMAND,Hh=A.KEY_DELETE_COMMAND,Yh=A.KEY_ENTER_COMMAND,Vh=A.KEY_ESCAPE_COMMAND,ci=A.OUTDENT_CONTENT_COMMAND,Jh=A.PASTE_COMMAND,Kc=A.REDO_COMMAND,Gh=A.REMOVE_TEXT_COMMAND,CC=A.SELECTION_CHANGE_COMMAND,qh=A.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Xh=A.SELECT_ALL_COMMAND,lr=A.TextNode,zc=A.UNDO_COMMAND,Qh=A.createCommand,xC=A.createEditor,Zh=A.isBlockDomNode,eg=A.isHTMLAnchorElement,tg=A.isHTMLElement,cr=A.isInlineDomNode,ng=A.isSelectionCapturedInDecoratorInput,rg=A.isSelectionWithinEditor;function TC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var EC=TC(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const og=V.createContext(null);function SC(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function xn(){const n=V.useContext(og);return n==null&&EC(8),n}const sg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,OC=sg?V.useLayoutEffect:V.useEffect,ai={tag:"history-merge"};function vC({initialConfig:n,children:e}){const t=V.useMemo(()=>{const{theme:r,namespace:o,nodes:s,onError:i,editorState:l,html:c}=n,a=SC(null,r),u=xC({editable:n.editable,html:c,namespace:o,nodes:s,onError:d=>i(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=de();if(h.isEmpty()){const g=Pe();h.append(g);const p=sg?document.activeElement:null;(L()!==null||p!==null&&p===d.getRootElement())&&g.select()}},ai);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,ai);break}case"object":d.setEditorState(f,ai);break;case"function":d.update(()=>{de().isEmpty()&&f(d)},ai)}}}(u,l),[u,a]},[]);return OC(()=>{const r=n.editable,[o]=t;o.setEditable(r===void 0||r)},[]),U.exports.jsx(og.Provider,{value:t,children:e})}function bC({defaultSelection:n}){const[e]=xn();return V.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ig(){return de().getTextContent()}function Wc(n,e=!0){if(n)return!1;let t=ig();return e&&(t=t.trim()),t===""}function wC(n,e){return()=>Wc(n,e)}function lg(n){if(!Wc(n,!1))return!1;const t=de().getChildren(),r=t.length;if(r>1)return!1;for(let o=0;o<r;o++){const s=t[o];if(Be(s))return!1;if(K(s)){if(!Eh(s)||s.__indent!==0)return!1;const i=s.getChildren(),l=i.length;for(let c=0;c<l;c++){const a=i[o];if(!F(a))return!1}}}return!0}function DC(n){return()=>lg(n)}function MC(n,e){let t=n.getFirstChild(),r=0;e:for(;t!==null;){if(K(t)){const i=t.getFirstChild();if(i!==null){t=i;continue}}else if(F(t)){const i=t.getTextContentSize();if(r+i>e)return{node:t,offset:e-r};r+=i}const o=t.getNextSibling();if(o!==null){t=o;continue}let s=t.getParent();for(;s!==null;){const i=s.getNextSibling();if(i!==null){t=i;continue e}s=s.getParent()}break}return null}function AC(n,e,t,r){const o=d=>d instanceof t,s=d=>{const f=Xn(d.getTextContent());f.setFormat(d.getFormat()),d.replace(f)},i=d=>d.getLatest().__mode,l=d=>{if(!d.isSimpleText())return;let f=d.getPreviousSibling(),h=d.getTextContent(),g=d,p;if(F(f)){const y=f.getTextContent(),m=y+h,N=e(m);if(o(f))if(N===null||i(f)!==0){s(f);return}else{const x=N.end-y.length;if(x>0){const T=h.slice(0,x),E=y+T;if(f.select(),f.setTextContent(E),x===h.length)d.remove();else{const O=h.slice(x);d.setTextContent(O)}return}}else if(N===null||N.start<y.length)return}let _=0;for(;;){p=e(h);let y=p===null?"":h.slice(p.end);if(h=y,y===""){const x=g.getNextSibling();if(F(x)){y=g.getTextContent()+x.getTextContent();const T=e(y);if(T===null){o(x)?s(x):x.markDirty();return}else if(T.start!==0)return}}if(p===null)return;if(p.start===0&&F(f)&&f.isTextEntity()){_+=p.end;continue}let m;if(p.start===0?[m,g]=g.splitText(p.end):[,m,g]=g.splitText(p.start+_,p.end+_),m===void 0)throw Error("nodeToReplace should not be undefined. You may want to check splitOffsets passed to the splitText.");const N=r(m);if(N.setFormat(m.getFormat()),m.replace(N),g==null)return;_=0,f=N}},c=d=>{const f=d.getTextContent(),h=e(f);if(h===null||h.start!==0){s(d);return}if(f.length>h.end){d.splitText(h.end);return}const g=d.getPreviousSibling();F(g)&&g.isTextEntity()&&(s(g),s(d));const p=d.getNextSibling();F(p)&&p.isTextEntity()&&(s(p),o(d)&&s(d))},a=n.registerNodeTransform(lr,l),u=n.registerNodeTransform(t,c);return[a,u]}const kC=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:lg,$canShowPlaceholderCurry:DC,$findTextIntersectionFromCharacters:MC,$isRootTextContentEmpty:Wc,$isRootTextContentEmptyCurry:wC,$rootTextContent:ig,registerLexicalTextEntity:AC},Symbol.toStringTag,{value:"Module"}));function cg(){return de().getTextContent()}function jc(n,e=!0){if(n)return!1;let t=cg();return e&&(t=t.trim()),t===""}function PC(n,e){return()=>jc(n,e)}function ag(n){if(!jc(n,!1))return!1;const e=de().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const o=e[r];if(Be(o))return!1;if(K(o)){if(!Eh(o)||o.__indent!==0)return!1;const s=o.getChildren(),i=s.length;for(let l=0;l<i;l++){const c=s[r];if(!F(c))return!1}}}return!0}function RC(n){return()=>ag(n)}function $C(n,e){let t=n.getFirstChild(),r=0;e:for(;t!==null;){if(K(t)){const i=t.getFirstChild();if(i!==null){t=i;continue}}else if(F(t)){const i=t.getTextContentSize();if(r+i>e)return{node:t,offset:e-r};r+=i}const o=t.getNextSibling();if(o!==null){t=o;continue}let s=t.getParent();for(;s!==null;){const i=s.getNextSibling();if(i!==null){t=i;continue e}s=s.getParent()}break}return null}function IC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var LC=IC(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function FC(n,e,t,r){const o=i=>i instanceof t,s=i=>{const l=Xn(i.getTextContent());l.setFormat(i.getFormat()),i.replace(l)};return[n.registerNodeTransform(lr,i=>{if(!i.isSimpleText())return;let l,c=i.getPreviousSibling(),a=i.getTextContent(),u=i;if(F(c)){const f=c.getTextContent(),h=e(f+a);if(o(c)){if(h===null||(g=>g.getLatest().__mode)(c)!==0)return void s(c);{const g=h.end-f.length;if(g>0){const p=f+a.slice(0,g);if(c.select(),c.setTextContent(p),g===a.length)i.remove();else{const _=a.slice(g);i.setTextContent(_)}return}}}else if(h===null||h.start<f.length)return}let d=0;for(;;){l=e(a);let f,h=l===null?"":a.slice(l.end);if(a=h,h===""){const p=u.getNextSibling();if(F(p)){h=u.getTextContent()+p.getTextContent();const _=e(h);if(_===null)return void(o(p)?s(p):p.markDirty());if(_.start!==0)return}}if(l===null)return;if(l.start===0&&F(c)&&c.isTextEntity()){d+=l.end;continue}l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start+d,l.end+d),f===void 0&&LC(165,"nodeToReplace");const g=r(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;d=0,c=g}}),n.registerNodeTransform(t,i=>{const l=i.getTextContent(),c=e(l);if(c===null||c.start!==0)return void s(i);if(l.length>c.end)return void i.splitText(c.end);const a=i.getPreviousSibling();F(a)&&a.isTextEntity()&&(s(a),s(i));const u=i.getNextSibling();F(u)&&u.isTextEntity()&&(s(u),o(i)&&s(i))})]}const BC=Object.freeze(Object.defineProperty({__proto__:null,$canShowPlaceholder:ag,$canShowPlaceholderCurry:RC,$findTextIntersectionFromCharacters:$C,$isRootTextContentEmpty:jc,$isRootTextContentEmptyCurry:PC,$rootTextContent:cg,registerLexicalTextEntity:FC},Symbol.toStringTag,{value:"Module"})),ug=(process.env.NODE_ENV==="development"?kC:BC).$canShowPlaceholderCurry,ui=new Map;function fg(n){let e=n;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function dg(n){const e=n.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(n)]}function KC(n,e,t,r,o){const s=e.getKey(),i=r.getKey(),l=document.createRange();let c=n.getElementByKey(s),a=n.getElementByKey(i),u=t,d=o;if(F(e)&&(c=fg(c)),F(r)&&(a=fg(a)),e===void 0||r===void 0||c===null||a===null)return null;c.nodeName==="BR"&&([c,u]=dg(c)),a.nodeName==="BR"&&([a,d]=dg(a));const f=c.firstChild;c===a&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{l.setStart(c,u),l.setEnd(a,d)}catch{return null}return l.collapsed&&(u!==d||s!==i)&&(l.setStart(a,d),l.setEnd(c,u)),l}function zC(n,e){const t=n.getRootElement();if(t===null)return[];const r=t.getBoundingClientRect(),o=getComputedStyle(t),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(e.getClientRects());let l=i.length;i.sort((a,u)=>{const d=a.top-u.top;return Math.abs(d)<=3?a.left-u.left:d});let c;for(let a=0;a<l;a++){const u=i[a],d=c&&c.top<=u.top&&c.top+c.height>u.top&&c.left+c.width>u.left,f=u.width+s===r.width;if(d||f){i.splice(a--,1),l--;continue}c=u}return i}function hg(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,s]=r.split(/:([^]+)/);o&&s&&(e[o.trim()]=s.trim())}return e}function fi(n){let e=ui.get(n);return e===void 0&&(e=hg(n),ui.set(n,e)),Object.freeze(e),e}function WC(n){let e="";for(const t in n)t&&(e+=`${t}: ${n[t]};`);return e}function jC(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,s=n.isBackward(),i=r.getNode(),l=o.getNode(),c=e.is(i),a=e.is(l);if(c||a){const[u,d]=_h(n),f=i.is(l),h=e.is(s?l:i),g=e.is(s?i:l);let p=0,_;if(f)p=u>d?d:u,_=u>d?u:d;else if(h)p=s?d:u,_=void 0;else if(g){const y=s?u:d;p=0,_=y}return e.__text=e.__text.slice(p,_),e}}return e}function UC(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();if(!K(e))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return n.offset===e.getChildrenSize()}function gg(n,e,t){let r=e.getNode(),o=t;if(K(r)){const s=r.getDescendantByIndex(e.offset);s!==null&&(r=s)}for(;o>0&&r!==null;){if(K(r)){const a=r.getLastDescendant();a!==null&&(r=a)}let s=r.getPreviousSibling(),i=0;if(s===null){let a=r.getParentOrThrow(),u=a.getPreviousSibling();for(;u===null;){if(a=a.getParent(),a===null){s=null;break}u=a.getPreviousSibling()}a!==null&&(i=a.isInline()?0:2,s=u)}let l=r.getTextContent();l===""&&K(r)&&!r.isInline()&&(l=`
32
-
33
- `);const c=l.length;if(!F(r)||o>=c){const a=r.getParent();r.remove(),a!=null&&a.getChildrenSize()===0&&!tn(a)&&a.remove(),o-=c+i,r=s}else{const a=r.getKey(),u=n.getEditorState().read(()=>{const h=yh(a);return F(h)&&h.isSimpleText()?h.getTextContent():null}),d=c-o,f=l.slice(0,d);if(u!==null&&u!==l){const h=er();let g=r;if(r.isSimpleText())r.setTextContent(u);else{const p=Xn(u);r.replace(p),g=p}if(P(h)&&h.isCollapsed()){const p=h.anchor.offset;g.select(p,p)}}else if(r.isSimpleText()){const h=e.key===a;let g=e.offset;g<o&&(g=c);const p=h?g-o:0,_=h?g:d;if(h&&p===0){const[y]=r.splitText(p,_);y.remove()}else{const[,y]=r.splitText(p,_);y.remove()}}else{const h=Xn(f);r.replace(h)}o=0}}}function HC(n){const e=n.getStyle(),t=hg(e);ui.set(e,t)}function ar(n,e){const t=fi("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((s,[i,l])=>(typeof l=="function"?s[i]=l(t[i],n):l===null?delete s[i]:s[i]=l,s),{...t}),o=WC(r);n.setStyle(o),ui.set(o,r)}function YC(n,e){const t=n.getNodes(),r=t.length,o=n.getStartEndPoints();if(o===null)return;const[s,i]=o,l=r-1;let c=t[0],a=t[l];if(n.isCollapsed()&&P(n)){ar(n,e);return}const d=c.getTextContent().length,f=i.offset;let h=s.offset;const g=s.isBefore(i);let p=g?h:f,_=g?f:h;const y=g?s.type:i.type,m=g?i.type:s.type,N=g?i.key:s.key;if(F(c)&&p===d){const x=c.getNextSibling();F(x)&&(h=0,p=0,c=x)}if(t.length===1){if(F(c)&&c.canHaveFormat()){if(p=y==="element"?0:h>f?f:h,_=m==="element"?d:h>f?h:f,p===_)return;if(nr(c)||p===0&&_===d)ar(c,e),c.select(p,_);else{const x=c.splitText(p,_),T=p===0?x[0]:x[1];ar(T,e),T.select(0,_-p)}}}else{if(F(c)&&p<c.getTextContentSize()&&c.canHaveFormat()&&(p!==0&&!nr(c)&&(c=c.splitText(p)[1],p=0,g?s.set(c.getKey(),p,"text"):i.set(c.getKey(),p,"text")),ar(c,e)),F(a)&&a.canHaveFormat()){const T=a.getTextContent().length;a.__key!==N&&_!==0&&(_=T),_!==T&&!nr(a)&&([a]=a.splitText(_)),(_!==0||m==="element")&&ar(a,e)}for(let x=1;x<l;x++){const T=t[x],E=T.getKey();F(T)&&T.canHaveFormat()&&E!==c.getKey()&&E!==a.getKey()&&!T.isToken()&&ar(T,e)}}}function VC(n,e){if(n===null)return;const t=n.getStartEndPoints(),r=t?t[0]:null;if(r!==null&&r.key==="root"){const i=e(),l=de(),c=l.getFirstChild();c?c.replace(i,!0):l.append(i);return}const o=n.getNodes(),s=r!==null?tx(r.getNode(),yg):!1;s&&o.indexOf(s)===-1&&o.push(s);for(let i=0;i<o.length;i++){const l=o[i];if(!yg(l))continue;if(!K(l))throw Error("Expected block node to be an ElementNode");const c=e();c.setFormat(l.getFormatType()),c.setIndent(l.getIndent()),l.replace(c,!0)}}function pg(n){return n.getNode().isAttached()}function JC(n){let e=n;for(;e!==null&&!ze(e);){const t=e.getLatest(),r=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=r}}function GC(n,e,t=null){const r=n.getStartEndPoints(),o=r?r[0]:null,s=n.getNodes(),i=s.length;if(o!==null&&(i===0||i===1&&o.type==="element"&&o.getNode().getChildrenSize()===0)){const a=o.type==="text"?o.getNode().getParentOrThrow():o.getNode(),u=a.getChildren();let d=e();d.setFormat(a.getFormatType()),d.setIndent(a.getIndent()),u.forEach(f=>d.append(f)),t&&(d=t.append(d)),a.replace(d);return}let l=null,c=[];for(let a=0;a<i;a++){const u=s[a];ze(u)?(Uc(n,c,c.length,e,t),c=[],l=u):l===null||l!==null&&Nh(u,l)?c.push(u):(Uc(n,c,c.length,e,t),c=[u])}Uc(n,c,c.length,e,t)}function Uc(n,e,t,r,o=null){if(e.length===0)return;const s=e[0],i=new Map,l=[];let c=K(s)?s:s.getParentOrThrow();c.isInline()&&(c=c.getParentOrThrow());let a=!1;for(;c!==null;){const g=c.getPreviousSibling();if(g!==null){c=g,a=!0;break}if(c=c.getParentOrThrow(),ze(c))break}const u=new Set;for(let g=0;g<t;g++){const p=e[g];K(p)&&p.getChildrenSize()===0&&u.add(p.getKey())}const d=new Set;for(let g=0;g<t;g++){const p=e[g];let _=p.getParent();if(_!==null&&_.isInline()&&(_=_.getParent()),_!==null&&xh(p)&&!d.has(p.getKey())){const y=_.getKey();if(i.get(y)===void 0){const m=r();m.setFormat(_.getFormatType()),m.setIndent(_.getIndent()),l.push(m),i.set(y,m),_.getChildren().forEach(N=>{m.append(N),d.add(N.getKey()),K(N)&&N.getChildrenKeys().forEach(x=>d.add(x))}),JC(_)}}else if(u.has(p.getKey())){if(!K(p))throw Error("Expected node in emptyElements to be an ElementNode");const y=r();y.setFormat(p.getFormatType()),y.setIndent(p.getIndent()),l.push(y),p.remove(!0)}}if(o!==null)for(let g=0;g<l.length;g++){const p=l[g];o.append(p)}let f=null;if(ze(c))if(a)if(o!==null)c.insertAfter(o);else for(let g=l.length-1;g>=0;g--){const p=l[g];c.insertAfter(p)}else{const g=c.getFirstChild();if(K(g)&&(c=g),g===null)if(o)c.append(o);else for(let p=0;p<l.length;p++){const _=l[p];c.append(_),f=_}else if(o!==null)g.insertBefore(o);else for(let p=0;p<l.length;p++){const _=l[p];g.insertBefore(_),f=_}}else if(o)c.insertAfter(o);else for(let g=l.length-1;g>=0;g--){const p=l[g];c.insertAfter(p),f=p}const h=er();P(h)&&pg(h.anchor)&&pg(h.focus)?rr(h.clone()):f!==null?f.selectEnd():n.dirty=!0}function qC(n,e){const t=Qn(n.focus,e);return Be(t)&&!t.isIsolated()||K(t)&&!t.isInline()&&!t.canBeEmpty()}function _g(n,e,t,r){n.modify(e?"extend":"move",t,r)}function mg(n){const e=n.anchor.getNode();return(tn(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function XC(n,e,t){const r=mg(n);_g(n,e,t?!r:r,"character")}function QC(n){const e=n.anchor,t=n.focus,s=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();let i=s.getFirstDescendant(),l=s.getLastDescendant(),c="element",a="element",u=0;F(i)?c="text":!K(i)&&i!==null&&(i=i.getParentOrThrow()),F(l)?(a="text",u=l.getTextContentSize()):!K(l)&&l!==null&&(l=l.getParentOrThrow()),i&&l&&(e.set(i.getKey(),0,c),t.set(l.getKey(),u,a))}function ZC(n,e,t){const r=n.getStyle(),o=fi(r);return o!==null&&o[e]||t}function ex(n,e,t=""){let r=null;const o=n.getNodes(),s=n.anchor,i=n.focus,l=n.isBackward(),c=l?i.offset:s.offset,a=l?i.getNode():s.getNode();if(P(n)&&n.isCollapsed()&&n.style!==""){const u=n.style,d=fi(u);if(d!==null&&e in d)return d[e]}for(let u=0;u<o.length;u++){const d=o[u];if(!(u!==0&&c===0&&d.is(a))&&F(d)){const f=ZC(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function yg(n){if(Be(n)||!K(n)||ze(n))return!1;const e=n.getFirstChild(),t=e===null||Th(e)||F(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function tx(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}const nx=Object.freeze(Object.defineProperty({__proto__:null,$addNodeStyle:HC,$getSelectionStyleValueForProperty:ex,$isAtNodeEnd:UC,$isParentElementRTL:mg,$moveCaretSelection:_g,$moveCharacter:XC,$patchStyleText:YC,$selectAll:QC,$setBlocksType:VC,$shouldOverrideDefaultCharacterSelection:qC,$sliceSelectedTextNodeContent:jC,$trimTextContentFromAnchor:gg,$wrapNodes:GC,createDOMRange:KC,createRectsFromDOMRange:zC,getStyleObjectFromCSS:fi,trimTextContentFromAnchor:gg,$cloneWithProperties:en},Symbol.toStringTag,{value:"Module"}));function rx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hc=rx(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const di=new Map;function Ng(n){let e=n;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function Cg(n){const e=n.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(n)]}function ox(n,e,t,r,o){const s=e.getKey(),i=r.getKey(),l=document.createRange();let c=n.getElementByKey(s),a=n.getElementByKey(i),u=t,d=o;if(F(e)&&(c=Ng(c)),F(r)&&(a=Ng(a)),e===void 0||r===void 0||c===null||a===null)return null;c.nodeName==="BR"&&([c,u]=Cg(c)),a.nodeName==="BR"&&([a,d]=Cg(a));const f=c.firstChild;c===a&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{l.setStart(c,u),l.setEnd(a,d)}catch{return null}return!l.collapsed||u===d&&s===i||(l.setStart(a,d),l.setEnd(c,u)),l}function sx(n,e){const t=n.getRootElement();if(t===null)return[];const r=t.getBoundingClientRect(),o=getComputedStyle(t),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=Array.from(e.getClientRects());let l,c=i.length;i.sort((a,u)=>{const d=a.top-u.top;return Math.abs(d)<=3?a.left-u.left:d});for(let a=0;a<c;a++){const u=i[a],d=l&&l.top<=u.top&&l.top+l.height>u.top&&l.left+l.width>u.left,f=u.width+s===r.width;d||f?(i.splice(a--,1),c--):l=u}return i}function xg(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,s]=r.split(/:([^]+)/);o&&s&&(e[o.trim()]=s.trim())}return e}function hi(n){let e=di.get(n);return e===void 0&&(e=xg(n),di.set(n,e)),e}function ix(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,s=n.isBackward(),i=r.getNode(),l=o.getNode(),c=e.is(i),a=e.is(l);if(c||a){const[u,d]=_h(n),f=i.is(l),h=e.is(s?l:i),g=e.is(s?i:l);let p,_=0;return f?(_=u>d?d:u,p=u>d?u:d):h?(_=s?d:u,p=void 0):g&&(_=0,p=s?u:d),e.__text=e.__text.slice(_,p),e}}return e}function lx(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return K(e)||Hc(177),n.offset===e.getChildrenSize()}function Tg(n,e,t){let r=e.getNode(),o=t;if(K(r)){const s=r.getDescendantByIndex(e.offset);s!==null&&(r=s)}for(;o>0&&r!==null;){if(K(r)){const a=r.getLastDescendant();a!==null&&(r=a)}let s=r.getPreviousSibling(),i=0;if(s===null){let a=r.getParentOrThrow(),u=a.getPreviousSibling();for(;u===null;){if(a=a.getParent(),a===null){s=null;break}u=a.getPreviousSibling()}a!==null&&(i=a.isInline()?0:2,s=u)}let l=r.getTextContent();l===""&&K(r)&&!r.isInline()&&(l=`
34
-
35
- `);const c=l.length;if(!F(r)||o>=c){const a=r.getParent();r.remove(),a==null||a.getChildrenSize()!==0||tn(a)||a.remove(),o-=c+i,r=s}else{const a=r.getKey(),u=n.getEditorState().read(()=>{const h=yh(a);return F(h)&&h.isSimpleText()?h.getTextContent():null}),d=c-o,f=l.slice(0,d);if(u!==null&&u!==l){const h=er();let g=r;if(r.isSimpleText())r.setTextContent(u);else{const p=Xn(u);r.replace(p),g=p}if(P(h)&&h.isCollapsed()){const p=h.anchor.offset;g.select(p,p)}}else if(r.isSimpleText()){const h=e.key===a;let g=e.offset;g<o&&(g=c);const p=h?g-o:0,_=h?g:d;if(h&&p===0){const[y]=r.splitText(p,_);y.remove()}else{const[,y]=r.splitText(p,_);y.remove()}}else{const h=Xn(f);r.replace(h)}o=0}}}function cx(n){const e=n.getStyle(),t=xg(e);di.set(e,t)}function ur(n,e){const t=hi("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((s,[i,l])=>(typeof l=="function"?s[i]=l(t[i],n):l===null?delete s[i]:s[i]=l,s),{...t}),o=function(s){let i="";for(const l in s)l&&(i+=`${l}: ${s[l]};`);return i}(r);n.setStyle(o),di.set(o,r)}function ax(n,e){const t=n.getNodes(),r=t.length,o=n.getStartEndPoints();if(o===null)return;const[s,i]=o,l=r-1;let c=t[0],a=t[l];if(n.isCollapsed()&&P(n))return void ur(n,e);const u=c.getTextContent().length,d=i.offset;let f=s.offset;const h=s.isBefore(i);let g=h?f:d,p=h?d:f;const _=h?s.type:i.type,y=h?i.type:s.type,m=h?i.key:s.key;if(F(c)&&g===u){const N=c.getNextSibling();F(N)&&(f=0,g=0,c=N)}if(t.length===1){if(F(c)&&c.canHaveFormat()){if(g=_==="element"?0:f>d?d:f,p=y==="element"?u:f>d?f:d,g===p)return;if(nr(c)||g===0&&p===u)ur(c,e),c.select(g,p);else{const N=c.splitText(g,p),x=g===0?N[0]:N[1];ur(x,e),x.select(0,p-g)}}}else{if(F(c)&&g<c.getTextContentSize()&&c.canHaveFormat()&&(g===0||nr(c)||(c=c.splitText(g)[1],g=0,h?s.set(c.getKey(),g,"text"):i.set(c.getKey(),g,"text")),ur(c,e)),F(a)&&a.canHaveFormat()){const N=a.getTextContent().length;a.__key!==m&&p!==0&&(p=N),p===N||nr(a)||([a]=a.splitText(p)),p===0&&y!=="element"||ur(a,e)}for(let N=1;N<l;N++){const x=t[N],T=x.getKey();F(x)&&x.canHaveFormat()&&T!==c.getKey()&&T!==a.getKey()&&!x.isToken()&&ur(x,e)}}}function ux(n,e){if(n===null)return;const t=n.getStartEndPoints(),r=t?t[0]:null;if(r!==null&&r.key==="root"){const i=e(),l=de(),c=l.getFirstChild();return void(c?c.replace(i,!0):l.append(i))}const o=n.getNodes(),s=r!==null&&function(i,l){let c=i;for(;c!==null&&c.getParent()!==null&&!l(c);)c=c.getParentOrThrow();return l(c)?c:null}(r.getNode(),vg);s&&o.indexOf(s)===-1&&o.push(s);for(let i=0;i<o.length;i++){const l=o[i];if(!vg(l))continue;K(l)||Hc(178);const c=e();c.setFormat(l.getFormatType()),c.setIndent(l.getIndent()),l.replace(c,!0)}}function Eg(n){return n.getNode().isAttached()}function fx(n){let e=n;for(;e!==null&&!ze(e);){const t=e.getLatest(),r=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=r}}function dx(n,e,t=null){const r=n.getStartEndPoints(),o=r?r[0]:null,s=n.getNodes(),i=s.length;if(o!==null&&(i===0||i===1&&o.type==="element"&&o.getNode().getChildrenSize()===0)){const a=o.type==="text"?o.getNode().getParentOrThrow():o.getNode(),u=a.getChildren();let d=e();return d.setFormat(a.getFormatType()),d.setIndent(a.getIndent()),u.forEach(f=>d.append(f)),t&&(d=t.append(d)),void a.replace(d)}let l=null,c=[];for(let a=0;a<i;a++){const u=s[a];ze(u)?(Yc(n,c,c.length,e,t),c=[],l=u):l===null||l!==null&&Nh(u,l)?c.push(u):(Yc(n,c,c.length,e,t),c=[u])}Yc(n,c,c.length,e,t)}function Yc(n,e,t,r,o=null){if(e.length===0)return;const s=e[0],i=new Map,l=[];let c=K(s)?s:s.getParentOrThrow();c.isInline()&&(c=c.getParentOrThrow());let a=!1;for(;c!==null;){const g=c.getPreviousSibling();if(g!==null){c=g,a=!0;break}if(c=c.getParentOrThrow(),ze(c))break}const u=new Set;for(let g=0;g<t;g++){const p=e[g];K(p)&&p.getChildrenSize()===0&&u.add(p.getKey())}const d=new Set;for(let g=0;g<t;g++){const p=e[g];let _=p.getParent();if(_!==null&&_.isInline()&&(_=_.getParent()),_!==null&&xh(p)&&!d.has(p.getKey())){const y=_.getKey();if(i.get(y)===void 0){const m=r();m.setFormat(_.getFormatType()),m.setIndent(_.getIndent()),l.push(m),i.set(y,m),_.getChildren().forEach(N=>{m.append(N),d.add(N.getKey()),K(N)&&N.getChildrenKeys().forEach(x=>d.add(x))}),fx(_)}}else if(u.has(p.getKey())){K(p)||Hc(179);const y=r();y.setFormat(p.getFormatType()),y.setIndent(p.getIndent()),l.push(y),p.remove(!0)}}if(o!==null)for(let g=0;g<l.length;g++){const p=l[g];o.append(p)}let f=null;if(ze(c))if(a)if(o!==null)c.insertAfter(o);else for(let g=l.length-1;g>=0;g--){const p=l[g];c.insertAfter(p)}else{const g=c.getFirstChild();if(K(g)&&(c=g),g===null)if(o)c.append(o);else for(let p=0;p<l.length;p++){const _=l[p];c.append(_),f=_}else if(o!==null)g.insertBefore(o);else for(let p=0;p<l.length;p++){const _=l[p];g.insertBefore(_),f=_}}else if(o)c.insertAfter(o);else for(let g=l.length-1;g>=0;g--){const p=l[g];c.insertAfter(p),f=p}const h=er();P(h)&&Eg(h.anchor)&&Eg(h.focus)?rr(h.clone()):f!==null?f.selectEnd():n.dirty=!0}function hx(n,e){const t=Qn(n.focus,e);return Be(t)&&!t.isIsolated()||K(t)&&!t.isInline()&&!t.canBeEmpty()}function Sg(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Og(n){const e=n.anchor.getNode();return(tn(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function gx(n,e,t){const r=Og(n);Sg(n,e,t?!r:r,"character")}function px(n){const e=n.anchor,t=n.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();let o=r.getFirstDescendant(),s=r.getLastDescendant(),i="element",l="element",c=0;F(o)?i="text":K(o)||o===null||(o=o.getParentOrThrow()),F(s)?(l="text",c=s.getTextContentSize()):K(s)||s===null||(s=s.getParentOrThrow()),o&&s&&(e.set(o.getKey(),0,i),t.set(s.getKey(),c,l))}function _x(n,e,t){const r=hi(n.getStyle());return r!==null&&r[e]||t}function mx(n,e,t=""){let r=null;const o=n.getNodes(),s=n.anchor,i=n.focus,l=n.isBackward(),c=l?i.offset:s.offset,a=l?i.getNode():s.getNode();if(P(n)&&n.isCollapsed()&&n.style!==""){const u=hi(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<o.length;u++){const d=o[u];if((u===0||c!==0||!d.is(a))&&F(d)){const f=_x(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function vg(n){if(Be(n)||!K(n)||ze(n))return!1;const e=n.getFirstChild(),t=e===null||Th(e)||F(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}const yx=Object.freeze(Object.defineProperty({__proto__:null,$addNodeStyle:cx,$getSelectionStyleValueForProperty:mx,$isAtNodeEnd:lx,$isParentElementRTL:Og,$moveCaretSelection:Sg,$moveCharacter:gx,$patchStyleText:ax,$selectAll:px,$setBlocksType:ux,$shouldOverrideDefaultCharacterSelection:hx,$sliceSelectedTextNodeContent:ix,$trimTextContentFromAnchor:Tg,$wrapNodes:dx,createDOMRange:ox,createRectsFromDOMRange:sx,getStyleObjectFromCSS:hi,trimTextContentFromAnchor:Tg,$cloneWithProperties:en},Symbol.toStringTag,{value:"Module"})),Eo=process.env.NODE_ENV==="development"?nx:yx,bg=Eo.$addNodeStyle,gi=Eo.$moveCharacter,pi=Eo.$shouldOverrideDefaultCharacterSelection,_i=Eo.$sliceSelectedTextNodeContent,wg=Eo.createRectsFromDOMRange,ot=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Nx=ot&&"documentMode"in document?document.documentMode:null,Cx=ot&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xx=ot&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tx=ot&&"InputEvent"in window&&!Nx?"getTargetRanges"in new window.InputEvent("input"):!1,Ex=ot&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Sx=ot&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Dg=ot&&/Android/.test(navigator.userAgent),Vc=ot&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ox=ot&&Dg&&Vc,vx=ot&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Vc;function Mg(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function Ag(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function yt(n){return`${n}px`}const bx={attributes:!0,characterData:!0,childList:!0,subtree:!0};function kg(n,e,t){let r=null,o=null,s=null,i=[];const l=document.createElement("div");function c(){if(r===null)throw Error("Unexpected null rootDOMNode");if(o===null)throw Error("Unexpected null parentDOMNode");const{left:f,top:h}=r.getBoundingClientRect(),g=o,p=wg(n,e);l.isConnected||g.append(l);let _=!1;for(let y=0;y<p.length;y++){const m=p[y],N=i[y]||document.createElement("div"),x=N.style;x.position!=="absolute"&&(x.position="absolute",_=!0);const T=yt(m.left-f);x.left!==T&&(x.left=T,_=!0);const E=yt(m.top-h);x.top!==E&&(N.style.top=E,_=!0);const O=yt(m.width);x.width!==O&&(N.style.width=O,_=!0);const S=yt(m.height);x.height!==S&&(N.style.height=S,_=!0),N.parentNode!==l&&(l.append(N),_=!0),i[y]=N}for(;i.length>p.length;)i.pop();_&&t(i)}function a(){o=null,r=null,s!==null&&s.disconnect(),s=null,l.remove();for(const f of i)f.remove();i=[]}function u(){const f=n.getRootElement();if(f===null)return a();const h=f.parentElement;if(!(h instanceof HTMLElement))return a();a(),r=f,o=h,s=new MutationObserver(g=>{const p=n.getRootElement(),_=p&&p.parentElement;if(p!==r||_!==o)return u();for(const y of g)if(!l.contains(y.target))return c()}),s.observe(h,bx),c()}const d=n.registerRootListener(u);return()=>{d(),a()}}function wx(n,e){let t=null,r=null,o=null,s=null,i=()=>{};function l(c){c.read(()=>{const a=L();if(!P(a)){t=null,r=null,o=null,s=null,i(),i=()=>{};return}const{anchor:u,focus:d}=a,f=u.getNode(),h=f.getKey(),g=u.offset,p=d.getNode(),_=p.getKey(),y=d.offset,m=n.getElementByKey(h),N=n.getElementByKey(_),x=t===null||m===null||g!==r||h!==t.getKey()||f!==t&&(!(t instanceof lr)||f.updateDOM(t,m,n._config)),T=o===null||N===null||y!==s||_!==o.getKey()||p!==o&&(!(o instanceof lr)||p.updateDOM(o,N,n._config));if(x||T){const E=n.getElementByKey(u.getNode().getKey()),O=n.getElementByKey(d.getNode().getKey());if(E!==null&&O!==null&&E.tagName==="SPAN"&&O.tagName==="SPAN"){const S=document.createRange();let v,M,B,X;d.isBefore(u)?(v=O,M=d.offset,B=E,X=u.offset):(v=E,M=u.offset,B=O,X=d.offset);const te=v.firstChild;if(te===null)throw Error("Expected text node to be first child of span");const q=B.firstChild;if(q===null)throw Error("Expected text node to be first child of span");S.setStart(te,M),S.setEnd(q,X),i(),i=kg(n,S,ne=>{for(const me of ne){const Q=me.style;Q.background!=="Highlight"&&(Q.background="Highlight"),Q.color!=="HighlightText"&&(Q.color="HighlightText"),Q.zIndex!=="-1"&&(Q.zIndex="-1"),Q.pointerEvents!=="none"&&(Q.pointerEvents="none"),Q.marginTop!==yt(-1.5)&&(Q.marginTop=yt(-1.5)),Q.paddingTop!==yt(4)&&(Q.paddingTop=yt(4)),Q.paddingBottom!==yt(0)&&(Q.paddingBottom=yt(0))}e!==void 0&&e(ne)})}}t=f,r=g,o=p,s=y})}return l(n.getEditorState()),Ag(n.registerUpdateListener(({editorState:c})=>l(c)),i,()=>{i()})}const Dx=Tx,Mx=ot,Ax=Dg,kx=Ox,Px=Cx,Rx=vx,$x=Vc,Pg=xx,Ix=Sx,Lx=Ex;function Fx(n,...e){const t=Mg(...e);t.length>0&&n.classList.add(...t)}function Bx(n,...e){const t=Mg(...e);t.length>0&&n.classList.remove(...t)}function Rg(n,e){for(const t of e)if(n.type.startsWith(t))return!0;return!1}function Kx(n,e){const t=n[Symbol.iterator]();return new Promise((r,o)=>{const s=[],i=()=>{const{done:l,value:c}=t.next();if(l)return r(s);const a=new FileReader;a.addEventListener("error",o),a.addEventListener("load",()=>{const u=a.result;typeof u=="string"&&s.push({file:c,result:u}),i()}),Rg(c,e)?a.readAsDataURL(c):i()};i()})}function zx(n,e){const t=[],r=(n||de()).getLatest(),o=e||K(r)&&r.getLastDescendant()||r;let s=r,i=Wx(s);for(;s!==null&&!s.is(o);)if(t.push({depth:i,node:s}),K(s)&&s.getChildrenSize()>0)s=s.getFirstChild(),i++;else{let l=null;for(;l===null&&s!==null;)l=s.getNextSibling(),l===null?(s=s.getParent(),i--):s=l}return s!==null&&s.is(o)&&t.push({depth:i,node:s}),t}function Wx(n){let e=n,t=0;for(;(e=e.getParent())!==null;)t++;return t}function jx(n){let e=n;if(K(e)&&e.getChildrenSize()>0)e=e.getLastChild();else{let t=null;for(;t===null&&e!==null;)t=e.getPreviousSibling(),t===null?e=e.getParent():e=t}return e}function Ux(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function Hx(n){const e=$g(n,t=>K(t)&&!t.isInline());if(!K(e))throw Error(`Expected node ${n.__key} to have closest block element node.`);return e}const $g=(n,e)=>{let t=n;for(;t!==de()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Yx(n,e,t,r){const o=l=>l instanceof e,s=l=>{const c=l.getChildren();for(let d=0;d<c.length;d++){const f=c[d];if(o(f))return null}let a=l,u=l;for(;a!==null;)if(u=a,a=a.getParent(),o(a))return{child:u,parent:a};return null},i=l=>{const c=s(l);if(c!==null){const{child:a,parent:u}=c;if(a.is(l)){r(u,l);const d=a.getNextSiblings(),f=d.length;if(u.insertAfter(a),f!==0){const h=t(u);a.insertAfter(h);for(let g=0;g<f;g++)h.append(d[g])}!u.canBeEmpty()&&u.getChildrenSize()===0&&u.remove()}}};return n.registerNodeTransform(e,i)}function Vx(n,e){const r=new Map,o=n._pendingEditorState;for(const[i,l]of e._nodeMap)r.set(i,en(l));o&&(o._nodeMap=r),n._dirtyType=2;const s=e._selection;rr(s===null?null:s.clone())}function Jx(n){const e=L()||er();if(P(e)){const{focus:t}=e,r=t.getNode(),o=t.offset;if(ze(r)){const s=r.getChildAtIndex(o);s==null?r.append(n):s.insertBefore(n),n.selectNext()}else{let s,i;F(r)?(s=r.getParentOrThrow(),i=r.getIndexWithinParent(),o>0&&(i+=1,r.splitText(o))):(s=r,i=o);const[,l]=ni(s,i);l.insertBefore(n),l.selectStart()}}else{if(e!=null){const r=e.getNodes();r[r.length-1].getTopLevelElementOrThrow().insertAfter(n)}else de().append(n);const t=Pe();n.insertAfter(t),t.select()}return n.getLatest()}function Gx(n,e){const t=e();return n.replace(t),t.append(n),t}function qx(n,e){return n!==null?Object.getPrototypeOf(n).constructor.name===e.name:!1}function Xx(n,e){const t=[];for(let r=0;r<n.length;r++){const o=e(n[r]);o!==null&&t.push(o)}return t}function Qx(n,e){const t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function Zx(n){if(Pg)return 1;let e=1;for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}function eT(n){return n._parentEditor!==null}const tT=Object.freeze(Object.defineProperty({__proto__:null,$dfs:zx,$filter:Xx,$findMatchingParent:$g,$getNearestBlockElementAncestorOrThrow:Hx,$getNearestNodeOfType:Ux,$getNextRightPreorderNode:jx,$insertFirst:Qx,$insertNodeToNearestRoot:Jx,$isEditorIsNestedEditor:eT,$restoreEditorState:Vx,$wrapNodeInElement:Gx,CAN_USE_BEFORE_INPUT:Dx,CAN_USE_DOM:Mx,IS_ANDROID:Ax,IS_ANDROID_CHROME:kx,IS_APPLE:Px,IS_APPLE_WEBKIT:Rx,IS_CHROME:$x,IS_FIREFOX:Pg,IS_IOS:Ix,IS_SAFARI:Lx,addClassNamesToElement:Fx,calculateZoomLevel:Zx,isMimeType:Rg,markSelection:wx,mediaFileReader:Kx,mergeRegister:Ag,objectKlassEquals:qx,positionNodeOnRange:kg,registerNestedElementResolver:Yx,removeClassNamesFromElement:Bx,$splitNode:ni,isBlockDomNode:Zh,isHTMLAnchorElement:eg,isHTMLElement:tg,isInlineDomNode:cr},Symbol.toStringTag,{value:"Module"}));function nT(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var So=nT(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const st=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,rT=st&&"documentMode"in document?document.documentMode:null,oT=st&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),sT=st&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),iT=!(!st||!("InputEvent"in window)||rT)&&"getTargetRanges"in new window.InputEvent("input"),lT=st&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),cT=st&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ig=st&&/Android/.test(navigator.userAgent),Jc=st&&/^(?=.*Chrome).*/i.test(navigator.userAgent),aT=st&&Ig&&Jc,uT=st&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Jc;function Lg(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function Fg(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Nt(n){return`${n}px`}const fT={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Bg(n,e,t){let r=null,o=null,s=null,i=[];const l=document.createElement("div");function c(){r===null&&So(182),o===null&&So(183);const{left:d,top:f}=r.getBoundingClientRect(),h=o,g=wg(n,e);l.isConnected||h.append(l);let p=!1;for(let _=0;_<g.length;_++){const y=g[_],m=i[_]||document.createElement("div"),N=m.style;N.position!=="absolute"&&(N.position="absolute",p=!0);const x=Nt(y.left-d);N.left!==x&&(N.left=x,p=!0);const T=Nt(y.top-f);N.top!==T&&(m.style.top=T,p=!0);const E=Nt(y.width);N.width!==E&&(m.style.width=E,p=!0);const O=Nt(y.height);N.height!==O&&(m.style.height=O,p=!0),m.parentNode!==l&&(l.append(m),p=!0),i[_]=m}for(;i.length>g.length;)i.pop();p&&t(i)}function a(){o=null,r=null,s!==null&&s.disconnect(),s=null,l.remove();for(const d of i)d.remove();i=[]}const u=n.registerRootListener(function d(){const f=n.getRootElement();if(f===null)return a();const h=f.parentElement;if(!(h instanceof HTMLElement))return a();a(),r=f,o=h,s=new MutationObserver(g=>{const p=n.getRootElement(),_=p&&p.parentElement;if(p!==r||_!==o)return d();for(const y of g)if(!l.contains(y.target))return c()}),s.observe(h,fT),c()});return()=>{u(),a()}}function dT(n,e){let t=null,r=null,o=null,s=null,i=()=>{};function l(c){c.read(()=>{const a=L();if(!P(a))return t=null,r=null,o=null,s=null,i(),void(i=()=>{});const{anchor:u,focus:d}=a,f=u.getNode(),h=f.getKey(),g=u.offset,p=d.getNode(),_=p.getKey(),y=d.offset,m=n.getElementByKey(h),N=n.getElementByKey(_),x=t===null||m===null||g!==r||h!==t.getKey()||f!==t&&(!(t instanceof lr)||f.updateDOM(t,m,n._config)),T=o===null||N===null||y!==s||_!==o.getKey()||p!==o&&(!(o instanceof lr)||p.updateDOM(o,N,n._config));if(x||T){const E=n.getElementByKey(u.getNode().getKey()),O=n.getElementByKey(d.getNode().getKey());if(E!==null&&O!==null&&E.tagName==="SPAN"&&O.tagName==="SPAN"){const S=document.createRange();let v,M,B,X;d.isBefore(u)?(v=O,M=d.offset,B=E,X=u.offset):(v=E,M=u.offset,B=O,X=d.offset);const te=v.firstChild;te===null&&So(181);const q=B.firstChild;q===null&&So(181),S.setStart(te,M),S.setEnd(q,X),i(),i=Bg(n,S,ne=>{for(const me of ne){const Q=me.style;Q.background!=="Highlight"&&(Q.background="Highlight"),Q.color!=="HighlightText"&&(Q.color="HighlightText"),Q.zIndex!=="-1"&&(Q.zIndex="-1"),Q.pointerEvents!=="none"&&(Q.pointerEvents="none"),Q.marginTop!==Nt(-1.5)&&(Q.marginTop=Nt(-1.5)),Q.paddingTop!==Nt(4)&&(Q.paddingTop=Nt(4)),Q.paddingBottom!==Nt(0)&&(Q.paddingBottom=Nt(0))}e!==void 0&&e(ne)})}}t=f,r=g,o=p,s=y})}return l(n.getEditorState()),Fg(n.registerUpdateListener(({editorState:c})=>l(c)),i,()=>{i()})}const hT=iT,gT=st,pT=Ig,_T=aT,mT=oT,yT=uT,NT=Jc,Kg=sT,CT=cT,xT=lT;function TT(n,...e){const t=Lg(...e);t.length>0&&n.classList.add(...t)}function ET(n,...e){const t=Lg(...e);t.length>0&&n.classList.remove(...t)}function zg(n,e){for(const t of e)if(n.type.startsWith(t))return!0;return!1}function ST(n,e){const t=n[Symbol.iterator]();return new Promise((r,o)=>{const s=[],i=()=>{const{done:l,value:c}=t.next();if(l)return r(s);const a=new FileReader;a.addEventListener("error",o),a.addEventListener("load",()=>{const u=a.result;typeof u=="string"&&s.push({file:c,result:u}),i()}),zg(c,e)?a.readAsDataURL(c):i()};i()})}function OT(n,e){const t=[],r=(n||de()).getLatest(),o=e||K(r)&&r.getLastDescendant()||r;let s=r,i=function(l){let c=l,a=0;for(;(c=c.getParent())!==null;)a++;return a}(s);for(;s!==null&&!s.is(o);)if(t.push({depth:i,node:s}),K(s)&&s.getChildrenSize()>0)s=s.getFirstChild(),i++;else{let l=null;for(;l===null&&s!==null;)l=s.getNextSibling(),l===null?(s=s.getParent(),i--):s=l}return s!==null&&s.is(o)&&t.push({depth:i,node:s}),t}function vT(n){let e=n;if(K(e)&&e.getChildrenSize()>0)e=e.getLastChild();else{let t=null;for(;t===null&&e!==null;)t=e.getPreviousSibling(),e=t===null?e.getParent():t}return e}function bT(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function wT(n){const e=Wg(n,t=>K(t)&&!t.isInline());return K(e)||So(4,n.__key),e}const Wg=(n,e)=>{let t=n;for(;t!==de()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function DT(n,e,t,r){const o=s=>s instanceof e;return n.registerNodeTransform(e,s=>{const i=(l=>{const c=l.getChildren();for(let d=0;d<c.length;d++){const f=c[d];if(o(f))return null}let a=l,u=l;for(;a!==null;)if(u=a,a=a.getParent(),o(a))return{child:u,parent:a};return null})(s);if(i!==null){const{child:l,parent:c}=i;if(l.is(s)){r(c,s);const a=l.getNextSiblings(),u=a.length;if(c.insertAfter(l),u!==0){const d=t(c);l.insertAfter(d);for(let f=0;f<u;f++)d.append(a[f])}c.canBeEmpty()||c.getChildrenSize()!==0||c.remove()}}})}function MT(n,e){const t=new Map,r=n._pendingEditorState;for(const[s,i]of e._nodeMap)t.set(s,en(i));r&&(r._nodeMap=t),n._dirtyType=2;const o=e._selection;rr(o===null?null:o.clone())}function AT(n){const e=L()||er();if(P(e)){const{focus:t}=e,r=t.getNode(),o=t.offset;if(ze(r)){const s=r.getChildAtIndex(o);s==null?r.append(n):s.insertBefore(n),n.selectNext()}else{let s,i;F(r)?(s=r.getParentOrThrow(),i=r.getIndexWithinParent(),o>0&&(i+=1,r.splitText(o))):(s=r,i=o);const[,l]=ni(s,i);l.insertBefore(n),l.selectStart()}}else{if(e!=null){const r=e.getNodes();r[r.length-1].getTopLevelElementOrThrow().insertAfter(n)}else de().append(n);const t=Pe();n.insertAfter(t),t.select()}return n.getLatest()}function kT(n,e){const t=e();return n.replace(t),t.append(n),t}function PT(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function RT(n,e){const t=[];for(let r=0;r<n.length;r++){const o=e(n[r]);o!==null&&t.push(o)}return t}function $T(n,e){const t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function IT(n){if(Kg)return 1;let e=1;for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}function LT(n){return n._parentEditor!==null}const FT=Object.freeze(Object.defineProperty({__proto__:null,$dfs:OT,$filter:RT,$findMatchingParent:Wg,$getNearestBlockElementAncestorOrThrow:wT,$getNearestNodeOfType:bT,$getNextRightPreorderNode:vT,$insertFirst:$T,$insertNodeToNearestRoot:AT,$isEditorIsNestedEditor:LT,$restoreEditorState:MT,$wrapNodeInElement:kT,CAN_USE_BEFORE_INPUT:hT,CAN_USE_DOM:gT,IS_ANDROID:pT,IS_ANDROID_CHROME:_T,IS_APPLE:mT,IS_APPLE_WEBKIT:yT,IS_CHROME:NT,IS_FIREFOX:Kg,IS_IOS:CT,IS_SAFARI:xT,addClassNamesToElement:TT,calculateZoomLevel:IT,isMimeType:zg,markSelection:dT,mediaFileReader:ST,mergeRegister:Fg,objectKlassEquals:PT,positionNodeOnRange:Bg,registerNestedElementResolver:DT,removeClassNamesFromElement:ET,$splitNode:ni,isBlockDomNode:Zh,isHTMLAnchorElement:eg,isHTMLElement:tg,isInlineDomNode:cr},Symbol.toStringTag,{value:"Module"})),Tn=process.env.NODE_ENV==="development"?tT:FT,mi=Tn.$findMatchingParent,jg=Tn.$getNearestBlockElementAncestorOrThrow,yi=Tn.addClassNamesToElement,Ni=Tn.isBlockDomNode,fr=Tn.isHTMLElement,nn=Tn.mergeRegister,We=Tn.objectKlassEquals,Ug=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function BT({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:o,ariaExpanded:s,ariaLabel:i,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:a,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:g="textbox",spellCheck:p=!0,style:_,tabIndex:y,"data-testid":m,...N},x){const[T,E]=V.useState(n.isEditable()),O=V.useCallback(v=>{v&&v.ownerDocument&&v.ownerDocument.defaultView?n.setRootElement(v):n.setRootElement(null)},[n]),S=V.useMemo(()=>function(...v){return M=>{v.forEach(B=>{typeof B=="function"?B(M):B!=null&&(B.current=M)})}}(x,O),[O,x]);return Ug(()=>(E(n.isEditable()),n.registerEditableListener(v=>{E(v)})),[n]),U.exports.jsx("div",{...N,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":o,"aria-expanded":T&&g==="combobox"?!!s:void 0,"aria-label":i,"aria-labelledby":l,"aria-multiline":c,"aria-owns":T?a:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:T,"data-testid":m,id:h,ref:S,role:T?g:void 0,spellCheck:p,style:_,tabIndex:y})}const KT=V.forwardRef(BT);function Hg(n){return n.getEditorState().read(ug(n.isComposing()))}const zT=V.forwardRef(WT);function WT(n,e){const{placeholder:t,...r}=n,[o]=xn();return U.exports.jsxs(U.exports.Fragment,{children:[U.exports.jsx(KT,{editor:o,...r,ref:e}),t!=null&&U.exports.jsx(jT,{editor:o,content:t})]})}function jT({content:n,editor:e}){const t=function(i){const[l,c]=V.useState(()=>Hg(i));return Ug(()=>{function a(){const u=Hg(i);c(u)}return a(),nn(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),l}(e),[r,o]=V.useState(e.isEditable());if(V.useLayoutEffect(()=>(o(e.isEditable()),e.registerEditableListener(i=>{o(i)})),[e]),!t)return null;let s=null;return typeof n=="function"?s=n(r):n!==null&&(s=n),s===null?null:U.exports.jsx("div",{"aria-hidden":!0,children:s})}const Ci=0,Gc=1,qc=2,it=0,UT=1,Yg=2,HT=3,YT=4;function VT(n,e,t){const r=n._nodeMap,o=[];for(const s of e){const i=r.get(s);i!==void 0&&o.push(i)}for(const[s,i]of t){if(!i)continue;const l=r.get(s);l!==void 0&&!tn(l)&&o.push(l)}return o}function JT(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return it;const s=e._selection,i=n._selection;if(o)return UT;if(!P(s)||!P(i)||!i.isCollapsed()||!s.isCollapsed())return it;const l=VT(e,t,r);if(l.length===0)return it;if(l.length>1){const y=e._nodeMap,m=y.get(s.anchor.key),N=y.get(i.anchor.key);return m&&N&&!n._nodeMap.has(m.__key)&&F(m)&&m.__text.length===1&&s.anchor.offset===1?Yg:it}const c=l[0],a=n._nodeMap.get(c.__key);if(!F(a)||!F(c)||a.__mode!==c.__mode)return it;const u=a.__text,d=c.__text;if(u===d)return it;const f=s.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return it;const g=f.offset,p=h.offset,_=d.length-u.length;return _===1&&p===g-1?Yg:_===-1&&p===g+1?HT:_===-1&&p===g?YT:it}function GT(n,e,t){const r=e._nodeMap.get(n),o=t._nodeMap.get(n),s=e._selection,i=t._selection;return!(P(s)&&P(i)&&s.anchor.type==="element"&&s.focus.type==="element"&&i.anchor.type==="text"&&i.focus.type==="text")&&F(r)&&F(o)&&r.__parent===o.__parent?JSON.stringify(e.read(()=>r.exportJSON()))===JSON.stringify(t.read(()=>o.exportJSON())):!1}function qT(n,e){let t=Date.now(),r=it;return(o,s,i,l,c,a)=>{const u=Date.now();if(a.has("historic"))return r=it,t=u,qc;const d=JT(o,s,l,c,n.isComposing()),f=(()=>{const h=i===null||i.editor===n,g=a.has("history-push");if(!g&&h&&a.has("history-merge"))return Ci;if(o===null)return Gc;const _=s._selection;if(!(l.size>0||c.size>0))return _!==null?Ci:qc;if(g===!1&&d!==it&&d===r&&u<t+e&&h)return Ci;if(l.size===1){const m=Array.from(l)[0];if(GT(m,o,s))return Ci}return Gc})();return t=u,r=d,f}}function XT(n,e){const t=e.redoStack,r=e.undoStack;if(t.length!==0){const o=e.current;o!==null&&(r.push(o),n.dispatchCommand(Mt,!0));const s=t.pop();t.length===0&&n.dispatchCommand(Dt,!1),e.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:"historic"})}}function QT(n,e){const t=e.redoStack,r=e.undoStack;if(r.length!==0){const s=e.current,i=r.pop();s!==null&&(t.push(s),n.dispatchCommand(Dt,!0)),r.length===0&&n.dispatchCommand(Mt,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}function Vg(n){n.undoStack=[],n.redoStack=[],n.current=null}function ZT(n,e,t){const r=qT(n,t),o=({editorState:i,prevEditorState:l,dirtyLeaves:c,dirtyElements:a,tags:u})=>{const d=e.current,f=e.redoStack,h=e.undoStack,g=d===null?null:d.editorState;if(d!==null&&i===g)return;const p=r(l,i,d,c,a,u);if(p===Gc)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),d!==null&&(h.push({...d}),n.dispatchCommand(Mt,!0));else if(p===qc)return;e.current={editor:n,editorState:i}};return nn(n.registerCommand(zc,()=>(QT(n,e),!0),z),n.registerCommand(Kc,()=>(XT(n,e),!0),z),n.registerCommand(bh,()=>(Vg(e),!1),z),n.registerCommand(wh,()=>(Vg(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(Mt,!1),!0),z),n.registerUpdateListener(o))}function eE(){return{current:null,redoStack:[],undoStack:[]}}const tE=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:eE,registerHistory:ZT},Symbol.toStringTag,{value:"Module"})),xi=0,Xc=1,Qc=2,lt=0,nE=1,Jg=2,rE=3,oE=4;function sE(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return lt;const s=e._selection,i=n._selection;if(o)return nE;if(!(P(s)&&P(i)&&i.isCollapsed()&&s.isCollapsed()))return lt;const l=function(y,m,N){const x=y._nodeMap,T=[];for(const E of m){const O=x.get(E);O!==void 0&&T.push(O)}for(const[E,O]of N){if(!O)continue;const S=x.get(E);S===void 0||tn(S)||T.push(S)}return T}(e,t,r);if(l.length===0)return lt;if(l.length>1){const y=e._nodeMap,m=y.get(s.anchor.key),N=y.get(i.anchor.key);return m&&N&&!n._nodeMap.has(m.__key)&&F(m)&&m.__text.length===1&&s.anchor.offset===1?Jg:lt}const c=l[0],a=n._nodeMap.get(c.__key);if(!F(a)||!F(c)||a.__mode!==c.__mode)return lt;const u=a.__text,d=c.__text;if(u===d)return lt;const f=s.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return lt;const g=f.offset,p=h.offset,_=d.length-u.length;return _===1&&p===g-1?Jg:_===-1&&p===g+1?rE:_===-1&&p===g?oE:lt}function iE(n,e){let t=Date.now(),r=lt;return(o,s,i,l,c,a)=>{const u=Date.now();if(a.has("historic"))return r=lt,t=u,Qc;const d=sE(o,s,l,c,n.isComposing()),f=(()=>{const h=i===null||i.editor===n,g=a.has("history-push");if(!g&&h&&a.has("history-merge"))return xi;if(o===null)return Xc;const p=s._selection;return l.size>0||c.size>0?g===!1&&d!==lt&&d===r&&u<t+e&&h||l.size===1&&function(_,y,m){const N=y._nodeMap.get(_),x=m._nodeMap.get(_),T=y._selection,E=m._selection;return!(P(T)&&P(E)&&T.anchor.type==="element"&&T.focus.type==="element"&&E.anchor.type==="text"&&E.focus.type==="text"||!F(N)||!F(x)||N.__parent!==x.__parent)&&JSON.stringify(y.read(()=>N.exportJSON()))===JSON.stringify(m.read(()=>x.exportJSON()))}(Array.from(l)[0],o,s)?xi:Xc:p!==null?xi:Qc})();return t=u,r=d,f}}function Gg(n){n.undoStack=[],n.redoStack=[],n.current=null}function lE(n,e,t){const r=iE(n,t);return nn(n.registerCommand(zc,()=>(function(s,i){const l=i.redoStack,c=i.undoStack;if(c.length!==0){const a=i.current,u=c.pop();a!==null&&(l.push(a),s.dispatchCommand(Dt,!0)),c.length===0&&s.dispatchCommand(Mt,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),z),n.registerCommand(Kc,()=>(function(s,i){const l=i.redoStack,c=i.undoStack;if(l.length!==0){const a=i.current;a!==null&&(c.push(a),s.dispatchCommand(Mt,!0));const u=l.pop();l.length===0&&s.dispatchCommand(Dt,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),z),n.registerCommand(bh,()=>(Gg(e),!1),z),n.registerCommand(wh,()=>(Gg(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(Mt,!1),!0),z),n.registerUpdateListener(({editorState:s,prevEditorState:i,dirtyLeaves:l,dirtyElements:c,tags:a})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&s===h)return;const g=r(i,s,u,l,c,a);if(g===Xc)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Mt,!0));else if(g===Qc)return;e.current={editor:n,editorState:s}}))}function cE(){return{current:null,redoStack:[],undoStack:[]}}const aE=Object.freeze(Object.defineProperty({__proto__:null,createEmptyHistoryState:cE,registerHistory:lE},Symbol.toStringTag,{value:"Module"})),qg=process.env.NODE_ENV==="development"?tE:aE,uE=qg.createEmptyHistoryState,fE=qg.registerHistory;function dE({delay:n,externalHistoryState:e}){const[t]=xn();return function(r,o,s=1e3){const i=V.useMemo(()=>o||uE(),[o]);V.useEffect(()=>fE(r,i,s),[s,r,i])}(t,e,n),null}const hE=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function gE(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function pE(){return function(n){const[e]=xn(),t=V.useMemo(()=>n(e),[e,n]),r=V.useRef(t.initialValueFn()),[o,s]=V.useState(r.current);return hE(()=>{const{initialValueFn:i,subscribe:l}=t,c=i();return r.current!==c&&(r.current=c,s(c)),l(a=>{r.current=a,s(a)})},[t,n]),o}(gE)}function _E(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const s=r.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const c=l.args;if(c){const[a,u,d,f,h,g]=c;n.update(()=>{const p=L();if(P(p)){const _=p.anchor;let y=_.getNode(),m=0,N=0;if(F(y)&&a>=0&&u>=0&&(m=a,N=a+u,p.setTextNodeRange(y,m,y,N)),(m!==N||d!=="")&&(p.insertRawText(d),y=_.getNode()),F(y)){m=f,N=f+h;const x=y.getTextContentSize();m=m>x?x:m,N=N>x?x:N,p.setTextNodeRange(y,m,y,N)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}const mE=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:_E},Symbol.toStringTag,{value:"Module"}));function yE(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const s=r.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const c=l.args;if(c){const[a,u,d,f,h,g]=c;n.update(()=>{const p=L();if(P(p)){const _=p.anchor;let y=_.getNode(),m=0,N=0;if(F(y)&&a>=0&&u>=0&&(m=a,N=a+u,p.setTextNodeRange(y,m,y,N)),m===N&&d===""||(p.insertRawText(d),y=_.getNode()),F(y)){m=f,N=f+h;const x=y.getTextContentSize();m=m>x?x:m,N=N>x?x:N,p.setTextNodeRange(y,m,y,N)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}const NE=Object.freeze(Object.defineProperty({__proto__:null,registerDragonSupport:yE},Symbol.toStringTag,{value:"Module"})),CE=(process.env.NODE_ENV==="development"?mE:NE).registerDragonSupport;function xE(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let s=0;s<t.length;s++){const i=t[s];if(!Qg.has(i.nodeName)){const l=Zg(i,n,o,!1);l!==null&&(r=r.concat(l))}}return SE(o),r}function TE(n,e){if(typeof document>"u"||typeof window>"u"&&typeof global.window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),o=de().getChildren();for(let s=0;s<o.length;s++){const i=o[s];Xg(n,i,t,e)}return t.innerHTML}function Xg(n,e,t,r=null){let o=r!==null?e.isSelected(r):!0;const s=K(e)&&e.excludeFromCopy("html");let i=e;if(r!==null){let h=en(e);h=F(h)&&r!==null?_i(r,h):h,i=h}const l=K(i)?i.getChildren():[],c=n._nodes.get(i.getType());let a;c&&c.exportDOM!==void 0?a=c.exportDOM(n,i):a=i.exportDOM(n);const{element:u,after:d}=a;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],p=Xg(n,g,f,r);!o&&K(e)&&p&&e.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!s){if(fr(u)&&u.append(f),t.append(u),d){const h=d.call(i,u);h&&u.replaceWith(h)}}else t.append(f);return o}function EE(n,e){const{nodeName:t}=n,r=e._htmlConversions.get(t.toLowerCase());let o=null;if(r!==void 0)for(const s of r){const i=s(n);i!==null&&(o===null||(o.priority||0)<(i.priority||0))&&(o=i)}return o!==null?o.conversion:null}const Qg=new Set(["STYLE","SCRIPT"]);function Zg(n,e,t,r,o=new Map,s){let i=[];if(Qg.has(n.nodeName))return i;let l=null;const c=EE(n,e),a=c?c(n):null;let u=null;if(a!==null){u=a.after;const g=a.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,p]of o)if(l=p(l,s),!l)break;l&&i.push(...Array.isArray(g)?g:[l])}a.forChild!=null&&o.set(n.nodeName,a.forChild)}const d=n.childNodes;let f=[];const h=l!=null&&ze(l)?!1:l!=null&&tr(l)||r;for(let g=0;g<d.length;g++)f.push(...Zg(d[g],e,t,h,new Map(o),l));return u!=null&&(f=u(f)),Ni(n)&&(h?f=ep(n,f,()=>{const g=new ri;return t.push(g),g}):f=ep(n,f,Pe)),l==null?f.length>0?i=i.concat(f):Ni(n)&&OE(n)&&(i=i.concat(ei())):K(l)&&l.append(...f),i}function ep(n,e,t){const r=n.style.textAlign,o=[];let s=[];for(let i=0;i<e.length;i++){const l=e[i];if(tr(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(s.push(l),i===e.length-1||i<e.length-1&&tr(e[i+1])){const c=t();c.setFormat(r),c.append(...s),o.push(c),s=[]}}return o}function SE(n){for(const e of n)e.getNextSibling()instanceof ri&&e.insertAfter(ei());for(const e of n){const t=e.getChildren();for(const r of t)e.insertBefore(r);e.remove()}}function OE(n){return n.nextSibling==null||n.previousSibling==null?!1:cr(n.nextSibling)&&cr(n.previousSibling)}const vE=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:TE,$generateNodesFromDOM:xE},Symbol.toStringTag,{value:"Module"}));function bE(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let s=0;s<t.length;s++){const i=t[s];if(!np.has(i.nodeName)){const l=rp(i,n,o,!1);l!==null&&(r=r.concat(l))}}return function(s){for(const i of s)i.getNextSibling()instanceof ri&&i.insertAfter(ei());for(const i of s){const l=i.getChildren();for(const c of l)i.insertBefore(c);i.remove()}}(o),r}function wE(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=de().getChildren();for(let o=0;o<r.length;o++)tp(n,r[o],t,e);return t.innerHTML}function tp(n,e,t,r=null){let o=r===null||e.isSelected(r);const s=K(e)&&e.excludeFromCopy("html");let i=e;if(r!==null){let h=en(e);h=F(h)&&r!==null?_i(r,h):h,i=h}const l=K(i)?i.getChildren():[],c=n._nodes.get(i.getType());let a;a=c&&c.exportDOM!==void 0?c.exportDOM(n,i):i.exportDOM(n);const{element:u,after:d}=a;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],p=tp(n,g,f,r);!o&&K(e)&&p&&e.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!s){if(fr(u)&&u.append(f),t.append(u),d){const h=d.call(i,u);h&&u.replaceWith(h)}}else t.append(f);return o}const np=new Set(["STYLE","SCRIPT"]);function rp(n,e,t,r,o=new Map,s){let i=[];if(np.has(n.nodeName))return i;let l=null;const c=function(g,p){const{nodeName:_}=g,y=p._htmlConversions.get(_.toLowerCase());let m=null;if(y!==void 0)for(const N of y){const x=N(g);x!==null&&(m===null||(m.priority||0)<(x.priority||0))&&(m=x)}return m!==null?m.conversion:null}(n,e),a=c?c(n):null;let u=null;if(a!==null){u=a.after;const g=a.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,p]of o)if(l=p(l,s),!l)break;l&&i.push(...Array.isArray(g)?g:[l])}a.forChild!=null&&o.set(n.nodeName,a.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!ze(l))&&(l!=null&&tr(l)||r);for(let g=0;g<d.length;g++)f.push(...rp(d[g],e,t,h,new Map(o),l));return u!=null&&(f=u(f)),Ni(n)&&(f=DE(n,f,h?()=>{const g=new ri;return t.push(g),g}:Pe)),l==null?f.length>0?i=i.concat(f):Ni(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:cr(g.nextSibling)&&cr(g.previousSibling)}(n)&&(i=i.concat(ei())):K(l)&&l.append(...f),i}function DE(n,e,t){const r=n.style.textAlign,o=[];let s=[];for(let i=0;i<e.length;i++){const l=e[i];if(tr(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(s.push(l),i===e.length-1||i<e.length-1&&tr(e[i+1])){const c=t();c.setFormat(r),c.append(...s),o.push(c),s=[]}}return o}const ME=Object.freeze(Object.defineProperty({__proto__:null,$generateHtmlFromNodes:wE,$generateNodesFromDOM:bE},Symbol.toStringTag,{value:"Module"})),op=process.env.NODE_ENV==="development"?vE:ME,sp=op.$generateHtmlFromNodes,ip=op.$generateNodesFromDOM,AE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lp=n=>AE?(n||window).getSelection():null;function cp(n,e=L()){if(e==null)throw Error("Expected valid LexicalSelection");return P(e)&&e.isCollapsed()||e.getNodes().length===0?"":sp(n,e)}function ap(n,e=L()){if(e==null)throw Error("Expected valid LexicalSelection");return P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(fp(n,e))}function kE(n,e){const t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function PE(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const i=JSON.parse(r);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes)){const l=dp(i.nodes);return Zc(t,l,e)}}catch{}const o=n.getData("text/html");if(o)try{const l=new DOMParser().parseFromString(o,"text/html"),c=ip(t,l);return Zc(t,c,e)}catch{}const s=n.getData("text/plain")||n.getData("text/uri-list");if(s!=null)if(P(e)){const i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const c=L();if(P(c)){const a=i[l];a===`
36
- `||a===`\r
37
- `?c.insertParagraph():a===" "?c.insertNodes([ti()]):c.insertText(a)}}}else e.insertRawText(s)}function Zc(n,e,t){n.dispatchCommand(qh,{nodes:e,selection:t})||t.insertNodes(e)}function RE(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType())throw Error(`LexicalNode: Node ${t.name} does not implement .exportJSON().`);if(K(n)){const r=e.children;if(!Array.isArray(r))throw Error(`LexicalNode: Node ${t.name} is an element but .exportJSON() does not have a children array.`)}return e}function up(n,e,t,r=[]){let o=e!==null?t.isSelected(e):!0;const s=K(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let a=en(t);a=F(a)&&e!==null?_i(e,a):a,i=a}const l=K(i)?i.getChildren():[],c=RE(i);if(F(i)){const a=i.__text;a.length>0?c.text=a:o=!1}for(let a=0;a<l.length;a++){const u=l[a],d=up(n,e,u,c.children);!o&&K(t)&&d&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!s)r.push(c);else if(Array.isArray(c.children))for(let a=0;a<c.children.length;a++){const u=c.children[a];r.push(u)}return o}function fp(n,e){const t=[],o=de().getChildren();for(let s=0;s<o.length;s++){const i=o[s];up(n,e,i,t)}return{namespace:n._config.namespace,nodes:t}}function dp(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=Oh(r);F(o)&&bg(o),e.push(o)}return e}const $E=50;let dr=null;async function IE(n,e,t){if(dr!==null)return!1;if(e!==null)return new Promise((c,a)=>{n.update(()=>{c(hp(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,s=lp(n._window);if(r===null||s===null)return!1;const i=o.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(o.createTextNode("#")),r.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((c,a)=>{const u=n.registerCommand(oi,d=>(We(d,ClipboardEvent)&&(u(),dr!==null&&(window.clearTimeout(dr),dr=null),c(hp(n,d,t))),!0),Mh);dr=window.setTimeout(()=>{u(),dr=null,c(!1)},$E),o.execCommand("copy"),i.remove()})}function hp(n,e,t){if(t===void 0){const o=lp(n._window);if(!o)return!1;const s=o.anchorNode,i=o.focusNode;if(s!==null&&i!==null&&!rg(n,s,i))return!1;const l=L();if(l===null)return!1;t=gp(l)}e.preventDefault();const r=e.clipboardData;return r===null?!1:(pp(r,t),!0)}const LE=[["text/html",cp],["application/x-lexical-editor",ap]];function gp(n=L()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=mh();for(const[r,o]of LE){const s=o(t,n);s!==null&&(e[r]=s)}}return e}function pp(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const FE=Object.freeze(Object.defineProperty({__proto__:null,$generateJSONFromSelectedNodes:fp,$generateNodesFromSerializedNodes:dp,$getClipboardDataFromSelection:gp,$getHtmlContent:cp,$getLexicalContent:ap,$insertDataTransferForPlainText:kE,$insertDataTransferForRichText:PE,$insertGeneratedNodes:Zc,copyToClipboard:IE,setLexicalClipboardDataTransfer:pp},Symbol.toStringTag,{value:"Module"}));function BE(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ti=BE(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const KE=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_p=n=>KE?(n||window).getSelection():null;function mp(n,e=L()){return e==null&&Ti(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?"":sp(n,e)}function yp(n,e=L()){return e==null&&Ti(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Cp(n,e))}function zE(n,e){const t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function WE(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const i=JSON.parse(r);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return ea(t,xp(i.nodes),e)}catch{}const o=n.getData("text/html");if(o)try{const i=new DOMParser().parseFromString(o,"text/html");return ea(t,ip(t,i),e)}catch{}const s=n.getData("text/plain")||n.getData("text/uri-list");if(s!=null)if(P(e)){const i=s.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const c=L();if(P(c)){const a=i[l];a===`
38
- `||a===`\r
39
- `?c.insertParagraph():a===" "?c.insertNodes([ti()]):c.insertText(a)}}}else e.insertRawText(s)}function ea(n,e,t){n.dispatchCommand(qh,{nodes:e,selection:t})||t.insertNodes(e)}function Np(n,e,t,r=[]){let o=e===null||t.isSelected(e);const s=K(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let a=en(t);a=F(a)&&e!==null?_i(e,a):a,i=a}const l=K(i)?i.getChildren():[],c=function(a){const u=a.exportJSON(),d=a.constructor;if(u.type!==d.getType()&&Ti(58,d.name),K(a)){const f=u.children;Array.isArray(f)||Ti(59,d.name)}return u}(i);if(F(i)){const a=i.__text;a.length>0?c.text=a:o=!1}for(let a=0;a<l.length;a++){const u=l[a],d=Np(n,e,u,c.children);!o&&K(t)&&d&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!s)r.push(c);else if(Array.isArray(c.children))for(let a=0;a<c.children.length;a++){const u=c.children[a];r.push(u)}return o}function Cp(n,e){const t=[],r=de().getChildren();for(let o=0;o<r.length;o++)Np(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function xp(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=Oh(r);F(o)&&bg(o),e.push(o)}return e}let hr=null;async function jE(n,e,t){if(hr!==null)return!1;if(e!==null)return new Promise((c,a)=>{n.update(()=>{c(Tp(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,s=_p(n._window);if(r===null||s===null)return!1;const i=o.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(o.createTextNode("#")),r.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),s.removeAllRanges(),s.addRange(l),new Promise((c,a)=>{const u=n.registerCommand(oi,d=>(We(d,ClipboardEvent)&&(u(),hr!==null&&(window.clearTimeout(hr),hr=null),c(Tp(n,d,t))),!0),Mh);hr=window.setTimeout(()=>{u(),hr=null,c(!1)},50),o.execCommand("copy"),i.remove()})}function Tp(n,e,t){if(t===void 0){const o=_p(n._window);if(!o)return!1;const s=o.anchorNode,i=o.focusNode;if(s!==null&&i!==null&&!rg(n,s,i))return!1;const l=L();if(l===null)return!1;t=Ep(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Sp(r,t),!0)}const UE=[["text/html",mp],["application/x-lexical-editor",yp]];function Ep(n=L()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=mh();for(const[r,o]of UE){const s=o(t,n);s!==null&&(e[r]=s)}}return e}function Sp(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const HE=Object.freeze(Object.defineProperty({__proto__:null,$generateJSONFromSelectedNodes:Cp,$generateNodesFromSerializedNodes:xp,$getClipboardDataFromSelection:Ep,$getHtmlContent:mp,$getLexicalContent:yp,$insertDataTransferForPlainText:zE,$insertDataTransferForRichText:WE,$insertGeneratedNodes:ea,copyToClipboard:jE,setLexicalClipboardDataTransfer:Sp},Symbol.toStringTag,{value:"Module"})),Op=process.env.NODE_ENV==="development"?FE:HE,Ei=Op.$insertDataTransferForRichText,Si=Op.copyToClipboard;function vp(n,e){if(typeof document.caretRangeFromPoint<"u"){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}else return null}const gr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",YE=gr&&"documentMode"in document?document.documentMode:null,VE=gr&&"InputEvent"in window&&!YE?"getTargetRanges"in new window.InputEvent("input"):!1,JE=gr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),GE=gr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,qE=gr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),XE=gr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!qE,ta=Qh("DRAG_DROP_PASTE_FILE");class Oo extends si{static getType(){return"quote"}static clone(e){return new Oo(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return yi(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:ZE,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&fr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){const t=na();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const r=Pe(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,t),r}collapseAtStart(){const e=Pe();return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function na(){return Zs(new Oo)}function QE(n){return n instanceof Oo}class vo extends si{static getType(){return"heading"}static clone(e){return new vo(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,r=document.createElement(t),s=e.theme.heading;if(s!==void 0){const i=s[t];yi(r,i)}return r}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:pr,priority:0}),h2:e=>({conversion:pr,priority:0}),h3:e=>({conversion:pr,priority:0}),h4:e=>({conversion:pr,priority:0}),h5:e=>({conversion:pr,priority:0}),h6:e=>({conversion:pr,priority:0}),p:e=>{const r=e.firstChild;return r!==null&&bp(r)?{conversion:()=>({node:null}),priority:3}:null},span:e=>bp(e)?{conversion:t=>({node:_r("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&fr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){const t=_r(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,o=this.getLastDescendant(),i=!o||e&&e.anchor.key===o.getKey()&&r===o.getTextContentSize()||!e?Pe():_r(this.getTag()),l=this.getDirection();if(i.setDirection(l),this.insertAfter(i,t),r===0&&!this.isEmpty()&&e){const c=Pe();c.select(),this.replace(c,!0)}return i}collapseAtStart(){const e=this.isEmpty()?Pe():_r(this.getTag());return this.getChildren().forEach(r=>e.append(r)),this.replace(e),!0}extractWithChild(){return!0}}function bp(n){return n.nodeName.toLowerCase()==="span"?n.style.fontSize==="26pt":!1}function pr(n){const e=n.nodeName.toLowerCase();let t=null;return(e==="h1"||e==="h2"||e==="h3"||e==="h4"||e==="h5"||e==="h6")&&(t=_r(e),n.style!==null&&t.setFormat(n.style.textAlign)),{node:t}}function ZE(n){const e=na();return n.style!==null&&e.setFormat(n.style.textAlign),{node:e}}function _r(n){return Zs(new vo(n))}function eS(n){return n instanceof vo}function tS(n,e){n.preventDefault(),e.update(()=>{const t=L(),r=We(n,InputEvent)||We(n,KeyboardEvent)?null:n.clipboardData;r!=null&&t!==null&&Ei(r,t,e)},{tag:"paste"})}async function nS(n,e){await Si(e,We(n,ClipboardEvent)?n:null),e.update(()=>{const t=L();P(t)?t.removeText():Ke(t)&&t.getNodes().forEach(r=>r.remove())})}function bo(n){let e=null;if(We(n,DragEvent)?e=n.dataTransfer:We(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function wp(n){const e=L();if(!P(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const s=r[o],i=s.getKey();if(t.has(i))continue;const l=mi(s,a=>K(a)&&!a.isInline());if(l===null)continue;const c=l.getKey();l.canIndent()&&!t.has(c)&&(t.add(c),n(l))}return t.size>0}function Oi(n){const e=Zn(n);return Be(e)}function rS(n){const e=n.focus;return e.key==="root"&&e.offset===de().getChildrenSize()}function oS(n){return nn(n.registerCommand(Dh,t=>{const r=L();return Ke(r)?(r.clear(),!0):!1},0),n.registerCommand(or,t=>{const r=L();return P(r)?(r.deleteCharacter(t),!0):!1},z),n.registerCommand(Rh,t=>{const r=L();return P(r)?(r.deleteWord(t),!0):!1},z),n.registerCommand(Ph,t=>{const r=L();return P(r)?(r.deleteLine(t),!0):!1},z),n.registerCommand(Ah,t=>{const r=L();if(typeof t=="string")r!==null&&r.insertText(t);else{if(r===null)return!1;const o=t.dataTransfer;if(o!=null)Ei(o,r,n);else if(P(r)){const s=t.data;return s&&r.insertText(s),!0}}return!0},z),n.registerCommand(Gh,()=>{const t=L();return P(t)?(t.removeText(),!0):!1},z),n.registerCommand(ir,t=>{const r=L();return P(r)?(r.formatText(t),!0):!1},z),n.registerCommand(sr,t=>{const r=L();if(!P(r)&&!Ke(r))return!1;const o=r.getNodes();for(const s of o){const i=mi(s,l=>K(l)&&!l.isInline());i!==null&&i.setFormat(t)}return!0},z),n.registerCommand(ii,t=>{const r=L();return P(r)?(r.insertLineBreak(t),!0):!1},z),n.registerCommand(li,()=>{const t=L();return P(t)?(t.insertParagraph(),!0):!1},z),n.registerCommand(Bh,()=>(Ch([ti()]),!0),z),n.registerCommand(Fh,()=>wp(t=>{const r=t.getIndent();t.setIndent(r+1)}),z),n.registerCommand(ci,()=>wp(t=>{const r=t.getIndent();r>0&&t.setIndent(r-1)}),z),n.registerCommand(jh,t=>{const r=L();if(Ke(r)&&!Oi(t.target)){const o=r.getNodes();if(o.length>0)return o[0].selectPrevious(),!0}else if(P(r)){const o=Qn(r.focus,!0);if(!t.shiftKey&&Be(o)&&!o.isIsolated()&&!o.isInline())return o.selectPrevious(),t.preventDefault(),!0}return!1},z),n.registerCommand(Kh,t=>{const r=L();if(Ke(r)){const o=r.getNodes();if(o.length>0)return o[0].selectNext(0,0),!0}else if(P(r)){if(rS(r))return t.preventDefault(),!0;const o=Qn(r.focus,!1);if(!t.shiftKey&&Be(o)&&!o.isIsolated()&&!o.isInline())return o.selectNext(),t.preventDefault(),!0}return!1},z),n.registerCommand(zh,t=>{const r=L();if(Ke(r)){const o=r.getNodes();if(o.length>0)return t.preventDefault(),o[0].selectPrevious(),!0}if(!P(r))return!1;if(pi(r,!0)){const o=t.shiftKey;return t.preventDefault(),gi(r,o,!0),!0}return!1},z),n.registerCommand(Wh,t=>{const r=L();if(Ke(r)&&!Oi(t.target)){const s=r.getNodes();if(s.length>0)return t.preventDefault(),s[0].selectNext(0,0),!0}if(!P(r))return!1;const o=t.shiftKey;return pi(r,!1)?(t.preventDefault(),gi(r,o,!1),!0):!1},z),n.registerCommand(Uh,t=>{if(Oi(t.target))return!1;const r=L();if(!P(r))return!1;t.preventDefault();const{anchor:o}=r,s=o.getNode();return r.isCollapsed()&&o.offset===0&&!tn(s)&&jg(s).getIndent()>0?n.dispatchCommand(ci,void 0):n.dispatchCommand(or,!0)},z),n.registerCommand(Hh,t=>{if(Oi(t.target))return!1;const r=L();return P(r)?(t.preventDefault(),n.dispatchCommand(or,!1)):!1},z),n.registerCommand(Yh,t=>{const r=L();if(!P(r))return!1;if(t!==null){if((GE||JE||XE)&&VE)return!1;if(t.preventDefault(),t.shiftKey)return n.dispatchCommand(ii,!1)}return n.dispatchCommand(li,void 0)},z),n.registerCommand(Vh,()=>{const t=L();return P(t)?(n.blur(),!0):!1},z),n.registerCommand(Lh,t=>{const[,r]=bo(t);if(r.length>0){const s=t.clientX,i=t.clientY,l=vp(s,i);if(l!==null){const{offset:c,node:a}=l,u=Zn(a);if(u!==null){const d=ph();if(F(u))d.anchor.set(u.getKey(),c,"text"),d.focus.set(u.getKey(),c,"text");else{const h=u.getParentOrThrow().getKey(),g=u.getIndexWithinParent()+1;d.anchor.set(h,g,"element"),d.focus.set(h,g,"element")}const f=Sh(d);rr(f)}n.dispatchCommand(ta,r)}return t.preventDefault(),!0}const o=L();return!!P(o)},z),n.registerCommand(Ih,t=>{const[r]=bo(t),o=L();return!(r&&!P(o))},z),n.registerCommand($h,t=>{const[r]=bo(t),o=L();if(r&&!P(o))return!1;const s=t.clientX,i=t.clientY,l=vp(s,i);if(l!==null){const c=Zn(l.node);Be(c)&&t.preventDefault()}return!0},z),n.registerCommand(Xh,()=>(vh(),!0),z),n.registerCommand(oi,t=>(Si(n,We(t,ClipboardEvent)?t:null),!0),z),n.registerCommand(kh,t=>(nS(t,n),!0),z),n.registerCommand(Jh,t=>{const[,r,o]=bo(t);return r.length>0&&!o?(n.dispatchCommand(ta,r),!0):ng(t.target)?!1:L()!==null?(tS(t,n),!0):!1},z))}const sS=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:_r,$createQuoteNode:na,$isHeadingNode:eS,$isQuoteNode:QE,DRAG_DROP_PASTE:ta,HeadingNode:vo,QuoteNode:Oo,eventFiles:bo,registerRichText:oS},Symbol.toStringTag,{value:"Module"}));function Dp(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const mr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,iS=mr&&"documentMode"in document?document.documentMode:null,lS=!(!mr||!("InputEvent"in window)||iS)&&"getTargetRanges"in new window.InputEvent("input"),cS=mr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),aS=mr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,uS=mr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fS=mr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!uS,ra=Qh("DRAG_DROP_PASTE_FILE");class wo extends si{static getType(){return"quote"}static clone(e){return new wo(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return yi(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:hS,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&fr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){const t=oa();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const r=Pe(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,t),r}collapseAtStart(){const e=Pe();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function oa(){return Zs(new wo)}function dS(n){return n instanceof wo}class Do extends si{static getType(){return"heading"}static clone(e){return new Do(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,r=document.createElement(t),o=e.theme.heading;if(o!==void 0){const s=o[t];yi(r,s)}return r}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:yr,priority:0}),h2:e=>({conversion:yr,priority:0}),h3:e=>({conversion:yr,priority:0}),h4:e=>({conversion:yr,priority:0}),h5:e=>({conversion:yr,priority:0}),h6:e=>({conversion:yr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Mp(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Mp(e)?{conversion:t=>({node:Nr("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&fr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const o=this.getDirection();o&&(t.dir=o)}return{element:t}}static importJSON(e){const t=Nr(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,o=this.getLastDescendant(),s=!o||e&&e.anchor.key===o.getKey()&&r===o.getTextContentSize()||!e?Pe():Nr(this.getTag()),i=this.getDirection();if(s.setDirection(i),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const l=Pe();l.select(),this.replace(l,!0)}return s}collapseAtStart(){const e=this.isEmpty()?Pe():Nr(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function Mp(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function yr(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Nr(e),n.style!==null&&t.setFormat(n.style.textAlign)),{node:t}}function hS(n){const e=oa();return n.style!==null&&e.setFormat(n.style.textAlign),{node:e}}function Nr(n){return Zs(new Do(n))}function gS(n){return n instanceof Do}function Mo(n){let e=null;if(We(n,DragEvent)?e=n.dataTransfer:We(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),o=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),o]}function Ap(n){const e=L();if(!P(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const s=r[o],i=s.getKey();if(t.has(i))continue;const l=mi(s,a=>K(a)&&!a.isInline());if(l===null)continue;const c=l.getKey();l.canIndent()&&!t.has(c)&&(t.add(c),n(l))}return t.size>0}function vi(n){const e=Zn(n);return Be(e)}function pS(n){return nn(n.registerCommand(Dh,e=>{const t=L();return!!Ke(t)&&(t.clear(),!0)},0),n.registerCommand(or,e=>{const t=L();return!!P(t)&&(t.deleteCharacter(e),!0)},z),n.registerCommand(Rh,e=>{const t=L();return!!P(t)&&(t.deleteWord(e),!0)},z),n.registerCommand(Ph,e=>{const t=L();return!!P(t)&&(t.deleteLine(e),!0)},z),n.registerCommand(Ah,e=>{const t=L();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ei(r,t,n);else if(P(t)){const o=e.data;return o&&t.insertText(o),!0}}return!0},z),n.registerCommand(Gh,()=>{const e=L();return!!P(e)&&(e.removeText(),!0)},z),n.registerCommand(ir,e=>{const t=L();return!!P(t)&&(t.formatText(e),!0)},z),n.registerCommand(sr,e=>{const t=L();if(!P(t)&&!Ke(t))return!1;const r=t.getNodes();for(const o of r){const s=mi(o,i=>K(i)&&!i.isInline());s!==null&&s.setFormat(e)}return!0},z),n.registerCommand(ii,e=>{const t=L();return!!P(t)&&(t.insertLineBreak(e),!0)},z),n.registerCommand(li,()=>{const e=L();return!!P(e)&&(e.insertParagraph(),!0)},z),n.registerCommand(Bh,()=>(Ch([ti()]),!0),z),n.registerCommand(Fh,()=>Ap(e=>{const t=e.getIndent();e.setIndent(t+1)}),z),n.registerCommand(ci,()=>Ap(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),z),n.registerCommand(jh,e=>{const t=L();if(Ke(t)&&!vi(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(P(t)){const r=Qn(t.focus,!0);if(!e.shiftKey&&Be(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},z),n.registerCommand(Kh,e=>{const t=L();if(Ke(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(P(t)){if(function(o){const s=o.focus;return s.key==="root"&&s.offset===de().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Qn(t.focus,!1);if(!e.shiftKey&&Be(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},z),n.registerCommand(zh,e=>{const t=L();if(Ke(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!P(t))return!1;if(pi(t,!0)){const r=e.shiftKey;return e.preventDefault(),gi(t,r,!0),!0}return!1},z),n.registerCommand(Wh,e=>{const t=L();if(Ke(t)&&!vi(e.target)){const o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}if(!P(t))return!1;const r=e.shiftKey;return!!pi(t,!1)&&(e.preventDefault(),gi(t,r,!1),!0)},z),n.registerCommand(Uh,e=>{if(vi(e.target))return!1;const t=L();if(!P(t))return!1;e.preventDefault();const{anchor:r}=t,o=r.getNode();return t.isCollapsed()&&r.offset===0&&!tn(o)&&jg(o).getIndent()>0?n.dispatchCommand(ci,void 0):n.dispatchCommand(or,!0)},z),n.registerCommand(Hh,e=>{if(vi(e.target))return!1;const t=L();return!!P(t)&&(e.preventDefault(),n.dispatchCommand(or,!1))},z),n.registerCommand(Yh,e=>{const t=L();if(!P(t))return!1;if(e!==null){if((aS||cS||fS)&&lS)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ii,!1)}return n.dispatchCommand(li,void 0)},z),n.registerCommand(Vh,()=>{const e=L();return!!P(e)&&(n.blur(),!0)},z),n.registerCommand(Lh,e=>{const[,t]=Mo(e);if(t.length>0){const o=Dp(e.clientX,e.clientY);if(o!==null){const{offset:s,node:i}=o,l=Zn(i);if(l!==null){const c=ph();if(F(l))c.anchor.set(l.getKey(),s,"text"),c.focus.set(l.getKey(),s,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;c.anchor.set(u,d,"element"),c.focus.set(u,d,"element")}const a=Sh(c);rr(a)}n.dispatchCommand(ra,t)}return e.preventDefault(),!0}const r=L();return!!P(r)},z),n.registerCommand(Ih,e=>{const[t]=Mo(e),r=L();return!(t&&!P(r))},z),n.registerCommand($h,e=>{const[t]=Mo(e),r=L();if(t&&!P(r))return!1;const o=Dp(e.clientX,e.clientY);if(o!==null){const s=Zn(o.node);Be(s)&&e.preventDefault()}return!0},z),n.registerCommand(Xh,()=>(vh(),!0),z),n.registerCommand(oi,e=>(Si(n,We(e,ClipboardEvent)?e:null),!0),z),n.registerCommand(kh,e=>(async function(t,r){await Si(r,We(t,ClipboardEvent)?t:null),r.update(()=>{const o=L();P(o)?o.removeText():Ke(o)&&o.getNodes().forEach(s=>s.remove())})}(e,n),!0),z),n.registerCommand(Jh,e=>{const[,t,r]=Mo(e);return t.length>0&&!r?(n.dispatchCommand(ra,t),!0):ng(e.target)?!1:L()!==null&&(function(o,s){o.preventDefault(),s.update(()=>{const i=L(),l=We(o,InputEvent)||We(o,KeyboardEvent)?null:o.clipboardData;l!=null&&i!==null&&Ei(l,i,s)},{tag:"paste"})}(e,n),!0)},z))}const _S=Object.freeze(Object.defineProperty({__proto__:null,$createHeadingNode:Nr,$createQuoteNode:oa,$isHeadingNode:gS,$isQuoteNode:dS,DRAG_DROP_PASTE:ra,HeadingNode:Do,QuoteNode:wo,eventFiles:Mo,registerRichText:pS},Symbol.toStringTag,{value:"Module"})),mS=(process.env.NODE_ENV==="development"?sS:_S).registerRichText,sa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function kp(n){return n.getEditorState().read(ug(n.isComposing()))}function yS({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=xn(),o=function(s,i){const[l,c]=V.useState(()=>s.getDecorators());return sa(()=>s.registerDecoratorListener(a=>{ha.flushSync(()=>{c(a)})}),[s]),V.useEffect(()=>{c(s.getDecorators())},[s]),V.useMemo(()=>{const a=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=U.exports.jsx(i,{onError:p=>s._onError(p),children:U.exports.jsx(V.Suspense,{fallback:null,children:l[f]})}),g=s.getElementByKey(f);g!==null&&a.push(ha.createPortal(h,g,f))}return a},[i,l,s])}(r,t);return function(s){sa(()=>nn(mS(s),CE(s)),[s])}(r),U.exports.jsxs(U.exports.Fragment,{children:[n,U.exports.jsx(NS,{content:e}),o]})}function NS({content:n}){const[e]=xn(),t=function(o){const[s,i]=V.useState(()=>kp(o));return sa(()=>{function l(){const c=kp(o);i(c)}return l(),nn(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),s}(e),r=pE();return t?typeof n=="function"?n(r):n:null}function ia(n,e){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ia(n,e)}var Pp={error:null},CS=function(n){var e,t;function r(){for(var s,i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return(s=n.call.apply(n,[this].concat(l))||this).state=Pp,s.resetErrorBoundary=function(){for(var a,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];s.props.onReset==null||(a=s.props).onReset.apply(a,d),s.reset()},s}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ia(e,t),r.getDerivedStateFromError=function(s){return{error:s}};var o=r.prototype;return o.reset=function(){this.setState(Pp)},o.componentDidCatch=function(s,i){var l,c;(l=(c=this.props).onError)==null||l.call(c,s,i)},o.componentDidUpdate=function(s,i){var l,c,a,u,d=this.state.error,f=this.props.resetKeys;d!==null&&i.error!==null&&((a=s.resetKeys)===void 0&&(a=[]),(u=f)===void 0&&(u=[]),a.length!==u.length||a.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(c=this.props).onResetKeysChange)==null||l.call(c,s.resetKeys,f),this.reset())},o.render=function(){var s=this.state.error,i=this.props,l=i.fallbackRender,c=i.FallbackComponent,a=i.fallback;if(s!==null){var u={error:s,resetErrorBoundary:this.resetErrorBoundary};if(Di.isValidElement(a))return a;if(typeof l=="function")return l(u);if(c)return Di.createElement(c,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Di.Component);function xS({children:n,onError:e}){return U.exports.jsx(CS,{fallback:U.exports.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const la=1;function Rp(){return U.exports.jsx("div",{className:"divider"})}function TS(){const[n]=xn(),e=V.useRef(null),[t,r]=V.useState(!1),[o,s]=V.useState(!1),[i,l]=V.useState(!1),[c,a]=V.useState(!1),[u,d]=V.useState(!1),[f,h]=V.useState(!1),g=V.useCallback(()=>{const p=L();P(p)&&(l(p.hasFormat("bold")),a(p.hasFormat("italic")),d(p.hasFormat("underline")),h(p.hasFormat("strikethrough")))},[]);return V.useEffect(()=>nn(n.registerUpdateListener(({editorState:p})=>{p.read(()=>{g()})}),n.registerCommand(CC,(p,_)=>(g(),!1),la),n.registerCommand(Mt,p=>(r(p),!1),la),n.registerCommand(Dt,p=>(s(p),!1),la)),[n,g]),U.exports.jsxs("div",{className:"toolbar",ref:e,children:[U.exports.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(zc,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:U.exports.jsx("i",{className:"format undo"})}),U.exports.jsx("button",{disabled:!o,onClick:()=>{n.dispatchCommand(Kc,void 0)},className:"toolbar-item","aria-label":"Redo",children:U.exports.jsx("i",{className:"format redo"})}),U.exports.jsx(Rp,{}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(ir,"bold")},className:"toolbar-item spaced "+(i?"active":""),"aria-label":"Format Bold",children:U.exports.jsx("i",{className:"format bold"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(ir,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:U.exports.jsx("i",{className:"format italic"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(ir,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:U.exports.jsx("i",{className:"format underline"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(ir,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:U.exports.jsx("i",{className:"format strikethrough"})}),U.exports.jsx(Rp,{}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(sr,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:U.exports.jsx("i",{className:"format left-align"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(sr,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:U.exports.jsx("i",{className:"format center-align"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(sr,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:U.exports.jsx("i",{className:"format right-align"})}),U.exports.jsx("button",{onClick:()=>{n.dispatchCommand(sr,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:U.exports.jsx("i",{className:"format justify-align"})})," "]})}const ES={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}};function SS(){return U.exports.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const OS={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ES};function vS(){return U.exports.jsx(vC,{initialConfig:OS,children:U.exports.jsxs("div",{className:"editor-container",children:[U.exports.jsx(TS,{}),U.exports.jsxs("div",{className:"editor-inner",children:[U.exports.jsx(yS,{contentEditable:U.exports.jsx(zT,{className:"editor-input"}),placeholder:U.exports.jsx(SS,{}),ErrorBoundary:xS}),U.exports.jsx(dE,{}),U.exports.jsx(bC,{})]})]})})}Pt.Editor=vS,Object.defineProperty(Pt,Symbol.toStringTag,{value:"Module"})});
36
+ `?i.push(Ze()):l===" "?i.push(Yt()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Eo(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Eo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function Eo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===Ot){const o=t.style.display;if(o===""&&!Tr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===je)return t;if(t.nodeName==="BR")return null}}const Wl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ze(n){const e=Wl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Kr(n.style,e),node:null}}function ie(n=""){return bn(new gt(n))}function D(n){return n instanceof gt}function Kr(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(D(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Vt extends gt{static getType(){return"tab"}static clone(e){return new Vt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Yt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){O(126)}setDetail(e){O(127)}setMode(e){O(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Yt(){return bn(new Vt)}function Bl(n){return n instanceof Vt}class zl{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(C(t)){const s=t.getDescendantByIndex(i);t=s??t}if(C(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&O(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Ht()||(We()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Te(n,e,t){return new zl(n,e,t)}function Ur(n,e){let t=e.__key,r=n.offset,i="element";if(D(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(D(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function No(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||D(t)?Ur(n,t):Ur(n,e)}else Ur(n,e)}function $e(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Fn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!xe(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}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 Fn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(D(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return Ht()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function P(n){return n instanceof Ke}class Ke{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!P(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(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(C(l)){const f=l.getDescendantByIndex(c);l=f??l}if(C(a)){let f=a.getDescendantByIndex(u);f!==null&&f!==l&&a.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Ht()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,i){$e(this.anchor,e.__key,t,"text"),$e(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=Jr(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(C(f)&&!f.isInline())u||(c+=`
37
+ `),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=s?h.slice(l):h.slice(a):f===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!U(f)&&!Jt(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=H(),r=t.getEditorState()._selection,i=Io(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;$e(this.anchor,o.key,o.offset,o.type),$e(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Ke(Te(e.key,e.offset,e.type),Te(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=pr(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Pe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
38
+ `||s===`\r
39
+ `?r.push(Ze()):s===" "?r.push(Yt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(m,x,y,v){const T=m.getNode(),S=T.getChildAtIndex(m.offset),b=ie(),N=oe(T)?ke().append(b):b;b.setFormat(y),b.setStyle(v),S===null?T.append(N):S.insertBefore(N),m.is(x)&&x.set(b.__key,0,"text"),m.set(b.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||O(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let _=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(D(m)&&m.canInsertTextBefore()&&!at(m)||(m=ie(),m.setFormat(i),m.setStyle(o),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(D(m)&&!at(m)||(m=ie(),m.setFormat(i),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=ie(f.getTextContent());m.setFormat(i),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=_.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||C(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),Fo(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const v=ie(e);return v.select(),void f.replace(v)}const m=f.getFormat(),x=f.getStyle();if(a!==c||m===i&&x===o){if(Bl(f)){const v=ie(e);return v.setFormat(i),v.setStyle(o),v.select(),void f.replace(v)}}else{if(f.getTextContent()!==""){const v=ie(e);if(v.setFormat(i),v.setStyle(o),v.select(),a===0)f.insertBefore(v,!1);else{const[T]=f.splitText(a);T.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(o)}const y=c-a;f=f.spliceText(a,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=x))}else{const m=new Set([...f.getParentKeys(),..._.getParentKeys()]),x=C(f)?f:f.getParentOrThrow();let y=C(_)?_:_.getParentOrThrow(),v=_;if(!x.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||_.getTextContent()==="")||l.type==="element"&&_.getIndexWithinParent()<c)if(D(_)&&!_.isToken()&&c!==_.getTextContentSize()){if(_.isSegmented()){const w=ie(_.getTextContent());_.replace(w),_=w}oe(l.getNode())||l.type!=="text"||(_=_.spliceText(0,c,"")),m.add(_.__key)}else{const w=_.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?_.remove():w.remove()}else m.add(_.__key);const T=y.getChildren(),S=new Set(u),b=x.is(y),N=x.isInline()&&f.getNextSibling()===null?x:f;for(let w=T.length-1;w>=0;w--){const E=T[w];if(E.is(f)||C(E)&&E.isParentOf(f))break;E.isAttached()&&(!S.has(E)||E.is(v)?b||N.insertAfter(E,!1):E.remove())}if(!b){let w=y,E=null;for(;w!==null;){const j=w.getChildren(),z=j.length;(z===0||j[z-1].is(E))&&(m.delete(w.__key),E=w),w=w.getParent()}}if(f.isToken())if(a===h)f.select();else{const w=ie(e);w.select(),f.replace(w)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let w=1;w<d;w++){const E=u[w],j=E.__key;m.has(j)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const y of t)D(y)&&r.push(y);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=i-1;let _=r[g];const m=c.type==="text"?c.offset:_.getTextContentSize();if(d.is(_)){if(f===m)return;if(at(d)||f===0&&m===d.getTextContentSize())d.setFormat(h);else{const y=d.splitText(f,m),v=f===0?y[0]:y[1];v.setFormat(h),a.type==="text"&&a.set(v.__key,0,"text"),c.type==="text"&&c.set(v.__key,m-f,"text")}return void(this.format=h)}f===0||at(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const x=_.getFormatFlags(e,h);m>0&&(m===_.getTextContentSize()||at(_)||([_]=_.splitText(m)),_.setFormat(x));for(let y=u+1;y<g;y++){const v=r[y],T=v.getFormatFlags(e,x);v.setFormat(T)}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(_.__key,m,"text"),this.format=h|x}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=I();return P(h)||O(134),h.insertNodes(e)}const t=kr((this.isBackward()?this.focus:this.anchor).getNode(),ft),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=qr(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(C(h)||U(h))&&!h.isInline())){C(t)||O(135);const h=qr(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=ke();let _=null;for(let m=0;m<h.length;m++){const x=h[m],y=Jt(x);if(y||U(x)&&x.isInline()||C(x)&&x.isInline()||D(x)||x.isParentRequired()){if(_===null&&(_=x.createParentElementNode(),g.append(_),y))continue;_!==null&&_.append(x)}else g.append(x),_=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&ft(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||O(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,_){const m=g.getParentOrThrow().getLastChild();let x=g;const y=[g];for(;x!==m;)x.getNextSibling()||O(140),x=x.getNextSibling(),y.push(x);let v=h;for(const T of y)v=v.insertAfter(T)}(t,c);const d=kr(o,ft);l&&C(d)&&(l.canMergeWhenEmpty()||ft(a))&&(d.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=C(t)?t.getLastChild():null;Jt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ke();return X().splice(this.anchor.offset,0,[s]),s.select(),s}const e=qr(this),t=kr(this.anchor.getNode(),ft);C(t)||O(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=Ze();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=Jr(this);if(t===0)return[];if(t===1){if(D(s)&&!this.isCollapsed()){const d=a>c?c:a,f=a>c?a:c,h=s.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(D(s)){const d=u?a:c;d===s.getTextContentSize()?e.shift():d!==0&&([,s]=s.splitText(d),e[0]=s)}if(D(l)){const d=l.getTextContent().length,f=u?c:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=At(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Ao();return h.add(l.__key),void be(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(D(f)){const h=f.__key,g=t?f.getTextContent().length:0;return i.set(h,g,"text"),void(s&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,_;return C(f)?(_=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),_=h.__key,t||g++),i.set(_,g,"element"),void(s&&o.set(_,g,"element"))}}const a=H(),c=Se(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Sr(u,a,d),function(f,h,g,_){f.modify(h,g,_)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Tl(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const _=this.getNodes(),m=[];let x=!1;for(let y=0;y<_.length;y++){const v=_[y];xr(v,g)?m.push(v):x=!0}if(x&&m.length>0)if(t){const y=m[0];C(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=m[m.length-1];C(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}c.anchorNode===f.startContainer&&c.anchorOffset===f.startOffset||function(y){const v=y.focus,T=y.anchor,S=T.key,b=T.offset,N=T.type;$e(T,v.key,v.offset,v.type),$e(v,S,b,N),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(C(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=At(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Ao();l.add(s.__key),be(l)}else s.remove(),H().dispatchCommand(nn,void 0);return}if(!e&&C(s)&&C(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Oo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Oo(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,_=d.offset,m=g<_,x=m?g:_,y=m?_:g,v=y-1;x!==v&&(Yi(f.getTextContent().slice(x,y))||(c?d.offset=v:u.offset=v))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function xe(n){return n instanceof Fn}function Po(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Jr(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Po(t),Po(r)]}function Oo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function Do(n,e,t,r){let i,o=e;if(n.nodeType===Ot){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],d=!1;if(u===c)u=l[o+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&o--}if(i=ct(u),D(i))o=Vi(i,s);else{let f=ct(n);if(f===null)return null;if(C(f)){o=Math.min(f.getChildrenSize(),o);let h=f.getChildAtIndex(o);if(C(h)&&function(g,_,m){const x=g.getParent();return m===null||x===null||!x.canBeEmpty()||x!==m.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=C(h)?h:h.getParentOrThrow()),o=0}D(h)?(i=h,f=null,o=Vi(h,s)):h!==f&&s&&!d&&o++}else{const h=f.getIndexWithinParent();o=e===0&&U(f)&&ct(n)===f?h:h+1,f=f.getParentOrThrow()}if(C(f))return Te(f.__key,o,"element")}}else i=ct(n);return D(i)?Te(i.__key,o,"text"):null}function Ro(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&C(s)&&s.isInline()){const l=s.getPreviousSibling();D(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):D(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();D(l)&&(n.key=l.__key,n.offset=0)}}}function Fo(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Ro(n,r,i),Ro(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=H();if(o.isComposing()&&o._compositionKey!==n.key&&P(t)){const s=t.anchor,l=t.focus;$e(n,s.key,s.offset,s.type),$e(e,l.key,l.offset,l.type)}}}function Io(n,e,t,r,i,o){if(n===null||t===null||!Dt(i,n,t))return null;const s=Do(n,e,P(o)?o.anchor:null,i);if(s===null)return null;const l=Do(t,r,P(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ct(n),c=ct(t);if(U(a)&&U(c))return null}return Fo(s,l,o),[s,l]}function Vr(n){return C(n)&&!n.isInline()}function Lo(n,e,t,r,i,o){const s=Re(),l=new Ke(Te(n,e,i),Te(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function $l(){const n=Te("root",0,"element"),e=Te("root",0,"element");return new Ke(n,e,0,"")}function Ao(){return new Fn(new Set)}function Yr(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!ur&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(P(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&P(n)&&!Dt(t,c,u))return n.clone();const h=Io(c,d,u,f,t,n);if(h===null)return null;const[g,_]=h;return new Ke(g,_,P(n)?n.format:0,P(n)?n.style:"")}function I(){return Re()._selection}function qt(){return H()._editorState._selection}function In(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Mo(n)}}else{const c=n.isBackward(),u=c?o:i,d=u.getNode(),f=c?i:o,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}Mo(n)}function Mo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Ln(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,D(i)?l="text":C(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function jo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Kl(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||d!==null&&hr(d))return;if(!P(e))return void(n!==null&&Dt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,_=h.key,m=vn(t,g),x=vn(t,_),y=f.offset,v=h.offset,T=e.format,S=e.style,b=e.isCollapsed();let N=m,w=x,E=!1;if(f.type==="text"){N=_n(m);const Y=f.getNode();E=Y.getFormat()!==T||Y.getStyle()!==S}else P(n)&&n.anchor.type==="text"&&(E=!0);var j,z,ee,q,W;if(h.type==="text"&&(w=_n(x)),N!==null&&w!==null&&(b&&(n===null||E||P(n)&&(n.format!==T||n.style!==S))&&(j=T,z=S,ee=y,q=g,W=performance.now(),go=[j,z,ee,q,W]),c!==y||u!==v||l!==N||a!==w||r.type==="Range"&&b||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(N,y,w,v)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const Y=e instanceof Ke&&e.anchor.type==="element"?N.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Fe=document.createRange();Fe.selectNode(Y),ce=Fe.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Fe,Je,Qt){const Zt=Qt.ownerDocument,en=Zt.defaultView;if(en===null)return;let{top:vt,bottom:xt}=Je,Ct=0,bt=0,pe=Qt;for(;pe!==null;){const nt=pe===Zt.body;if(nt)Ct=0,bt=Cn(Fe).innerHeight;else{const Ve=pe.getBoundingClientRect();Ct=Ve.top,bt=Ve.bottom}let Ee=0;if(vt<Ct?Ee=-(Ct-vt):xt>bt&&(Ee=xt-bt),Ee!==0)if(nt)en.scrollBy(0,Ee);else{const Ve=pe.scrollTop;pe.scrollTop+=Ee;const rt=pe.scrollTop-Ve;vt-=rt,xt-=rt}if(nt)break;pe=xn(pe)}})(t,ce,o)}}Mr=!0}}function Ul(n){let e=I()||qt();e===null&&(e=X().selectEnd()),e.insertNodes(n)}function qr(n){let e=n;n.isCollapsed()||e.removeText();const t=I();P(t)&&(e=t),P(e)||O(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!ft(i);)[i,o]=Jl(i,o);return o}function Jl(n,e){const t=n.getParent();if(!t){const i=ke();return X().append(i),i.select(),[X(),0]}if(D(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Ke(Te(n.__key,e,"element"),Te(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,Hr=!1,An=0;const Wo={characterData:!0,childList:!0,subtree:!0};function Ht(){return fe||te!==null&&te._readOnly}function de(){fe&&O(13)}function Bo(){An>99&&O(14)}function Re(){return te===null&&O(195,zo()),te}function H(){return ne===null&&O(196,zo()),ne}function zo(){let n=0;const e=new Set,t=Wn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(gr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Vl(){return ne}function $o(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&O(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function Ko(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Yl(n){return Gr(n,H()._nodes)}function Gr(n,e){const t=n.type,r=e.get(t);r===void 0&&O(17,t);const i=r.klass;n.type!==i.getType()&&O(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=Gr(s[l],e);o.append(a)}return o}function Uo(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ue(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==qe,c=te,u=fe,d=ne,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const b=n._dirtyType,N=n._dirtyElements,w=n._dirtyLeaves;h.disconnect(),g=Rl(o,t,n,b,N,w)}catch(b){if(b instanceof Error&&n._onError(b),Hr)throw b;return Go(n,null,r,t),Li(n),n._dirtyType=lt,Hr=!0,Ue(n,o),void(Hr=!1)}finally{h.observe(r,Wo),n._updating=f,te=c,fe=u,ne=d}}t._readOnly||(t._readOnly=!0);const _=n._dirtyLeaves,m=n._dirtyElements,x=n._normalizedNodes,y=n._updateTags,v=n._deferred;a&&(n._dirtyType=qe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(b,N){const w=b._decorators;let E=b._pendingDecorators||w;const j=N._nodeMap;let z;for(z in E)j.has(z)||(E===w&&(E=Ki(b)),delete E[z])}(n,t);const T=i?null:Se(n._window);if(n._editable&&T!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const b=n._blockCursorElement;b!==null&&Sr(b,n,r),Kl(s,l,n,T,y,r)}kl(n,r,l),h!==null&&h.observe(r,Wo)}finally{ne=d,te=c}}g!==null&&function(b,N,w,E,j){const z=Array.from(b._listeners.mutation),ee=z.length;for(let q=0;q<ee;q++){const[W,Y]=z[q],ce=N.get(Y);ce!==void 0&&W(ce,{dirtyLeaves:E,prevEditorState:j,updateTags:w})}}(n,g,y,_,o),P(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,Gt("decorator",n,!0,S)),function(b,N,w){const E=Ui(N),j=Ui(w);E!==j&&Gt("textcontent",b,!0,j)}(n,e||o,t),Gt("update",n,!0,{dirtyElements:m,dirtyLeaves:_,editorState:t,normalizedNodes:x,prevEditorState:e||o,tags:y}),function(b,N){if(b._deferred=[],N.length!==0){const w=b._updating;b._updating=!0;try{for(let E=0;E<N.length;E++)N[E]()}finally{b._updating=w}}}(n,v),function(b){const N=b._updates;if(N.length!==0){const w=N.shift();if(w){const[E,j]=w;Yo(b,E,j)}}}(n)}function Gt(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function Jo(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Jo(n,e,t)}),i}const r=_r(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function Vo(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&O(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Yo(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new jn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const d=te,f=fe,h=ne,g=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(y){const v=y.getEditorState()._selection,T=Se(y._window);return P(v)||v==null?Yr(v,T,y,null):v.clone()}(n));const m=n._compositionKey;e(),s=Vo(n,s),function(y,v){const T=v.getEditorState()._selection,S=y._selection;if(P(S)){const b=S.anchor,N=S.focus;let w;if(b.type==="text"&&(w=b.getNode(),w.selectionTransform(T,S)),N.type==="text"){const E=N.getNode();w!==E&&E.selectionTransform(T,S)}}}(c,n),n._dirtyType!==qe&&(s?function(y,v){const T=v._dirtyLeaves,S=y._nodeMap;for(const b of T){const N=S.get(b);D(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&ji(N)}}(c,n):function(y,v){const T=v._dirtyLeaves,S=v._dirtyElements,b=y._nodeMap,N=We(),w=new Map;let E=T,j=E.size,z=S,ee=z.size;for(;j>0||ee>0;){if(j>0){v._dirtyLeaves=new Set;for(const q of E){const W=b.get(q);D(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&ji(W),W!==void 0&&Ko(W,N)&&$o(v,W,w),T.add(q)}if(E=v._dirtyLeaves,j=E.size,j>0){An++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map;for(const q of z){const W=q[0],Y=q[1];if(W!=="root"&&!Y)continue;const ce=b.get(W);ce!==void 0&&Ko(ce,N)&&$o(v,ce,w),S.set(W,Y)}E=v._dirtyLeaves,j=E.size,z=v._dirtyElements,ee=z.size,An++}v._dirtyLeaves=T,v._dirtyElements=S}(c,n),Vo(n),function(y,v,T,S){const b=y._nodeMap,N=v._nodeMap,w=[];for(const[E]of S){const j=N.get(E);j!==void 0&&(j.isAttached()||(C(j)&&ro(j,E,b,N,w,S),b.has(E)||S.delete(E),w.push(E)))}for(const E of w)N.delete(E);for(const E of T){const j=N.get(E);j===void 0||j.isAttached()||(b.has(E)||T.delete(E),N.delete(E))}}(a,c,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(c._flushSync=!0);const x=c._selection;if(P(x)){const y=c._nodeMap,v=x.anchor.key,T=x.focus.key;y.get(v)!==void 0&&y.get(T)!==void 0||O(19)}else xe(x)&&x._nodes.size===0&&(c._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ue(n)}finally{te=d,fe=f,ne=h,n._updating=g,An=0}n._dirtyType!==qe||function(m,x){const y=x.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ue(n)):u&&xl(()=>{Ue(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Yo(n,e,t)}class Mn extends On{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return fl[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=H()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(D(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&O(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&O(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ne)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ne.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ri[e];return!!(this.getFormat()&t)}return!1}select(e,t){de();const r=I();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(D(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return P(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Lo(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ri[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let d=null,f=o-t+i;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let _=0;_<t;_++){g===null&&O(100);const m=g.getNextSibling(),x=g.__key;He(g.getWritable()),c.push(x),g=m}}let h=d;for(let g=0;g<i;g++){const _=r[g];h!==null&&_.is(h)&&(d=h=h.getPreviousSibling());const m=_.getWritable();m.__parent===l&&f--,He(m);const x=_.__key;if(h===null)s.__first=x,m.__prev=null;else{const y=h.getWritable();y.__next=x,m.__prev=y.__key}_.__key===l&&O(76),m.__parent=l,a.push(x),h=_}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const _=h.getWritable();g.__prev=h.__key,_.__next=u.__key}else g.__prev=null}if(s.__size=f,c.length){const g=I();if(P(g)){const _=new Set(c),m=new Set(a),{anchor:x,focus:y}=g;qo(x,_,m)&&Ln(x,x.getNode(),this,d,u),qo(y,_,m)&&Ln(y,y.getNode(),this,d,u),f!==0||this.canBeEmpty()||ut(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){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,t,r){return!1}canMergeWhenEmpty(){return!1}}function C(n){return n instanceof Mn}function qo(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class ql extends On{constructor(e){super(e)}decorate(e,t){O(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof ql}class Xt extends Mn{static getType(){return"root"}static clone(){return new Xt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){O(51)}getTextContent(){const e=this.__cachedText;return!Ht()&&H()._dirtyType!==qe||e===null?super.getTextContent():e}remove(){O(52)}replace(e){O(53)}insertBefore(e){O(54)}insertAfter(e){O(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||U(r)||O(56)}return super.append(...e)}static importJSON(e){const t=X();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof Xt}function Xr(){return new jn(new Map([["root",new Xt]]))}function Ho(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&O(130,t.name),C(n)){const r=e.children;Array.isArray(r)||O(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Ho(i[o]);r.push(s)}}return e}class jn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Uo(t&&t.editor||null,this,e)}clone(e){const t=new jn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Uo(null,this,()=>({root:Ho(X())}))}}class Qr extends Mn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends Mn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Pe[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new pt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Lt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Hl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&wr(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=ke();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=ke();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(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 Hl(n){const e=ke();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function ke(){return bn(new pt)}function Zr(n){return n instanceof pt}const K=0,Gl=4;function Go(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Xr(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=qe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Xl(n){const e=n||{},t=Vl(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Xr(),l=e.namespace||(i!==null?i._config.namespace:qi()),a=e.editorState,c=[Xt,gt,Ut,Vt,pt,Qr,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let _=0;_<c.length;_++){let m=c[_],x=null,y=null;if(typeof m!="function"){const b=m;m=b.replace,x=b.with,y=b.withKlass||null}const v=m.getType(),T=m.transform(),S=new Set;T!==null&&S.add(T),h.set(v,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,transforms:S})}}const g=new Wn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(_,m){const x=new Map,y=new Set,v=T=>{Object.keys(T).forEach(S=>{let b=x.get(S);b===void 0&&(b=[],x.set(S,b)),b.push(T[S])})};return _.forEach(T=>{const S=T.klass.importDOM;if(S==null||y.has(S))return;y.add(S);const b=S.call(T.klass);b!==null&&v(b)}),m&&v(m),x}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=lt),g}class Wn{constructor(e,t,r,i,o,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=qi(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&O(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&O(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&O(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Pl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),he(s,()=>{const a=Re();if(a.isEmpty())return;if(l==="root")return void X().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return F(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Lt(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,Go(this,t,e,i),t!==null&&(this._config.disableEvents||Fl(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=lt,Li(this),this._updateTags.add("history-merge"),Ue(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Pn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",xo),Pn.set(c,(u||0)+1),l.__lexicalEditor=a;const d=vo(l);for(let f=0;f<Ar.length;f++){const[h,g]=Ar[f],_=typeof g=="function"?m=>{bo(m)||(Co(m),(a.isEditable()||h==="click")&&g(m,a))}:m=>{if(bo(m))return;Co(m);const x=a.isEditable();switch(h){case"cut":return x&&F(a,Zn,m);case"copy":return F(a,an,m);case"paste":return x&&F(a,Xn,m);case"dragstart":return x&&F(a,ki,m);case"dragover":return x&&F(a,Ei,m);case"dragend":return x&&F(a,qs,m);case"focus":return x&&F(a,Xs,m);case"blur":return x&&F(a,Qs,m);case"drop":return x&&F(a,Ti,m)}};l.addEventListener(h,_),d.push(()=>{l.removeEventListener(h,_)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;Gt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&O(38),Ii(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ue(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ue(this)}parseEditorState(e,t){return function(r,i,o){const s=Xr(),l=te,a=fe,c=ne,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const g=i._nodes;Gr(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ue(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const i=I(),o=X();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Se(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Gt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Wn.version="0.17.1+prod.esm";const Nc="";function Ql(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zl=Ql(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Xo=A.createContext(null);function ea(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function et(){const n=A.useContext(Xo);return n==null&&Zl(8),n}const Qo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Qo?A.useLayoutEffect:A.useEffect,Bn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=A.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Xl({editable:n.editable,html:a,namespace:i,nodes:o,onError:d=>s(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=X();if(h.isEmpty()){const g=ke();h.append(g);const _=Qo?document.activeElement:null;(I()!==null||_!==null&&_===d.getRootElement())&&g.select()}},Bn);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,Bn);break}case"object":d.setEditorState(f,Bn);break;case"function":d.update(()=>{X().isEmpty()&&f(d)},Bn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),L.jsx(Xo.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return A.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ia(){return X().getTextContent()}function oa(n,e=!0){if(n)return!1;let t=ia();return e&&(t=t.trim()),t===""}function sa(n){if(!oa(n,!1))return!1;const e=X().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(U(i))return!1;if(C(i)){if(!Zr(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!D(a))return!1}}}return!0}function Zo(n){return()=>sa(n)}function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}la(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}aa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ca=new Map;function ua(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function es(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,d]=Jr(n),f=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let _,m=0;return f?(m=u>d?d:u,_=u>d?u:d):h?(m=o?d:u,_=void 0):g&&(m=0,_=o?u:d),e.__text=e.__text.slice(m,_),e}}return e}function fa(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=At(n.focus,e);return U(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function da(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ha(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ha(n);da(n,e,t?!r:r,"character")}function ga(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ga(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_a=rs&&"documentMode"in document?document.documentMode:null;!(!rs||!("InputEvent"in window)||_a)&&"getTargetRanges"in new window.InputEvent("input");function _t(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function ma(n){const e=ei(n,t=>C(t)&&!t.isInline());return C(e)||pa(4,n.__key),e}const ei=(n,e)=>{let t=n;for(;t!==X()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function ya({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:g="textbox",spellCheck:_=!0,style:m,tabIndex:x,"data-testid":y,...v},T){const[S,b]=A.useState(n.isEditable()),N=A.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),w=A.useMemo(()=>function(...E){return j=>{E.forEach(z=>{typeof z=="function"?z(j):z!=null&&(z.current=j)})}}(T,N),[N,T]);return is(()=>(b(n.isEditable()),n.registerEditableListener(E=>{b(E)})),[n]),L.jsx("div",{...v,"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":i,"aria-expanded":S&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":S?c:void 0,"aria-readonly":!S||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:S,"data-testid":y,id:h,ref:w,role:S?g:void 0,spellCheck:_,style:m,tabIndex:x})}const va=A.forwardRef(ya);function os(n){return n.getEditorState().read(Zo(n.isComposing()))}const xa=A.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return L.jsxs(L.Fragment,{children:[L.jsx(va,{editor:i,...r,ref:e}),t!=null&&L.jsx(ba,{editor:i,content:t})]})}function ba({content:n,editor:e}){const t=function(s){const[l,a]=A.useState(()=>os(s));return is(()=>{function c(){const u=os(s);a(u)}return c(),_t(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=A.useState(e.isEditable());if(A.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:L.jsx("div",{"aria-hidden":!0,children:o})}const zn=0,ti=1,ni=2,Ce=0,Sa=1,ss=2,wa=3,Ta=4;function ka(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ce;const o=e._selection,s=n._selection;if(i)return Sa;if(!(P(o)&&P(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(x,y,v){const T=x._nodeMap,S=[];for(const b of y){const N=T.get(b);N!==void 0&&S.push(N)}for(const[b,N]of v){if(!N)continue;const w=T.get(b);w===void 0||oe(w)||S.push(w)}return S}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const x=e._nodeMap,y=x.get(o.anchor.key),v=x.get(s.anchor.key);return y&&v&&!n._nodeMap.has(y.__key)&&D(y)&&y.__text.length===1&&o.anchor.offset===1?ss:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,d=a.__text;if(u===d)return Ce;const f=o.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return Ce;const g=f.offset,_=h.offset,m=d.length-u.length;return m===1&&_===g-1?ss:m===-1&&_===g+1?wa:m===-1&&_===g?Ta:Ce}function Ea(n,e){let t=Date.now(),r=Ce;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,ni;const d=ka(i,o,l,a,n.isComposing()),f=(()=>{const h=s===null||s.editor===n,g=c.has("history-push");if(!g&&h&&c.has("history-merge"))return zn;if(i===null)return ti;const _=o._selection;return l.size>0||a.size>0?g===!1&&d!==Ce&&d===r&&u<t+e&&h||l.size===1&&function(m,x,y){const v=x._nodeMap.get(m),T=y._nodeMap.get(m),S=x._selection,b=y._selection;return!(P(S)&&P(b)&&S.anchor.type==="element"&&S.focus.type==="element"&&b.anchor.type==="text"&&b.focus.type==="text"||!D(v)||!D(T)||v.__parent!==T.__parent)&&JSON.stringify(x.read(()=>v.exportJSON()))===JSON.stringify(y.read(()=>T.exportJSON()))}(Array.from(l)[0],i,o)?zn:ti:_!==null?zn:ni})();return t=u,r=d,f}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Na(n,e,t){const r=Ea(n,t);return _t(n.registerCommand(on,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(Nt,!0)),a.length===0&&o.dispatchCommand(Pt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(sn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(Pt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Nt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(Hs,()=>(ls(e),!1),K),n.registerCommand(Gs,()=>(ls(e),n.dispatchCommand(Nt,!1),n.dispatchCommand(Pt,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&o===h)return;const g=r(s,o,u,l,a,c);if(g===ti)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Nt,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Pt,!0));else if(g===ni)return;e.current={editor:n,editorState:o}}))}function Pa(){return{current:null,redoStack:[],undoStack:[]}}function Oa({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=A.useMemo(()=>i||Pa(),[i]);A.useEffect(()=>Na(r,s,o),[o,r,s])}(t,e,n),null}const Da=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function Ra(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Fa(){return function(n){const[e]=et(),t=A.useMemo(()=>n(e),[e,n]),r=A.useRef(t.initialValueFn()),[i,o]=A.useState(r.current);return Da(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(Ra)}function Ia(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h,g]=a;n.update(()=>{const _=I();if(P(_)){const m=_.anchor;let x=m.getNode(),y=0,v=0;if(D(x)&&c>=0&&u>=0&&(y=c,v=c+u,_.setTextNodeRange(x,y,x,v)),y===v&&d===""||(_.insertRawText(d),x=m.getNode()),D(x)){y=f,v=f+h;const T=x.getTextContentSize();y=y>T?T:y,v=v>T?T:v,_.setTextNodeRange(x,y,x,v)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function La(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!cs.has(s.nodeName)){const l=us(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof Qr&&s.insertAfter(Ze());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Aa(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=X().getChildren();for(let i=0;i<r.length;i++)as(n,r[i],t,e);return t.innerHTML}function as(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=Er(e);h=D(h)&&r!==null?es(r,h):h,s=h}const l=C(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],_=as(n,g,f,r);!i&&C(e)&&_&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(wr(u)&&u.append(f),t.append(u),d){const h=d.call(s,u);h&&u.replaceWith(h)}}else t.append(f);return i}const cs=new Set(["STYLE","SCRIPT"]);function us(n,e,t,r,i=new Map,o){let s=[];if(cs.has(n.nodeName))return s;let l=null;const a=function(g,_){const{nodeName:m}=g,x=_._htmlConversions.get(m.toLowerCase());let y=null;if(x!==void 0)for(const v of x){const T=v(g);T!==null&&(y===null||(y.priority||0)<(T.priority||0))&&(y=T)}return y!==null?y.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,_]of i)if(l=_(l,o),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!ut(l))&&(l!=null&&Vr(l)||r);for(let g=0;g<d.length;g++)f.push(...us(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),Sn(n)&&(f=Ma(n,f,h?()=>{const g=new Qr;return t.push(g),g}:ke)),l==null?f.length>0?s=s.concat(f):Sn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Tr(g.nextSibling)&&Tr(g.previousSibling)}(n)&&(s=s.concat(Ze())):C(l)&&l.append(...f),s}function Ma(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Vr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Vr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $n=ja(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Wa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fs=n=>Wa?(n||window).getSelection():null;function Ba(n,e=I()){return e==null&&$n(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?"":Aa(n,e)}function za(n,e=I()){return e==null&&$n(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify($a(n,e))}function ds(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return hs(t,Ka(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return hs(t,La(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(P(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=I();if(P(a)){const c=s[l];c===`
40
+ `||c===`\r
41
+ `?a.insertParagraph():c===" "?a.insertNodes([Yt()]):a.insertText(c)}}}else e.insertRawText(o)}function hs(n,e,t){n.dispatchCommand(Bs,{nodes:e,selection:t})||t.insertNodes(e)}function gs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Er(t);c=D(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&$n(58,d.name),C(c)){const f=u.children;Array.isArray(f)||$n(59,d.name)}return u}(s);if(D(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],d=gs(n,e,u,a.children);!i&&C(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function $a(n,e){const t=[],r=X().getChildren();for(let i=0;i<r.length;i++)gs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Ka(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Yl(r);D(i)&&fa(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=fs(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(an,d=>(tt(d,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,d,t))),!0),Gl);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=fs(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Dt(n,o,s))return!1;const l=I();if(l===null)return!1;t=Ja(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Va(r,t),!0)}const Ua=[["text/html",Ba],["application/x-lexical-editor",za]];function Ja(n=I()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=El();for(const[r,i]of Ua){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Va(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ya=yt&&"documentMode"in document?document.documentMode:null,qa=!(!yt||!("InputEvent"in window)||Ya)&&"getTargetRanges"in new window.InputEvent("input"),Ha=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ga=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xa=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qa=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Xa,ys=Ws();function Kn(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function vs(n){const e=I();if(!P(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=ei(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Un(n){const e=Ge(n);return U(e)}function Za(n){return _t(n.registerCommand(_i,e=>{const t=I();return!!xe(t)&&(t.clear(),!0)},0),n.registerCommand(Ye,e=>{const t=I();return!!P(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Tt,e=>{const t=I();return!!P(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(kt,e=>{const t=I();return!!P(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(st,e=>{const t=I();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)ds(r,t,n);else if(P(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(Qn,()=>{const e=I();return!!P(e)&&(e.removeText(),!0)},K),n.registerCommand(ge,e=>{const t=I();return!!P(t)&&(t.formatText(e),!0)},K),n.registerCommand(Et,e=>{const t=I();if(!P(t)&&!xe(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(ot,e=>{const t=I();return!!P(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(rn,()=>{const e=I();return!!P(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(Vs,()=>(Ul([Yt()]),!0),K),n.registerCommand(Ys,()=>vs(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(wi,()=>vs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(vi,e=>{const t=I();if(xe(t)&&!Un(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(P(t)){const r=At(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(xi,e=>{const t=I();if(xe(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(P(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===X().getChildrenSize()}(t))return e.preventDefault(),!0;const r=At(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(yi,e=>{const t=I();if(xe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!P(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},K),n.registerCommand(mi,e=>{const t=I();if(xe(t)&&!Un(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!P(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},K),n.registerCommand(Ci,e=>{if(Un(e.target))return!1;const t=I();if(!P(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(wi,void 0):n.dispatchCommand(Ye,!0)},K),n.registerCommand(Si,e=>{if(Un(e.target))return!1;const t=I();return!!P(t)&&(e.preventDefault(),n.dispatchCommand(Ye,!1))},K),n.registerCommand(ln,e=>{const t=I();if(!P(t))return!1;if(e!==null){if((Ga||Ha||Qa)&&qa)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},K),n.registerCommand(bi,()=>{const e=I();return!!P(e)&&(n.blur(),!0)},K),n.registerCommand(Ti,e=>{const[,t]=Kn(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=Ge(s);if(l!==null){const a=$l();if(D(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=Wi(a);be(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=I();return!!P(r)},K),n.registerCommand(ki,e=>{const[t]=Kn(e),r=I();return!(t&&!P(r))},K),n.registerCommand(Ei,e=>{const[t]=Kn(e),r=I();if(t&&!P(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=Ge(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(er,()=>(wl(),!0),K),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(Zn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=I();P(i)?i.removeText():xe(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(Xn,e=>{const[,t,r]=Kn(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):hr(e.target)?!1:I()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=I(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&ds(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function xs(n){return n.getEditorState().read(Zo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=A.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{fi.flushSync(()=>{a(c)})}),[o]),A.useEffect(()=>{a(o.getDecorators())},[o]),A.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=L.jsx(s,{onError:_=>o._onError(_),children:L.jsx(A.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&c.push(fi.createPortal(h,g,f))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Za(o),Ia(o)),[o])}(r),L.jsxs(L.Fragment,{children:[n,L.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=A.useState(()=>xs(i));return ri(()=>{function l(){const a=xs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Fa();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Cs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];o.props.onReset==null||(c=o.props).onReset.apply(c,d),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=f)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Yn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Yn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Yn.Component);function rc({children:n,onError:e}){return L.jsx(nc,{fallback:L.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oi=1;function bs(){return L.jsx("div",{className:"divider"})}function oc(){const[n]=et(),e=A.useRef(null),[t,r]=A.useState(!1),[i,o]=A.useState(!1),[s,l]=A.useState(!1),[a,c]=A.useState(!1),[u,d]=A.useState(!1),[f,h]=A.useState(!1),g=A.useCallback(()=>{const _=I();P(_)&&(l(_.hasFormat("bold")),c(_.hasFormat("italic")),d(_.hasFormat("underline")),h(_.hasFormat("strikethrough")))},[]);return A.useEffect(()=>_t(n.registerUpdateListener(({editorState:_})=>{_.read(()=>{g()})}),n.registerCommand(nn,(_,m)=>(g(),!1),oi),n.registerCommand(Pt,_=>(r(_),!1),oi),n.registerCommand(Nt,_=>(o(_),!1),oi)),[n,g]),L.jsxs("div",{className:"toolbar",ref:e,children:[L.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:L.jsx("i",{className:"format undo"})}),L.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:L.jsx("i",{className:"format redo"})}),L.jsx(bs,{}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:L.jsx("i",{className:"format bold"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:L.jsx("i",{className:"format italic"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:L.jsx("i",{className:"format underline"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:L.jsx("i",{className:"format strikethrough"})}),L.jsx(bs,{}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:L.jsx("i",{className:"format left-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:L.jsx("i",{className:"format center-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:L.jsx("i",{className:"format right-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:L.jsx("i",{className:"format justify-align"})})," "]})}function sc(){return L.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const lc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function ac(){return L.jsx(na,{initialConfig:lc,children:L.jsxs("div",{className:"editor-container",children:[L.jsx(oc,{}),L.jsxs("div",{className:"editor-inner",children:[L.jsx(ec,{contentEditable:L.jsx(xa,{className:"editor-input"}),placeholder:L.jsx(sc,{}),ErrorBoundary:rc}),L.jsx(Oa,{}),L.jsx(ra,{})]})]})})}Ae.Editor=ac,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
40
42
  //# sourceMappingURL=index.umd.js.map